π The fast, Pythonic way to build MCP servers and clients.
Update readme + welcome docs (#1883)
Jeremiah Lowin7f7482824f82
diff --git a/README.md b/README.mdindex 33260f67a..683898957 100644--- a/README.md+++ b/README.md@@ -1,6 +1,12 @@<div align="center"><!-- omit in toc -->+<picture>+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/brand/wordmark-white-padded.png">+ <source media="(prefers-color-scheme: light)" srcset="docs/assets/brand/wordmark-padded.png">+ <img alt="FastMCP Logo" src="docs/assets/brand/wordmark.png">+</picture>+# FastMCP v2 π<strong>The fast, Pythonic way to build MCP servers and clients.</strong>@@ -17,19 +23,19 @@> [!Note]>-> #### Beyond the Protocol->-> FastMCP is the standard framework for working with the Model Context Protocol. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024.+> #### FastMCP 2.0: The Standard Framework>-> This is FastMCP 2.0, the **actively maintained version** that provides a complete toolkit for working with the MCP ecosystem.+> FastMCP pioneered Python MCP development, and FastMCP 1.0 was incorporated into the [official MCP SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024.>-> FastMCP 2.0 has a comprehensive set of features that go far beyond the core MCP specification, all in service of providing **the simplest path to production**. These include deployment, auth, clients, server proxying and composition, generating servers from REST APIs, dynamic tool rewriting, built-in testing tools, integrations, and more.+> **This is FastMCP 2.0** β the actively maintained, production-ready framework that extends far beyond basic protocol implementation. While the SDK provides core functionality, FastMCP 2.0 delivers everything needed for production: advanced MCP patterns (server composition, proxying, OpenAPI/FastAPI generation, tool transformation), enterprise auth (Google, GitHub, WorkOS, Azure, Auth0, and more), deployment tools, testing utilities, and comprehensive client libraries.>-> Ready to upgrade or get started? Follow the [installation instructions](https://gofastmcp.com/getting-started/installation), which include steps for upgrading from the official MCP SDK.+> **For production MCP applications, install FastMCP:** `pip install fastmcp`----The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is a new, standardized way to provide context and tools to your LLMs, and FastMCP makes building MCP servers and clients simple and intuitive. Create tools, expose resources, define prompts, and connect components with clean, Pythonic code.+**FastMCP is the standard framework for building MCP applications**, providing the fastest path from idea to production.++The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is a standardized way to provide context and tools to LLMs. FastMCP makes building production-ready MCP servers simple, with enterprise auth, deployment tools, and a complete ecosystem built in.```python# server.py@@ -68,28 +74,33 @@ There are two ways to access the LLM-friendly documentation:<!-- omit in toc -->## Table of Contents-- [What is MCP?](#what-is-mcp)-- [Why FastMCP?](#why-fastmcp)-- [Installation](#installation)-- [Core Concepts](#core-concepts)- - [The `FastMCP` Server](#the-fastmcp-server)- - [Tools](#tools)- - [Resources \& Templates](#resources--templates)- - [Prompts](#prompts)- - [Context](#context)- - [MCP Clients](#mcp-clients)-- [Advanced Features](#advanced-features)- - [Proxy Servers](#proxy-servers)- - [Composing MCP Servers](#composing-mcp-servers)- - [OpenAPI \& FastAPI Generation](#openapi--fastapi-generation)- - [Authentication \& Security](#authentication--security)-- [Running Your Server](#running-your-server)-- [Contributing](#contributing)- - [Prerequisites](#prerequisites)- - [Setup](#setup)- - [Unit Tests](#unit-tests)- - [Static Checks](#static-checks)- - [Pull Requests](#pull-requests)+- [FastMCP v2 π](#fastmcp-v2-)+ - [π Documentation](#-documentation)+ - [What is MCP?](#what-is-mcp)+ - [Why FastMCP?](#why-fastmcp)+ - [Installation](#installation)+ - [Core Concepts](#core-concepts)+ - [The `FastMCP` Server](#the-fastmcp-server)+ - [Tools](#tools)+ - [Resources \& Templates](#resources--templates)+ - [Prompts](#prompts)+ - [Context](#context)+ - [MCP Clients](#mcp-clients)+ - [Authentication](#authentication)+ - [Enterprise Authentication, Zero Configuration](#enterprise-authentication-zero-configuration)+ - [Deployment](#deployment)+ - [From Development to Production](#from-development-to-production)+ - [Advanced Features](#advanced-features)+ - [Proxy Servers](#proxy-servers)+ - [Composing MCP Servers](#composing-mcp-servers)+ - [OpenAPI \& FastAPI Generation](#openapi--fastapi-generation)+ - [Running Your Server](#running-your-server)+ - [Contributing](#contributing)+ - [Prerequisites](#prerequisites)+ - [Setup](#setup)+ - [Unit Tests](#unit-tests)+ - [Static Checks](#static-checks)+ - [Pull Requests](#pull-requests)---@@ -106,11 +117,7 @@ FastMCP provides a high-level, Pythonic interface for building, managing, and in## Why FastMCP?-The MCP protocol is powerful but implementing it involves a lot of boilerplate - server setup, protocol handlers, content types, error management. FastMCP handles all the complex protocol details and server management, so you can focus on building great tools. It's designed to be high-level and Pythonic; in most cases, decorating a function is all you need.--FastMCP 2.0 has evolved into a comprehensive platform that goes far beyond basic protocol implementation. While 1.0 provided server-building capabilities (and is now part of the official MCP SDK), 2.0 offers a complete ecosystem including client libraries, authentication systems, deployment tools, integrations with major AI platforms, testing frameworks, and production-ready infrastructure patterns.--FastMCP aims to be:+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@@ -118,7 +125,9 @@ FastMCP aims to be:π **Pythonic:** Feels natural to Python developers-π **Complete:** A comprehensive platform for all MCP use cases, from dev to prod+π **Complete:** Everything for production β enterprise auth (Google, GitHub, Azure, Auth0, WorkOS), deployment tools, testing frameworks, client libraries, and more++FastMCP provides the shortest path from idea to production. Deploy locally, to the cloud with [FastMCP Cloud](https://fastmcp.cloud), or to your own infrastructure.## Installation@@ -288,9 +297,82 @@ async def main():Learn more in the [**Client Documentation**](https://gofastmcp.com/clients/client) and [**Transports Documentation**](https://gofastmcp.com/clients/transports).+## Authentication++### Enterprise Authentication, Zero Configuration++FastMCP provides comprehensive authentication support that sets it apart from basic MCP implementations. Secure your servers and authenticate your clients with the same enterprise-grade providers used by major corporations.++**Built-in OAuth Providers:**++- **Google**+- **GitHub**+- **Microsoft Azure**+- **Auth0**+- **WorkOS**+- **Descope**+- **JWT/Custom**+- **API Keys**++Protecting a server takes just two lines:++```python+from fastmcp.server.auth import GoogleProvider++auth = GoogleProvider(client_id="...", client_secret="...", base_url="https://myserver.com")+mcp = FastMCP("Protected Server", auth=auth)+```++Connecting to protected servers is even simpler:++```python+async with Client("https://protected-server.com/mcp", auth="oauth") as client:+ # Automatic browser-based OAuth flow+ result = await client.call_tool("protected_tool")+```++**Why FastMCP Auth Matters:**++- **Production-Ready:** Persistent storage, token refresh, comprehensive error handling+- **Zero-Config OAuth:** Just pass `auth="oauth"` for automatic setup+- **Enterprise Integration:** WorkOS SSO, Azure Active Directory, Auth0 tenants+- **Developer Experience:** Automatic browser launch, local callback server, environment variable support+- **Advanced Architecture:** Full OIDC support, Dynamic Client Registration (DCR), and unique OAuth proxy pattern that enables DCR with any provider++*Authentication this comprehensive is unique to FastMCP 2.0.*++Learn more in the **Authentication Documentation** for [servers](https://gofastmcp.com/servers/auth) and [clients](https://gofastmcp.com/clients/auth).++## Deployment++### From Development to Production++FastMCP supports every deployment scenario from local development to global scale:++**Development:** Run locally with a single command++```bash+fastmcp run server.py+```++**Production:** Deploy to [**FastMCP Cloud**](https://fastmcp.cloud) β Remote MCP that just works++- Instant HTTPS endpoints+- Built-in authentication+- Zero configuration+- Free for personal servers++**Self-Hosted:** Use HTTP or SSE transports for your own infrastructure++```python+mcp.run(transport="http", host="0.0.0.0", port=8000)+```++Learn more in the [**Deployment Documentation**](https://gofastmcp.com/deployment).+## Advanced Features-FastMCP introduces powerful ways to structure and deploy your MCP applications.+FastMCP introduces powerful ways to structure and compose your MCP applications.### Proxy Servers@@ -310,16 +392,6 @@ Automatically generate FastMCP servers from existing OpenAPI specifications (`FaLearn more: [**OpenAPI Integration**](https://gofastmcp.com/integrations/openapi) | [**FastAPI Integration**](https://gofastmcp.com/integrations/fastapi).-### Authentication & Security--FastMCP provides built-in authentication support to secure both your MCP servers and clients in production environments. Protect your server endpoints from unauthorized access and authenticate your clients against secured MCP servers using industry-standard protocols.--- **Server Protection**: Secure your FastMCP server endpoints with configurable authentication providers-- **Client Authentication**: Connect to authenticated MCP servers with automatic credential management-- **Production Ready**: Support for common authentication patterns used in enterprise environments--Learn more in the **Authentication Documentation** for [servers](https://gofastmcp.com/servers/auth) and [clients](https://gofastmcp.com/clients/auth).-## Running Your ServerThe main way to run a FastMCP server is by calling the `run()` method on your server instance:diff --git a/docs/assets/brand/f-watercolor-background-dark.png b/docs/assets/brand/f-watercolor-background-dark.pngnew file mode 100644index 000000000..a50956cc8Binary files /dev/null and b/docs/assets/brand/f-watercolor-background-dark.png differdiff --git a/docs/assets/brand/f-watercolor-background.png b/docs/assets/brand/f-watercolor-background.pngnew file mode 100644index 000000000..93ccf6efbBinary files /dev/null and b/docs/assets/brand/f-watercolor-background.png differdiff --git a/docs/assets/brand/logo-robot.mp4 b/docs/assets/brand/logo-robot.mp4new file mode 100644index 000000000..4c9686f74Binary files /dev/null and b/docs/assets/brand/logo-robot.mp4 differdiff --git a/docs/assets/brand/wordmark-padded.png b/docs/assets/brand/wordmark-padded.pngnew file mode 100644index 000000000..5dc7932e4Binary files /dev/null and b/docs/assets/brand/wordmark-padded.png differdiff --git a/docs/assets/brand/wordmark-white-padded.png b/docs/assets/brand/wordmark-white-padded.pngnew file mode 100644index 000000000..71eb80777Binary files /dev/null and b/docs/assets/brand/wordmark-white-padded.png differdiff --git a/docs/assets/brand/wordmark-white.png b/docs/assets/brand/wordmark-white.pngindex 265fc9ce9..81377c5be 100644Binary files a/docs/assets/brand/wordmark-white.png and b/docs/assets/brand/wordmark-white.png differdiff --git a/docs/assets/brand/wordmark.png b/docs/assets/brand/wordmark.pngindex 40e9c4bb6..41b5717b2 100644Binary files a/docs/assets/brand/wordmark.png and b/docs/assets/brand/wordmark.png differdiff --git a/docs/docs.json b/docs/docs.jsonindex 306e771e7..a408b8aea 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -11,8 +11,11 @@},"decoration": "windows"},+ "contextual": {+ "options": ["copy", "view"]+ },"banner": {- "content": "Remote MCP that just works: [FastMCP Cloud is here!](https://fastmcp.link/IhmBxWn) "+ "content": "Host your server free on [FastMCP Cloud!](https://fastmcp.cloud)"},"colors": {"dark": "#f72585",@@ -45,6 +48,13 @@},"name": "FastMCP","navbar": {+ "links": [+ {+ "href": "https://fastmcp.cloud",+ "label": "FastMCP Cloud",+ "icon": "cloud"+ }+ ],"primary": {"href": "https://github.com/jlowin/fastmcp","type": "github"diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdxindex 8c4095707..1c5c2330e 100644--- a/docs/getting-started/quickstart.mdx+++ b/docs/getting-started/quickstart.mdx@@ -119,11 +119,10 @@ Note that:## Deploy to FastMCP Cloud-[FastMCP Cloud](https://fastmcp.cloud) is a hosting service run by the FastMCP team at [Prefect](https://www.prefect.io/fastmcp). It is optimized to deploy authenticated FastMCP servers as quickly as possible, giving you a secure URL that you can plug into any LLM client.<Info>-Please note that FastMCP Cloud is a commercial service, though it is completely free for most personal servers.+FastMCP Cloud is **free for personal servers** and offers simple pay-as-you-go pricing for teams.</Info>To deploy your server, you'll need a [GitHub account](https://github.com). Once you have one, you can deploy your server in three steps:diff --git a/docs/getting-started/welcome.mdx b/docs/getting-started/welcome.mdxindex f63bfd5e3..f5f9203e3 100644--- a/docs/getting-started/welcome.mdx+++ b/docs/getting-started/welcome.mdx@@ -4,9 +4,23 @@ sidebarTitle: "Welcome!"description: The fast, Pythonic way to build MCP servers and clients.icon: hand-wave------The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is a new, standardized way to provide context and tools to your LLMs, and FastMCP makes building MCP servers and clients simple and intuitive. Create tools, expose resources, define prompts, and more with clean, Pythonic code:+<img+ src="/assets/brand/f-watercolor-background.png"+ alt="'F' logo on a watercolor background"+ height="300"+ noZoom+ className="rounded-lg block dark:hidden"+ />+<img+ src="/assets/brand/f-watercolor-background-dark.png"+ alt="'F' logo on a watercolor background"+ height="300"+ noZoom+ className="rounded-lg 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@@ -23,15 +37,13 @@ if __name__ == "__main__":```-## Beyond the Protocol+## Beyond Basic MCP-FastMCP is the standard framework for working with the Model Context Protocol. FastMCP 1.0 was incorporated into the [official MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024.+FastMCP pioneered Python MCP development, with FastMCP 1.0 being incorporated into the [official MCP SDK](https://github.com/modelcontextprotocol/python-sdk) in 2024.-This is FastMCP 2.0, the **actively maintained version** that provides a complete toolkit for working with the MCP ecosystem.+**This is FastMCP 2.0** β the actively maintained version that extends far beyond basic protocol implementation. While the SDK provides core functionality, FastMCP 2.0 delivers everything needed for production: advanced MCP patterns (server composition, proxying, OpenAPI/FastAPI generation, tool transformation), enterprise auth (Google, GitHub, Azure, Auth0, WorkOS, and more), deployment tools, testing frameworks, and comprehensive client libraries.-FastMCP 2.0 has a comprehensive set of features that go far beyond the core MCP specification, all in service of providing **the simplest path to production**. These include deployment, auth, clients, server proxying and composition, generating servers from REST APIs, dynamic tool rewriting, built-in testing tools, integrations, and more.--Ready to upgrade or get started? Follow the [installation instructions](/getting-started/installation), which include steps for upgrading from the official MCP SDK.+Ready to build? Start with our [installation guide](/getting-started/installation) or jump straight to the [quickstart](/getting-started/quickstart).## What is MCP?@@ -47,11 +59,7 @@ FastMCP provides a high-level, Pythonic interface for building, managing, and in## Why FastMCP?-The MCP protocol is powerful but implementing it involves a lot of boilerplate - server setup, protocol handlers, content types, error management. FastMCP handles all the complex protocol details and server management, so you can focus on building great tools. It's designed to be high-level and Pythonic; in most cases, decorating a function is all you need.--FastMCP 2.0 has evolved into a comprehensive platform that goes far beyond basic protocol implementation. While 1.0 provided server-building capabilities (and is now part of the official MCP SDK), 2.0 offers a complete ecosystem including client libraries, authentication systems, deployment tools, integrations with major AI platforms, testing frameworks, and production-ready infrastructure patterns.--FastMCP aims to be:+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@@ -59,7 +67,9 @@ FastMCP aims to be:π **Pythonic**: Feels natural to Python developers-π **Complete**: A comprehensive platform for all MCP use cases, from dev to prod+π **Complete**: Everything for production β enterprise auth (Google, GitHub, Azure, Auth0, WorkOS), deployment tools, testing frameworks, client libraries, and more++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.FastMCP is made with π by [Prefect](https://www.prefect.io/).@@ -67,12 +77,35 @@ FastMCP is made with π by [Prefect](https://www.prefect.io/).## LLM-Friendly Docs-This documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily.+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())+```++### Plain Text Formats-There are two ways to access the LLM-friendly documentation:-- [llms.txt](https://gofastmcp.com/llms.txt) is essentially a sitemap, listing all the pages in the documentation.-- [llms-full.txt](https://gofastmcp.com/llms-full.txt) contains the entire documentation. Note this may exceed the context window of your LLM.+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)-In addition, any page can be accessed as markdown by appending `.md` to the URL. For example, this page would become `https://gofastmcp.com/getting-started/welcome.md`, which you can view [here](/getting-started/welcome.md).+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`.-Finally, you can copy the contents of any page as markdown by pressing "Cmd+C" (or "Ctrl+C" on Windows) on your keyboard.+You can also copy any page as markdown by pressing "Cmd+C" (or "Ctrl+C" on Windows) on your keyboard.