← Back to all projects

FastMCP

The Python framework most MCP servers are written in, well ahead of the copy inside the official SDK

OfficialApache-2.0
Stars
28.2k
Forks
2.5k
Open issues
568
Last commit
30 Oct 2026

What is FastMCP?

A decorator over a typed Python function is a complete tool: the schema is derived from the type hints and docstring, and both the arguments coming in and the value going out are validated for you. Beyond that it covers the parts a second week of work runs into — a typed client, OAuth and remote identity providers, mounting several servers as one, proxying an existing server, and middleware. The confusion to be aware of is the name: an earlier version of this API was absorbed into the official MCP Python SDK, so FastMCP refers to two different things depending on which import you read.

What can you do with FastMCP?

  • One decorator turns a function into a tool — Annotate a typed function and the framework derives the input schema from its signature and the description from its docstring, then validates arguments before your code runs and the return value before it goes back.
  • Expose data and prompts, not only actions — Resources and resource templates serve data the client can read, and prompts are reusable parameterised message templates — the two parts of MCP that servers built by hand usually skip.
  • Write the client side with the same library — A typed client calls tools, reads resources and fetches prompts against local or remote servers, which is also what makes a server testable without launching a separate process.
  • Put real authentication in front of it — OAuth 2.1 and token verification are supported with remote identity providers including Auth0, WorkOS, Descope, AWS Cognito and Azure, and authorisation rules can hide components a given caller should not see.
  • Compose or wrap servers you did not write — Several servers can be mounted into one namespace, an existing server can be fronted by a proxy, and middleware intercepts requests and responses across whatever is mounted.

Before you choose FastMCP

  • The high-level API this project created was absorbed into the official MCP Python SDK, so docs naming FastMCP may mean that older frozen copy, not this one — check the import before following a tutorial.
  • Maintenance now sits with Prefect, which also sells a hosted MCP platform the documentation points to; the framework is Apache-2.0, but its direction is set alongside a commercial product.

Star history

21 Aug to 30 Oct · +922

27.3k28.2k

Frequently asked questions

Is FastMCP free for commercial use?

FastMCP is released under the Apache-2.0 licence — OSI-approved open source, which permits commercial use.

How can FastMCP be deployed?

FastMCP is available as Self-hosted / Runs locally.