Skip to main content

The fast, Pythonic way to build MCP servers and clients.

Project description

FastMCP Logo

FastMCP 🚀

Move fast and make things.

Made with 💙 by Prefect

Docs Discord PyPI - Version Tests License

jlowin%2Ffastmcp | Trendshift


The Model Context Protocol (MCP) provides a standardized way to connect AI agents to tools and data. FastMCP makes it easy to build MCP applications with clean, Pythonic code:

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

MCP lets you give agents access to your tools and data. But building an effective MCP server is harder than it looks.

Give your agent too much—hundreds of tools, verbose responses—and it gets overwhelmed. Give it too little and it can't do its job. The protocol itself is complex, with layers of serialization, validation, and error handling that have nothing to do with your business logic. And the spec keeps evolving; what worked last month might already need updating.

The real challenge isn't implementing the protocol. It's delivering the right information at the right time.

That's the problem FastMCP solves—and why it's become the standard. FastMCP 1.0 was incorporated into the official MCP SDK in 2024. Today, the actively maintained standalone project is downloaded a million times a day, and some version of FastMCP powers 70% of MCP servers across all languages.

The framework is built on three abstractions that map to the decisions you actually need to make:

  • Components are what you expose: tools, resources, and prompts. Wrap a Python function, and FastMCP handles the schema, validation, and docs.
  • Providers are where components come from: decorated functions, files on disk, OpenAPI specs, remote servers—your logic can live anywhere.
  • Transforms shape what clients see: namespacing, filtering, authorization, versioning. The same server can present differently to different users.

These compose cleanly, so complex patterns don't require complex code. And because FastMCP is opinionated about the details, like serialization, error handling, and protocol compliance, best practices are the path of least resistance. You focus on your logic; the MCP part just works.

Move fast and make things.

Installation

[!Note] FastMCP 3.0 is currently a release candidate. Install with: pip install fastmcp==3.0.0rc1

For production systems requiring stability, pin to v2: pip install 'fastmcp<3'

We recommend installing FastMCP with uv:

uv pip install fastmcp

For full installation instructions, including verification and upgrading, see the Installation Guide.

📚 Documentation

FastMCP's complete documentation is available at gofastmcp.com, including detailed guides, API references, and advanced patterns.

Documentation is also available in llms.txt format, which is a simple markdown standard that LLMs can consume easily:

  • llms.txt is essentially a sitemap, listing all the pages in the documentation.
  • llms-full.txt contains the entire documentation. Note this may exceed the context window of your LLM.

Community: Join our Discord server to connect with other FastMCP developers and share what you're building.

Contributing

We welcome contributions! See the Contributing Guide for setup instructions, testing requirements, and PR guidelines.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastmcp-3.0.0rc2.tar.gz (14.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastmcp-3.0.0rc2-py3-none-any.whl (601.4 kB view details)

Uploaded Python 3

File details

Details for the file fastmcp-3.0.0rc2.tar.gz.

File metadata

  • Download URL: fastmcp-3.0.0rc2.tar.gz
  • Upload date:
  • Size: 14.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastmcp-3.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 81cc408b13a0ab2e7701abaa04c8a64597e13bb2fec2a7fc92fd324e08855ef2
MD5 907e397cd73011eba7a05fb52d965000
BLAKE2b-256 8b3aafa90e3646b754d52cd8a436490ffed38bc9fd0d605f479d04de38af1dee

See more details on using hashes here.

File details

Details for the file fastmcp-3.0.0rc2-py3-none-any.whl.

File metadata

  • Download URL: fastmcp-3.0.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 601.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastmcp-3.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 0596b372c4b6b193f02619a874dca3550b153b085827e82133ccfef2bb687a3d
MD5 e03d81dbc2099338448250e85ccf7bb4
BLAKE2b-256 567b556317e567956fb6108f981d63a48be69e5e0014ae745f4feb3f50a1da4e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page