FastMCP logo

FastMCP

Build Python MCP servers, clients, and interactive apps with automatic schemas, validation, documentation, and protocol handling.

Install FastMCP

Run the project’s own setup commands, in order.

Setup steps from the project

FastMCP installs with its own commands rather than a config we can generate, so these are copied as-is. Run them in order in a terminal. Source: github.com

  1. 1. Install
    uv add fastmcp
    

Overview

FastMCP is a Python framework for building MCP servers, clients, and interactive applications. Python functions can become MCP tools, with schemas, validation, and documentation generated from their definitions. It also connects to local or remote MCP servers while handling transport negotiation, authentication, and protocol lifecycle concerns. Reach for FastMCP when an application needs to expose tools, resources, or prompts through MCP without implementing the protocol layer directly.

Use cases

  • Expose Python functions as MCP tools
  • Publish resources and prompts to language models
  • Connect an application to local or remote MCP servers
  • Build interactive tool interfaces for conversations

Key features

  • Python framework for MCP servers and clients
  • Automatic tool schemas and validation
  • Support for tools, resources, and prompts
  • Local and remote server connections
  • Interactive UIs rendered in conversations
  • Protocol lifecycle and authentication handling

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

55/55 checks healthy over the last 97d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars28kStargazers on the source repository.
Last commitTodayMost recent push to the default branch.
Directory activity10 viewsConfig copies, upvotes, and views on AllMCPs.

How FastMCP works

What FastMCP does

FastMCP provides a Python application framework for working with the Model Context Protocol. Its server APIs expose Python functions as MCP tools and can also publish resources and prompts for language models. The framework generates tool schemas, validation, and documentation from Python definitions, reducing the amount of protocol-specific code an application needs.

The project also includes client capabilities for connecting to MCP servers. Clients can work with local or remote servers and provide protocol support for the connection lifecycle. A third part of the framework, called Apps, supports interactive user interfaces that render directly in a conversation.

FastMCP is suited to developers building MCP applications in Python, whether they need to publish a small collection of functions or create an application containing servers, clients, and conversational interfaces.

How it works

A basic server starts by creating a FastMCP instance and decorating ordinary Python functions with @mcp.tool. Function parameters and return types supply information used to construct the MCP tool schema and validate calls. A function docstring can provide the tool description. Calling mcp.run() starts the application when the Python file is executed.

For client applications, FastMCP accepts a server URL and manages the connection details needed to communicate with an MCP server. The framework covers transport negotiation, authentication, and protocol lifecycle handling so application code can focus on its own logic.

The framework is organized around three areas: servers expose tools, resources, and prompts; clients connect to MCP servers; and apps provide interactive UIs for tools inside conversations.

Setup and configuration

FastMCP is distributed as a Python package. The project recommends adding it with uv:

bash
uv add fastmcp

A minimal server can be written as follows:

server.ts
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()

The project publishes installation, verification, upgrade, quickstart, API, and advanced-pattern documentation on gofastmcp.com. Upgrade guidance covers migrations from earlier FastMCP releases and from multiple MCP SDK versions.

Tools and capabilities

  • Expose Python functions as MCP tools.
  • Publish MCP resources and prompts.
  • Generate schemas, validation, and documentation from Python definitions.
  • Connect programmatically to local or remote MCP servers.
  • Handle transport negotiation, authentication, and protocol lifecycle concerns.
  • Build interactive UIs that render in conversations through FastMCP Apps.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about FastMCP

FastMCP is an MCP server that connects Python functions and applications to language models through the Model Context Protocol. It provides tools for exposing functions, resources, and prompts, plus client support for local or remote MCP servers and Apps for interactive interfaces rendered inside conversations.

Install FastMCP with `uv add fastmcp`. Add the package to a Python project, create a `FastMCP` instance, define tools with `@mcp.tool`, and call `mcp.run()` when the file is executed.

Decorate the function with `@mcp.tool` on a `FastMCP` instance. FastMCP derives the tool schema, validation, and documentation from the function signature, return type, and docstring.

Yes, FastMCP clients connect to remote MCP servers using a URL. The framework manages transport negotiation, authentication, and protocol lifecycle handling for the connection.

FastMCP Apps provide interactive user interfaces for tools that render directly inside a conversation. They are one of the framework's three main areas alongside servers and clients.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewFastMCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/fastmcp?style=directory)](https://allmcps.com/mcp/fastmcp)
HTML Embed
<a href="https://allmcps.com/mcp/fastmcp"><img src="https://allmcps.com/api/badge/fastmcp?style=directory" alt="FastMCP on AllMCPs" /></a>