fastmcp  by jlowin

Pythonic SDK for building Model Context Protocol (MCP) servers/clients

created 8 months ago
15,469 stars

Top 3.2% on sourcepulse

GitHubView on GitHub
Project Summary

FastMCP provides a Pythonic framework for building Model Context Protocol (MCP) servers and clients, simplifying the creation of tools, resources, and prompts for LLM applications. It abstracts away protocol complexities, enabling developers to focus on core logic and integration with LLMs.

How It Works

FastMCP leverages Python decorators (@mcp.tool(), @mcp.resource(), @mcp.prompt()) to define server capabilities. It automatically generates MCP schemas from type hints and docstrings. The FastMCP class manages server lifecycle, routing, and protocol details, while the Client class allows programmatic interaction with any MCP server, supporting various transport protocols like SSE, Stdio, and WebSockets.

Quick Start & Requirements

  • Install: uv pip install fastmcp
  • Prerequisites: Python 3.10+, uv
  • Docs: gofastmcp.com
  • Run server: fastmcp run server.py
  • Development: fastmcp dev server.py
  • Install for Claude Desktop: fastmcp install server.py

Highlighted Details

  • Supports server composition, proxying, and generation from OpenAPI/FastAPI specs.
  • Client-side LLM sampling allows servers to delegate completions to the client LLM.
  • Handles image data via fastmcp.Image helper.
  • Provides Context object for logging, progress reporting, and resource access within tools/resources.

Maintenance & Community

  • Project is active with a clear contribution guide and testing setup.
  • Links to documentation and examples are provided.

Licensing & Compatibility

  • License: MIT
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The project is actively evolving, with v2 introducing advanced features. While designed for simplicity, advanced use cases like proxying and composition require a deeper understanding of MCP concepts.

Health Check
Last commit

1 day ago

Responsiveness

1 day

Pull Requests (30d)
155
Issues (30d)
126
Star History
7,283 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

fastmcp by punkpeye

3.7%
2k
TypeScript framework for building MCP servers handling client sessions
created 7 months ago
updated 2 days ago
Feedback? Help us improve.