Category · Tools and protocols
What is FastMCP?
FastMCP is a free Python framework for writing MCP (Model Context Protocol) servers. Add @mcp.tool to a typed function, and it becomes a tool the model can call. Its first version went into the official Python kit.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- You write a typed Python function, with a comment that describes it, then decorate it with @mcp.tool. FastMCP derives the parameter schema and the description the model will read.
- FastMCP can also generate a server from an OpenAPI specification, the standard description of a web interface. Its documentation keeps this for prototypes, because a model chooses better among a few tools designed for it.
- A server can mount others, and all their tools then appear on the parent. It can also relay a remote server, which gathers several sources behind a single address.
The trap to avoid
The trap is confusing two projects. The official Python kit ships the older interface that came from FastMCP, while the standalone FastMCP, maintained by Prefect, kept evolving on its own.
Related terms
- MCP (Model Context Protocol)Tools and protocols
- Function callingTools and protocols
- ConnectorTools and protocols
Where this is taught
This idea comes up throughout the lessons; we work on it with your own examples during a lesson.
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.