MCP.so

FastMCP v2 ๐Ÿš€

@jlowin

FastMCP v2 ๐Ÿš€ ใซใคใ„ใฆ

๐Ÿš€ The fast, Pythonic way to build MCP servers and clients.

ๅŸบๆœฌๆƒ…ๅ ฑ

ใ‚ซใƒ†ใ‚ดใƒช

ใใฎไป–

ใƒฉใ‚คใ‚ปใƒณใ‚น

Apache-2.0

ใƒฉใƒณใ‚ฟใ‚คใƒ 

python

ใƒˆใƒฉใƒณใ‚นใƒใƒผใƒˆ

stdio

ๅ…ฌ้–‹่€…

jlowin

่จญๅฎš

ไปฅไธ‹ใฎ่จญๅฎšใ‚’ไฝฟใฃใฆใ€ใ“ใฎใ‚ตใƒผใƒใƒผใ‚’ MCP ๅฏพๅฟœใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใซ่ฟฝๅŠ ใ—ใฆใใ ใ•ใ„ใ€‚

{
  "mcpServers": {
    "fastmcp": {
      "command": "uv",
      "args": [
        "pip",
        "install",
        "fastmcp"
      ]
    }
  }
}

ใƒ„ใƒผใƒซ

ใƒ„ใƒผใƒซใฏๆคœๅ‡บใ•ใ‚Œใพใ›ใ‚“ใงใ—ใŸ

ใƒ„ใƒผใƒซใฏ README ใ‹ใ‚‰่‡ชๅ‹•็š„ใซๆŠฝๅ‡บใ•ใ‚Œใพใ™ใ€‚ใƒกใƒณใƒ†ใƒŠใƒผใฏ ## Tools ใจใ„ใ†่ฆ‹ๅ‡บใ—ใฎไธ‹ใซ่จ˜่ผ‰ใ™ใ‚‹ใ“ใจใงใ€ใ“ใฎใ‚ฟใƒ–ใซๅๆ˜ ใงใใพใ™ใ€‚

ๆฆ‚่ฆ

What is FastMCP v2 ๐Ÿš€?

FastMCP v2 ๐Ÿš€ is a Python framework for building MCP (Model Context Protocol) servers, apps, and clients. It wraps your Python functions into MCP-compliant tools, resources, and prompts, automatically generating schema, validation, and documentation. Made by Prefect, it powers 70% of MCP servers across all languages and is downloaded a million times daily.

How to use FastMCP v2 ๐Ÿš€?

Install with uv pip install fastmcp. Create an FastMCP instance, decorate functions with @mcp.tool, and run the server with mcp.run(). FastMCP also provides clients to connect to any MCP server and apps that give tools interactive UIs inside the conversation.

Key features of FastMCP v2 ๐Ÿš€

  • Auto-generates MCP schema, validation, and documentation from Python functions.
  • Three pillars: Servers, Apps, and Clients.
  • Handles transport negotiation, authentication, and protocol lifecycle.
  • Best practices for MCP are built in by default.
  • Supports local and remote MCP server connections.
  • Interactive UI rendering for tools via Apps.

Use cases of FastMCP v2 ๐Ÿš€

  • Build MCP servers that expose custom tools and resources to LLMs.
  • Create interactive UIs for tools that appear directly in the LLM conversation.
  • Connect to existing MCP servers (local or remote) from Python code or CLI.
  • Rapidly prototype and then scale MCP applications to production.

FAQ from FastMCP v2 ๐Ÿš€

What is the Model Context Protocol (MCP)?

MCP is a protocol that connects LLMs to tools and data. FastMCP v2 ๐Ÿš€ is a framework that makes implementing MCP servers, clients, and apps easy.

How do I install FastMCP v2 ๐Ÿš€?

The recommended installation is via uv pip install fastmcp. Full instructions including verification and upgrading are in the Installation Guide at gofastmcp.com.

What are the runtime requirements?

FastMCP v2 ๐Ÿš€ requires Python 3.9+ and the fastmcp package installed via uv or pip. There are no other mandatory external services.

Can I use FastMCP v2 ๐Ÿš€ without Prefect Horizon?

Yes. FastMCP v2 ๐Ÿš€ is a standalone framework. Horizon is an optional enterprise gateway for managing FastMCP servers in production.

Where can I find the full documentation?

Complete documentation is available at gofastmcp.com, including API references and advanced patterns. An llms.txt version is also provided for LLM consumption.

ใ‚ณใƒกใƒณใƒˆ

ใ€Œใใฎไป–ใ€ใฎไป–ใฎใ‚ณใƒณใƒ†ใƒณใƒ„