Repolode
PrefectHQ

PrefectHQ/fastmcp

A Python framework for building MCP servers, clients, and interactive apps that connect LLMs to tools and data.

Stars
28,144
Forks
2,491
Open issues
595
Last commit
9 hours ago

What is it?

FastMCP is a Python framework for the Model Context Protocol (MCP), the standard that lets LLMs connect to tools and data. You declare a tool as an ordinary Python function, and FastMCP generates the schema, input validation, and documentation for it. The same framework covers three areas: servers that expose tools, resources, and prompts; clients that connect to local or remote MCP servers; and apps that render interactive UIs inside the conversation.

On the client side, connecting to a server takes a URL, and transport negotiation, authentication, and protocol lifecycle are handled by the library. The project also ships a CLI and a TypeScript counterpart, FastMCP for TypeScript, maintained by the same team.

The project is maintained by Prefect, which also offers a commercial gateway, Prefect Horizon, for deploying and governing MCP servers across teams.

Key features

  • 01Turns Python functions into MCP tools with auto-generated schemas and validation.
  • 02Exposes tools, resources, and prompts from a server.
  • 03Connects clients to local or remote MCP servers through URLs.
  • 04Renders interactive UIs for tools inside the conversation.
  • 05Provides a command-line interface and llms.txt documentation for LLMs.

Use cases

  • Wrapping internal Python code or APIs so an LLM agent can call them as tools.
  • Building a Python MCP client that connects to existing remote MCP servers.
  • Adding interactive UI components to tool responses in an LLM chat.

Quick start

  1. 1

    Add FastMCP to your project with uv

    uv add fastmcp
  2. 2

    Create a server file with the Demo example from the README and run it

Topics

FAQ

What is fastmcp?
A Python framework for building MCP servers, clients, and interactive apps that connect LLMs to tools and data. FastMCP is a Python framework for the Model Context Protocol (MCP), the standard that lets LLMs connect to tools and data. You declare a tool as an ordinary Python function, and FastMCP generates the schema, input validation, and documentation for it. The same framework covers three areas: servers that expose tools, resources, and prompts; clients that connect to local or remote MCP servers; and apps that render interactive UIs inside the conversation.
Is fastmcp free to use? What license does it have?
fastmcp is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is fastmcp still maintained?
Actively maintained. The last commit to fastmcp was on Oct 20, 2026.
What can I use fastmcp for?
Wrapping internal Python code or APIs so an LLM agent can call them as tools. Building a Python MCP client that connects to existing remote MCP servers. Adding interactive UI components to tool responses in an LLM chat.
How do I install fastmcp?
Add FastMCP to your project with uv: uv add fastmcp Create a server file with the Demo example from the README and run it
Where can I get fastmcp?
The source code and installation instructions are on GitHub: https://github.com/PrefectHQ/fastmcp

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects