Skip to content

Share your Skills over MCP. Try now free

The framework for MCP

Build MCP servers, clients and interactive apps.
You write the application logic.
FastMCP handles the protocol.

uv add fastmcp
server.py
from fastmcp import FastMCP

mcp = FastMCP("Bookshop")

BOOKS = ["Dune", "Neuromancer", "Hyperion"]


@mcp.tool
def search_books(query: str) -> list[str]:
    """Find books by title."""
    q = query.lower()
    return [b for b in BOOKS if q in b.lower()]
$ uv add fastmcp
$ fastmcp run server.py --transport http

Teams at these companies build MCP servers with FastMCP

  • AWS
  • NVIDIA
  • Snowflake
  • SAP
  • MLflow
  • ClickHouse
  • Neo4j
  • Couchbase
  • Apache Superset
  • Kagi

Everything you need to build on MCP

Build tools, connect systems and add interactive interfaces.
Authentication and testing ship in the same package.

  • Tools, resources and prompts

    Decorate a function and FastMCP serves it as a tool, a resource or a prompt.

    Read the docs
    @mcp.tool
    def search(query: str, limit: int = 10):
        """Search the knowledge base."""
        return index.search(query, limit=limit)
  • Clients

    Connect to any MCP server, local or remote, from Python or the command line.

    Read the docs
  • Tool transformation

    Shape the tools your agents see. Rename them, simplify their inputs and control what's exposed.

  • Interactive apps

    Give users forms, tables and charts they can use directly in compatible MCP clients. The components come from Prefab.

    Read the docs
    @mcp.tool(app=True)
    def team_directory() -> DataTable:
        return DataTable(
            columns=COLUMNS,
            rows=members,
            search=True,
        )
    Search
    NameRoleOffice
    Alice ChenStaff EngineerSan Francisco
    Bob MartinezLead DesignerNew York
    Carol JohnsonSenior EngineerLondon
    A searchable team directory table rendered in an MCP client.
  • Authentication

    Connect your identity provider. FastMCP handles the MCP authentication flow.

    Read the docs
    auth = GitHubProvider(
        client_id=os.environ["GH_CLIENT_ID"],
        client_secret=os.environ["GH_SECRET"],
        base_url="https://tools.example.com",
    )
    mcp = FastMCP("Secured app", auth=auth)
  • Composition

    Bring existing APIs and MCP servers together behind one server.

    Read the docs
  • Middleware and background tasks

    Add logging and rate limits, and move slow work into background tasks.

    Read the docs
  • Testing and the CLI

    Test your server in memory, without starting a separate process. Run, inspect and install it from the CLI.

    Read the docsCLI reference
    async def test_search_books():
        async with Client(mcp) as client:
            result = await client.call_tool(
                "search_books",
                {"query": "dune"},
            )
        assert result.data == ["Dune"]

Share your team's skills over MCP

Copying skill folders onto every laptop leaves everyone with a slightly different version. Serve them from a FastMCP server instead and the whole team works from one copy.

  • Distribute once

    Publish a skill to the server and every teammate whose agent connects reads it there. Nobody copies folders between machines.

  • Keep every copy current

    Edit a SKILL.md and redeploy. Anyone reading from the server gets the new version, with no pull or reinstall.

  • Decide who sees which skills

    Discovery lists only the skills a caller can read, so the server's auth rules decide which teams get which skills.

  • Stop broken skills at the door

    Each skill is checked against the Agent Skills spec when the server loads it, so a bad edit fails fast instead of reaching an agent.

MCP Python SDKEvery skill and file wired by hand82 lines
import hashlib
import json
from pathlib import Path

from mcp.server import MCPServer

mcp = MCPServer("Team Skills")
SKILLS = Path("skills")


@mcp.resource(
    "skill://release-notes/SKILL.md",
    mime_type="text/markdown",
    description="Write release notes from merged pull requests.",
)
def release_notes() -> str:
    return read("release-notes/SKILL.md")


@mcp.resource("skill://release-notes/template.md", mime_type="text/markdown")
def release_notes_template() -> str:
    return read("release-notes/template.md")


@mcp.resource("skill://release-notes/_manifest", mime_type="application/json")
def release_notes_manifest() -> str:
    return manifest("release-notes", ["SKILL.md", "template.md"])


@mcp.resource(
    "skill://triage/SKILL.md",
    mime_type="text/markdown",
    description="Label and assign new issues.",
)
def triage() -> str:
    return read("triage/SKILL.md")


@mcp.resource("skill://triage/labels.md", mime_type="text/markdown")
def triage_labels() -> str:
    return read("triage/labels.md")


@mcp.resource("skill://triage/_manifest", mime_type="application/json")
def triage_manifest() -> str:
    return manifest("triage", ["SKILL.md", "labels.md"])


@mcp.resource(
    "skill://incident-review/SKILL.md",
    mime_type="text/markdown",
    description="Run a blameless incident review.",
)
def incident_review() -> str:
    return read("incident-review/SKILL.md")


@mcp.resource("skill://incident-review/checklist.md", mime_type="text/markdown")
def incident_review_checklist() -> str:
    return read("incident-review/checklist.md")


@mcp.resource("skill://incident-review/_manifest", mime_type="application/json")
def incident_review_manifest() -> str:
    return manifest("incident-review", ["SKILL.md", "checklist.md"])


def read(path: str) -> str:
    return (SKILLS / path).read_text(encoding="utf-8")


def manifest(skill: str, files: list[str]) -> str:
    entries = []
    for file in files:
        data = (SKILLS / skill / file).read_bytes()
        digest = hashlib.sha256(data).hexdigest()
        entries.append({"path": file, "size": len(data), "hash": f"sha256:{digest}"})
    return json.dumps({"skill": skill, "files": entries})


if __name__ == "__main__":
    mcp.run()
FastMCPOne line per skill, checked on load13 lines
from fastmcp import FastMCP, Skill
from fastmcp.skills.provider import SkillCatalogProvider

team_skills = [
    Skill.from_directory("skills/release-notes"),
    Skill.from_directory("skills/triage"),
    Skill.from_directory("skills/incident-review"),
]

mcp = FastMCP("Team Skills", providers=[SkillCatalogProvider(team_skills)])

if __name__ == "__main__":
    mcp.run()

Enterprise features for your MCP servers

Talk to our team
  • Self-host or serverless

    Run your FastMCP servers on your own infrastructure, or deploy them to FastMCP Gateway. It scales to zero when idle.

  • Use your existing identity provider

    Sign in through SAML SSO and provision users with SCIM. MCP clients connect through managed OAuth.

  • Control access to your servers

    Grant roles per server and per tool. Discovering, using and managing a server are separate permissions.

  • Reach your systems from static IPs

    Gateway calls your upstream services from known IP addresses you can add to an allowlist.

  • Full observability

    Every access attempt is logged with who called what, when, and whether it was allowed.

For coding agents

Build it with your coding agent

Give your agent the FastMCP docs and a starting point for your project.

  • Claude Code
  • Codex
  • T3 Code
  • OpenCode
Agent setup guide

Build servers. Connect clients. Add interfaces.

The three examples below share one catalog search. FastMCP handles the protocol so you can focus on your application.

Servers

Expose your catalog search as a tool.

server.py
@mcp.tool
def search(query: str) -> list:
    """Search the catalog."""
    return catalog.search(query)
Server docs

Clients

Call that search from your own Python code.

client.py
async with Client(URL) as client:
    hits = await client.call_tool(
        "search",
        {"query": "lamp"},
    )
    print(hits.data)
Client docs

Apps

Show the results as a table the user can sort and search.

server.py
@mcp.tool(app=True)
def browse(q: str) -> DataTable:
    return DataTable(
        columns=COLUMNS,
        rows=catalog.search(q),
        search=True,
    )
App docs

Build with FastMCP.
Deploy with FastMCP Gateway.

Deploy your FastMCP server and make it available to the people and agents that need it. Connect a GitHub repo and get a live URL in about a minute.

FastMCP and FastMCP Gateway are built by the same team at Prefect