MCP ConfigsMay 14, 2026·3 min read

FastMCP — Python Framework for MCP Servers

FastMCP is a Python framework for building MCP servers/clients with generated schemas and lifecycle handling. Verified 25154★; pushed 2026-05-13.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Native · 94/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Mcp
Install
Uv|Pip
Trust
Trust: Established
Entrypoint
from fastmcp import FastMCP; mcp.run()
Universal CLI install command
npx tokrepo install 4c9dd8ef-7adc-5835-bb5a-2a2ccb2fda88
Intro

FastMCP is a Python framework for building MCP servers/clients with generated schemas and lifecycle handling. Verified 25154★; pushed 2026-05-13.

Best for: Python teams who want a structured way to ship MCP servers with fewer protocol edge cases

Works with: Python 3.x; uv/pip installs; integrates with MCP clients (per docs/README links)

Setup time: 5-12 minutes

Key facts (verified)

  • GitHub: 25154 stars · 2010 forks · pushed 2026-05-13.
  • License: Apache-2.0 · owner avatar + repo URL verified via GitHub API.
  • README-backed entrypoint: from fastmcp import FastMCP; mcp.run().

Main

  • Start from the minimal server example, then move each tool into small, testable Python functions with clear docstrings.

  • Keep tool contracts stable: treat schemas and return types as an API, and version changes in your MCP server like any other service.

  • Add production concerns early (timeouts, rate limits, auth) and keep a staging server to validate client compatibility.

  • Use the project docs links for server/client/app patterns instead of inventing protocol glue by hand.

README (excerpt)

FastMCP Logo

FastMCP 🚀

Move fast and make things.

Made with 💙 by Prefect

Docs Discord PyPI - Version Tests License

prefecthq%2Ffastmcp | Trendshift


The Model Context Protocol (MCP) connects LLMs to tools and data. FastMCP gives you everything you need to go from prototype to production:

from fastmcp import FastMCP

mcp = FastMCP("Demo 🚀")

@mcp.tool
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

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

Why FastMCP

Building an effective MCP application is harder than it looks. FastMCP handles all of it. Declare a tool with a Python function, and the schema, validation, and documentation are generated automatically. Connect to a server with a URL, and transport negotiation, authentication, and protocol lifecycle are managed for you. You focus on your logic, and the MCP part just works: with FastMCP, best practices are built in.

Source-backed notes

  • README shows a minimal server using FastMCP("Demo"), a @mcp.tool function, and mcp.run().
  • README recommends installing via uv pip install fastmcp and links to a dedicated docs site.
  • Project description frames FastMCP as a higher-level way to build MCP servers/clients without manual schema wiring.

FAQ

  • Is FastMCP a server or a client?: README describes both server and client patterns; start by building a server first.
  • Do I need uv?: README recommends uv, but pip-based installs are also common for Python libraries.
  • How do I keep tool behavior predictable?: Treat tool schemas as an API contract, add tests, and version breaking changes.
🙏

Source & Thanks

Created by PrefectHQ. Licensed under Apache-2.0.

PrefectHQ/fastmcp — ⭐ 25154

Thanks to the upstream maintainers and contributors for publishing this work under an open license.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets