mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
123 lines
5.8 KiB
Text
123 lines
5.8 KiB
Text
---
|
|
title: "Welcome to FastMCP 3.0!"
|
|
sidebarTitle: "Welcome!"
|
|
description: The fast, Pythonic way to build MCP servers and clients.
|
|
icon: hand-wave
|
|
---
|
|
<img
|
|
src="/assets/brand/f-watercolor-waves-2.png"
|
|
|
|
alt="'F' logo on a watercolor background"
|
|
noZoom
|
|
className="rounded-2xl block dark:hidden"
|
|
/>
|
|
<img
|
|
src="/assets/brand/f-watercolor-waves-dark-2.jpeg"
|
|
alt="'F' logo on a watercolor background"
|
|
noZoom
|
|
className="rounded-2xl hidden dark:block"
|
|
/>
|
|
|
|
|
|
**FastMCP is the standard framework for building MCP applications.** The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) provides a standardized way to connect LLMs to tools and data, and FastMCP makes it production-ready with clean, Pythonic code:
|
|
|
|
```python {1}
|
|
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()
|
|
```
|
|
|
|
<Tip>
|
|
**This documentation is for FastMCP 3.0**, which is currently in beta. For the 2.x release, see the [FastMCP 2.0 documentation](/v2/getting-started/welcome).
|
|
</Tip>
|
|
|
|
## Production-Ready MCP
|
|
|
|
FastMCP pioneered Python MCP development—FastMCP 1.0 was incorporated into the [official MCP SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024. Today, roughly 70% of MCP servers run on some version of FastMCP.
|
|
|
|
**FastMCP 3.0 is built for enterprise MCP applications.** When you need to compose multiple servers, proxy remote APIs, add enterprise auth, or deploy multi-tenant systems, FastMCP provides the right abstractions:
|
|
|
|
- **[Providers](/servers/providers/overview)** let you source components from anywhere—decorated functions, filesystem discovery, remote servers, OpenAPI specs, or your own custom sources.
|
|
- **[Transforms](/servers/providers/transforms)** control what clients see—namespace for composition, filter by version or user permissions, convert resources to tools for compatibility.
|
|
- **[Servers](/servers/server)** expose everything over stdio, HTTP, or WebSocket with session management and protocol handling built in.
|
|
- **[Middleware](/servers/middleware)** handles cross-cutting concerns—authentication, authorization, logging, rate limiting, custom business logic.
|
|
|
|
Mount a weather API and a calendar server together with automatic namespacing. Proxy your company's internal MCP servers through a single authenticated gateway. Build a SaaS product where each tenant gets their own isolated component set. These aren't edge cases—they're what production MCP looks like.
|
|
|
|
Ready to build? Start with our [installation guide](/getting-started/installation) or jump straight to the [quickstart](/getting-started/quickstart).
|
|
|
|
FastMCP is made with 💙 by [Prefect](https://www.prefect.io/).
|
|
|
|
## What is MCP?
|
|
|
|
The Model Context Protocol lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. It is often described as "the USB-C port for AI", providing a uniform way to connect LLMs to resources they can use. It may be easier to think of it as an API, but specifically designed for LLM interactions. MCP servers can:
|
|
|
|
- Expose data through `Resources` (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
|
|
- Provide functionality through `Tools` (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
|
|
- Define interaction patterns through `Prompts` (reusable templates for LLM interactions)
|
|
- And more!
|
|
|
|
FastMCP provides a high-level, Pythonic interface for building, managing, and interacting with these servers.
|
|
|
|
## Why FastMCP?
|
|
|
|
FastMCP handles all the complex protocol details so you can focus on building. In most cases, decorating a Python function is all you need—FastMCP handles the rest.
|
|
|
|
🚀 **Fast**: High-level interface means less code and faster development
|
|
|
|
🍀 **Simple**: Build MCP servers with minimal boilerplate
|
|
|
|
🐍 **Pythonic**: Feels natural to Python developers
|
|
|
|
🔍 **Complete**: Everything for production—enterprise auth (Google, GitHub, Azure, Auth0, WorkOS), deployment tools, testing frameworks, client libraries, and more
|
|
|
|
🔧 **Composable**: The v3 architecture scales from a single tool to complex multi-server deployments
|
|
|
|
FastMCP provides the shortest path from idea to production. Deploy locally, to the cloud with [FastMCP Cloud](https://fastmcp.cloud) (free for personal servers), or to your own infrastructure.
|
|
|
|
<Tip>
|
|
**This documentation reflects FastMCP's `main` branch**, meaning it always reflects the latest development version. Features are generally marked with version badges (e.g. `New in version: 3.0.0`) to indicate when they were introduced. Note that this may include features that are not yet released.
|
|
</Tip>
|
|
|
|
## LLM-Friendly Docs
|
|
|
|
The FastMCP documentation is available in multiple LLM-friendly formats:
|
|
|
|
### MCP Server
|
|
|
|
The FastMCP docs are accessible via MCP! The server URL is `https://gofastmcp.com/mcp`.
|
|
|
|
In fact, you can use FastMCP to search the FastMCP docs:
|
|
|
|
```python
|
|
import asyncio
|
|
from fastmcp import Client
|
|
|
|
async def main():
|
|
async with Client("https://gofastmcp.com/mcp") as client:
|
|
result = await client.call_tool(
|
|
name="SearchFastMcp",
|
|
arguments={"query": "deploy a FastMCP server"}
|
|
)
|
|
print(result)
|
|
|
|
asyncio.run(main())
|
|
```
|
|
|
|
### Text Formats
|
|
|
|
The docs are also available in [llms.txt format](https://llmstxt.org/):
|
|
- [llms.txt](https://gofastmcp.com/llms.txt) - A sitemap listing all documentation pages
|
|
- [llms-full.txt](https://gofastmcp.com/llms-full.txt) - The entire documentation in one file (may exceed context windows)
|
|
|
|
Any page can be accessed as markdown by appending `.md` to the URL. For example, this page becomes `https://gofastmcp.com/getting-started/welcome.md`.
|
|
|
|
You can also copy any page as markdown by pressing "Cmd+C" (or "Ctrl+C" on Windows) on your keyboard.
|