# Technical Documentation: jlowin/fastmcp

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/jlowin/fastmcp)

### Overview (README.md)

<div align="center">



<picture>
  <source width="550" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/PrefectHQ/fastmcp/main/docs/assets/brand/f-watercolor-waves-4-dark.png">
  <source width="550" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/PrefectHQ/fastmcp/main/docs/assets/brand/f-watercolor-waves-4.png">
  <img width="550" alt="FastMCP Logo" src="https://raw.githubusercontent.com/PrefectHQ/fastmcp/main/docs/assets/brand/f-watercolor-waves-2.png">
</picture>

# FastMCP 🚀

<strong>Move fast and make things.</strong>

*Made with 💙 by [Prefect](https://www.prefect.io/)*

[](https://gofastmcp.com)
[](https://discord.gg/uu8dJCgttd)
[](https://pypi.org/project/fastmcp)
[](https://github.com/PrefectHQ/fastmcp-ts)
[](https://github.com/PrefectHQ/fastmcp/actions/workflows/run-tests.yml)
[](https://github.com/PrefectHQ/fastmcp/blob/main/LICENSE)

<a href="https://trendshift.io/repositories/21461" target="_blank"><img src="https://trendshift.io/api/badge/repositories/21461" alt="prefecthq%2Ffastmcp | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
</div>

---

The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) connects LLMs to tools and data. FastMCP is a full MCP application framework for servers, clients, and interactive apps. A server starts with ordinary Python:

```python
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()
```

## Why FastMCP

Building an effective MCP application is harder than it looks. FastMCP handles all of it. Declare a tool with a Python function, and the schema, validation, and documentation are generated automatically. Connect to a server with a URL, and transport negotiation, authentication, and protocol lifecycle are managed for you. You focus on your logic, and the MCP part just works: **with FastMCP, best practices are built in.**

**That's why FastMCP is the standard framework for working with MCP.** FastMCP 1.0 was incorporated into the official MCP Python SDK in 2024. Today, the actively maintained standalone project is downloaded a million times a day, and some version of FastMCP powers 70% of MCP servers across all languages.

FastMCP has three pillars:

<table>
<tr>
<td align="center" valign="top" width="33%">
<a href="https://gofastmcp.com/servers/server">
<img src="https://raw.githubusercontent.com/PrefectHQ/fastmcp/main/docs/assets/images/servers-card.png" alt="Servers" />
<br /><strong>Servers</strong>
</a>
<br />Expose tools, resources, and prompts to LLMs.
</td>
<td align="center" valign="top" width="33%">
<a href="https://gofastmcp.com/apps/overview">
<img src="https://raw.githubusercontent.com/PrefectHQ/fastmcp/main/docs/assets/images/apps-card.png" alt="Apps" />
<br /><strong>Apps</strong>
</a>
<br />Give your tools interactive UIs rendered directly in the conversation.
</td>
<td align="center" valign="top" width="33%">
<a href="https://gofastmcp.com/clients/client">
<img src="https://raw.githubusercontent.com/PrefectHQ/fastmcp/main/docs/assets/images/clients-card.png" alt="Clients" />
<br /><strong>Clients</strong>
</a>
<br />Connect to any MCP server — local or remote, programmatic or CLI.
</td>
</tr>
</table>

**[Servers](https://gofastmcp.com/servers/server)** wrap your Python functions into MCP-compliant tools, resources, and prompts. **[Clients](https://gofastmcp.com/clients/client)** connect to any server with full protocol support. And **[Apps](https://gofastmcp.com/apps/overview)** give your tools interactive UIs rendered directly in the conversation.

**Building in TypeScript?** [FastMCP for TypeScript](https://github.com/PrefectHQ/fastmcp-ts) is the official counterpart, built and maintained by the same team. Same pillars, same ideas, `npm install @prefecthq/fastmcp-ts`.

Ready to build? Start with the [installation guide](https://gofastmcp.com/getting-started/installation) or jump straight to the [quickstart](https://gofastmcp.com/getting-started/quickstart).

<a id="scale-mcp-with-horizon"></a>

## Scale MCP with FastMCP Gateway

FastMCP handles the MCP application layer. **[FastMCP Gateway](https://www.prefect.io/horizon?utm_source=github&utm_medium=readme&utm_campaign=readme_horizon&utm_content=readme_body)** is the enterprise MCP gateway for scaling servers and tools across teams, with centralized governance over how they are deployed, discovered, secured, and used.

FastMCP and FastMCP Gateway are built by the same team at [Prefect](https://www.prefect.io/).

Deploy FastMCP servers from GitHub with branch previews and instant rollback. Create a private registry of every MCP your company uses. Secure access with SSO and tool-level RBAC. Get audit logs, observability, and governance across your MCP stack. Remix approved tools into purpose-built endpoints for teams and agents.

Start with FastMCP. [Scale with FastMCP Gateway →](https://www.prefect.io/horizon?utm_source=github&utm_medium=readme&utm_campaign=readme_horizon&utm_content=readme_cta)

## Installation

We recommend adding FastMCP to your project with [uv](https://docs.astral.sh/uv/):

```bash
uv add fastmcp
```

For full installation instructions, including verification and upgrading, see the [**Installation Guide**](https://gofastmcp.com/getting-started/installation).

**Upgrading?** We have guides for:
- [Upgrading from FastMCP 3](https://gofastmcp.com/getting-started/upgrading/from-fastmcp-3)
- [Upgrading from FastMCP 2](https://gofastmcp.com/getting-started/upgrading/from-fastmcp-2)
- [Upgrading from MCP SDK v1](https://gofastmcp.com/getting-started/upgrading/from-mcp-sdk-v1) or [v2](https://gofastmcp.com/getting-started/upgrading/from-mcp-sdk-v2)
- [Upgrading from the low-level SDK v1](https://gofastmcp.com/getting-started/upgrading/from-low-level-sdk-v1) or [v2](https://gofastmcp.com/getting-started/upgrading/from-low-level-sdk-v2)

## 📚 Documentation

FastMCP's complete documentation is available at **[gofastmcp.com](https://gofastmcp.com)**, including detailed guides, API references, and advanced patterns.

Documentation is also available in [llms.txt format](https://llmstxt.org/), which is a simple markdown standard that LLMs can consume easily:

- [`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.

Give your coding agent [`llms.txt`](https://gofastmcp.com/llms.txt) as its starting point. See [Coding Agents](https://gofastmcp.com/getting-started/ai-assisted-development) for version-matched documentation and the optional server authoring skill.

**Community:** Join our [Discord server](https://discord.gg/uu8dJCgttd) to connect with other FastMCP developers and share what you're building.

## Contributing

Start with [CONTRIBUTING.md](CONTRIBUTING.md) for accepted contributions and the issue-assignment workflow, then follow the [Contributing Guide](https://gofastmcp.com/development/contributing) for setup and validation. Agents should read [AGENTS.md](AGENTS.md).

---

### Apps Overview (`docs/apps/overview.mdx`)

---
title: Apps
sidebarTitle: Overview
description: Give your tools interactive UIs rendered directly in the conversation.
icon: grid-2
mode: center
---

import { VersionBadge } from '/snippets/version-badge.mdx'
import PrefabPinWarning from '/snippets/prefab-pin-warning.mdx'
import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx'

<VersionBadge version="3.0.0" />

A FastMCP app is a tool that returns an interactive UI instead of text. When the host calls it, the user sees a chart, a table, a form, or a whole dashboard rendered right inside the conversation, with working sort, search, tooltips, and state.

<div style={{
  margin: '0 clamp(-180px, calc(-18vw + 90px), 0px) 2rem',
  maxHeight: '700px',
  overflow: 'hidden',
  position: 'relative',
  maskImage: 'linear-gradient(to bottom, black 75%, transparent)',
  WebkitMaskImage: 'linear-gradient(to bottom, black 75%, transparent)',
}}>
  <PrefabDemoFrame demo="hitchhikers" height="2000px" title="Prefab showcase demo" />
</div>

The dashboard above is a [Prefab](https://prefab.prefect.io) showcase — a taste of what you can deliver from a FastMCP tool. Every card, chart, slider, dialog, and carousel is a Python component. Build a composition like this, add `@mcp.tool(app=True)`, and the host renders it inside the conversation.

Under the hood, FastMCP builds on the [MCP Apps extension](https://modelcontextprotocol.io/docs/extensions/apps) and uses Prefab to describe UIs in Python.

```bash
pip install "fastmcp[apps]"
```

<PrefabPinWarning />

## Pick your path

Four patterns cover almost everything you'd want to build. Most apps start with Interactive Tools; you only reach for the others when you've hit a specific limit.

### [Interactive Tools](/apps/prefab) — start here

Add `app=True` to a tool and return a Prefab component. Charts, tables, dashboards, and client-side interactivity (toggles, tabs, filtering) all work without any server round-trips.

```python
@mcp.tool(app=True)
def team_directory() -> DataTable:
    return DataTable(columns=[...], rows=employees, search=True)
```

### [FastMCPApp](/apps/fastmcp-app) — when the UI calls back to the server

Forms that save data, buttons that trigger backend work, search that hits a database. `FastMCPApp` manages the wiring between UI actions and backend tools, with stable tool identifiers that survive server composition.

### [Generative UI](/apps/generative) — when the LLM writes the UI

Register one provider and the model can write Prefab code tailored to the current data and request. The user watches the UI build up as the model generates it.

```python
mcp.add_provider(GenerativeUI())
```

### [Custom HTML](/apps/low-level) — when you need full control

Write your own HTML, CSS, and JavaScript. Use a specific framework, drop in a map or 3D viewer, embed video. You're talking to the MCP Apps protocol directly.

## What's next

- **[Quickstart](/apps/quickstart)** — build a working app in a minute
- **[Examples](/apps/examples)** — complete working servers you can run today
- **[Providers](/apps/providers/approval)** — ready-made capabilities (approvals, choice pickers, file upload, forms) you add with one line
- **[Development](/apps/development)** — preview app tools locally with `fastmcp dev apps`

---

### Apps Quickstart (`docs/apps/quickstart.mdx`)

---
title: Quickstart
sidebarTitle: Quickstart
description: Build your first FastMCP app in under a minute.
icon: rocket
---

import { VersionBadge } from '/snippets/version-badge.mdx'
import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx'

<VersionBadge version="3.2.0" />

By the end of this page, you'll have a working tool that returns this:

<PrefabDemoFrame demo="team-directory" height="545px" title="Team directory demo" />

A pie chart the user can hover, a table they can sort and search — and a single Python tool.

## Install

```bash
pip install "fastmcp[apps]"
```

The `apps` extra pulls in [Prefab](https://prefab.prefect.io), the Python component library used to build app UIs.

## Write the tool

Create `server.py`. The interesting parts: `app=True` tells FastMCP this tool renders a UI, and `with PrefabApp() as app:` is the canonical pattern for composing one.

```
/* Detailed source-code truncated for AI context efficiency. */
```

The Prefab code reads top-to-bottom. `PrefabApp()` is the root; everything inside its `with` block becomes the UI. `Column` stacks children vertically, `Grid` lays them out in columns. `DataTable` takes rows and column definitions and gives you sort and search for free.

`app=True` does the rest: it sets up the renderer resource, the content security policy, and the metadata that tells the host "this tool returns a UI." The host loads the result in a sandboxed iframe where the user can interact with it — all client-side, no round-trips.

## Preview it

FastMCP ships a dev server that renders your app tools in a browser, no MCP host needed:

```bash
fastmcp dev apps server.py
```

Open `http://localhost:8080`, pick `team_directory`, and try sorting columns and searching.

<Frame>
  <img src="/apps/images/app-quickstart-dev-2.png" alt="The team directory rendered in the fastmcp dev apps preview, showing a pie chart, searchable table, and a detail card after clicking a row" />
</Frame>

## Make it reactive

The UI above renders once from your Python. Prefab apps can also respond to user input live, without any server round-trips. The key concept is **state**: a client-side key-value store that components read from and write to.

Click a row in the demo below to see a detail card appear:

<PrefabDemoFrame demo="team-directory-reactive" height="675px" title="Reactive team directory demo" />

Add a few imports, give each member a couple more fields, wire up a click handler, and render a detail card when something's selected:

```
/* Detailed source-code truncated for AI context efficiency. */
```

Three new ideas do all the work:

- **`on_row_click=SetState("selected", Rx("$event"))`** — clicking a row writes its data into the `selected` state key. `$event` is the clicked row dict.
- **`Rx("selected.name")`** — a reactive reference. It doesn't hold a Python value; it compiles to a browser-side expression that re-evaluates whenever `selected` changes, so `Text(Rx("selected.name"))` always shows the latest clicked name.
- **`If(STATE.selected)`** — conditionally renders its body. Before any click, `selected` is `None` and the card stays hidden.

The `state={"selected": None}` dict on `PrefabApp` sets the initial value. Everything else happens in the browser — no round-trips to your server when the user clicks.

## Where to go next

You've built a tool that returns an interactive, reactive UI. This pattern covers a huge range of use cases: build a visualization, return it, and the user gets it rendered right in the conversation.

- **[Interactive Tools](/apps/prefab)** — charts, tables, dashboards, reactive state, with live demos
- **[FastMCPApp](/apps/fastmcp-app)** — when the UI needs to call back to your server (forms, search, CRUD)
- **[Examples](/apps/examples)** — complete working servers you can run today

---

### Cli Overview (`docs/cli/overview.mdx`)

---
title: CLI
sidebarTitle: Overview
description: The fastmcp command-line interface
icon: terminal
---

The `fastmcp` CLI is installed automatically with FastMCP. It's the primary way to run, test, install, and interact with MCP servers from your terminal.

```bash
fastmcp --help
```

## Commands at a Glance

| Command | What it does |
| ------- | ------------ |
| [`run`](/cli/running) | Run a server (local file, factory function, remote URL, or config file) |
| [`dev apps`](/cli/running#previewing-apps) | Launch a browser-based preview UI for Prefab App tools |
| [`dev inspector`](/cli/running#development-with-the-inspector) | Launch a server inside the MCP Inspector for interactive testing |
| [`install`](/cli/install-mcp) | Install a server into Claude Code, Claude Desktop, Cursor, Gemini CLI, or Goose |
| [`inspect`](/cli/inspecting) | Print a server's tools, resources, and prompts as a summary or JSON report |
| [`list`](/cli/client) | List a server's tools (and optionally resources and prompts) |
| [`call`](/cli/client#calling-tools) | Call a tool, read a resource, or get a prompt |
| [`discover`](/cli/client#discovering-configured-servers) | Find MCP servers configured in your editors and tools |
| [`generate-cli`](/cli/generate-cli) | Scaffold a standalone typed CLI from a server's tool schemas |
| [`project prepare`](/cli/running#pre-building-environments) | Pre-install dependencies into a reusable uv project |
| [`auth cimd`](/cli/auth) | Create and validate CIMD documents for OAuth |
| `login` | Sign in to FastMCP Gateway with a browser device flow |
| `whoami` | Show the current FastMCP Gateway account |
| `logout` | Revoke the current FastMCP Gateway key and remove the local credential |
| `version` | Print version info (`--copy` to copy to clipboard) |

## Server Targets

Most commands need to know *which server* to talk to. You pass a "server spec" as the first argument, and FastMCP resolves the right transport automatically.

**URLs** connect to a running HTTP server:

```bash
fastmcp list http://localhost:8000/mcp
fastmcp call http://localhost:8000/mcp get_forecast city=London
```

**Python files** are loaded directly — no `mcp.run()` boilerplate needed. FastMCP finds a server instance named `mcp`, `server`, or `app` in the file, or you can specify one explicitly:

```bash
fastmcp list server.py
fastmcp run server.py:my_custom_server
```

**Config files** work too — both FastMCP's own `fastmcp.json` format and standard MCP config files with an `mcpServers` key:

```bash
fastmcp run fastmcp.json
fastmcp list mcp-config.json
```

**Stdio commands** connect to any MCP server that speaks over standard I/O. Use `--command` instead of a positional argument:

```bash
fastmcp list --command 'npx -y @modelcontextprotocol/server-github'
```

### Name-Based Resolution

If your servers are already configured in an editor or tool, you can refer to them by name. FastMCP scans configs from Claude Desktop, Claude Code, Cursor, Gemini CLI, Goose, and a project-level `mcp.json`:

```bash
fastmcp list weather
fastmcp call weather get_forecast city=London
```

When the same name appears in multiple configs, use the `source:name` form to be specific:

```bash
fastmcp list claude-code:my-server
fastmcp call cursor:weather get_forecast city=London
```

Run [`fastmcp discover`](/cli/client#discovering-configured-servers) to see what's available on your machine.

## Authentication

<a id="prefect-horizon-account" />

### FastMCP Gateway Account

Use the top-level account commands to manage the credential for FastMCP Gateway.

```bash
fastmcp login
fastmcp whoami
fastmcp logout
```

`fastmcp login` first uses `HORIZON_API_KEY` or a valid stored key when one is available.
When login needs a new key, it shows a verification URL and code.
It opens a browser when the terminal supports it.
If the browser does not open, use the shown URL and code on another device.
To switch accounts, run `fastmcp logout` before you run `fastmcp login` again.

Login stores only the personal FastMCP Gateway API key.
It does not select or store a deployment organization.
`fastmcp whoami` gets the current user from FastMCP Gateway.
`fastmcp logout` attempts to revoke the stored key and always removes its local credential.

Set `HORIZON_API_KEY` to use an environment credential instead.
The CLI gives that value first precedence and never stores it.
When this variable controls the session, logout does not revoke or remove any credential.
Remove the variable from your environment to sign out.

Use `--json` for stable command results.
During JSON login, the verification challenge goes to stderr and the final result goes to stdout.
JSON mode does not open a browser or ask a question.

### MCP Server Authentication

When targeting an HTTP URL, the CLI enables OAuth authentication by default. If the server requires it, you'll be guided through the flow (typically opening a browser). If it doesn't, the setup is a silent no-op.

OAuth tokens are kept in memory by default and discarded when the command exits. To reuse authentication across `fastmcp list` and `fastmcp call`, generate a Fernet key once and save it as `FASTMCP_OAUTH_ENCRYPTION_KEY` in your environment or `.env` file:

```bash
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
```

With that setting, the CLI encrypts tokens and client registration details on disk under `FASTMCP_HOME`. Keep the key secret and reuse the same value across invocations. Changing it starts a separate cache and requires signing in again. This applies to HTTP and SSE URLs and discovered servers that connect directly over HTTP or SSE; MCPConfig files retain their per-server authentication configuration. The Python SDK's storage defaults are unchanged.

To skip authentication entirely — useful for local development servers — pass `--auth none`:

```bash
fastmcp call http://localhost:8000/mcp my_tool --auth none
```

You can also pass a bearer token directly. Give the token value on its own; FastMCP adds the `Bearer` prefix when it builds the `Authorization` header.

```bash
fastmcp list http://localhost:8000/mcp --auth "sk-..."
```

## Transport Override

FastMCP defaults to Streamable HTTP for URL targets. If the server only supports Server-Sent Events (SSE), force the older transport:

```bash
fastmcp list http://localhost:8000 --transport sse
```

---

### Community README (`docs/community/README.md`)

# Community Section

This directory contains community-contributed content and showcases for FastMCP.

## Structure

- `showcase.mdx` - Main community showcase page featuring high-quality projects and examples

## Adding Content

To add new community content:
1. Create a new MDX file in this directory
2. Update `docs.json` to include it in the navigation
3. Follow the existing format for consistency

## Guidelines

Community content should:
- Demonstrate best practices
- Provide educational value
- Include proper documentation
- Be maintained and up-to-date

---

### Getting Started Quickstart (`docs/getting-started/quickstart.mdx`)

---
title: Quickstart
description: "Build a FastMCP server with one tool, run it, call it from a client, add a visual UI, and deploy it so it is reachable over the internet."
icon: rocket-launch
---

This guide builds a working MCP server from scratch: a tool, a way to run it, a client that calls it, and a visual UI for the result. It ends with the server deployed and reachable over the internet.

If you haven't already installed FastMCP, follow the [installation instructions](/getting-started/installation).

## Create a FastMCP Server

A FastMCP server is a collection of tools, resources, and other MCP components. To create a server, start by instantiating the `FastMCP` class.

Create a new file called `my_server.py` and add the following code:

```python my_server.py
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")
```


That's it! You've created a FastMCP server, albeit a very boring one. Let's add a tool to make it more interesting.


## Add a Tool

To add a tool that returns a simple greeting, write a function and decorate it with `@mcp.tool` to register it with the server:

```python my_server.py {5-7}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"
```


## Run the Server

The simplest way to run your FastMCP server is to call its `run()` method. You can choose between different transports, like `stdio` for local servers, or `http` for remote access:

<CodeGroup>

```python my_server.py (stdio) {9, 10}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run()
```

```python my_server.py (HTTP) {9, 10}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

</CodeGroup>

This lets us run the server with `python my_server.py`. The stdio transport is the traditional way to connect MCP servers to clients, while the HTTP transport enables remote connections.

<Tip>
Why do we need the `if __name__ == "__main__":` block?

The `__main__` block is recommended for consistency and compatibility, ensuring your server works with all MCP clients that execute your server file as a script. Users who will exclusively run their server with the FastMCP CLI can omit it, as the CLI imports the server object directly.
</Tip>

### Using the FastMCP CLI

You can also use the `fastmcp run` command to start your server. Note that the FastMCP CLI **does not** execute the `__main__` block of your server file. Instead, it imports your server object and runs it with whatever transport and options you provide.

For example, to run this server with the default stdio transport (no matter how you called `mcp.run()`), you can use the following command:
```bash
fastmcp run my_server.py:mcp
```

To run this server with the HTTP transport, you can use the following command:
```bash
fastmcp run my_server.py:mcp --transport http --port 8000
```

## Call Your Server

Once your server is running with HTTP transport, you can connect to it with a FastMCP client or any LLM client that supports the MCP protocol:

```python my_client.py
import asyncio
from fastmcp import Client

client = Client("http://localhost:8000/mcp")

async def call_tool(name: str):
    async with client:
        result = await client.call_tool("greet", {"name": name})
        print(result)

asyncio.run(call_tool("Ford"))
```

FastMCP clients are asynchronous, so the call goes through `asyncio.run`. Entering the client context with `async with client:` is what opens the connection, and it stays open for as many calls as you want to make inside the block.

## Give Your Tool a UI

Tools normally return text, but any tool can return an interactive UI instead. Add `app=True` to your tool decorator and return a [Prefab](https://prefab.prefect.io) component — the host renders it as a chart, table, form, or any other visual element right in the conversation. This requires the `apps` extra (`pip install "fastmcp[apps]"`).

The `app=True` flag tells FastMCP to wire up the renderer and protocol metadata automatically. The tool still works like any other MCP tool — it receives arguments and returns a result — but the result is a component tree that the host displays visually instead of as plain text.

```python my_server.py
from prefab_ui.app import PrefabApp
from prefab_ui.components import Column, Heading, Text, Badge, Row
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")


@mcp.tool(app=True)
def greet(name: str) -> PrefabApp:
    """Greet someone with a visual card."""
    with Column(gap=4, css_class="p-6") as view:
        Heading(f"Hello, {name}!")
        with Row(gap=2, align="center"):
            Text("Status")
            Badge("Greeted", variant="success")

    return PrefabApp(view=view)
```

You can preview app tools locally with `fastmcp dev apps my_server.py` — no MCP host required. See the [Apps overview](/apps/overview) for the full guide, including state management, forms, charts, and server-connected interactivity.

## Deploy Your Server

FastMCP HTTP servers run anywhere you can host a Python application. The [HTTP deployment guide](/deployment/http) covers the transport settings and security boundaries for self-managed infrastructure.

For a managed deployment, [FastMCP Gateway](https://horizon.prefect.io?utm_source=gofastmcp&utm_medium=docs) is the enterprise MCP platform built by the FastMCP team at [Prefect](https://www.prefect.io). It provides hosting, authentication, access control, and observability for MCP servers.

<Info>
FastMCP Gateway is **free for personal projects** and offers enterprise governance 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:

1. Push your `my_server.py` file to a GitHub repository
2. Sign in to [FastMCP Gateway](https://horizon.prefect.io?utm_source=gofastmcp&utm_medium=docs) with your GitHub account
3. Create a new project from your repository and enter `my_server.py:mcp` as the server entrypoint

FastMCP Gateway will build and deploy your server, making it available at a URL like `https://your-project.fastmcp.app/mcp`. You can chat with it to test its functionality, or connect to it from any LLM client that supports the MCP protocol.

For more details, see the [FastMCP Gateway guide](/deployment/fastmcp-gateway).

---

### Servers Providers Overview (`docs/servers/providers/overview.mdx`)

---
title: Providers
sidebarTitle: Overview
description: How FastMCP sources tools, resources, and prompts
icon: layer-group
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.0.0" />

Every FastMCP server has one or more component providers. A provider is a source of tools, resources, and prompts - it's what makes components available to clients.

## What Is a Provider?

When a client connects to your server and asks "what tools do you have?", FastMCP asks each provider that question and combines the results. When a client calls a specific tool, FastMCP finds which provider has it and delegates the call.

You're already using providers. When you write `@mcp.tool`, you're adding a tool to your server's `LocalProvider` - the default provider that stores components you define directly in code. You just don't have to think about it for simple servers.

Providers become important when your components come from multiple sources: another FastMCP server to include, a remote MCP server to proxy, or a database where tools are defined dynamically. Each source gets its own provider, and FastMCP queries them all.

## Why Providers?

The provider abstraction solves a common problem: as servers grow, you need to organize components across multiple sources without tangling everything together.

**Composition**: Break a large server into focused modules. A "weather" server and a "calendar" server can each be developed independently, then mounted into a main server. Each mounted server becomes a `FastMCPProvider`.

**Proxying**: Expose a remote MCP server through your local server. Maybe you're bridging transports (remote HTTP to local stdio) or aggregating multiple backends. Remote connections become `ProxyProvider` instances.

**Dynamic sources**: Load tools from a database, generate them from an OpenAPI spec, or create them based on user permissions. Custom providers let components come from anywhere.

## Built-in Providers

FastMCP includes providers for common patterns:

| Provider | What it does | How you use it |
|----------|--------------|----------------|
| `LocalProvider` | Stores components you define in code | `@mcp.tool`, `mcp.add_tool()` |
| `FastMCPProvider` | Wraps another FastMCP server | `mcp.mount(server)` |
| `ProxyProvider` | Connects to remote MCP servers | `create_proxy(client)` |

Most users only interact with `LocalProvider` (through decorators) and occasionally mount or proxy other servers. The provider abstraction stays invisible until you need it.

## Transforms

[Transforms](/servers/transforms/transforms) modify components as they flow from providers to clients. Each transform sits in a chain, intercepting queries and modifying results before passing them along.

| Transform | Purpose |
|-----------|---------|
| `Namespace` | Prefixes names to avoid conflicts |
| `ToolTransform` | Modifies tool schemas (rename, description, arguments) |

The most common use is namespacing mounted servers to prevent name collisions. When you call `mount(server, namespace="api")`, FastMCP creates a `Namespace` transform automatically.

Transforms can be added to individual providers (affecting just that source) or to the server itself (affecting all components). See [Transforms](/servers/transforms/transforms) for the full picture.

## Provider Order

When a client requests a component by name or URI, FastMCP queries providers and returns the highest matching version across the providers that have it. For unversioned components, or for components with equal versions, provider registration order is the tie-breaker.

`LocalProvider` is always registered first, so your decorator-defined components take precedence over equal-version components from mounted or proxied providers. Additional providers are registered in the order you add them.

## When to Care About Providers

**You can ignore providers entirely** if you're building a simple server with decorators. Just use `@mcp.tool`, `@mcp.resource`, and `@mcp.prompt` - FastMCP handles the rest.

**Learn about providers when** you want to:
- [Mount another server](/servers/composition) into yours
- [Proxy a remote server](/servers/providers/proxy) through yours
- [Control visibility state](/servers/visibility) of components
- [Build dynamic sources](/servers/providers/custom) like database-backed tools
- [Transform components](/servers/transforms/transforms) to namespace, rename, or modify them

The decorators you already use are themselves a provider: [`LocalProvider`](/servers/providers/local) is what backs `@mcp.tool` and its siblings.

---

### V2 Getting Started Quickstart (`docs/v2/getting-started/quickstart.mdx`)

---
title: Quickstart
description: "Create a FastMCP 2 server with a tool, run it, call it from a client, and deploy it. Archived guide for the 2.x release line."
icon: rocket-launch
---

Welcome! This guide will help you quickly set up FastMCP, run your first MCP server, and deploy a server to Prefect Horizon.

If you haven't already installed FastMCP, follow the [installation instructions](/v2/getting-started/installation).

## Create a FastMCP Server

A FastMCP server is a collection of tools, resources, and other MCP components. To create a server, start by instantiating the `FastMCP` class. 

Create a new file called `my_server.py` and add the following code:

```python my_server.py
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")
```


That's it! You've created a FastMCP server, albeit a very boring one. Let's add a tool to make it more interesting.


## Add a Tool

To add a tool that returns a simple greeting, write a function and decorate it with `@mcp.tool` to register it with the server:

```python my_server.py {5-7}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"
```


## Run the Server

The simplest way to run your FastMCP server is to call its `run()` method. You can choose between different transports, like `stdio` for local servers, or `http` for remote access:

<CodeGroup>

```python my_server.py (stdio) {9, 10}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run()
```

```python my_server.py (HTTP) {9, 10}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

</CodeGroup>

This lets us run the server with `python my_server.py`. The stdio transport is the traditional way to connect MCP servers to clients, while the HTTP transport enables remote connections.

<Tip>
Why do we need the `if __name__ == "__main__":` block?

The `__main__` block is recommended for consistency and compatibility, ensuring your server works with all MCP clients that execute your server file as a script. Users who will exclusively run their server with the FastMCP CLI can omit it, as the CLI imports the server object directly.
</Tip>

### Using the FastMCP CLI

You can also use the `fastmcp run` command to start your server. Note that the FastMCP CLI **does not** execute the `__main__` block of your server file. Instead, it imports your server object and runs it with whatever transport and options you provide.

For example, to run this server with the default stdio transport (no matter how you called `mcp.run()`), you can use the following command:
```bash
fastmcp run my_server.py:mcp
```

To run this server with the HTTP transport, you can use the following command:
```bash
fastmcp run my_server.py:mcp --transport http --port 8000
```

## Call Your Server

Once your server is running with HTTP transport, you can connect to it with a FastMCP client or any LLM client that supports the MCP protocol:

```python my_client.py
import asyncio
from fastmcp import Client

client = Client("http://localhost:8000/mcp")

async def call_tool(name: str):
    async with client:
        result = await client.call_tool("greet", {"name": name})
        print(result)

asyncio.run(call_tool("Ford"))
```

Note that:
- FastMCP clients are asynchronous, so we need to use `asyncio.run` to run the client
- We must enter a client context (`async with client:`) before using the client
- You can make multiple client calls within the same context

## Deploy to Prefect Horizon

[Prefect Horizon](https://horizon.prefect.io?utm_source=gofastmcp&utm_medium=docs) is the enterprise MCP platform built by the FastMCP team at [Prefect](https://www.prefect.io). It provides managed hosting, authentication, access control, and observability for MCP servers.

<Info>
Horizon is **free for personal projects** and offers enterprise governance 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:

1. Push your `my_server.py` file to a GitHub repository
2. Sign in to [Prefect Horizon](https://horizon.prefect.io?utm_source=gofastmcp&utm_medium=docs) with your GitHub account
3. Create a new project from your repository and enter `my_server.py:mcp` as the server entrypoint

That's it! Horizon will build and deploy your server, making it available at a URL like `https://your-project.fastmcp.app/mcp`. You can chat with it to test its functionality, or connect to it from any LLM client that supports the MCP protocol.

For more details, see the [Prefect Horizon guide](/deployment/prefect-horizon).

---

### V3 Apps Overview (`docs/v3/apps/overview.mdx`)

---
title: Apps
sidebarTitle: Overview
description: Give your tools interactive UIs rendered directly in the conversation.
icon: grid-2
mode: center
---

import { VersionBadge } from '/snippets/version-badge.mdx'
import PrefabPinWarning from '/snippets/prefab-pin-warning.mdx'
import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx'

<VersionBadge version="3.0.0" />

A FastMCP app is a tool that returns an interactive UI instead of text. When the host calls it, the user sees a chart, a table, a form, or a whole dashboard rendered right inside the conversation, with working sort, search, tooltips, and state.

<div style={{
  margin: '0 clamp(-180px, calc(-18vw + 90px), 0px) 2rem',
  maxHeight: '700px',
  overflow: 'hidden',
  position: 'relative',
  maskImage: 'linear-gradient(to bottom, black 75%, transparent)',
  WebkitMaskImage: 'linear-gradient(to bottom, black 75%, transparent)',
}}>
  <PrefabDemoFrame demo="hitchhikers" height="2000px" title="Prefab showcase demo" />
</div>

The dashboard above is a [Prefab](https://prefab.prefect.io) showcase — a taste of what you can deliver from a FastMCP tool. Every card, chart, slider, dialog, and carousel is a Python component. Build a composition like this, add `@mcp.tool(app=True)`, and the host renders it inside the conversation.

Under the hood, FastMCP builds on the [MCP Apps extension](https://modelcontextprotocol.io/docs/extensions/apps) and uses Prefab to describe UIs in Python.

```bash
pip install "fastmcp[apps]"
```

<PrefabPinWarning />

## Pick your path

Four patterns cover almost everything you'd want to build. Most apps start with Interactive Tools; you only reach for the others when you've hit a specific limit.

### [Interactive Tools](/apps/prefab) — start here

Add `app=True` to a tool and return a Prefab component. Charts, tables, dashboards, and client-side interactivity (toggles, tabs, filtering) all work without any server round-trips.

```python
@mcp.tool(app=True)
def team_directory() -> DataTable:
    return DataTable(columns=[...], rows=employees, search=True)
```

### [FastMCPApp](/apps/fastmcp-app) — when the UI calls back to the server

Forms that save data, buttons that trigger backend work, search that hits a database. `FastMCPApp` manages the wiring between UI actions and backend tools, with stable tool identifiers that survive server composition.

### [Generative UI](/apps/generative) — when the LLM writes the UI

Register one provider and the model can write Prefab code tailored to the current data and request. The user watches the UI build up as the model generates it.

```python
mcp.add_provider(GenerativeUI())
```

### [Custom HTML](/apps/low-level) — when you need full control

Write your own HTML, CSS, and JavaScript. Use a specific framework, drop in a map or 3D viewer, embed video. You're talking to the MCP Apps protocol directly.

## What's next

- **[Quickstart](/apps/quickstart)** — build a working app in a minute
- **[Examples](/apps/examples)** — complete working servers you can run today
- **[Providers](/apps/providers/approval)** — ready-made capabilities (approvals, choice pickers, file upload, forms) you add with one line
- **[Development](/apps/development)** — preview app tools locally with `fastmcp dev apps`

---

### V3 Apps Quickstart (`docs/v3/apps/quickstart.mdx`)

---
title: Quickstart
sidebarTitle: Quickstart
description: Build your first FastMCP app in under a minute.
icon: rocket
tag: NEW
---

import { VersionBadge } from '/snippets/version-badge.mdx'
import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx'

<VersionBadge version="3.2.0" />

By the end of this page, you'll have a working tool that returns this:

<PrefabDemoFrame demo="team-directory" height="545px" title="Team directory demo" />

A pie chart the user can hover, a table they can sort and search — and a single Python tool.

## Install

```bash
pip install "fastmcp[apps]"
```

The `apps` extra pulls in [Prefab](https://prefab.prefect.io), the Python component library used to build app UIs.

## Write the tool

Create `server.py`. The interesting parts: `app=True` tells FastMCP this tool renders a UI, and `with PrefabApp() as app:` is the canonical pattern for composing one.

```
/* Detailed source-code truncated for AI context efficiency. */
```

The Prefab code reads top-to-bottom. `PrefabApp()` is the root; everything inside its `with` block becomes the UI. `Column` stacks children vertically, `Grid` lays them out in columns. `DataTable` takes rows and column definitions and gives you sort and search for free.

`app=True` does the rest: it sets up the renderer resource, the content security policy, and the metadata that tells the host "this tool returns a UI." The host loads the result in a sandboxed iframe where the user can interact with it — all client-side, no round-trips.

## Preview it

FastMCP ships a dev server that renders your app tools in a browser, no MCP host needed:

```bash
fastmcp dev apps server.py
```

Open `http://localhost:8080`, pick `team_directory`, and try sorting columns and searching.

<Frame>
  <img src="/apps/images/app-quickstart-dev-2.png" alt="The team directory rendered in the fastmcp dev apps preview, showing a pie chart, searchable table, and a detail card after clicking a row" />
</Frame>

## Make it reactive

The UI above renders once from your Python. Prefab apps can also respond to user input live, without any server round-trips. The key concept is **state**: a client-side key-value store that components read from and write to.

Click a row in the demo below to see a detail card appear:

<PrefabDemoFrame demo="team-directory-reactive" height="675px" title="Reactive team directory demo" />

Add a few imports, give each member a couple more fields, wire up a click handler, and render a detail card when something's selected:

```
/* Detailed source-code truncated for AI context efficiency. */
```

Three new ideas do all the work:

- **`on_row_click=SetState("selected", Rx("$event"))`** — clicking a row writes its data into the `selected` state key. `$event` is the clicked row dict.
- **`Rx("selected.name")`** — a reactive reference. It doesn't hold a Python value; it compiles to a browser-side expression that re-evaluates whenever `selected` changes, so `Text(Rx("selected.name"))` always shows the latest clicked name.
- **`If(STATE.selected)`** — conditionally renders its body. Before any click, `selected` is `None` and the card stays hidden.

The `state={"selected": None}` dict on `PrefabApp` sets the initial value. Everything else happens in the browser — no round-trips to your server when the user clicks.

## Where to go next

You've built a tool that returns an interactive, reactive UI. This pattern covers a huge range of use cases: build a visualization, return it, and the user gets it rendered right in the conversation.

- **[Interactive Tools](/apps/prefab)** — charts, tables, dashboards, reactive state, with live demos
- **[FastMCPApp](/apps/fastmcp-app)** — when the UI needs to call back to your server (forms, search, CRUD)
- **[Examples](/apps/examples)** — complete working servers you can run today

---

### V3 Cli Overview (`docs/v3/cli/overview.mdx`)

---
title: CLI
sidebarTitle: Overview
description: The fastmcp command-line interface
icon: terminal
---

import { VersionBadge } from '/snippets/version-badge.mdx'

The `fastmcp` CLI is installed automatically with FastMCP. It's the primary way to run, test, install, and interact with MCP servers from your terminal.

```bash
fastmcp --help
```

## Commands at a Glance

| Command | What it does |
| ------- | ------------ |
| [`run`](/cli/running) | Run a server (local file, factory function, remote URL, or config file) |
| [`dev apps`](/cli/running#previewing-apps) | Launch a browser-based preview UI for Prefab App tools |
| [`dev inspector`](/cli/running#development-with-the-inspector) | Launch a server inside the MCP Inspector for interactive testing |
| [`install`](/cli/install-mcp) | Install a server into Claude Code, Claude Desktop, Cursor, Gemini CLI, or Goose |
| [`inspect`](/cli/inspecting) | Print a server's tools, resources, and prompts as a summary or JSON report |
| [`list`](/cli/client) | List a server's tools (and optionally resources and prompts) |
| [`call`](/cli/client#calling-tools) | Call a single tool with arguments |
| [`discover`](/cli/client#discovering-configured-servers) | Find MCP servers configured in your editors and tools |
| [`generate-cli`](/cli/generate-cli) | Scaffold a standalone typed CLI from a server's tool schemas |
| [`project prepare`](/cli/running#pre-building-environments) | Pre-install dependencies into a reusable uv project |
| [`auth cimd`](/cli/auth) | Create and validate CIMD documents for OAuth |
| `version` | Print version info (`--copy` to copy to clipboard) |

## Server Targets

Most commands need to know *which server* to talk to. You pass a "server spec" as the first argument, and FastMCP resolves the right transport automatically.

**URLs** connect to a running HTTP server:

```bash
fastmcp list http://localhost:8000/mcp
fastmcp call http://localhost:8000/mcp get_forecast city=London
```

**Python files** are loaded directly — no `mcp.run()` boilerplate needed. FastMCP finds a server instance named `mcp`, `server`, or `app` in the file, or you can specify one explicitly:

```bash
fastmcp list server.py
fastmcp run server.py:my_custom_server
```

**Config files** work too — both FastMCP's own `fastmcp.json` format and standard MCP config files with an `mcpServers` key:

```bash
fastmcp run fastmcp.json
fastmcp list mcp-config.json
```

**Stdio commands** connect to any MCP server that speaks over standard I/O. Use `--command` instead of a positional argument:

```bash
fastmcp list --command 'npx -y @modelcontextprotocol/server-github'
```

### Name-Based Resolution

If your servers are already configured in an editor or tool, you can refer to them by name. FastMCP scans configs from Claude Desktop, Claude Code, Cursor, Gemini CLI, and Goose:

```bash
fastmcp list weather
fastmcp call weather get_forecast city=London
```

When the same name appears in multiple configs, use the `source:name` form to be specific:

```bash
fastmcp list claude-code:my-server
fastmcp call cursor:weather get_forecast city=London
```

Run [`fastmcp discover`](/cli/client#discovering-configured-servers) to see what's available on your machine.

## Authentication

When targeting an HTTP URL, the CLI enables OAuth authentication by default. If the server requires it, you'll be guided through the flow (typically opening a browser). If it doesn't, the setup is a silent no-op.

To skip authentication entirely — useful for local development servers — pass `--auth none`:

```bash
fastmcp call http://localhost:8000/mcp my_tool --auth none
```

You can also pass a bearer token directly:

```bash
fastmcp list http://localhost:8000/mcp --auth "Bearer sk-..."
```

## Transport Override

FastMCP defaults to Streamable HTTP for URL targets. If the server only supports Server-Sent Events (SSE), force the older transport:

```bash
fastmcp list http://localhost:8000 --transport sse
```

---

### V3 Community README (`docs/v3/community/README.md`)

# Community Section

This directory contains community-contributed content and showcases for FastMCP.

## Structure

- `showcase.mdx` - Main community showcase page featuring high-quality projects and examples

## Adding Content

To add new community content:
1. Create a new MDX file in this directory
2. Update `docs.json` to include it in the navigation
3. Follow the existing format for consistency

## Guidelines

Community content should:
- Demonstrate best practices
- Provide educational value
- Include proper documentation
- Be maintained and up-to-date

---

### V3 Getting Started Quickstart (`docs/v3/getting-started/quickstart.mdx`)

---
title: Quickstart
description: "Create a FastMCP 3 server with a tool, run it, call it from a client, give it a visual UI, and deploy it. Archived guide for the 3.x release line."
icon: rocket-launch
---

Welcome! This guide will help you quickly set up FastMCP, run your first MCP server, give it a visual UI, and deploy it to Prefect Horizon.

If you haven't already installed FastMCP, follow the [installation instructions](/getting-started/installation).

## Create a FastMCP Server

A FastMCP server is a collection of tools, resources, and other MCP components. To create a server, start by instantiating the `FastMCP` class. 

Create a new file called `my_server.py` and add the following code:

```python my_server.py
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")
```


That's it! You've created a FastMCP server, albeit a very boring one. Let's add a tool to make it more interesting.


## Add a Tool

To add a tool that returns a simple greeting, write a function and decorate it with `@mcp.tool` to register it with the server:

```python my_server.py {5-7}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"
```


## Run the Server

The simplest way to run your FastMCP server is to call its `run()` method. You can choose between different transports, like `stdio` for local servers, or `http` for remote access:

<CodeGroup>

```python my_server.py (stdio) {9, 10}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run()
```

```python my_server.py (HTTP) {9, 10}
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

</CodeGroup>

This lets us run the server with `python my_server.py`. The stdio transport is the traditional way to connect MCP servers to clients, while the HTTP transport enables remote connections.

<Tip>
Why do we need the `if __name__ == "__main__":` block?

The `__main__` block is recommended for consistency and compatibility, ensuring your server works with all MCP clients that execute your server file as a script. Users who will exclusively run their server with the FastMCP CLI can omit it, as the CLI imports the server object directly.
</Tip>

### Using the FastMCP CLI

You can also use the `fastmcp run` command to start your server. Note that the FastMCP CLI **does not** execute the `__main__` block of your server file. Instead, it imports your server object and runs it with whatever transport and options you provide.

For example, to run this server with the default stdio transport (no matter how you called `mcp.run()`), you can use the following command:
```bash
fastmcp run my_server.py:mcp
```

To run this server with the HTTP transport, you can use the following command:
```bash
fastmcp run my_server.py:mcp --transport http --port 8000
```

## Call Your Server

Once your server is running with HTTP transport, you can connect to it with a FastMCP client or any LLM client that supports the MCP protocol:

```python my_client.py
import asyncio
from fastmcp import Client

client = Client("http://localhost:8000/mcp")

async def call_tool(name: str):
    async with client:
        result = await client.call_tool("greet", {"name": name})
        print(result)

asyncio.run(call_tool("Ford"))
```

Note that:
- FastMCP clients are asynchronous, so we need to use `asyncio.run` to run the client
- We must enter a client context (`async with client:`) before using the client
- You can make multiple client calls within the same context

## Give Your Tool a UI

Tools normally return text, but any tool can return an interactive UI instead. Add `app=True` to your tool decorator and return a [Prefab](https://prefab.prefect.io) component — the host renders it as a chart, table, form, or any other visual element right in the conversation. This requires the `apps` extra (`pip install "fastmcp[apps]"`).

The `app=True` flag tells FastMCP to wire up the renderer and protocol metadata automatically. The tool still works like any other MCP tool — it receives arguments and returns a result — but the result is a component tree that the host displays visually instead of as plain text.

```python my_server.py
from prefab_ui.app import PrefabApp
from prefab_ui.components import Column, Heading, Text, Badge, Row
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")


@mcp.tool(app=True)
def greet(name: str) -> PrefabApp:
    """Greet someone with a visual card."""
    with Column(gap=4, css_class="p-6") as view:
        Heading(f"Hello, {name}!")
        with Row(gap=2, align="center"):
            Text("Status")
            Badge("Greeted", variant="success")

    return PrefabApp(view=view)
```

You can preview app tools locally with `fastmcp dev apps my_server.py` — no MCP host required. See the [Apps overview](/apps/overview) for the full guide, including state management, forms, charts, and server-connected interactivity.

## Deploy to Prefect Horizon

[Prefect Horizon](https://horizon.prefect.io?utm_source=gofastmcp&utm_medium=docs) is the enterprise MCP platform built by the FastMCP team at [Prefect](https://www.prefect.io). It provides managed hosting, authentication, access control, and observability for MCP servers.

<Info>
Horizon is **free for personal projects** and offers enterprise governance 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:

1. Push your `my_server.py` file to a GitHub repository
2. Sign in to [Prefect Horizon](https://horizon.prefect.io?utm_source=gofastmcp&utm_medium=docs) with your GitHub account
3. Create a new project from your repository and enter `my_server.py:mcp` as the server entrypoint

That's it! Horizon will build and deploy your server, making it available at a URL like `https://your-project.fastmcp.app/mcp`. You can chat with it to test its functionality, or connect to it from any LLM client that supports the MCP protocol.

For more details, see the [Prefect Horizon guide](/deployment/prefect-horizon).

---

### V3 Servers Providers Overview (`docs/v3/servers/providers/overview.mdx`)

---
title: Providers
sidebarTitle: Overview
description: How FastMCP sources tools, resources, and prompts
icon: layer-group
tag: NEW
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.0.0" />

Every FastMCP server has one or more component providers. A provider is a source of tools, resources, and prompts - it's what makes components available to clients.

## What Is a Provider?

When a client connects to your server and asks "what tools do you have?", FastMCP asks each provider that question and combines the results. When a client calls a specific tool, FastMCP finds which provider has it and delegates the call.

You're already using providers. When you write `@mcp.tool`, you're adding a tool to your server's `LocalProvider` - the default provider that stores components you define directly in code. You just don't have to think about it for simple servers.

Providers become important when your components come from multiple sources: another FastMCP server to include, a remote MCP server to proxy, or a database where tools are defined dynamically. Each source gets its own provider, and FastMCP queries them all seamlessly.

## Why Providers?

The provider abstraction solves a common problem: as servers grow, you need to organize components across multiple sources without tangling everything together.

**Composition**: Break a large server into focused modules. A "weather" server and a "calendar" server can each be developed independently, then mounted into a main server. Each mounted server becomes a `FastMCPProvider`.

**Proxying**: Expose a remote MCP server through your local server. Maybe you're bridging transports (remote HTTP to local stdio) or aggregating multiple backends. Remote connections become `ProxyProvider` instances.

**Dynamic sources**: Load tools from a database, generate them from an OpenAPI spec, or create them based on user permissions. Custom providers let components come from anywhere.

## Built-in Providers

FastMCP includes providers for common patterns:

| Provider | What it does | How you use it |
|----------|--------------|----------------|
| `LocalProvider` | Stores components you define in code | `@mcp.tool`, `mcp.add_tool()` |
| `FastMCPProvider` | Wraps another FastMCP server | `mcp.mount(server)` |
| `ProxyProvider` | Connects to remote MCP servers | `create_proxy(client)` |

Most users only interact with `LocalProvider` (through decorators) and occasionally mount or proxy other servers. The provider abstraction stays invisible until you need it.

## Transforms

[Transforms](/servers/transforms/transforms) modify components as they flow from providers to clients. Each transform sits in a chain, intercepting queries and modifying results before passing them along.

| Transform | Purpose |
|-----------|---------|
| `Namespace` | Prefixes names to avoid conflicts |
| `ToolTransform` | Modifies tool schemas (rename, description, arguments) |

The most common use is namespacing mounted servers to prevent name collisions. When you call `mount(server, namespace="api")`, FastMCP creates a `Namespace` transform automatically.

Transforms can be added to individual providers (affecting just that source) or to the server itself (affecting all components). See [Transforms](/servers/transforms/transforms) for the full picture.

## Provider Order

When a client requests a tool, FastMCP queries providers in registration order. The first provider that has the tool handles the request.

`LocalProvider` is always first, so your decorator-defined tools take precedence. Additional providers are queried in the order you added them. This means if two providers have a tool with the same name, the first one wins.

## When to Care About Providers

**You can ignore providers entirely** if you're building a simple server with decorators. Just use `@mcp.tool`, `@mcp.resource`, and `@mcp.prompt` - FastMCP handles the rest.

**Learn about providers when** you want to:
- [Mount another server](/servers/composition) into yours
- [Proxy a remote server](/servers/providers/proxy) through yours
- [Control visibility state](/servers/visibility) of components
- [Build dynamic sources](/servers/providers/custom) like database-backed tools

## Next Steps

- [Local](/servers/providers/local) - How decorators work
- [Mounting](/servers/composition) - Compose servers together
- [Proxying](/servers/providers/proxy) - Connect to remote servers
- [Transforms](/servers/transforms/transforms) - Namespace, rename, and modify components
- [Visibility](/servers/visibility) - Control which components clients can access
- [Custom](/servers/providers/custom) - Build your own providers

---

### Changelog (`docs/changelog.mdx`)

---
title: "Changelog"
description: "Release notes for every FastMCP version, with the changes, fixes, and contributors in each release."
icon: "list-check"
rss: true
tag: NEW
---

<Update label="v4.2.0" description="2026-11-13">

**[v4.2.0: Mad Skills](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0)**

FastMCP 4.2 makes skills something a server can serve. A `Skill` is now a plain value — a name, a description, instructions and files, validated once when you build it — and you can load one from a directory or a package, or build it in code. Put skills on a server with `SkillCatalogProvider` or `SkillsDirectoryProvider` and they're served as ordinary resources; clients that speak the experimental [Skills extension](https://modelcontextprotocol.io/seps/2640-skills-extension) also get `skills/list` with a hashed manifest per skill. Client support is still uneven, so FastMCP's own client covers the gap: `Client.read_skill()` verifies every file's size and digest, and `to_directory()` installs a skill into any agent's skills folder. Skills follow the rest of FastMCP's composition: they namespace under mounts, pass through proxies with `skills=True`, list across a `ClientGroup`, and respect `AuthMiddleware`.

Dependencies got two upgrades. A dependency can live in the annotation (`Annotated[dict, Depends(get_config)]`), so the parameter keeps its real type, and a dependency can now own the tool argument it reads through `CallArgument`. The rest is a broad sweep of fixes across OpenAPI, proxies, auth, telemetry and tasks, including completion no longer suggesting values for prompts or templates a caller can't see.

Check these before upgrading:

- **Python 3.11 or newer** is required.
- **The 4.1 skills API is deprecated** and goes away in 4.3. The old providers in `fastmcp.server.providers.skills` and helpers in `fastmcp.utilities.skills` still work and warn with their replacement; the [skills docs](https://gofastmcp.com/docs/servers/skills) have a migration table.
- **`Skill` is now the authoring class.** The wire model that used that name is `MCPSkill`; the old import keeps working until 4.3.

Thanks to our 129 contributors, including 55 first-time contributors.

### Breaking Changes ⚠️
* Make Skill a storage-neutral object with folders as one loader by [@zzstoatzz](https://github.com/zzstoatzz) in [#6065](https://github.com/PrefectHQ/fastmcp/pull/6065)
* Require Python 3.11 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6377](https://github.com/PrefectHQ/fastmcp/pull/6377)
### Enhancements ✨
* Rename the resource-era list_skills helper to list_skill_summaries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6051](https://github.com/PrefectHQ/fastmcp/pull/6051)
* Discover skills through mounted servers by [@zzstoatzz](https://github.com/zzstoatzz) in [#6067](https://github.com/PrefectHQ/fastmcp/pull/6067)
* Share Prefab renderer resources across equivalent tools by [@jlowin](https://github.com/jlowin), [@fprieto14](https://github.com/fprieto14), and [@keremoktener](https://github.com/keremoktener) in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* Export Skill from fastmcp by [@zzstoatzz](https://github.com/zzstoatzz) in [#6071](https://github.com/PrefectHQ/fastmcp/pull/6071)
* Add skills discovery to ClientGroup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6072](https://github.com/PrefectHQ/fastmcp/pull/6072)
* Add --skills to fastmcp list by [@zzstoatzz](https://github.com/zzstoatzz) in [#6073](https://github.com/PrefectHQ/fastmcp/pull/6073)
* Add Client.read_skill and tighten skills docs by [@zzstoatzz](https://github.com/zzstoatzz) in [#6087](https://github.com/PrefectHQ/fastmcp/pull/6087)
* Verify and export skills with resource-manifest fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#6086](https://github.com/PrefectHQ/fastmcp/pull/6086)
* Forward Skills discovery through proxies by [@jakekaplan](https://github.com/jakekaplan) in [#5788](https://github.com/PrefectHQ/fastmcp/pull/5788)
* Share strict skill snapshot projection by [@zzstoatzz](https://github.com/zzstoatzz) in [#6089](https://github.com/PrefectHQ/fastmcp/pull/6089)
* Use scoped local tests and leave full suites to CI by [@zzstoatzz](https://github.com/zzstoatzz) in [#6094](https://github.com/PrefectHQ/fastmcp/pull/6094)
* Share ClientGroup skill client lookup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6101](https://github.com/PrefectHQ/fastmcp/pull/6101)
* Share filesystem skill supporting-file reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#6102](https://github.com/PrefectHQ/fastmcp/pull/6102)
* Deliver concurrent triage reviews, draft fixes and mutation proposals by [@zzstoatzz](https://github.com/zzstoatzz) in [#6116](https://github.com/PrefectHQ/fastmcp/pull/6116)
* Post Marvin's dedupe and too-long comments from workflow steps by [@gaker](https://github.com/gaker) in [#6170](https://github.com/PrefectHQ/fastmcp/pull/6170)
* Remove the unused triage mutation batch by [@zzstoatzz](https://github.com/zzstoatzz) in [#6208](https://github.com/PrefectHQ/fastmcp/pull/6208)
* Restore the status site by [@zzstoatzz](https://github.com/zzstoatzz) in [#6216](https://github.com/PrefectHQ/fastmcp/pull/6216)
* Add agno, Agent Framework, and OpenAI Agents SDK to downstream smoke by [@zzstoatzz](https://github.com/zzstoatzz) in [#6222](https://github.com/PrefectHQ/fastmcp/pull/6222)
* Close external PRs until their author is assigned again by [@zzstoatzz](https://github.com/zzstoatzz) in [#6227](https://github.com/PrefectHQ/fastmcp/pull/6227)
* Let private triage sweeps run without the Sol reviewer by [@zzstoatzz](https://github.com/zzstoatzz) in [#6229](https://github.com/PrefectHQ/fastmcp/pull/6229)
* Add named model tiers to the agentic triage plans by [@zzstoatzz](https://github.com/zzstoatzz) in [#6228](https://github.com/PrefectHQ/fastmcp/pull/6228)
* Add reproducible public triage leads to backlog dashboard by [@zzstoatzz](https://github.com/zzstoatzz) in [#6293](https://github.com/PrefectHQ/fastmcp/pull/6293)
* Add a strict SkillsDirectoryProvider to fastmcp.skills.provider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6278](https://github.com/PrefectHQ/fastmcp/pull/6278)
* Point experimental_skills at the new provider and drop alpha-only skills code by [@zzstoatzz](https://github.com/zzstoatzz) in [#6279](https://github.com/PrefectHQ/fastmcp/pull/6279)
* Deprecate the 4.1 skills API for removal in 4.3 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6280](https://github.com/PrefectHQ/fastmcp/pull/6280)
* Add app restart to the smart home Fire TV example by [@zzstoatzz](https://github.com/zzstoatzz) in [#6356](https://github.com/PrefectHQ/fastmcp/pull/6356)
* Add a workflow that deploys agentic triage to Prefect Cloud by [@zzstoatzz](https://github.com/zzstoatzz) in [#6380](https://github.com/PrefectHQ/fastmcp/pull/6380)
* Support Annotated dependencies by [@zzstoatzz](https://github.com/zzstoatzz) and [@Kludex](https://github.com/Kludex) in [#6378](https://github.com/PrefectHQ/fastmcp/pull/6378)
* Post triage outcomes instead of run starts, and skip maintainer events by [@zzstoatzz](https://github.com/zzstoatzz) in [#6382](https://github.com/PrefectHQ/fastmcp/pull/6382)
* feat(auth): Add KeystoneTokenVerifier by [@bkranendonk](https://github.com/bkranendonk) in [#6264](https://github.com/PrefectHQ/fastmcp/pull/6264)
* Support npm_config_registry override in fastmcp dev apps by [@Abhi2939](https://github.com/Abhi2939) and [@ezz3r](https://github.com/ezz3r) in [#5969](https://github.com/PrefectHQ/fastmcp/pull/5969)
* Revert 12 contributions merged without enough review by [@zzstoatzz](https://github.com/zzstoatzz) in [#6434](https://github.com/PrefectHQ/fastmcp/pull/6434)
* Bump the conformance pin to 0.2.0-alpha.12 and check it weekly by [@zzstoatzz](https://github.com/zzstoatzz) in [#6424](https://github.com/PrefectHQ/fastmcp/pull/6424)
* Make background task execution TTL configurable by [@zzstoatzz](https://github.com/zzstoatzz) and [@carterthayer](https://github.com/carterthayer) in [#6428](https://github.com/PrefectHQ/fastmcp/pull/6428)
* Drop --isolated from the ty pre-commit hook by [@zzstoatzz](https://github.com/zzstoatzz) in [#6430](https://github.com/PrefectHQ/fastmcp/pull/6430)
* Set gen_ai.operation.name on tools/call spans by [@zzstoatzz](https://github.com/zzstoatzz), [@swantzter](https://github.com/swantzter), and [@CaselIT](https://github.com/CaselIT) in [#6429](https://github.com/PrefectHQ/fastmcp/pull/6429)
* Let a dependency's CallArgument own a tool argument by [@zzstoatzz](https://github.com/zzstoatzz) and [@Kludex](https://github.com/Kludex) in [#6438](https://github.com/PrefectHQ/fastmcp/pull/6438)
* Remove private dead code and type-check the companion packages by [@zzstoatzz](https://github.com/zzstoatzz) in [#6454](https://github.com/PrefectHQ/fastmcp/pull/6454)
* Add SkillManifestProvider to serve skills without loading their files by [@jakekaplan](https://github.com/jakekaplan) in [#6465](https://github.com/PrefectHQ/fastmcp/pull/6465)
### Security 🔒
* Verify advertised skill frontmatter when reading content by [@zzstoatzz](https://github.com/zzstoatzz) in [#6090](https://github.com/PrefectHQ/fastmcp/pull/6090)
* Check skill limits before reading directory and remote files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6092](https://github.com/PrefectHQ/fastmcp/pull/6092)
* fix: preserve _list_query_params in FastMCPProviderResourceTemplate.wrap by [@RS-ITACHI](https://github.com/RS-ITACHI) in [#6130](https://github.com/PrefectHQ/fastmcp/pull/6130)
* Read composite action inputs from env and pin actions by digest by [@gaker](https://github.com/gaker) in [#6168](https://github.com/PrefectHQ/fastmcp/pull/6168)
* Scope the /marvin App token to the permissions it uses by [@zzstoatzz](https://github.com/zzstoatzz) in [#6206](https://github.com/PrefectHQ/fastmcp/pull/6206)
* Require patched Authlib in client and server extras by [@zzstoatzz](https://github.com/zzstoatzz) and [@zhuweid](https://github.com/zhuweid) in [#6337](https://github.com/PrefectHQ/fastmcp/pull/6337)
* Update example locks past the schema-parsing security fix by [@zzstoatzz](https://github.com/zzstoatzz) in [#6339](https://github.com/PrefectHQ/fastmcp/pull/6339)
* Redact passwords from the worker's backend URL by [@jaeminbird](https://github.com/jaeminbird) and [@mbishflavien](https://github.com/mbishflavien) in [#6113](https://github.com/PrefectHQ/fastmcp/pull/6113)
* fix(auth): collapse a repeated `iss` in the client redirect by [@shi-felix](https://github.com/shi-felix) and [@alpaylan](https://github.com/alpaylan) in [#6352](https://github.com/PrefectHQ/fastmcp/pull/6352)
* Normalize raw-string redirect URIs through AnyUrl before validation by [@uhhgxg](https://github.com/uhhgxg) and [@alpaylan](https://github.com/alpaylan) in [#6315](https://github.com/PrefectHQ/fastmcp/pull/6315)
* fix(auth): include DNS in SSRF deadline by [@mikamikasuki](https://github.com/mikamikasuki) in [#5509](https://github.com/PrefectHQ/fastmcp/pull/5509)
* fix(transforms): enforce wall-clock timeout and external callback limit in MontySandboxProvider and CodeMode by [@Pyhroff](https://github.com/Pyhroff) in [#6063](https://github.com/PrefectHQ/fastmcp/pull/6063)
* fix(server): rebuild tool argument errors instead of echoing pydantic's by [@xubenqiang](https://github.com/xubenqiang) and [@glopezz](https://github.com/glopezz) in [#6107](https://github.com/PrefectHQ/fastmcp/pull/6107)
* Revert the consent double-submit re-acceptance by [@zzstoatzz](https://github.com/zzstoatzz) in [#6451](https://github.com/PrefectHQ/fastmcp/pull/6451)
### Fixes 🐞
* Make the version-check InvalidURL regression independent of proxy parsing by [@HootRock](https://github.com/HootRock) in [#6048](https://github.com/PrefectHQ/fastmcp/pull/6048)
* Build the Prefab renderer page on read, not on resources/list by [@adam-zovos](https://github.com/adam-zovos) in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* Install mounted skills under their own name in sync_skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#6078](https://github.com/PrefectHQ/fastmcp/pull/6078)
* Stage skill exports before replacing installed files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6091](https://github.com/PrefectHQ/fastmcp/pull/6091)
* fix: Prefix backend hash addresses with double underscores by [@jlowin](https://github.com/jlowin) and [@BlueX888](https://github.com/BlueX888) in [#6100](https://github.com/PrefectHQ/fastmcp/pull/6100)
* Rebind pre-4.2 Prefab backend addresses through 4.2 proxies by [@jakekaplan](https://github.com/jakekaplan) in [#6108](https://github.com/PrefectHQ/fastmcp/pull/6108)
* Isolate and bound triage verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6109](https://github.com/PrefectHQ/fastmcp/pull/6109)
* Improve OpenAPI upstream error details by [@zzstoatzz](https://github.com/zzstoatzz) and [@mssaleh](https://github.com/mssaleh) in [#6141](https://github.com/PrefectHQ/fastmcp/pull/6141)
* Compare JSON const and enum values by JSON equality by [@prassu017](https://github.com/prassu017) and [@alpaylan](https://github.com/alpaylan) in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* Bound Skills proxy backend pagination by [@prassu017](https://github.com/prassu017) and [@Yash-Tripath1](https://github.com/Yash-Tripath1) in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* fix: forward script arguments in FastMCPStdioTransport by [@KashifManzer](https://github.com/KashifManzer) and [@BlueX888](https://github.com/BlueX888) in [#6119](https://github.com/PrefectHQ/fastmcp/pull/6119)
* Return invalid params for prompts/get with a missing required argument by [@asasemahmed](https://github.com/asasemahmed) and [@xubenqiang](https://github.com/xubenqiang) in [#6027](https://github.com/PrefectHQ/fastmcp/pull/6027)
* Fix kept-alive stdio transports ignoring client timeouts by [@HootRock](https://github.com/HootRock) in [#6156](https://github.com/PrefectHQ/fastmcp/pull/6156)
* perf(schema): skip unnecessary reference sibling restoration by [@andreivince](https://github.com/andreivince) in [#6161](https://github.com/PrefectHQ/fastmcp/pull/6161)
* fix(cli): prefer Claude Code project servers by [@mikamikasuki](https://github.com/mikamikasuki) in [#5522](https://github.com/PrefectHQ/fastmcp/pull/5522)
* fix(cli): preserve JSON content block fields by [@mikamikasuki](https://github.com/mikamikasuki) in [#5530](https://github.com/PrefectHQ/fastmcp/pull/5530)
* Keep schema definitions when hydrating a wrapped tool result by [@asasemahmed](https://github.com/asasemahmed) in [#5927](https://github.com/PrefectHQ/fastmcp/pull/5927)
* Reject undeclared OpenAPI tool arguments under strict input validation by [@prassu017](https://github.com/prassu017) and [@mssaleh](https://github.com/mssaleh) in [#6140](https://github.com/PrefectHQ/fastmcp/pull/6140)
* fix(resources): reverse hostless URIs through Namespace unchanged by [@serhiizghama](https://github.com/serhiizghama) and [@andreivince](https://github.com/andreivince) in [#5230](https://github.com/PrefectHQ/fastmcp/pull/5230)
* fix(openapi): preserve timeouts so the server maps them to the actionable message by [@BlueX888](https://github.com/BlueX888) in [#5847](https://github.com/PrefectHQ/fastmcp/pull/5847)
* Keep posted review receipts on partial delivery and reject differing reviews by [@zzstoatzz](https://github.com/zzstoatzz) in [#6178](https://github.com/PrefectHQ/fastmcp/pull/6178)
* Drop client context holds left by finished tasks by [@zzstoatzz](https://github.com/zzstoatzz) in [#6205](https://github.com/PrefectHQ/fastmcp/pull/6205)
* Let clients with different timeouts share a kept-alive stdio session by [@zzstoatzz](https://github.com/zzstoatzz) in [#6223](https://github.com/PrefectHQ/fastmcp/pull/6223)
* fix(cli): preserve explicit null in generated tool commands by [@likecake](https://github.com/likecake) in [#6191](https://github.com/PrefectHQ/fastmcp/pull/6191)
* Honor empty tag inclusion filters in multi-server configs by [@PennEwan](https://github.com/PennEwan) in [#6200](https://github.com/PrefectHQ/fastmcp/pull/6200)
* fix(mcp-config): reuse one OAuth client per configured server by [@kbkb628](https://github.com/kbkb628) and [@whoskn](https://github.com/whoskn) in [#6097](https://github.com/PrefectHQ/fastmcp/pull/6097)
* Fix and quiet the triage alerts from 2026-11-02 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6235](https://github.com/PrefectHQ/fastmcp/pull/6235)
* fix(tasks): send task IDs in routing headers by [@eli-yip](https://github.com/eli-yip) in [#5810](https://github.com/PrefectHQ/fastmcp/pull/5810)
* fix(middleware): treat an empty methods allowlist as "log nothing" by [@gdut4140](https://github.com/gdut4140) in [#5727](https://github.com/PrefectHQ/fastmcp/pull/5727)
* Fix namespaced file resource reads while preserving URI normalization by [@BlueLi66](https://github.com/BlueLi66) in [#5716](https://github.com/PrefectHQ/fastmcp/pull/5716)
* fix(server): pass typed list request messages to list middleware hooks by [@BlueX888](https://github.com/BlueX888) in [#5732](https://github.com/PrefectHQ/fastmcp/pull/5732)
* Stop OpenAPI end-to-end tests from hitting the network by [@zzstoatzz](https://github.com/zzstoatzz) in [#6249](https://github.com/PrefectHQ/fastmcp/pull/6249)
* fix(auth): Preserve browser consent bindings across concurrent OAuth approvals by [@mikamikasuki](https://github.com/mikamikasuki) in [#5541](https://github.com/PrefectHQ/fastmcp/pull/5541)
* fix(openapi): serialize header and path parameters per the simple style by [@Harsh23Kashyap](https://github.com/Harsh23Kashyap) in [#5091](https://github.com/PrefectHQ/fastmcp/pull/5091)
* Fall back to method and path when an OpenAPI name slugs to nothing by [@asasemahmed](https://github.com/asasemahmed) in [#5699](https://github.com/PrefectHQ/fastmcp/pull/5699)
* Convert OpenAPI 3.0 boolean exclusive bounds to numeric bounds by [@asasemahmed](https://github.com/asasemahmed) in [#5697](https://github.com/PrefectHQ/fastmcp/pull/5697)
* Rewrite component refs under not, if/then/else and similar keywords by [@asasemahmed](https://github.com/asasemahmed) in [#5698](https://github.com/PrefectHQ/fastmcp/pull/5698)
* fix(openapi): keep media-type $defs beside component schemas by [@BlueX888](https://github.com/BlueX888) in [#5709](https://github.com/PrefectHQ/fastmcp/pull/5709)
* Omit readOnly properties from OpenAPI tool input schemas by [@AarnavNoble](https://github.com/AarnavNoble) in [#5753](https://github.com/PrefectHQ/fastmcp/pull/5753)
* fix: name root self-references after the generated root class by [@BlueX888](https://github.com/BlueX888) in [#5671](https://github.com/PrefectHQ/fastmcp/pull/5671)
* fix(proxy): keep stale list results out of cache by [@mikamikasuki](https://github.com/mikamikasuki) in [#5521](https://github.com/PrefectHQ/fastmcp/pull/5521)
* Match Claude Code project keys by path on Windows by [@zzstoatzz](https://github.com/zzstoatzz) and [@yongpange](https://github.com/yongpange) in [#6240](https://github.com/PrefectHQ/fastmcp/pull/6240)
* Stop preloading the server before launching the Inspector by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6241](https://github.com/PrefectHQ/fastmcp/pull/6241)
* Cull expired OAuth state from the default OAuthProxy file store by [@zzstoatzz](https://github.com/zzstoatzz), [@nosmile99](https://github.com/nosmile99), and [@mheidari98](https://github.com/mheidari98) in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* Reuse the stdio session after a cancelled startup by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6243](https://github.com/PrefectHQ/fastmcp/pull/6243)
* Match Gemini function responses to tool-use IDs by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6244](https://github.com/PrefectHQ/fastmcp/pull/6244)
* Replace parent type keywords when an ArgTransform changes the type by [@zzstoatzz](https://github.com/zzstoatzz), [@syf2211](https://github.com/syf2211), [@HootRock](https://github.com/HootRock), and [@chrikrah](https://github.com/chrikrah) in [#6246](https://github.com/PrefectHQ/fastmcp/pull/6246)
* Expire idle per-client rate limiters by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6247](https://github.com/PrefectHQ/fastmcp/pull/6247)
* Match resource templates that spell out a literal query by [@zzstoatzz](https://github.com/zzstoatzz) and [@arieleven](https://github.com/arieleven) in [#6248](https://github.com/PrefectHQ/fastmcp/pull/6248)
* fix(openapi): preserve explicit null in nullable JSON body properties by [@mumu-bird](https://github.com/mumu-bird) in [#5633](https://github.com/PrefectHQ/fastmcp/pull/5633)
* Keep OpenAPI refs that point into a component schema intact by [@zzstoatzz](https://github.com/zzstoatzz) and [@AarnavNoble](https://github.com/AarnavNoble) in [#6245](https://github.com/PrefectHQ/fastmcp/pull/6245)
* fix(telemetry): record mounted and nested server spans as INTERNAL by [@zzstoatzz](https://github.com/zzstoatzz) and [@sonmaximum](https://github.com/sonmaximum) in [#6252](https://github.com/PrefectHQ/fastmcp/pull/6252)
* fix(client): identify as fastmcp in clientInfo by default by [@zzstoatzz](https://github.com/zzstoatzz) in [#6254](https://github.com/PrefectHQ/fastmcp/pull/6254)
* fix(openapi): keep both values when a query object property matches another parameter by [@zzstoatzz](https://github.com/zzstoatzz) and [@alpaylan](https://github.com/alpaylan) in [#6256](https://github.com/PrefectHQ/fastmcp/pull/6256)
* fix(middleware): map exception subclasses in ErrorHandlingMiddleware by [@zzstoatzz](https://github.com/zzstoatzz) and [@zurmag](https://github.com/zurmag) in [#6257](https://github.com/PrefectHQ/fastmcp/pull/6257)
* fix(client): report a lost connection instead of 'Client is not connected' by [@zzstoatzz](https://github.com/zzstoatzz) and [@alex-feel](https://github.com/alex-feel) in [#6259](https://github.com/PrefectHQ/fastmcp/pull/6259)
* fix(client): keep ClientGroup tool routes after the group context exits by [@zzstoatzz](https://github.com/zzstoatzz), [@hntrl](https://github.com/hntrl), and [@YingzuoLiu](https://github.com/YingzuoLiu) in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* Accept structured skill metadata and allowed-tools lists by [@jakekaplan](https://github.com/jakekaplan) in [#6292](https://github.com/PrefectHQ/fastmcp/pull/6292)
* Preserve 4.1 skills type checks and resource-only manifest migration by [@zzstoatzz](https://github.com/zzstoatzz) in [#6305](https://github.com/PrefectHQ/fastmcp/pull/6305)
* Fix generated CLIs for tools named app, console or Client by [@andreivince](https://github.com/andreivince) in [#6056](https://github.com/PrefectHQ/fastmcp/pull/6056)
* Disambiguate colliding parameter flags in generate-cli by [@mohitdixit02](https://github.com/mohitdixit02) and [@andreivince](https://github.com/andreivince) in [#6311](https://github.com/PrefectHQ/fastmcp/pull/6311)
* fix: preserve CRLF descriptions in generated CLI parameter help by [@chris00234](https://github.com/chris00234) in [#6075](https://github.com/PrefectHQ/fastmcp/pull/6075)
* fix(agentic): repair baseline collection verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6313](https://github.com/PrefectHQ/fastmcp/pull/6313)
* Reject non-positive event retention limits by [@mikamikasuki](https://github.com/mikamikasuki) in [#5535](https://github.com/PrefectHQ/fastmcp/pull/5535)
* fix(search): rebuild the BM25 index when the tool name set changes by [@shi-felix](https://github.com/shi-felix) in [#6282](https://github.com/PrefectHQ/fastmcp/pull/6282)
* fix(tools): keep hidden parameter factories out of visible defaults by [@shi-felix](https://github.com/shi-felix) in [#6283](https://github.com/PrefectHQ/fastmcp/pull/6283)
* fix(auth): accept private-use scheme redirect URIs in CIMD documents by [@ColePBryan](https://github.com/ColePBryan) in [#6335](https://github.com/PrefectHQ/fastmcp/pull/6335)
* Report the stop reason from sampling handlers when no tools are offered by [@AarnavNoble](https://github.com/AarnavNoble) in [#6342](https://github.com/PrefectHQ/fastmcp/pull/6342)
* fix(auth): preserve empty authority on custom-scheme redirect URIs by [@codesphere-u](https://github.com/codesphere-u) and [@alpaylan](https://github.com/alpaylan) in [#6347](https://github.com/PrefectHQ/fastmcp/pull/6347)
* Declare items.type on multi-select list shorthand elicitations by [@zzstoatzz](https://github.com/zzstoatzz), [@shi-felix](https://github.com/shi-felix), [@Vivek1898](https://github.com/Vivek1898), and [@alpaylan](https://github.com/alpaylan) in [#6361](https://github.com/PrefectHQ/fastmcp/pull/6361)
* Mask prompt handler exceptions when mask_error_details=True by [@pratyu2h](https://github.com/pratyu2h) and [@maxmorrish](https://github.com/maxmorrish) in [#6277](https://github.com/PrefectHQ/fastmcp/pull/6277)
* Send `{}` for required OpenAPI object bodies with no fields by [@rome-xi](https://github.com/rome-xi) and [@wang1299](https://github.com/wang1299) in [#6340](https://github.com/PrefectHQ/fastmcp/pull/6340)
* fix(client): keep the response cache inert on legacy connections (#6298) by [@xunWhale](https://github.com/xunWhale) and [@alpaylan](https://github.com/alpaylan) in [#6321](https://github.com/PrefectHQ/fastmcp/pull/6321)
* Encode manifest paths in download_skill URIs by [@zzstoatzz](https://github.com/zzstoatzz), [@67-luck](https://github.com/67-luck), and [@BlueX888](https://github.com/BlueX888) in [#6376](https://github.com/PrefectHQ/fastmcp/pull/6376)
* Fix skill discovery for nested supporting files by [@mahekara28](https://github.com/mahekara28) and [@alpaylan](https://github.com/alpaylan) in [#6310](https://github.com/PrefectHQ/fastmcp/pull/6310)
* fix: keep additionalProperties on object schemas without a type by [@bfs2021](https://github.com/bfs2021) and [@alpaylan](https://github.com/alpaylan) in [#6127](https://github.com/PrefectHQ/fastmcp/pull/6127)
* Fix hydration of mutually recursive schema types by [@zzstoatzz](https://github.com/zzstoatzz), [@wozhenbang2004](https://github.com/wozhenbang2004), and [@alpaylan](https://github.com/alpaylan) in [#6394](https://github.com/PrefectHQ/fastmcp/pull/6394)
* Isolate filesystem component construction failures by [@PennEwan](https://github.com/PennEwan) in [#6210](https://github.com/PrefectHQ/fastmcp/pull/6210)
* fix(config): apply tool transforms before tag filters on single servers by [@AP24110011695](https://github.com/AP24110011695) and [@arjunprabhulal](https://github.com/arjunprabhulal) in [#6214](https://github.com/PrefectHQ/fastmcp/pull/6214)
* fix(tools): isolate mutable defaults in transformed tool calls by [@priy-anshugupta](https://github.com/priy-anshugupta) in [#6184](https://github.com/PrefectHQ/fastmcp/pull/6184)
* fix(openapi): make resource templates for non-identifier path parameters readable by [@AP24110011695](https://github.com/AP24110011695) and [@alpaylan](https://github.com/alpaylan) in [#6187](https://github.com/PrefectHQ/fastmcp/pull/6187)
* fix(json-schema): keep tools/list working when a root $ref resolves to a boolean schema by [@AP24110011695](https://github.com/AP24110011695) and [@alpaylan](https://github.com/alpaylan) in [#6185](https://github.com/PrefectHQ/fastmcp/pull/6185)
* Keep constraints on scalar schema references by [@shayanxcyber](https://github.com/shayanxcyber) in [#6041](https://github.com/PrefectHQ/fastmcp/pull/6041)
* fix(server): validate cursors when pagination is disabled by [@xu91102](https://github.com/xu91102) and [@DMomplaisir](https://github.com/DMomplaisir) in [#6045](https://github.com/PrefectHQ/fastmcp/pull/6045)
* Document that a custom httpx_client_factory owns its timeout by [@asasemahmed](https://github.com/asasemahmed) and [@himanshuchawla0807-gif](https://github.com/himanshuchawla0807-gif) in [#5923](https://github.com/PrefectHQ/fastmcp/pull/5923)
* Stop PingMiddleware erroring when the client has no back-channel by [@asasemahmed](https://github.com/asasemahmed) in [#5901](https://github.com/PrefectHQ/fastmcp/pull/5901)
* Store sessionless client log levels on the connection by [@asasemahmed](https://github.com/asasemahmed) in [#5899](https://github.com/PrefectHQ/fastmcp/pull/5899)
* Send the whole body when a body $ref with siblings cannot be flattened by [@asasemahmed](https://github.com/asasemahmed) in [#5893](https://github.com/PrefectHQ/fastmcp/pull/5893)
* Pass the transport to the fastmcp-remote proxy so it forwards server-initiated requests by [@asasemahmed](https://github.com/asasemahmed) in [#5885](https://github.com/PrefectHQ/fastmcp/pull/5885)
* fix(cli): forward path, stateless and log-level to SDK MCPServer servers by [@BlueX888](https://github.com/BlueX888) in [#5870](https://github.com/PrefectHQ/fastmcp/pull/5870)
* fix(client): preserve a caller-provided OAuth httpx client factory when verify is set by [@BlueX888](https://github.com/BlueX888) in [#5849](https://github.com/PrefectHQ/fastmcp/pull/5849)
* fix(prompts): resolve postponed annotations when rendering by [@67-luck](https://github.com/67-luck) and [@BlueX888](https://github.com/BlueX888) in [#5803](https://github.com/PrefectHQ/fastmcp/pull/5803)
* Roll back the tool stamp when a tool registration is rejected by [@Winoren](https://github.com/Winoren) in [#5798](https://github.com/PrefectHQ/fastmcp/pull/5798)
* fix(openapi): hydrate data for wrapped non-object responses with validate_output=False by [@nosmile99](https://github.com/nosmile99) and [@BlueX888](https://github.com/BlueX888) in [#5784](https://github.com/PrefectHQ/fastmcp/pull/5784)
* Carry prompt argument titles through PromptArgument and proxies by [@AarnavNoble](https://github.com/AarnavNoble) in [#5749](https://github.com/PrefectHQ/fastmcp/pull/5749)
* Relay the client's sampling result unchanged through proxies by [@AarnavNoble](https://github.com/AarnavNoble) in [#5747](https://github.com/PrefectHQ/fastmcp/pull/5747)
* fix(json-schema): keep x-unsupported-pattern when a format is set by [@gdut4140](https://github.com/gdut4140) in [#5731](https://github.com/PrefectHQ/fastmcp/pull/5731)
* fix(tasks): let async-generator tools run as background tasks by [@gdut4140](https://github.com/gdut4140) in [#5730](https://github.com/PrefectHQ/fastmcp/pull/5730)
* Honor Code Mode search limits after BM25 ranking by [@Winoren](https://github.com/Winoren) and [@BlueX888](https://github.com/BlueX888) in [#5715](https://github.com/PrefectHQ/fastmcp/pull/5715)
* Keep the client timeout from capping the HTTP read timeout by [@asasemahmed](https://github.com/asasemahmed) in [#5690](https://github.com/PrefectHQ/fastmcp/pull/5690)
* fix(auth): avoid rereading failed authorization forms by [@pei711](https://github.com/pei711) and [@JordanAfolabiLaw](https://github.com/JordanAfolabiLaw) in [#5570](https://github.com/PrefectHQ/fastmcp/pull/5570)
* Fix unbounded Apps dev log retention by [@mikamikasuki](https://github.com/mikamikasuki) in [#5549](https://github.com/PrefectHQ/fastmcp/pull/5549)
* Bound error-stat cardinality in ErrorHandlingMiddleware by [@mikamikasuki](https://github.com/mikamikasuki) in [#5537](https://github.com/PrefectHQ/fastmcp/pull/5537)
* fix(auth): preserve GitHub sessions across transient verification failures by [@sui-ni2](https://github.com/sui-ni2) and [@benjohngf](https://github.com/benjohngf) in [#4881](https://github.com/PrefectHQ/fastmcp/pull/4881)
* Expect the extended read timeout in the factory timeout test by [@zzstoatzz](https://github.com/zzstoatzz) in [#6395](https://github.com/PrefectHQ/fastmcp/pull/6395)
* Accept intake's contribution route in the triage review check by [@zzstoatzz](https://github.com/zzstoatzz) in [#6405](https://github.com/PrefectHQ/fastmcp/pull/6405)
* fix(auth): keep revocation ownership separate from user identity by [@zzstoatzz](https://github.com/zzstoatzz), [@BlueX888](https://github.com/BlueX888), and [@67-luck](https://github.com/67-luck) in [#6404](https://github.com/PrefectHQ/fastmcp/pull/6404)
* Authenticate and pin the schema download in the OpenAPI performance test by [@zzstoatzz](https://github.com/zzstoatzz) in [#6177](https://github.com/PrefectHQ/fastmcp/pull/6177)
* Use renamed argument names in transformed tool validation errors by [@kartikmadan11](https://github.com/kartikmadan11) in [#6158](https://github.com/PrefectHQ/fastmcp/pull/6158)
* Preserve invalid defaults for omitted JSON Schema fields by [@totoyang](https://github.com/totoyang) and [@alpaylan](https://github.com/alpaylan) in [#6133](https://github.com/PrefectHQ/fastmcp/pull/6133)
* Validate positional array prefixes separately from their tails by [@PennEwan](https://github.com/PennEwan) and [@alpaylan](https://github.com/alpaylan) in [#6146](https://github.com/PrefectHQ/fastmcp/pull/6146)
* Stop FastMCP callable caches from retaining dropped tools by [@PennEwan](https://github.com/PennEwan) and [@hanhyperfx](https://github.com/hanhyperfx) in [#6147](https://github.com/PrefectHQ/fastmcp/pull/6147)
* Fix resource templates with multiple query expressions by [@xiong-wei1](https://github.com/xiong-wei1) in [#6061](https://github.com/PrefectHQ/fastmcp/pull/6061)
* fix(json-schema): decode RFC 6901 escapes when extracting $defs names by [@AP24110011695](https://github.com/AP24110011695) and [@RS-ITACHI](https://github.com/RS-ITACHI) in [#6180](https://github.com/PrefectHQ/fastmcp/pull/6180)
* Drop backend serverInfo from proxied tool and prompt results by [@asasemahmed](https://github.com/asasemahmed) in [#5911](https://github.com/PrefectHQ/fastmcp/pull/5911)
* fix(telemetry): record exceptions once per span by [@DMomplaisir](https://github.com/DMomplaisir) in [#5861](https://github.com/PrefectHQ/fastmcp/pull/5861)
* fix(resources): honor Pydantic field aliases in resource templates by [@anh-nguyenn](https://github.com/anh-nguyenn) and [@BlueX888](https://github.com/BlueX888) in [#6054](https://github.com/PrefectHQ/fastmcp/pull/6054)
* fix(auth): authorize hashed app-tool names and synthesized Prefab resources by [@BlueX888](https://github.com/BlueX888) in [#5841](https://github.com/PrefectHQ/fastmcp/pull/5841)
* fix(prompts): honor field aliases when rendering prompts by [@BlueX888](https://github.com/BlueX888) in [#5836](https://github.com/PrefectHQ/fastmcp/pull/5836)
* fix(server): serialize structured prompt arguments before middleware by [@67-luck](https://github.com/67-luck) and [@BlueX888](https://github.com/BlueX888) in [#5805](https://github.com/PrefectHQ/fastmcp/pull/5805)
* fix(oauth-proxy): answer a repeated consent approval with the same redirect by [@jamesmaidment](https://github.com/jamesmaidment) in [#5775](https://github.com/PrefectHQ/fastmcp/pull/5775)
* fix(client): stop validating version-pinned call_tool results against the highest version's schema by [@gdut4140](https://github.com/gdut4140) in [#5725](https://github.com/PrefectHQ/fastmcp/pull/5725)
* Preserve typed additional properties in hydrated tool results by [@PrathmeshPawar2110](https://github.com/PrathmeshPawar2110), [@yannvr](https://github.com/yannvr), [@BlueX888](https://github.com/BlueX888), and [@hulkbig](https://github.com/hulkbig) in [#5779](https://github.com/PrefectHQ/fastmcp/pull/5779)
* fix(server): serve Mcp-Param validation from a wire-schema cache by [@akushonkamen](https://github.com/akushonkamen) and [@anormang1992](https://github.com/anormang1992) in [#5666](https://github.com/PrefectHQ/fastmcp/pull/5666)
* Fix #5563: OTel: prefer `AccessToken.subject` over `client_id` for `enduser.id` by [@nandanadileep](https://github.com/nandanadileep) and [@omikader](https://github.com/omikader) in [#5565](https://github.com/PrefectHQ/fastmcp/pull/5565)
* fix: decode URI fragments before schema reference hydration by [@HuaTNA](https://github.com/HuaTNA) in [#5561](https://github.com/PrefectHQ/fastmcp/pull/5561)
* Fix #5559: Configuration helpers still discard explicit port=0 by [@nandanadileep](https://github.com/nandanadileep) and [@dream-star-end](https://github.com/dream-star-end) in [#5562](https://github.com/PrefectHQ/fastmcp/pull/5562)
* Preserve or explicitly reject images in sampling tool results by [@mikamikasuki](https://github.com/mikamikasuki) in [#5554](https://github.com/PrefectHQ/fastmcp/pull/5554)
* fix(client): Prevent stale ClientGroup refreshes from replacing newer routes by [@mikamikasuki](https://github.com/mikamikasuki) in [#5543](https://github.com/PrefectHQ/fastmcp/pull/5543)
* fix(client): close partial group connections on cancellation by [@mikamikasuki](https://github.com/mikamikasuki) in [#5519](https://github.com/PrefectHQ/fastmcp/pull/5519)
* fix(cli): resolve config paths beside fastmcp.json by [@mikamikasuki](https://github.com/mikamikasuki) in [#5511](https://github.com/PrefectHQ/fastmcp/pull/5511)
* fix(tasks): retain results after tool removal by [@mikamikasuki](https://github.com/mikamikasuki) in [#5507](https://github.com/PrefectHQ/fastmcp/pull/5507)
* fix(tools): reject non-finite floats at the JSON serialization boundary by [@akushonkamen](https://github.com/akushonkamen) and [@YogaSakti](https://github.com/YogaSakti) in [#5665](https://github.com/PrefectHQ/fastmcp/pull/5665)
* Make the partial-construction stdio test fast and strict by [@zzstoatzz](https://github.com/zzstoatzz) in [#6433](https://github.com/PrefectHQ/fastmcp/pull/6433)
* test: isolate consent checks and preserve OpenAPI download budget by [@Larry-Labs](https://github.com/Larry-Labs) in [#5664](https://github.com/PrefectHQ/fastmcp/pull/5664)
* fix(client): validate accepted elicitation content by [@mikamikasuki](https://github.com/mikamikasuki) in [#5513](https://github.com/PrefectHQ/fastmcp/pull/5513)
* Advertise the MCP Apps extension only when the server serves an app by [@lancy69](https://github.com/lancy69) and [@adrianto-nanovest](https://github.com/adrianto-nanovest) in [#5062](https://github.com/PrefectHQ/fastmcp/pull/5062)
* fix: `session: UserSession` on a resource or resource template fails at registration by [@xixi-box](https://github.com/xixi-box) and [@arjunprabhulal](https://github.com/arjunprabhulal) in [#6198](https://github.com/PrefectHQ/fastmcp/pull/6198)
* fix(cli): parse JSON for non-string unions and accept null in call args by [@Christian-Sidak](https://github.com/Christian-Sidak) and [@BHAWESHBHASKAR](https://github.com/BHAWESHBHASKAR) in [#6012](https://github.com/PrefectHQ/fastmcp/pull/6012)
* Forward URL-mode elicitation through the proxy by [@Kushal9889](https://github.com/Kushal9889) in [#5980](https://github.com/PrefectHQ/fastmcp/pull/5980)
* Let context list calls run outside a request by [@asasemahmed](https://github.com/asasemahmed) in [#5903](https://github.com/PrefectHQ/fastmcp/pull/5903)
* Keep ResourceLink content on prompt messages by [@asasemahmed](https://github.com/asasemahmed) in [#5897](https://github.com/PrefectHQ/fastmcp/pull/5897)
* Accept WorkOS tokens when required_scopes is set by [@asasemahmed](https://github.com/asasemahmed) in [#5881](https://github.com/PrefectHQ/fastmcp/pull/5881)
* fix(openapi): JSON-encode object form fields in urlencoded request bodies by [@BlueX888](https://github.com/BlueX888) in [#5851](https://github.com/PrefectHQ/fastmcp/pull/5851)
* Keep task config and execution on transformed tools by [@Winoren](https://github.com/Winoren) and [@BlueX888](https://github.com/BlueX888) in [#5793](https://github.com/PrefectHQ/fastmcp/pull/5793)
* fix(proxy): relay non-object tool results across MCP versions by [@Lpk124](https://github.com/Lpk124) and [@maxime-gautre](https://github.com/maxime-gautre) in [#5763](https://github.com/PrefectHQ/fastmcp/pull/5763)
* Fix #5706: Resource template with a level-3 operator such as `{&size}` is listed but can never be read by [@nandanadileep](https://github.com/nandanadileep) and [@chrikrah](https://github.com/chrikrah) in [#5711](https://github.com/PrefectHQ/fastmcp/pull/5711)
* fix: preserve referenced schema definitions by [@lux-liang](https://github.com/lux-liang) in [#5588](https://github.com/PrefectHQ/fastmcp/pull/5588)
* fix(server): fall back to the highest authorized version on direct lookup by [@gshklovs](https://github.com/gshklovs) and [@CoralGarden52](https://github.com/CoralGarden52) in [#5169](https://github.com/PrefectHQ/fastmcp/pull/5169)
* Resolve deferred defaults by alias and keep unverified GitHub scopes out of the cache by [@zzstoatzz](https://github.com/zzstoatzz) in [#6417](https://github.com/PrefectHQ/fastmcp/pull/6417)
* Drop unpinned ping from auth example clients by [@zzstoatzz](https://github.com/zzstoatzz) and [@stephaneberle9](https://github.com/stephaneberle9) in [#6418](https://github.com/PrefectHQ/fastmcp/pull/6418)
* Call a re-versioned tool by its transformed version by [@zzstoatzz](https://github.com/zzstoatzz) and [@MayankTamakuwala](https://github.com/MayankTamakuwala) in [#6419](https://github.com/PrefectHQ/fastmcp/pull/6419)
* Apply logging/setLevel to mounted servers over HTTP sessions by [@zzstoatzz](https://github.com/zzstoatzz) and [@alpaylan](https://github.com/alpaylan) in [#6421](https://github.com/PrefectHQ/fastmcp/pull/6421)
* Reconnect StdioTransport when reused on a different event loop by [@zzstoatzz](https://github.com/zzstoatzz) and [@dsfaccini](https://github.com/dsfaccini) in [#6425](https://github.com/PrefectHQ/fastmcp/pull/6425)
* Forward list-changed notifications through ProxyClient by [@zzstoatzz](https://github.com/zzstoatzz), [@chrikrah](https://github.com/chrikrah), and [@ldlda](https://github.com/ldlda) in [#6426](https://github.com/PrefectHQ/fastmcp/pull/6426)
* Report JSON-RPC error codes and request ids on telemetry spans by [@zzstoatzz](https://github.com/zzstoatzz) in [#6427](https://github.com/PrefectHQ/fastmcp/pull/6427)
* Stop the SSE endpoint sending a second response after its stream by [@zzstoatzz](https://github.com/zzstoatzz) and [@JonZeolla](https://github.com/JonZeolla) in [#6431](https://github.com/PrefectHQ/fastmcp/pull/6431)
* Bypass proxy env when fastmcp dev apps lists tools by [@zzstoatzz](https://github.com/zzstoatzz) and [@AlyLanier](https://github.com/AlyLanier) in [#6422](https://github.com/PrefectHQ/fastmcp/pull/6422)
* fix(context): allow background task logging without a session by [@67-luck](https://github.com/67-luck) and [@BlueX888](https://github.com/BlueX888) in [#5806](https://github.com/PrefectHQ/fastmcp/pull/5806)
* fix(skills): follow empty pagination cursors when listing skills by [@67-luck](https://github.com/67-luck) in [#6473](https://github.com/PrefectHQ/fastmcp/pull/6473)
* Fix the CLI .js deprecation warning and a dead error-message link by [@zzstoatzz](https://github.com/zzstoatzz) in [#6453](https://github.com/PrefectHQ/fastmcp/pull/6453)
* Ignore stray ResourceWarnings in CLI OAuth warning checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#6474](https://github.com/PrefectHQ/fastmcp/pull/6474)
* Accept a sync tool timeout that fires before its thread starts by [@zzstoatzz](https://github.com/zzstoatzz) in [#6475](https://github.com/PrefectHQ/fastmcp/pull/6475)
* Drop GC ResourceWarnings at the assertion in CLI OAuth warning checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#6481](https://github.com/PrefectHQ/fastmcp/pull/6481)
### Docs 📚
* Consolidate skills docs into one Skills over MCP page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6049](https://github.com/PrefectHQ/fastmcp/pull/6049)
* Rewrite skills docs around Skill and SkillCatalogProvider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6066](https://github.com/PrefectHQ/fastmcp/pull/6066)
* Tighten skills docs examples by [@zzstoatzz](https://github.com/zzstoatzz) in [#6070](https://github.com/PrefectHQ/fastmcp/pull/6070)
* Shorten the skills docs page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6079](https://github.com/PrefectHQ/fastmcp/pull/6079)
* Badge the skills page as 4.2.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6083](https://github.com/PrefectHQ/fastmcp/pull/6083)
* Consolidate skills examples around verified Skill values by [@zzstoatzz](https://github.com/zzstoatzz) in [#6093](https://github.com/PrefectHQ/fastmcp/pull/6093)
* docs: add v4.2.0a1 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6105](https://github.com/PrefectHQ/fastmcp/pull/6105)
* Add MCP tool annotations to get_file example by [@gl1tchdust](https://github.com/gl1tchdust) in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* Fix dead links in current documentation by [@zzstoatzz](https://github.com/zzstoatzz) and [@Wilson0511](https://github.com/Wilson0511) in [#6142](https://github.com/PrefectHQ/fastmcp/pull/6142)
* docs: rename Horizon to FastMCP Gateway in current docs by [@parkedwards](https://github.com/parkedwards) in [#5653](https://github.com/PrefectHQ/fastmcp/pull/5653)
* Document strict-mode handling of undeclared OpenAPI arguments by [@zzstoatzz](https://github.com/zzstoatzz) in [#6169](https://github.com/PrefectHQ/fastmcp/pull/6169)
* docs: add v4.2.0a2 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6224](https://github.com/PrefectHQ/fastmcp/pull/6224)
* docs(settings): explain what FASTMCP_DEBUG actually does by [@zzstoatzz](https://github.com/zzstoatzz) and [@ianw](https://github.com/ianw) in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* docs: pass referrers on outbound links, add organization schema and page descriptions by [@madureira-gabriel](https://github.com/madureira-gabriel) in [#6287](https://github.com/PrefectHQ/fastmcp/pull/6287)
* docs: add v4.2.0a3 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6306](https://github.com/PrefectHQ/fastmcp/pull/6306)
* docs: preserve docs routing metadata and release guidance by [@zzstoatzz](https://github.com/zzstoatzz) in [#6320](https://github.com/PrefectHQ/fastmcp/pull/6320)
* Correct how tools docs describe bytes return values by [@DivyaNarahari97](https://github.com/DivyaNarahari97) in [#6275](https://github.com/PrefectHQ/fastmcp/pull/6275)
* docs: add v4.2.0a4 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6388](https://github.com/PrefectHQ/fastmcp/pull/6388)
* docs: correct the server pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6406](https://github.com/PrefectHQ/fastmcp/pull/6406)
* docs: correct the client pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6407](https://github.com/PrefectHQ/fastmcp/pull/6407)
* docs: correct the apps pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6409](https://github.com/PrefectHQ/fastmcp/pull/6409)
* docs: correct getting started, CLI and deployment pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6410](https://github.com/PrefectHQ/fastmcp/pull/6410)
* docs: correct the integration pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6408](https://github.com/PrefectHQ/fastmcp/pull/6408)
* docs: label the current docs version v4 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6411](https://github.com/PrefectHQ/fastmcp/pull/6411)
* docs: explain root_path for SSE behind a prefix-stripping proxy by [@zzstoatzz](https://github.com/zzstoatzz) and [@KnittelK](https://github.com/KnittelK) in [#6215](https://github.com/PrefectHQ/fastmcp/pull/6215)
* docs: keep the search shortcut hint off the button edge by [@zzstoatzz](https://github.com/zzstoatzz) in [#6413](https://github.com/PrefectHQ/fastmcp/pull/6413)
* docs: clarify tool errors and middleware transformations by [@rasokiwayami](https://github.com/rasokiwayami) and [@jeffsawatzky](https://github.com/jeffsawatzky) in [#5566](https://github.com/PrefectHQ/fastmcp/pull/5566)
* docs: server-level component changes don't notify clients by [@zzstoatzz](https://github.com/zzstoatzz) and [@Ngtvu1752](https://github.com/Ngtvu1752) in [#6423](https://github.com/PrefectHQ/fastmcp/pull/6423)
* docs: badge 4.2.0 features and add the 4.1 → 4.2 upgrade guide by [@zzstoatzz](https://github.com/zzstoatzz) in [#6436](https://github.com/PrefectHQ/fastmcp/pull/6436)
* Pre-4.2 polish: stale docs, examples and docstrings by [@zzstoatzz](https://github.com/zzstoatzz) in [#6452](https://github.com/PrefectHQ/fastmcp/pull/6452)
* docs: add v4.2.0a5 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6469](https://github.com/PrefectHQ/fastmcp/pull/6469)
* Update docs logo to new FastMCP wordmark by [@ninadewane](https://github.com/ninadewane) in [#6462](https://github.com/PrefectHQ/fastmcp/pull/6462)
### Examples & Contrib 💡
* Register templated MCPMixin resources as resource templates by [@asasemahmed](https://github.com/asasemahmed) in [#5895](https://github.com/PrefectHQ/fastmcp/pull/5895)
* Keep structured content on bulk tool results by [@asasemahmed](https://github.com/asasemahmed) in [#5917](https://github.com/PrefectHQ/fastmcp/pull/5917)
### Dependencies 📦
* build(deps): bump mcp from 1.28.1 to 1.30.0 in /examples/testing_demo in the uv group across 1 directory by @dependabot[bot] in https://github.com/PrefectHQ/fastmcp/pull/5990
### Other Changes 🦾
* chore(deps): Update dependency ruff to v0.17.2 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6233
* chore(deps): Pin dependencies by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6064
* Require patched joserfc by [@zzstoatzz](https://github.com/zzstoatzz) in [#6371](https://github.com/PrefectHQ/fastmcp/pull/6371)
* Keep colon-terminated prose lines in docstring tool descriptions by [@zzstoatzz](https://github.com/zzstoatzz), [@jlx1999s](https://github.com/jlx1999s), and [@ptrailblazer89](https://github.com/ptrailblazer89) in [#6372](https://github.com/PrefectHQ/fastmcp/pull/6372)
* chore(deps): Update dependency oauthlib to v4.0.1 [SECURITY] by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6367
* chore(deps): Update dependency node to v26 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6234
* chore(deps): Update dependency prefect to v3.9.1 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6232
* Keep completion from suggesting values for hidden references by [@zzstoatzz](https://github.com/zzstoatzz) and [@pvliesdonk](https://github.com/pvliesdonk) in [#6450](https://github.com/PrefectHQ/fastmcp/pull/6450)

## New Contributors
* @adam-zovos made their first contribution in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* @fprieto14 made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @keremoktener made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @gl1tchdust made their first contribution in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* @Yash-Tripath1 made their first contribution in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* @ianw made their first contribution in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* @hntrl made their first contribution in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* @YingzuoLiu made their first contribution in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* @mohitdixit02 made their first contribution in [#6311](https://github.com/PrefectHQ/fastmcp/pull/6311)
* @chris00234 made their first contribution in [#6075](https://github.com/PrefectHQ/fastmcp/pull/6075)
* @67-luck made their first contribution in [#6376](https://github.com/PrefectHQ/fastmcp/pull/6376)
* @mahekara28 made their first contribution in [#6310](https://github.com/PrefectHQ/fastmcp/pull/6310)
* @shayanxcyber made their first contribution in [#6041](https://github.com/PrefectHQ/fastmcp/pull/6041)
* @DMomplaisir made their first contribution in [#6045](https://github.com/PrefectHQ/fastmcp/pull/6045)
* @xu91102 made their first contribution in [#6045](https://github.com/PrefectHQ/fastmcp/pull/6045)
* @KnittelK made their first contribution in [#6215](https://github.com/PrefectHQ/fastmcp/pull/6215)
* @bkranendonk made their first contribution in [#6264](https://github.com/PrefectHQ/fastmcp/pull/6264)
* @kartikmadan11 made their first contribution in [#6158](https://github.com/PrefectHQ/fastmcp/pull/6158)
* @totoyang made their first contribution in [#6133](https://github.com/PrefectHQ/fastmcp/pull/6133)
* @hanhyperfx made their first contribution in [#6147](https://github.com/PrefectHQ/fastmcp/pull/6147)
* @xiong-wei1 made their first contribution in [#6061](https://github.com/PrefectHQ/fastmcp/pull/6061)
* @anh-nguyenn made their first contribution in [#6054](https://github.com/PrefectHQ/fastmcp/pull/6054)
* @jamesmaidment made their first contribution in [#5775](https://github.com/PrefectHQ/fastmcp/pull/5775)
* @yannvr made their first contribution in [#5779](https://github.com/PrefectHQ/fastmcp/pull/5779)
* @akushonkamen made their first contribution in [#5666](https://github.com/PrefectHQ/fastmcp/pull/5666)
* @anormang1992 made their first contribution in [#5666](https://github.com/PrefectHQ/fastmcp/pull/5666)
* @jeffsawatzky made their first contribution in [#5566](https://github.com/PrefectHQ/fastmcp/pull/5566)
* @rasokiwayami made their first contribution in [#5566](https://github.com/PrefectHQ/fastmcp/pull/5566)
* @omikader made their first contribution in [#5565](https://github.com/PrefectHQ/fastmcp/pull/5565)
* @dream-star-end made their first contribution in [#5562](https://github.com/PrefectHQ/fastmcp/pull/5562)
* @YogaSakti made their first contribution in [#5665](https://github.com/PrefectHQ/fastmcp/pull/5665)
* @Pyhroff made their first contribution in [#6063](https://github.com/PrefectHQ/fastmcp/pull/6063)
* @Larry-Labs made their first contribution in [#5664](https://github.com/PrefectHQ/fastmcp/pull/5664)
* @adrianto-nanovest made their first contribution in [#5062](https://github.com/PrefectHQ/fastmcp/pull/5062)
* @lancy69 made their first contribution in [#5062](https://github.com/PrefectHQ/fastmcp/pull/5062)
* @xixi-box made their first contribution in [#6198](https://github.com/PrefectHQ/fastmcp/pull/6198)
* @glopezz made their first contribution in [#6107](https://github.com/PrefectHQ/fastmcp/pull/6107)
* @BHAWESHBHASKAR made their first contribution in [#6012](https://github.com/PrefectHQ/fastmcp/pull/6012)
* @Christian-Sidak made their first contribution in [#6012](https://github.com/PrefectHQ/fastmcp/pull/6012)
* @Kushal9889 made their first contribution in [#5980](https://github.com/PrefectHQ/fastmcp/pull/5980)
* @Abhi2939 made their first contribution in [#5969](https://github.com/PrefectHQ/fastmcp/pull/5969)
* @ezz3r made their first contribution in [#5969](https://github.com/PrefectHQ/fastmcp/pull/5969)
* @Lpk124 made their first contribution in [#5763](https://github.com/PrefectHQ/fastmcp/pull/5763)
* @maxime-gautre made their first contribution in [#5763](https://github.com/PrefectHQ/fastmcp/pull/5763)
* @lux-liang made their first contribution in [#5588](https://github.com/PrefectHQ/fastmcp/pull/5588)
* @gshklovs made their first contribution in [#5169](https://github.com/PrefectHQ/fastmcp/pull/5169)
* @ninadewane made their first contribution in [#6462](https://github.com/PrefectHQ/fastmcp/pull/6462)
* @MayankTamakuwala made their first contribution in [#6419](https://github.com/PrefectHQ/fastmcp/pull/6419)
* @Ngtvu1752 made their first contribution in [#6423](https://github.com/PrefectHQ/fastmcp/pull/6423)
* @dsfaccini made their first contribution in [#6425](https://github.com/PrefectHQ/fastmcp/pull/6425)
* @ldlda made their first contribution in [#6426](https://github.com/PrefectHQ/fastmcp/pull/6426)
* @carterthayer made their first contribution in [#6428](https://github.com/PrefectHQ/fastmcp/pull/6428)
* @AlyLanier made their first contribution in [#6422](https://github.com/PrefectHQ/fastmcp/pull/6422)
* @CaselIT made their first contribution in [#6429](https://github.com/PrefectHQ/fastmcp/pull/6429)
* @swantzter made their first contribution in [#6429](https://github.com/PrefectHQ/fastmcp/pull/6429)

**Full Changelog**: [v4.1.4...v4.2.0](https://github.com/PrefectHQ/fastmcp/compare/v4.1.4...v4.2.0)

</Update>

<Update label="v4.2.0a5" description="2026-11-12">

**[v4.2.0a5: Skillium Fancyson](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a5)**

FastMCP 4.2.0a5 adds `SkillManifestProvider`, which serves skills from their manifests (frontmatter plus each file's digest and size) and reads a file only when a client reads it, so skills kept in a bucket or database don't have to be loaded to answer `skills/list`. `SkillCatalogProvider` now builds on it and no longer re-hashes every file on each request. Since a4, a dependency can own the tool argument it reads through `CallArgument`, completion no longer suggests values for prompts or templates a caller can't see, `ctx.info()` and the other logging helpers work inside background tasks, and a final polish pass covered docs, examples and docstrings. This is the last prerelease before 4.2.0. Thanks to our 128 contributors, including 54 first-time contributors.

### Breaking Changes ⚠️
* Make Skill a storage-neutral object with folders as one loader by [@zzstoatzz](https://github.com/zzstoatzz) in [#6065](https://github.com/PrefectHQ/fastmcp/pull/6065)
* Require Python 3.11 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6377](https://github.com/PrefectHQ/fastmcp/pull/6377)
### Enhancements ✨
* Rename the resource-era list_skills helper to list_skill_summaries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6051](https://github.com/PrefectHQ/fastmcp/pull/6051)
* Discover skills through mounted servers by [@zzstoatzz](https://github.com/zzstoatzz) in [#6067](https://github.com/PrefectHQ/fastmcp/pull/6067)
* Share Prefab renderer resources across equivalent tools by [@jlowin](https://github.com/jlowin), [@fprieto14](https://github.com/fprieto14), and [@keremoktener](https://github.com/keremoktener) in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* Export Skill from fastmcp by [@zzstoatzz](https://github.com/zzstoatzz) in [#6071](https://github.com/PrefectHQ/fastmcp/pull/6071)
* Add skills discovery to ClientGroup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6072](https://github.com/PrefectHQ/fastmcp/pull/6072)
* Add --skills to fastmcp list by [@zzstoatzz](https://github.com/zzstoatzz) in [#6073](https://github.com/PrefectHQ/fastmcp/pull/6073)
* Add Client.read_skill and tighten skills docs by [@zzstoatzz](https://github.com/zzstoatzz) in [#6087](https://github.com/PrefectHQ/fastmcp/pull/6087)
* Verify and export skills with resource-manifest fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#6086](https://github.com/PrefectHQ/fastmcp/pull/6086)
* Forward Skills discovery through proxies by [@jakekaplan](https://github.com/jakekaplan) in [#5788](https://github.com/PrefectHQ/fastmcp/pull/5788)
* Share strict skill snapshot projection by [@zzstoatzz](https://github.com/zzstoatzz) in [#6089](https://github.com/PrefectHQ/fastmcp/pull/6089)
* Use scoped local tests and leave full suites to CI by [@zzstoatzz](https://github.com/zzstoatzz) in [#6094](https://github.com/PrefectHQ/fastmcp/pull/6094)
* Share ClientGroup skill client lookup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6101](https://github.com/PrefectHQ/fastmcp/pull/6101)
* Share filesystem skill supporting-file reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#6102](https://github.com/PrefectHQ/fastmcp/pull/6102)
* Deliver concurrent triage reviews, draft fixes and mutation proposals by [@zzstoatzz](https://github.com/zzstoatzz) in [#6116](https://github.com/PrefectHQ/fastmcp/pull/6116)
* Post Marvin's dedupe and too-long comments from workflow steps by [@gaker](https://github.com/gaker) in [#6170](https://github.com/PrefectHQ/fastmcp/pull/6170)
* Remove the unused triage mutation batch by [@zzstoatzz](https://github.com/zzstoatzz) in [#6208](https://github.com/PrefectHQ/fastmcp/pull/6208)
* Restore the status site by [@zzstoatzz](https://github.com/zzstoatzz) in [#6216](https://github.com/PrefectHQ/fastmcp/pull/6216)
* Add agno, Agent Framework, and OpenAI Agents SDK to downstream smoke by [@zzstoatzz](https://github.com/zzstoatzz) in [#6222](https://github.com/PrefectHQ/fastmcp/pull/6222)
* Close external PRs until their author is assigned again by [@zzstoatzz](https://github.com/zzstoatzz) in [#6227](https://github.com/PrefectHQ/fastmcp/pull/6227)
* Let private triage sweeps run without the Sol reviewer by [@zzstoatzz](https://github.com/zzstoatzz) in [#6229](https://github.com/PrefectHQ/fastmcp/pull/6229)
* Add named model tiers to the agentic triage plans by [@zzstoatzz](https://github.com/zzstoatzz) in [#6228](https://github.com/PrefectHQ/fastmcp/pull/6228)
* Add reproducible public triage leads to backlog dashboard by [@zzstoatzz](https://github.com/zzstoatzz) in [#6293](https://github.com/PrefectHQ/fastmcp/pull/6293)
* Add a strict SkillsDirectoryProvider to fastmcp.skills.provider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6278](https://github.com/PrefectHQ/fastmcp/pull/6278)
* Point experimental_skills at the new provider and drop alpha-only skills code by [@zzstoatzz](https://github.com/zzstoatzz) in [#6279](https://github.com/PrefectHQ/fastmcp/pull/6279)
* Deprecate the 4.1 skills API for removal in 4.3 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6280](https://github.com/PrefectHQ/fastmcp/pull/6280)
* Add app restart to the smart home Fire TV example by [@zzstoatzz](https://github.com/zzstoatzz) in [#6356](https://github.com/PrefectHQ/fastmcp/pull/6356)
* Add a workflow that deploys agentic triage to Prefect Cloud by [@zzstoatzz](https://github.com/zzstoatzz) in [#6380](https://github.com/PrefectHQ/fastmcp/pull/6380)
* Support Annotated dependencies by [@zzstoatzz](https://github.com/zzstoatzz) and [@Kludex](https://github.com/Kludex) in [#6378](https://github.com/PrefectHQ/fastmcp/pull/6378)
* Post triage outcomes instead of run starts, and skip maintainer events by [@zzstoatzz](https://github.com/zzstoatzz) in [#6382](https://github.com/PrefectHQ/fastmcp/pull/6382)
* feat(auth): Add KeystoneTokenVerifier by [@bkranendonk](https://github.com/bkranendonk) in [#6264](https://github.com/PrefectHQ/fastmcp/pull/6264)
* Support npm_config_registry override in fastmcp dev apps by [@Abhi2939](https://github.com/Abhi2939) and [@ezz3r](https://github.com/ezz3r) in [#5969](https://github.com/PrefectHQ/fastmcp/pull/5969)
* Revert 12 contributions merged without enough review by [@zzstoatzz](https://github.com/zzstoatzz) in [#6434](https://github.com/PrefectHQ/fastmcp/pull/6434)
* Bump the conformance pin to 0.2.0-alpha.12 and check it weekly by [@zzstoatzz](https://github.com/zzstoatzz) in [#6424](https://github.com/PrefectHQ/fastmcp/pull/6424)
* Make background task execution TTL configurable by [@zzstoatzz](https://github.com/zzstoatzz) and [@carterthayer](https://github.com/carterthayer) in [#6428](https://github.com/PrefectHQ/fastmcp/pull/6428)
* Drop --isolated from the ty pre-commit hook by [@zzstoatzz](https://github.com/zzstoatzz) in [#6430](https://github.com/PrefectHQ/fastmcp/pull/6430)
* Set gen_ai.operation.name on tools/call spans by [@zzstoatzz](https://github.com/zzstoatzz), [@swantzter](https://github.com/swantzter), and [@CaselIT](https://github.com/CaselIT) in [#6429](https://github.com/PrefectHQ/fastmcp/pull/6429)
* Let a dependency's CallArgument own a tool argument by [@zzstoatzz](https://github.com/zzstoatzz) and [@Kludex](https://github.com/Kludex) in [#6438](https://github.com/PrefectHQ/fastmcp/pull/6438)
* Remove private dead code and type-check the companion packages by [@zzstoatzz](https://github.com/zzstoatzz) in [#6454](https://github.com/PrefectHQ/fastmcp/pull/6454)
* Add SkillManifestProvider to serve skills without loading their files by [@jakekaplan](https://github.com/jakekaplan) in [#6465](https://github.com/PrefectHQ/fastmcp/pull/6465)
### Security 🔒
* Verify advertised skill frontmatter when reading content by [@zzstoatzz](https://github.com/zzstoatzz) in [#6090](https://github.com/PrefectHQ/fastmcp/pull/6090)
* Check skill limits before reading directory and remote files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6092](https://github.com/PrefectHQ/fastmcp/pull/6092)
* fix: preserve _list_query_params in FastMCPProviderResourceTemplate.wrap by [@RS-ITACHI](https://github.com/RS-ITACHI) in [#6130](https://github.com/PrefectHQ/fastmcp/pull/6130)
* Read composite action inputs from env and pin actions by digest by [@gaker](https://github.com/gaker) in [#6168](https://github.com/PrefectHQ/fastmcp/pull/6168)
* Scope the /marvin App token to the permissions it uses by [@zzstoatzz](https://github.com/zzstoatzz) in [#6206](https://github.com/PrefectHQ/fastmcp/pull/6206)
* Require patched Authlib in client and server extras by [@zzstoatzz](https://github.com/zzstoatzz) and [@zhuweid](https://github.com/zhuweid) in [#6337](https://github.com/PrefectHQ/fastmcp/pull/6337)
* Update example locks past the schema-parsing security fix by [@zzstoatzz](https://github.com/zzstoatzz) in [#6339](https://github.com/PrefectHQ/fastmcp/pull/6339)
* Redact passwords from the worker's backend URL by [@jaeminbird](https://github.com/jaeminbird) and [@mbishflavien](https://github.com/mbishflavien) in [#6113](https://github.com/PrefectHQ/fastmcp/pull/6113)
* fix(auth): collapse a repeated `iss` in the client redirect by [@shi-felix](https://github.com/shi-felix) and [@alpaylan](https://github.com/alpaylan) in [#6352](https://github.com/PrefectHQ/fastmcp/pull/6352)
* Normalize raw-string redirect URIs through AnyUrl before validation by [@uhhgxg](https://github.com/uhhgxg) and [@alpaylan](https://github.com/alpaylan) in [#6315](https://github.com/PrefectHQ/fastmcp/pull/6315)
* fix(auth): include DNS in SSRF deadline by [@mikamikasuki](https://github.com/mikamikasuki) in [#5509](https://github.com/PrefectHQ/fastmcp/pull/5509)
* fix(transforms): enforce wall-clock timeout and external callback limit in MontySandboxProvider and CodeMode by [@Pyhroff](https://github.com/Pyhroff) in [#6063](https://github.com/PrefectHQ/fastmcp/pull/6063)
* fix(server): rebuild tool argument errors instead of echoing pydantic's by [@xubenqiang](https://github.com/xubenqiang) and [@glopezz](https://github.com/glopezz) in [#6107](https://github.com/PrefectHQ/fastmcp/pull/6107)
* Revert the consent double-submit re-acceptance by [@zzstoatzz](https://github.com/zzstoatzz) in [#6451](https://github.com/PrefectHQ/fastmcp/pull/6451)
### Fixes 🐞
* Make the version-check InvalidURL regression independent of proxy parsing by [@HootRock](https://github.com/HootRock) in [#6048](https://github.com/PrefectHQ/fastmcp/pull/6048)
* Build the Prefab renderer page on read, not on resources/list by [@adam-zovos](https://github.com/adam-zovos) in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* Install mounted skills under their own name in sync_skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#6078](https://github.com/PrefectHQ/fastmcp/pull/6078)
* Stage skill exports before replacing installed files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6091](https://github.com/PrefectHQ/fastmcp/pull/6091)
* fix: Prefix backend hash addresses with double underscores by [@jlowin](https://github.com/jlowin) and [@BlueX888](https://github.com/BlueX888) in [#6100](https://github.com/PrefectHQ/fastmcp/pull/6100)
* Rebind pre-4.2 Prefab backend addresses through 4.2 proxies by [@jakekaplan](https://github.com/jakekaplan) in [#6108](https://github.com/PrefectHQ/fastmcp/pull/6108)
* Isolate and bound triage verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6109](https://github.com/PrefectHQ/fastmcp/pull/6109)
* Improve OpenAPI upstream error details by [@zzstoatzz](https://github.com/zzstoatzz) and [@mssaleh](https://github.com/mssaleh) in [#6141](https://github.com/PrefectHQ/fastmcp/pull/6141)
* Compare JSON const and enum values by JSON equality by [@prassu017](https://github.com/prassu017) and [@alpaylan](https://github.com/alpaylan) in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* Bound Skills proxy backend pagination by [@prassu017](https://github.com/prassu017) and [@Yash-Tripath1](https://github.com/Yash-Tripath1) in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* fix: forward script arguments in FastMCPStdioTransport by [@KashifManzer](https://github.com/KashifManzer) and [@BlueX888](https://github.com/BlueX888) in [#6119](https://github.com/PrefectHQ/fastmcp/pull/6119)
* Return invalid params for prompts/get with a missing required argument by [@asasemahmed](https://github.com/asasemahmed) and [@xubenqiang](https://github.com/xubenqiang) in [#6027](https://github.com/PrefectHQ/fastmcp/pull/6027)
* Fix kept-alive stdio transports ignoring client timeouts by [@HootRock](https://github.com/HootRock) in [#6156](https://github.com/PrefectHQ/fastmcp/pull/6156)
* perf(schema): skip unnecessary reference sibling restoration by [@andreivince](https://github.com/andreivince) in [#6161](https://github.com/PrefectHQ/fastmcp/pull/6161)
* fix(cli): prefer Claude Code project servers by [@mikamikasuki](https://github.com/mikamikasuki) in [#5522](https://github.com/PrefectHQ/fastmcp/pull/5522)
* fix(cli): preserve JSON content block fields by [@mikamikasuki](https://github.com/mikamikasuki) in [#5530](https://github.com/PrefectHQ/fastmcp/pull/5530)
* Keep schema definitions when hydrating a wrapped tool result by [@asasemahmed](https://github.com/asasemahmed) in [#5927](https://github.com/PrefectHQ/fastmcp/pull/5927)
* Reject undeclared OpenAPI tool arguments under strict input validation by [@prassu017](https://github.com/prassu017) and [@mssaleh](https://github.com/mssaleh) in [#6140](https://github.com/PrefectHQ/fastmcp/pull/6140)
* fix(resources): reverse hostless URIs through Namespace unchanged by [@serhiizghama](https://github.com/serhiizghama) and [@andreivince](https://github.com/andreivince) in [#5230](https://github.com/PrefectHQ/fastmcp/pull/5230)
* fix(openapi): preserve timeouts so the server maps them to the actionable message by [@BlueX888](https://github.com/BlueX888) in [#5847](https://github.com/PrefectHQ/fastmcp/pull/5847)
* Keep posted review receipts on partial delivery and reject differing reviews by [@zzstoatzz](https://github.com/zzstoatzz) in [#6178](https://github.com/PrefectHQ/fastmcp/pull/6178)
* Drop client context holds left by finished tasks by [@zzstoatzz](https://github.com/zzstoatzz) in [#6205](https://github.com/PrefectHQ/fastmcp/pull/6205)
* Let clients with different timeouts share a kept-alive stdio session by [@zzstoatzz](https://github.com/zzstoatzz) in [#6223](https://github.com/PrefectHQ/fastmcp/pull/6223)
* fix(cli): preserve explicit null in generated tool commands by [@likecake](https://github.com/likecake) in [#6191](https://github.com/PrefectHQ/fastmcp/pull/6191)
* Honor empty tag inclusion filters in multi-server configs by [@PennEwan](https://github.com/PennEwan) in [#6200](https://github.com/PrefectHQ/fastmcp/pull/6200)
* fix(mcp-config): reuse one OAuth client per configured server by [@kbkb628](https://github.com/kbkb628) and [@whoskn](https://github.com/whoskn) in [#6097](https://github.com/PrefectHQ/fastmcp/pull/6097)
* Fix and quiet the triage alerts from 2026-11-02 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6235](https://github.com/PrefectHQ/fastmcp/pull/6235)
* fix(tasks): send task IDs in routing headers by [@eli-yip](https://github.com/eli-yip) in [#5810](https://github.com/PrefectHQ/fastmcp/pull/5810)
* fix(middleware): treat an empty methods allowlist as "log nothing" by [@gdut4140](https://github.com/gdut4140) in [#5727](https://github.com/PrefectHQ/fastmcp/pull/5727)
* Fix namespaced file resource reads while preserving URI normalization by [@BlueLi66](https://github.com/BlueLi66) in [#5716](https://github.com/PrefectHQ/fastmcp/pull/5716)
* fix(server): pass typed list request messages to list middleware hooks by [@BlueX888](https://github.com/BlueX888) in [#5732](https://github.com/PrefectHQ/fastmcp/pull/5732)
* Stop OpenAPI end-to-end tests from hitting the network by [@zzstoatzz](https://github.com/zzstoatzz) in [#6249](https://github.com/PrefectHQ/fastmcp/pull/6249)
* fix(auth): Preserve browser consent bindings across concurrent OAuth approvals by [@mikamikasuki](https://github.com/mikamikasuki) in [#5541](https://github.com/PrefectHQ/fastmcp/pull/5541)
* fix(openapi): serialize header and path parameters per the simple style by [@Harsh23Kashyap](https://github.com/Harsh23Kashyap) in [#5091](https://github.com/PrefectHQ/fastmcp/pull/5091)
* Fall back to method and path when an OpenAPI name slugs to nothing by [@asasemahmed](https://github.com/asasemahmed) in [#5699](https://github.com/PrefectHQ/fastmcp/pull/5699)
* Convert OpenAPI 3.0 boolean exclusive bounds to numeric bounds by [@asasemahmed](https://github.com/asasemahmed) in [#5697](https://github.com/PrefectHQ/fastmcp/pull/5697)
* Rewrite component refs under not, if/then/else and similar keywords by [@asasemahmed](https://github.com/asasemahmed) in [#5698](https://github.com/PrefectHQ/fastmcp/pull/5698)
* fix(openapi): keep media-type $defs beside component schemas by [@BlueX888](https://github.com/BlueX888) in [#5709](https://github.com/PrefectHQ/fastmcp/pull/5709)
* Omit readOnly properties from OpenAPI tool input schemas by [@AarnavNoble](https://github.com/AarnavNoble) in [#5753](https://github.com/PrefectHQ/fastmcp/pull/5753)
* fix: name root self-references after the generated root class by [@BlueX888](https://github.com/BlueX888) in [#5671](https://github.com/PrefectHQ/fastmcp/pull/5671)
* fix(proxy): keep stale list results out of cache by [@mikamikasuki](https://github.com/mikamikasuki) in [#5521](https://github.com/PrefectHQ/fastmcp/pull/5521)
* Match Claude Code project keys by path on Windows by [@zzstoatzz](https://github.com/zzstoatzz) and [@yongpange](https://github.com/yongpange) in [#6240](https://github.com/PrefectHQ/fastmcp/pull/6240)
* Stop preloading the server before launching the Inspector by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6241](https://github.com/PrefectHQ/fastmcp/pull/6241)
* Cull expired OAuth state from the default OAuthProxy file store by [@zzstoatzz](https://github.com/zzstoatzz), [@nosmile99](https://github.com/nosmile99), and [@mheidari98](https://github.com/mheidari98) in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* Reuse the stdio session after a cancelled startup by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6243](https://github.com/PrefectHQ/fastmcp/pull/6243)
* Match Gemini function responses to tool-use IDs by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6244](https://github.com/PrefectHQ/fastmcp/pull/6244)
* Replace parent type keywords when an ArgTransform changes the type by [@zzstoatzz](https://github.com/zzstoatzz), [@syf2211](https://github.com/syf2211), [@HootRock](https://github.com/HootRock), and [@chrikrah](https://github.com/chrikrah) in [#6246](https://github.com/PrefectHQ/fastmcp/pull/6246)
* Expire idle per-client rate limiters by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6247](https://github.com/PrefectHQ/fastmcp/pull/6247)
* Match resource templates that spell out a literal query by [@zzstoatzz](https://github.com/zzstoatzz) and [@arieleven](https://github.com/arieleven) in [#6248](https://github.com/PrefectHQ/fastmcp/pull/6248)
* fix(openapi): preserve explicit null in nullable JSON body properties by [@mumu-bird](https://github.com/mumu-bird) in [#5633](https://github.com/PrefectHQ/fastmcp/pull/5633)
* Keep OpenAPI refs that point into a component schema intact by [@zzstoatzz](https://github.com/zzstoatzz) and [@AarnavNoble](https://github.com/AarnavNoble) in [#6245](https://github.com/PrefectHQ/fastmcp/pull/6245)
* fix(telemetry): record mounted and nested server spans as INTERNAL by [@zzstoatzz](https://github.com/zzstoatzz) and [@sonmaximum](https://github.com/sonmaximum) in [#6252](https://github.com/PrefectHQ/fastmcp/pull/6252)
* fix(client): identify as fastmcp in clientInfo by default by [@zzstoatzz](https://github.com/zzstoatzz) in [#6254](https://github.com/PrefectHQ/fastmcp/pull/6254)
* fix(openapi): keep both values when a query object property matches another parameter by [@zzstoatzz](https://github.com/zzstoatzz) and [@alpaylan](https://github.com/alpaylan) in [#6256](https://github.com/PrefectHQ/fastmcp/pull/6256)
* fix(middleware): map exception subclasses in ErrorHandlingMiddleware by [@zzstoatzz](https://github.com/zzstoatzz) and [@zurmag](https://github.com/zurmag) in [#6257](https://github.com/PrefectHQ/fastmcp/pull/6257)
* fix(client): report a lost connection instead of 'Client is not connected' by [@zzstoatzz](https://github.com/zzstoatzz) and [@alex-feel](https://github.com/alex-feel) in [#6259](https://github.com/PrefectHQ/fastmcp/pull/6259)
* fix(client): keep ClientGroup tool routes after the group context exits by [@zzstoatzz](https://github.com/zzstoatzz), [@hntrl](https://github.com/hntrl), and [@YingzuoLiu](https://github.com/YingzuoLiu) in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* Accept structured skill metadata and allowed-tools lists by [@jakekaplan](https://github.com/jakekaplan) in [#6292](https://github.com/PrefectHQ/fastmcp/pull/6292)
* Preserve 4.1 skills type checks and resource-only manifest migration by [@zzstoatzz](https://github.com/zzstoatzz) in [#6305](https://github.com/PrefectHQ/fastmcp/pull/6305)
* Fix generated CLIs for tools named app, console or Client by [@andreivince](https://github.com/andreivince) in [#6056](https://github.com/PrefectHQ/fastmcp/pull/6056)
* Disambiguate colliding parameter flags in generate-cli by [@mohitdixit02](https://github.com/mohitdixit02) and [@andreivince](https://github.com/andreivince) in [#6311](https://github.com/PrefectHQ/fastmcp/pull/6311)
* fix: preserve CRLF descriptions in generated CLI parameter help by [@chris00234](https://github.com/chris00234) in [#6075](https://github.com/PrefectHQ/fastmcp/pull/6075)
* fix(agentic): repair baseline collection verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6313](https://github.com/PrefectHQ/fastmcp/pull/6313)
* Reject non-positive event retention limits by [@mikamikasuki](https://github.com/mikamikasuki) in [#5535](https://github.com/PrefectHQ/fastmcp/pull/5535)
* fix(search): rebuild the BM25 index when the tool name set changes by [@shi-felix](https://github.com/shi-felix) in [#6282](https://github.com/PrefectHQ/fastmcp/pull/6282)
* fix(tools): keep hidden parameter factories out of visible defaults by [@shi-felix](https://github.com/shi-felix) in [#6283](https://github.com/PrefectHQ/fastmcp/pull/6283)
* fix(auth): accept private-use scheme redirect URIs in CIMD documents by [@ColePBryan](https://github.com/ColePBryan) in [#6335](https://github.com/PrefectHQ/fastmcp/pull/6335)
* Report the stop reason from sampling handlers when no tools are offered by [@AarnavNoble](https://github.com/AarnavNoble) in [#6342](https://github.com/PrefectHQ/fastmcp/pull/6342)
* fix(auth): preserve empty authority on custom-scheme redirect URIs by [@codesphere-u](https://github.com/codesphere-u) and [@alpaylan](https://github.com/alpaylan) in [#6347](https://github.com/PrefectHQ/fastmcp/pull/6347)
* Declare items.type on multi-select list shorthand elicitations by [@zzstoatzz](https://github.com/zzstoatzz), [@shi-felix](https://github.com/shi-felix), [@Vivek1898](https://github.com/Vivek1898), and [@alpaylan](https://github.com/alpaylan) in [#6361](https://github.com/PrefectHQ/fastmcp/pull/6361)
* Mask prompt handler exceptions when mask_error_details=True by [@pratyu2h](https://github.com/pratyu2h) and [@maxmorrish](https://github.com/maxmorrish) in [#6277](https://github.com/PrefectHQ/fastmcp/pull/6277)
* Send `{}` for required OpenAPI object bodies with no fields by [@rome-xi](https://github.com/rome-xi) and [@wang1299](https://github.com/wang1299) in [#6340](https://github.com/PrefectHQ/fastmcp/pull/6340)
* fix(client): keep the response cache inert on legacy connections (#6298) by [@xunWhale](https://github.com/xunWhale) and [@alpaylan](https://github.com/alpaylan) in [#6321](https://github.com/PrefectHQ/fastmcp/pull/6321)
* Encode manifest paths in download_skill URIs by [@zzstoatzz](https://github.com/zzstoatzz), [@67-luck](https://github.com/67-luck), and [@BlueX888](https://github.com/BlueX888) in [#6376](https://github.com/PrefectHQ/fastmcp/pull/6376)
* Fix skill discovery for nested supporting files by [@mahekara28](https://github.com/mahekara28) and [@alpaylan](https://github.com/alpaylan) in [#6310](https://github.com/PrefectHQ/fastmcp/pull/6310)
* fix: keep additionalProperties on object schemas without a type by [@bfs2021](https://github.com/bfs2021) and [@alpaylan](https://github.com/alpaylan) in [#6127](https://github.com/PrefectHQ/fastmcp/pull/6127)
* Fix hydration of mutually recursive schema types by [@zzstoatzz](https://github.com/zzstoatzz), [@wozhenbang2004](https://github.com/wozhenbang2004), and [@alpaylan](https://github.com/alpaylan) in [#6394](https://github.com/PrefectHQ/fastmcp/pull/6394)
* Isolate filesystem component construction failures by [@PennEwan](https://github.com/PennEwan) in [#6210](https://github.com/PrefectHQ/fastmcp/pull/6210)
* fix(config): apply tool transforms before tag filters on single servers by [@AP24110011695](https://github.com/AP24110011695) and [@arjunprabhulal](https://github.com/arjunprabhulal) in [#6214](https://github.com/PrefectHQ/fastmcp/pull/6214)
* fix(tools): isolate mutable defaults in transformed tool calls by [@priy-anshugupta](https://github.com/priy-anshugupta) in [#6184](https://github.com/PrefectHQ/fastmcp/pull/6184)
* fix(openapi): make resource templates for non-identifier path parameters readable by [@AP24110011695](https://github.com/AP24110011695) and [@alpaylan](https://github.com/alpaylan) in [#6187](https://github.com/PrefectHQ/fastmcp/pull/6187)
* fix(json-schema): keep tools/list working when a root $ref resolves to a boolean schema by [@AP24110011695](https://github.com/AP24110011695) and [@alpaylan](https://github.com/alpaylan) in [#6185](https://github.com/PrefectHQ/fastmcp/pull/6185)
* Keep constraints on scalar schema references by [@shayanxcyber](https://github.com/shayanxcyber) in [#6041](https://github.com/PrefectHQ/fastmcp/pull/6041)
* fix(server): validate cursors when pagination is disabled by [@xu91102](https://github.com/xu91102) and [@DMomplaisir](https://github.com/DMomplaisir) in [#6045](https://github.com/PrefectHQ/fastmcp/pull/6045)
* Document that a custom httpx_client_factory owns its timeout by [@asasemahmed](https://github.com/asasemahmed) and [@himanshuchawla0807-gif](https://github.com/himanshuchawla0807-gif) in [#5923](https://github.com/PrefectHQ/fastmcp/pull/5923)
* Stop PingMiddleware erroring when the client has no back-channel by [@asasemahmed](https://github.com/asasemahmed) in [#5901](https://github.com/PrefectHQ/fastmcp/pull/5901)
* Store sessionless client log levels on the connection by [@asasemahmed](https://github.com/asasemahmed) in [#5899](https://github.com/PrefectHQ/fastmcp/pull/5899)
* Send the whole body when a body $ref with siblings cannot be flattened by [@asasemahmed](https://github.com/asasemahmed) in [#5893](https://github.com/PrefectHQ/fastmcp/pull/5893)
* Pass the transport to the fastmcp-remote proxy so it forwards server-initiated requests by [@asasemahmed](https://github.com/asasemahmed) in [#5885](https://github.com/PrefectHQ/fastmcp/pull/5885)
* fix(cli): forward path, stateless and log-level to SDK MCPServer servers by [@BlueX888](https://github.com/BlueX888) in [#5870](https://github.com/PrefectHQ/fastmcp/pull/5870)
* fix(client): preserve a caller-provided OAuth httpx client factory when verify is set by [@BlueX888](https://github.com/BlueX888) in [#5849](https://github.com/PrefectHQ/fastmcp/pull/5849)
* fix(prompts): resolve postponed annotations when rendering by [@67-luck](https://github.com/67-luck) and [@BlueX888](https://github.com/BlueX888) in [#5803](https://github.com/PrefectHQ/fastmcp/pull/5803)
* Roll back the tool stamp when a tool registration is rejected by [@Winoren](https://github.com/Winoren) in [#5798](https://github.com/PrefectHQ/fastmcp/pull/5798)
* fix(openapi): hydrate data for wrapped non-object responses with validate_output=False by [@nosmile99](https://github.com/nosmile99) and [@BlueX888](https://github.com/BlueX888) in [#5784](https://github.com/PrefectHQ/fastmcp/pull/5784)
* Carry prompt argument titles through PromptArgument and proxies by [@AarnavNoble](https://github.com/AarnavNoble) in [#5749](https://github.com/PrefectHQ/fastmcp/pull/5749)
* Relay the client's sampling result unchanged through proxies by [@AarnavNoble](https://github.com/AarnavNoble) in [#5747](https://github.com/PrefectHQ/fastmcp/pull/5747)
* fix(json-schema): keep x-unsupported-pattern when a format is set by [@gdut4140](https://github.com/gdut4140) in [#5731](https://github.com/PrefectHQ/fastmcp/pull/5731)
* fix(tasks): let async-generator tools run as background tasks by [@gdut4140](https://github.com/gdut4140) in [#5730](https://github.com/PrefectHQ/fastmcp/pull/5730)
* Honor Code Mode search limits after BM25 ranking by [@Winoren](https://github.com/Winoren) and [@BlueX888](https://github.com/BlueX888) in [#5715](https://github.com/PrefectHQ/fastmcp/pull/5715)
* Keep the client timeout from capping the HTTP read timeout by [@asasemahmed](https://github.com/asasemahmed) in [#5690](https://github.com/PrefectHQ/fastmcp/pull/5690)
* fix(auth): avoid rereading failed authorization forms by [@pei711](https://github.com/pei711) and [@JordanAfolabiLaw](https://github.com/JordanAfolabiLaw) in [#5570](https://github.com/PrefectHQ/fastmcp/pull/5570)
* Fix unbounded Apps dev log retention by [@mikamikasuki](https://github.com/mikamikasuki) in [#5549](https://github.com/PrefectHQ/fastmcp/pull/5549)
* Bound error-stat cardinality in ErrorHandlingMiddleware by [@mikamikasuki](https://github.com/mikamikasuki) in [#5537](https://github.com/PrefectHQ/fastmcp/pull/5537)
* fix(auth): preserve GitHub sessions across transient verification failures by [@sui-ni2](https://github.com/sui-ni2) and [@benjohngf](https://github.com/benjohngf) in [#4881](https://github.com/PrefectHQ/fastmcp/pull/4881)
* Expect the extended read timeout in the factory timeout test by [@zzstoatzz](https://github.com/zzstoatzz) in [#6395](https://github.com/PrefectHQ/fastmcp/pull/6395)
* Accept intake's contribution route in the triage review check by [@zzstoatzz](https://github.com/zzstoatzz) in [#6405](https://github.com/PrefectHQ/fastmcp/pull/6405)
* fix(auth): keep revocation ownership separate from user identity by [@zzstoatzz](https://github.com/zzstoatzz), [@BlueX888](https://github.com/BlueX888), and [@67-luck](https://github.com/67-luck) in [#6404](https://github.com/PrefectHQ/fastmcp/pull/6404)
* Authenticate and pin the schema download in the OpenAPI performance test by [@zzstoatzz](https://github.com/zzstoatzz) in [#6177](https://github.com/PrefectHQ/fastmcp/pull/6177)
* Use renamed argument names in transformed tool validation errors by [@kartikmadan11](https://github.com/kartikmadan11) in [#6158](https://github.com/PrefectHQ/fastmcp/pull/6158)
* Preserve invalid defaults for omitted JSON Schema fields by [@totoyang](https://github.com/totoyang) and [@alpaylan](https://github.com/alpaylan) in [#6133](https://github.com/PrefectHQ/fastmcp/pull/6133)
* Validate positional array prefixes separately from their tails by [@PennEwan](https://github.com/PennEwan) and [@alpaylan](https://github.com/alpaylan) in [#6146](https://github.com/PrefectHQ/fastmcp/pull/6146)
* Stop FastMCP callable caches from retaining dropped tools by [@PennEwan](https://github.com/PennEwan) and [@hanhyperfx](https://github.com/hanhyperfx) in [#6147](https://github.com/PrefectHQ/fastmcp/pull/6147)
* Fix resource templates with multiple query expressions by [@xiong-wei1](https://github.com/xiong-wei1) in [#6061](https://github.com/PrefectHQ/fastmcp/pull/6061)
* fix(json-schema): decode RFC 6901 escapes when extracting $defs names by [@AP24110011695](https://github.com/AP24110011695) and [@RS-ITACHI](https://github.com/RS-ITACHI) in [#6180](https://github.com/PrefectHQ/fastmcp/pull/6180)
* Drop backend serverInfo from proxied tool and prompt results by [@asasemahmed](https://github.com/asasemahmed) in [#5911](https://github.com/PrefectHQ/fastmcp/pull/5911)
* fix(telemetry): record exceptions once per span by [@DMomplaisir](https://github.com/DMomplaisir) in [#5861](https://github.com/PrefectHQ/fastmcp/pull/5861)
* fix(resources): honor Pydantic field aliases in resource templates by [@anh-nguyenn](https://github.com/anh-nguyenn) and [@BlueX888](https://github.com/BlueX888) in [#6054](https://github.com/PrefectHQ/fastmcp/pull/6054)
* fix(auth): authorize hashed app-tool names and synthesized Prefab resources by [@BlueX888](https://github.com/BlueX888) in [#5841](https://github.com/PrefectHQ/fastmcp/pull/5841)
* fix(prompts): honor field aliases when rendering prompts by [@BlueX888](https://github.com/BlueX888) in [#5836](https://github.com/PrefectHQ/fastmcp/pull/5836)
* fix(server): serialize structured prompt arguments before middleware by [@67-luck](https://github.com/67-luck) and [@BlueX888](https://github.com/BlueX888) in [#5805](https://github.com/PrefectHQ/fastmcp/pull/5805)
* fix(oauth-proxy): answer a repeated consent approval with the same redirect by [@jamesmaidment](https://github.com/jamesmaidment) in [#5775](https://github.com/PrefectHQ/fastmcp/pull/5775)
* fix(client): stop validating version-pinned call_tool results against the highest version's schema by [@gdut4140](https://github.com/gdut4140) in [#5725](https://github.com/PrefectHQ/fastmcp/pull/5725)
* Preserve typed additional properties in hydrated tool results by [@PrathmeshPawar2110](https://github.com/PrathmeshPawar2110), [@yannvr](https://github.com/yannvr), [@BlueX888](https://github.com/BlueX888), and [@hulkbig](https://github.com/hulkbig) in [#5779](https://github.com/PrefectHQ/fastmcp/pull/5779)
* fix(server): serve Mcp-Param validation from a wire-schema cache by [@akushonkamen](https://github.com/akushonkamen) and [@anormang1992](https://github.com/anormang1992) in [#5666](https://github.com/PrefectHQ/fastmcp/pull/5666)
* Fix #5563: OTel: prefer `AccessToken.subject` over `client_id` for `enduser.id` by [@nandanadileep](https://github.com/nandanadileep) and [@omikader](https://github.com/omikader) in [#5565](https://github.com/PrefectHQ/fastmcp/pull/5565)
* fix: decode URI fragments before schema reference hydration by [@HuaTNA](https://github.com/HuaTNA) in [#5561](https://github.com/PrefectHQ/fastmcp/pull/5561)
* Fix #5559: Configuration helpers still discard explicit port=0 by [@nandanadileep](https://github.com/nandanadileep) and [@dream-star-end](https://github.com/dream-star-end) in [#5562](https://github.com/PrefectHQ/fastmcp/pull/5562)
* Preserve or explicitly reject images in sampling tool results by [@mikamikasuki](https://github.com/mikamikasuki) in [#5554](https://github.com/PrefectHQ/fastmcp/pull/5554)
* fix(client): Prevent stale ClientGroup refreshes from replacing newer routes by [@mikamikasuki](https://github.com/mikamikasuki) in [#5543](https://github.com/PrefectHQ/fastmcp/pull/5543)
* fix(client): close partial group connections on cancellation by [@mikamikasuki](https://github.com/mikamikasuki) in [#5519](https://github.com/PrefectHQ/fastmcp/pull/5519)
* fix(cli): resolve config paths beside fastmcp.json by [@mikamikasuki](https://github.com/mikamikasuki) in [#5511](https://github.com/PrefectHQ/fastmcp/pull/5511)
* fix(tasks): retain results after tool removal by [@mikamikasuki](https://github.com/mikamikasuki) in [#5507](https://github.com/PrefectHQ/fastmcp/pull/5507)
* fix(tools): reject non-finite floats at the JSON serialization boundary by [@akushonkamen](https://github.com/akushonkamen) and [@YogaSakti](https://github.com/YogaSakti) in [#5665](https://github.com/PrefectHQ/fastmcp/pull/5665)
* Make the partial-construction stdio test fast and strict by [@zzstoatzz](https://github.com/zzstoatzz) in [#6433](https://github.com/PrefectHQ/fastmcp/pull/6433)
* test: isolate consent checks and preserve OpenAPI download budget by [@Larry-Labs](https://github.com/Larry-Labs) in [#5664](https://github.com/PrefectHQ/fastmcp/pull/5664)
* fix(client): validate accepted elicitation content by [@mikamikasuki](https://github.com/mikamikasuki) in [#5513](https://github.com/PrefectHQ/fastmcp/pull/5513)
* Advertise the MCP Apps extension only when the server serves an app by [@lancy69](https://github.com/lancy69) and [@adrianto-nanovest](https://github.com/adrianto-nanovest) in [#5062](https://github.com/PrefectHQ/fastmcp/pull/5062)
* fix: `session: UserSession` on a resource or resource template fails at registration by [@xixi-box](https://github.com/xixi-box) and [@arjunprabhulal](https://github.com/arjunprabhulal) in [#6198](https://github.com/PrefectHQ/fastmcp/pull/6198)
* fix(cli): parse JSON for non-string unions and accept null in call args by [@Christian-Sidak](https://github.com/Christian-Sidak) and [@BHAWESHBHASKAR](https://github.com/BHAWESHBHASKAR) in [#6012](https://github.com/PrefectHQ/fastmcp/pull/6012)
* Forward URL-mode elicitation through the proxy by [@Kushal9889](https://github.com/Kushal9889) in [#5980](https://github.com/PrefectHQ/fastmcp/pull/5980)
* Let context list calls run outside a request by [@asasemahmed](https://github.com/asasemahmed) in [#5903](https://github.com/PrefectHQ/fastmcp/pull/5903)
* Keep ResourceLink content on prompt messages by [@asasemahmed](https://github.com/asasemahmed) in [#5897](https://github.com/PrefectHQ/fastmcp/pull/5897)
* Accept WorkOS tokens when required_scopes is set by [@asasemahmed](https://github.com/asasemahmed) in [#5881](https://github.com/PrefectHQ/fastmcp/pull/5881)
* fix(openapi): JSON-encode object form fields in urlencoded request bodies by [@BlueX888](https://github.com/BlueX888) in [#5851](https://github.com/PrefectHQ/fastmcp/pull/5851)
* Keep task config and execution on transformed tools by [@Winoren](https://github.com/Winoren) and [@BlueX888](https://github.com/BlueX888) in [#5793](https://github.com/PrefectHQ/fastmcp/pull/5793)
* fix(proxy): relay non-object tool results across MCP versions by [@Lpk124](https://github.com/Lpk124) and [@maxime-gautre](https://github.com/maxime-gautre) in [#5763](https://github.com/PrefectHQ/fastmcp/pull/5763)
* Fix #5706: Resource template with a level-3 operator such as `{&size}` is listed but can never be read by [@nandanadileep](https://github.com/nandanadileep) and [@chrikrah](https://github.com/chrikrah) in [#5711](https://github.com/PrefectHQ/fastmcp/pull/5711)
* fix: preserve referenced schema definitions by [@lux-liang](https://github.com/lux-liang) in [#5588](https://github.com/PrefectHQ/fastmcp/pull/5588)
* fix(server): fall back to the highest authorized version on direct lookup by [@gshklovs](https://github.com/gshklovs) and [@CoralGarden52](https://github.com/CoralGarden52) in [#5169](https://github.com/PrefectHQ/fastmcp/pull/5169)
* Resolve deferred defaults by alias and keep unverified GitHub scopes out of the cache by [@zzstoatzz](https://github.com/zzstoatzz) in [#6417](https://github.com/PrefectHQ/fastmcp/pull/6417)
* Drop unpinned ping from auth example clients by [@zzstoatzz](https://github.com/zzstoatzz) and [@stephaneberle9](https://github.com/stephaneberle9) in [#6418](https://github.com/PrefectHQ/fastmcp/pull/6418)
* Call a re-versioned tool by its transformed version by [@zzstoatzz](https://github.com/zzstoatzz) and [@MayankTamakuwala](https://github.com/MayankTamakuwala) in [#6419](https://github.com/PrefectHQ/fastmcp/pull/6419)
* Apply logging/setLevel to mounted servers over HTTP sessions by [@zzstoatzz](https://github.com/zzstoatzz) and [@alpaylan](https://github.com/alpaylan) in [#6421](https://github.com/PrefectHQ/fastmcp/pull/6421)
* Reconnect StdioTransport when reused on a different event loop by [@zzstoatzz](https://github.com/zzstoatzz) and [@dsfaccini](https://github.com/dsfaccini) in [#6425](https://github.com/PrefectHQ/fastmcp/pull/6425)
* Forward list-changed notifications through ProxyClient by [@zzstoatzz](https://github.com/zzstoatzz), [@chrikrah](https://github.com/chrikrah), and [@ldlda](https://github.com/ldlda) in [#6426](https://github.com/PrefectHQ/fastmcp/pull/6426)
* Report JSON-RPC error codes and request ids on telemetry spans by [@zzstoatzz](https://github.com/zzstoatzz) in [#6427](https://github.com/PrefectHQ/fastmcp/pull/6427)
* Stop the SSE endpoint sending a second response after its stream by [@zzstoatzz](https://github.com/zzstoatzz) and [@JonZeolla](https://github.com/JonZeolla) in [#6431](https://github.com/PrefectHQ/fastmcp/pull/6431)
* Bypass proxy env when fastmcp dev apps lists tools by [@zzstoatzz](https://github.com/zzstoatzz) and [@AlyLanier](https://github.com/AlyLanier) in [#6422](https://github.com/PrefectHQ/fastmcp/pull/6422)
* fix(context): allow background task logging without a session by [@67-luck](https://github.com/67-luck) and [@BlueX888](https://github.com/BlueX888) in [#5806](https://github.com/PrefectHQ/fastmcp/pull/5806)
* Fix the CLI .js deprecation warning and a dead error-message link by [@zzstoatzz](https://github.com/zzstoatzz) in [#6453](https://github.com/PrefectHQ/fastmcp/pull/6453)
### Docs 📚
* Consolidate skills docs into one Skills over MCP page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6049](https://github.com/PrefectHQ/fastmcp/pull/6049)
* Rewrite skills docs around Skill and SkillCatalogProvider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6066](https://github.com/PrefectHQ/fastmcp/pull/6066)
* Tighten skills docs examples by [@zzstoatzz](https://github.com/zzstoatzz) in [#6070](https://github.com/PrefectHQ/fastmcp/pull/6070)
* Shorten the skills docs page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6079](https://github.com/PrefectHQ/fastmcp/pull/6079)
* Badge the skills page as 4.2.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6083](https://github.com/PrefectHQ/fastmcp/pull/6083)
* Consolidate skills examples around verified Skill values by [@zzstoatzz](https://github.com/zzstoatzz) in [#6093](https://github.com/PrefectHQ/fastmcp/pull/6093)
* docs: add v4.2.0a1 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6105](https://github.com/PrefectHQ/fastmcp/pull/6105)
* Add MCP tool annotations to get_file example by [@gl1tchdust](https://github.com/gl1tchdust) in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* Fix dead links in current documentation by [@zzstoatzz](https://github.com/zzstoatzz) and [@Wilson0511](https://github.com/Wilson0511) in [#6142](https://github.com/PrefectHQ/fastmcp/pull/6142)
* docs: rename Horizon to FastMCP Gateway in current docs by [@parkedwards](https://github.com/parkedwards) in [#5653](https://github.com/PrefectHQ/fastmcp/pull/5653)
* Document strict-mode handling of undeclared OpenAPI arguments by [@zzstoatzz](https://github.com/zzstoatzz) in [#6169](https://github.com/PrefectHQ/fastmcp/pull/6169)
* docs: add v4.2.0a2 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6224](https://github.com/PrefectHQ/fastmcp/pull/6224)
* docs(settings): explain what FASTMCP_DEBUG actually does by [@zzstoatzz](https://github.com/zzstoatzz) and [@ianw](https://github.com/ianw) in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* docs: pass referrers on outbound links, add organization schema and page descriptions by [@madureira-gabriel](https://github.com/madureira-gabriel) in [#6287](https://github.com/PrefectHQ/fastmcp/pull/6287)
* docs: add v4.2.0a3 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6306](https://github.com/PrefectHQ/fastmcp/pull/6306)
* docs: preserve docs routing metadata and release guidance by [@zzstoatzz](https://github.com/zzstoatzz) in [#6320](https://github.com/PrefectHQ/fastmcp/pull/6320)
* Correct how tools docs describe bytes return values by [@DivyaNarahari97](https://github.com/DivyaNarahari97) in [#6275](https://github.com/PrefectHQ/fastmcp/pull/6275)
* docs: add v4.2.0a4 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6388](https://github.com/PrefectHQ/fastmcp/pull/6388)
* docs: correct the server pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6406](https://github.com/PrefectHQ/fastmcp/pull/6406)
* docs: correct the client pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6407](https://github.com/PrefectHQ/fastmcp/pull/6407)
* docs: correct the apps pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6409](https://github.com/PrefectHQ/fastmcp/pull/6409)
* docs: correct getting started, CLI and deployment pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6410](https://github.com/PrefectHQ/fastmcp/pull/6410)
* docs: correct the integration pages against main by [@zzstoatzz](https://github.com/zzstoatzz) in [#6408](https://github.com/PrefectHQ/fastmcp/pull/6408)
* docs: label the current docs version v4 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6411](https://github.com/PrefectHQ/fastmcp/pull/6411)
* docs: explain root_path for SSE behind a prefix-stripping proxy by [@zzstoatzz](https://github.com/zzstoatzz) and [@KnittelK](https://github.com/KnittelK) in [#6215](https://github.com/PrefectHQ/fastmcp/pull/6215)
* docs: keep the search shortcut hint off the button edge by [@zzstoatzz](https://github.com/zzstoatzz) in [#6413](https://github.com/PrefectHQ/fastmcp/pull/6413)
* docs: clarify tool errors and middleware transformations by [@rasokiwayami](https://github.com/rasokiwayami) and [@jeffsawatzky](https://github.com/jeffsawatzky) in [#5566](https://github.com/PrefectHQ/fastmcp/pull/5566)
* docs: server-level component changes don't notify clients by [@zzstoatzz](https://github.com/zzstoatzz) and [@Ngtvu1752](https://github.com/Ngtvu1752) in [#6423](https://github.com/PrefectHQ/fastmcp/pull/6423)
* docs: badge 4.2.0 features and add the 4.1 → 4.2 upgrade guide by [@zzstoatzz](https://github.com/zzstoatzz) in [#6436](https://github.com/PrefectHQ/fastmcp/pull/6436)
* Pre-4.2 polish: stale docs, examples and docstrings by [@zzstoatzz](https://github.com/zzstoatzz) in [#6452](https://github.com/PrefectHQ/fastmcp/pull/6452)
### Examples & Contrib 💡
* Register templated MCPMixin resources as resource templates by [@asasemahmed](https://github.com/asasemahmed) in [#5895](https://github.com/PrefectHQ/fastmcp/pull/5895)
* Keep structured content on bulk tool results by [@asasemahmed](https://github.com/asasemahmed) in [#5917](https://github.com/PrefectHQ/fastmcp/pull/5917)
### Dependencies 📦
* build(deps): bump mcp from 1.28.1 to 1.30.0 in /examples/testing_demo in the uv group across 1 directory by @dependabot[bot] in https://github.com/PrefectHQ/fastmcp/pull/5990
### Other Changes 🦾
* chore(deps): Update dependency ruff to v0.17.2 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6233
* chore(deps): Pin dependencies by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6064
* Require patched joserfc by [@zzstoatzz](https://github.com/zzstoatzz) in [#6371](https://github.com/PrefectHQ/fastmcp/pull/6371)
* Keep colon-terminated prose lines in docstring tool descriptions by [@zzstoatzz](https://github.com/zzstoatzz), [@jlx1999s](https://github.com/jlx1999s), and [@ptrailblazer89](https://github.com/ptrailblazer89) in [#6372](https://github.com/PrefectHQ/fastmcp/pull/6372)
* chore(deps): Update dependency oauthlib to v4.0.1 [SECURITY] by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6367
* chore(deps): Update dependency node to v26 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6234
* chore(deps): Update dependency prefect to v3.9.1 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6232
* Keep completion from suggesting values for hidden references by [@zzstoatzz](https://github.com/zzstoatzz) and [@pvliesdonk](https://github.com/pvliesdonk) in [#6450](https://github.com/PrefectHQ/fastmcp/pull/6450)

## New Contributors
* @adam-zovos made their first contribution in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* @fprieto14 made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @keremoktener made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @gl1tchdust made their first contribution in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* @Yash-Tripath1 made their first contribution in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* @ianw made their first contribution in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* @hntrl made their first contribution in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* @YingzuoLiu made their first contribution in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* @mohitdixit02 made their first contribution in [#6311](https://github.com/PrefectHQ/fastmcp/pull/6311)
* @chris00234 made their first contribution in [#6075](https://github.com/PrefectHQ/fastmcp/pull/6075)
* @67-luck made their first contribution in [#6376](https://github.com/PrefectHQ/fastmcp/pull/6376)
* @mahekara28 made their first contribution in [#6310](https://github.com/PrefectHQ/fastmcp/pull/6310)
* @shayanxcyber made their first contribution in [#6041](https://github.com/PrefectHQ/fastmcp/pull/6041)
* @DMomplaisir made their first contribution in [#6045](https://github.com/PrefectHQ/fastmcp/pull/6045)
* @xu91102 made their first contribution in [#6045](https://github.com/PrefectHQ/fastmcp/pull/6045)
* @KnittelK made their first contribution in [#6215](https://github.com/PrefectHQ/fastmcp/pull/6215)
* @bkranendonk made their first contribution in [#6264](https://github.com/PrefectHQ/fastmcp/pull/6264)
* @kartikmadan11 made their first contribution in [#6158](https://github.com/PrefectHQ/fastmcp/pull/6158)
* @totoyang made their first contribution in [#6133](https://github.com/PrefectHQ/fastmcp/pull/6133)
* @hanhyperfx made their first contribution in [#6147](https://github.com/PrefectHQ/fastmcp/pull/6147)
* @xiong-wei1 made their first contribution in [#6061](https://github.com/PrefectHQ/fastmcp/pull/6061)
* @anh-nguyenn made their first contribution in [#6054](https://github.com/PrefectHQ/fastmcp/pull/6054)
* @jamesmaidment made their first contribution in [#5775](https://github.com/PrefectHQ/fastmcp/pull/5775)
* @yannvr made their first contribution in [#5779](https://github.com/PrefectHQ/fastmcp/pull/5779)
* @akushonkamen made their first contribution in [#5666](https://github.com/PrefectHQ/fastmcp/pull/5666)
* @anormang1992 made their first contribution in [#5666](https://github.com/PrefectHQ/fastmcp/pull/5666)
* @jeffsawatzky made their first contribution in [#5566](https://github.com/PrefectHQ/fastmcp/pull/5566)
* @rasokiwayami made their first contribution in [#5566](https://github.com/PrefectHQ/fastmcp/pull/5566)
* @omikader made their first contribution in [#5565](https://github.com/PrefectHQ/fastmcp/pull/5565)
* @dream-star-end made their first contribution in [#5562](https://github.com/PrefectHQ/fastmcp/pull/5562)
* @YogaSakti made their first contribution in [#5665](https://github.com/PrefectHQ/fastmcp/pull/5665)
* @Pyhroff made their first contribution in [#6063](https://github.com/PrefectHQ/fastmcp/pull/6063)
* @Larry-Labs made their first contribution in [#5664](https://github.com/PrefectHQ/fastmcp/pull/5664)
* @adrianto-nanovest made their first contribution in [#5062](https://github.com/PrefectHQ/fastmcp/pull/5062)
* @lancy69 made their first contribution in [#5062](https://github.com/PrefectHQ/fastmcp/pull/5062)
* @xixi-box made their first contribution in [#6198](https://github.com/PrefectHQ/fastmcp/pull/6198)
* @glopezz made their first contribution in [#6107](https://github.com/PrefectHQ/fastmcp/pull/6107)
* @BHAWESHBHASKAR made their first contribution in [#6012](https://github.com/PrefectHQ/fastmcp/pull/6012)
* @Christian-Sidak made their first contribution in [#6012](https://github.com/PrefectHQ/fastmcp/pull/6012)
* @Kushal9889 made their first contribution in [#5980](https://github.com/PrefectHQ/fastmcp/pull/5980)
* @Abhi2939 made their first contribution in [#5969](https://github.com/PrefectHQ/fastmcp/pull/5969)
* @ezz3r made their first contribution in [#5969](https://github.com/PrefectHQ/fastmcp/pull/5969)
* @Lpk124 made their first contribution in [#5763](https://github.com/PrefectHQ/fastmcp/pull/5763)
* @maxime-gautre made their first contribution in [#5763](https://github.com/PrefectHQ/fastmcp/pull/5763)
* @lux-liang made their first contribution in [#5588](https://github.com/PrefectHQ/fastmcp/pull/5588)
* @gshklovs made their first contribution in [#5169](https://github.com/PrefectHQ/fastmcp/pull/5169)
* @MayankTamakuwala made their first contribution in [#6419](https://github.com/PrefectHQ/fastmcp/pull/6419)
* @Ngtvu1752 made their first contribution in [#6423](https://github.com/PrefectHQ/fastmcp/pull/6423)
* @dsfaccini made their first contribution in [#6425](https://github.com/PrefectHQ/fastmcp/pull/6425)
* @ldlda made their first contribution in [#6426](https://github.com/PrefectHQ/fastmcp/pull/6426)
* @carterthayer made their first contribution in [#6428](https://github.com/PrefectHQ/fastmcp/pull/6428)
* @AlyLanier made their first contribution in [#6422](https://github.com/PrefectHQ/fastmcp/pull/6422)
* @CaselIT made their first contribution in [#6429](https://github.com/PrefectHQ/fastmcp/pull/6429)
* @swantzter made their first contribution in [#6429](https://github.com/PrefectHQ/fastmcp/pull/6429)

**Full Changelog**: [v4.1.4...v4.2.0a5](https://github.com/PrefectHQ/fastmcp/compare/v4.1.4...v4.2.0a5)

</Update>

<Update label="v4.2.0a4" description="2026-11-09">

**[v4.2.0a4: Skills to Pay the Bills](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a4)**

FastMCP 4.2.0a4 requires Python 3.11 or newer and adds `Annotated` dependencies. `Depends(...)` and built-ins such as `CurrentContext()` can now be declared as `Annotated` metadata, so a type alias like `Config = Annotated[dict, Depends(get_config)]` works across tools, resources, and prompts. Skill discovery over plain resources no longer lists a nested supporting `SKILL.md` as its own skill, and `download_skill` URIs now encode manifest paths. Since a3, the redirect URI helpers normalize raw strings the way browsers read them, the joserfc and Authlib floors pick up security fixes, and fixes land for OpenAPI request bodies, CIMD redirect URIs, multi-select elicitation schemas, search indexing, and docstring parsing. Skills support remains experimental; this prerelease is intended for integration testing. Thanks to our 68 contributors, including 40 first-time contributors.

### Breaking Changes ⚠️
* Make Skill a storage-neutral object with folders as one loader by [@zzstoatzz](https://github.com/zzstoatzz) in [#6065](https://github.com/PrefectHQ/fastmcp/pull/6065)
* Require Python 3.11 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6377](https://github.com/PrefectHQ/fastmcp/pull/6377)
### Enhancements ✨
* Rename the resource-era list_skills helper to list_skill_summaries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6051](https://github.com/PrefectHQ/fastmcp/pull/6051)
* Discover skills through mounted servers by [@zzstoatzz](https://github.com/zzstoatzz) in [#6067](https://github.com/PrefectHQ/fastmcp/pull/6067)
* Share Prefab renderer resources across equivalent tools by [@jlowin](https://github.com/jlowin), [@fprieto14](https://github.com/fprieto14), and [@keremoktener](https://github.com/keremoktener) in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* Export Skill from fastmcp by [@zzstoatzz](https://github.com/zzstoatzz) in [#6071](https://github.com/PrefectHQ/fastmcp/pull/6071)
* Add skills discovery to ClientGroup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6072](https://github.com/PrefectHQ/fastmcp/pull/6072)
* Add --skills to fastmcp list by [@zzstoatzz](https://github.com/zzstoatzz) in [#6073](https://github.com/PrefectHQ/fastmcp/pull/6073)
* Add Client.read_skill and tighten skills docs by [@zzstoatzz](https://github.com/zzstoatzz) in [#6087](https://github.com/PrefectHQ/fastmcp/pull/6087)
* Verify and export skills with resource-manifest fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#6086](https://github.com/PrefectHQ/fastmcp/pull/6086)
* Forward Skills discovery through proxies by [@jakekaplan](https://github.com/jakekaplan) in [#5788](https://github.com/PrefectHQ/fastmcp/pull/5788)
* Share strict skill snapshot projection by [@zzstoatzz](https://github.com/zzstoatzz) in [#6089](https://github.com/PrefectHQ/fastmcp/pull/6089)
* Use scoped local tests and leave full suites to CI by [@zzstoatzz](https://github.com/zzstoatzz) in [#6094](https://github.com/PrefectHQ/fastmcp/pull/6094)
* Share ClientGroup skill client lookup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6101](https://github.com/PrefectHQ/fastmcp/pull/6101)
* Share filesystem skill supporting-file reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#6102](https://github.com/PrefectHQ/fastmcp/pull/6102)
* Deliver concurrent triage reviews, draft fixes and mutation proposals by [@zzstoatzz](https://github.com/zzstoatzz) in [#6116](https://github.com/PrefectHQ/fastmcp/pull/6116)
* Post Marvin's dedupe and too-long comments from workflow steps by [@gaker](https://github.com/gaker) in [#6170](https://github.com/PrefectHQ/fastmcp/pull/6170)
* Remove the unused triage mutation batch by [@zzstoatzz](https://github.com/zzstoatzz) in [#6208](https://github.com/PrefectHQ/fastmcp/pull/6208)
* Restore the status site by [@zzstoatzz](https://github.com/zzstoatzz) in [#6216](https://github.com/PrefectHQ/fastmcp/pull/6216)
* Add agno, Agent Framework, and OpenAI Agents SDK to downstream smoke by [@zzstoatzz](https://github.com/zzstoatzz) in [#6222](https://github.com/PrefectHQ/fastmcp/pull/6222)
* Close external PRs until their author is assigned again by [@zzstoatzz](https://github.com/zzstoatzz) in [#6227](https://github.com/PrefectHQ/fastmcp/pull/6227)
* Let private triage sweeps run without the Sol reviewer by [@zzstoatzz](https://github.com/zzstoatzz) in [#6229](https://github.com/PrefectHQ/fastmcp/pull/6229)
* Add named model tiers to the agentic triage plans by [@zzstoatzz](https://github.com/zzstoatzz) in [#6228](https://github.com/PrefectHQ/fastmcp/pull/6228)
* Add reproducible public triage leads to backlog dashboard by [@zzstoatzz](https://github.com/zzstoatzz) in [#6293](https://github.com/PrefectHQ/fastmcp/pull/6293)
* Add a strict SkillsDirectoryProvider to fastmcp.skills.provider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6278](https://github.com/PrefectHQ/fastmcp/pull/6278)
* Point experimental_skills at the new provider and drop alpha-only skills code by [@zzstoatzz](https://github.com/zzstoatzz) in [#6279](https://github.com/PrefectHQ/fastmcp/pull/6279)
* Deprecate the 4.1 skills API for removal in 4.3 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6280](https://github.com/PrefectHQ/fastmcp/pull/6280)
* Add app restart to the smart home Fire TV example by [@zzstoatzz](https://github.com/zzstoatzz) in [#6356](https://github.com/PrefectHQ/fastmcp/pull/6356)
* Add a workflow that deploys agentic triage to Prefect Cloud by [@zzstoatzz](https://github.com/zzstoatzz) in [#6380](https://github.com/PrefectHQ/fastmcp/pull/6380)
* Support Annotated dependencies by [@zzstoatzz](https://github.com/zzstoatzz) and [@Kludex](https://github.com/Kludex) in [#6378](https://github.com/PrefectHQ/fastmcp/pull/6378)
* Post triage outcomes instead of run starts, and skip maintainer events by [@zzstoatzz](https://github.com/zzstoatzz) in [#6382](https://github.com/PrefectHQ/fastmcp/pull/6382)
### Security 🔒
* Verify advertised skill frontmatter when reading content by [@zzstoatzz](https://github.com/zzstoatzz) in [#6090](https://github.com/PrefectHQ/fastmcp/pull/6090)
* Check skill limits before reading directory and remote files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6092](https://github.com/PrefectHQ/fastmcp/pull/6092)
* fix: preserve _list_query_params in FastMCPProviderResourceTemplate.wrap by [@RS-ITACHI](https://github.com/RS-ITACHI) in [#6130](https://github.com/PrefectHQ/fastmcp/pull/6130)
* Read composite action inputs from env and pin actions by digest by [@gaker](https://github.com/gaker) in [#6168](https://github.com/PrefectHQ/fastmcp/pull/6168)
* Scope the /marvin App token to the permissions it uses by [@zzstoatzz](https://github.com/zzstoatzz) in [#6206](https://github.com/PrefectHQ/fastmcp/pull/6206)
* Require patched Authlib in client and server extras by [@zzstoatzz](https://github.com/zzstoatzz) and [@zhuweid](https://github.com/zhuweid) in [#6337](https://github.com/PrefectHQ/fastmcp/pull/6337)
* Update example locks past the schema-parsing security fix by [@zzstoatzz](https://github.com/zzstoatzz) in [#6339](https://github.com/PrefectHQ/fastmcp/pull/6339)
* Redact passwords from the worker's backend URL by [@jaeminbird](https://github.com/jaeminbird) and [@mbishflavien](https://github.com/mbishflavien) in [#6113](https://github.com/PrefectHQ/fastmcp/pull/6113)
* fix(auth): collapse a repeated `iss` in the client redirect by [@shi-felix](https://github.com/shi-felix) and [@alpaylan](https://github.com/alpaylan) in [#6352](https://github.com/PrefectHQ/fastmcp/pull/6352)
* Normalize raw-string redirect URIs through AnyUrl before validation by [@uhhgxg](https://github.com/uhhgxg) and [@alpaylan](https://github.com/alpaylan) in [#6315](https://github.com/PrefectHQ/fastmcp/pull/6315)
### Fixes 🐞
* Make the version-check InvalidURL regression independent of proxy parsing by [@HootRock](https://github.com/HootRock) in [#6048](https://github.com/PrefectHQ/fastmcp/pull/6048)
* Build the Prefab renderer page on read, not on resources/list by [@adam-zovos](https://github.com/adam-zovos) in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* Install mounted skills under their own name in sync_skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#6078](https://github.com/PrefectHQ/fastmcp/pull/6078)
* Stage skill exports before replacing installed files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6091](https://github.com/PrefectHQ/fastmcp/pull/6091)
* fix: Prefix backend hash addresses with double underscores by [@jlowin](https://github.com/jlowin) and [@BlueX888](https://github.com/BlueX888) in [#6100](https://github.com/PrefectHQ/fastmcp/pull/6100)
* Rebind pre-4.2 Prefab backend addresses through 4.2 proxies by [@jakekaplan](https://github.com/jakekaplan) in [#6108](https://github.com/PrefectHQ/fastmcp/pull/6108)
* Isolate and bound triage verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6109](https://github.com/PrefectHQ/fastmcp/pull/6109)
* Improve OpenAPI upstream error details by [@zzstoatzz](https://github.com/zzstoatzz) and [@mssaleh](https://github.com/mssaleh) in [#6141](https://github.com/PrefectHQ/fastmcp/pull/6141)
* Compare JSON const and enum values by JSON equality by [@prassu017](https://github.com/prassu017) and [@alpaylan](https://github.com/alpaylan) in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* Bound Skills proxy backend pagination by [@prassu017](https://github.com/prassu017) and [@Yash-Tripath1](https://github.com/Yash-Tripath1) in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* fix: forward script arguments in FastMCPStdioTransport by [@KashifManzer](https://github.com/KashifManzer) and [@BlueX888](https://github.com/BlueX888) in [#6119](https://github.com/PrefectHQ/fastmcp/pull/6119)
* Return invalid params for prompts/get with a missing required argument by [@asasemahmed](https://github.com/asasemahmed) and [@xubenqiang](https://github.com/xubenqiang) in [#6027](https://github.com/PrefectHQ/fastmcp/pull/6027)
* Fix kept-alive stdio transports ignoring client timeouts by [@HootRock](https://github.com/HootRock) in [#6156](https://github.com/PrefectHQ/fastmcp/pull/6156)
* perf(schema): skip unnecessary reference sibling restoration by [@andreivince](https://github.com/andreivince) in [#6161](https://github.com/PrefectHQ/fastmcp/pull/6161)
* fix(cli): prefer Claude Code project servers by [@mikamikasuki](https://github.com/mikamikasuki) in [#5522](https://github.com/PrefectHQ/fastmcp/pull/5522)
* fix(cli): preserve JSON content block fields by [@mikamikasuki](https://github.com/mikamikasuki) in [#5530](https://github.com/PrefectHQ/fastmcp/pull/5530)
* Keep schema definitions when hydrating a wrapped tool result by [@asasemahmed](https://github.com/asasemahmed) in [#5927](https://github.com/PrefectHQ/fastmcp/pull/5927)
* Reject undeclared OpenAPI tool arguments under strict input validation by [@prassu017](https://github.com/prassu017) and [@mssaleh](https://github.com/mssaleh) in [#6140](https://github.com/PrefectHQ/fastmcp/pull/6140)
* fix(resources): reverse hostless URIs through Namespace unchanged by [@serhiizghama](https://github.com/serhiizghama) and [@andreivince](https://github.com/andreivince) in [#5230](https://github.com/PrefectHQ/fastmcp/pull/5230)
* fix(openapi): preserve timeouts so the server maps them to the actionable message by [@BlueX888](https://github.com/BlueX888) in [#5847](https://github.com/PrefectHQ/fastmcp/pull/5847)
* Keep posted review receipts on partial delivery and reject differing reviews by [@zzstoatzz](https://github.com/zzstoatzz) in [#6178](https://github.com/PrefectHQ/fastmcp/pull/6178)
* Drop client context holds left by finished tasks by [@zzstoatzz](https://github.com/zzstoatzz) in [#6205](https://github.com/PrefectHQ/fastmcp/pull/6205)
* Let clients with different timeouts share a kept-alive stdio session by [@zzstoatzz](https://github.com/zzstoatzz) in [#6223](https://github.com/PrefectHQ/fastmcp/pull/6223)
* fix(cli): preserve explicit null in generated tool commands by [@likecake](https://github.com/likecake) in [#6191](https://github.com/PrefectHQ/fastmcp/pull/6191)
* Honor empty tag inclusion filters in multi-server configs by [@PennEwan](https://github.com/PennEwan) in [#6200](https://github.com/PrefectHQ/fastmcp/pull/6200)
* fix(mcp-config): reuse one OAuth client per configured server by [@kbkb628](https://github.com/kbkb628) and [@whoskn](https://github.com/whoskn) in [#6097](https://github.com/PrefectHQ/fastmcp/pull/6097)
* Fix and quiet the triage alerts from 2026-11-02 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6235](https://github.com/PrefectHQ/fastmcp/pull/6235)
* fix(tasks): send task IDs in routing headers by [@eli-yip](https://github.com/eli-yip) in [#5810](https://github.com/PrefectHQ/fastmcp/pull/5810)
* fix(middleware): treat an empty methods allowlist as "log nothing" by [@gdut4140](https://github.com/gdut4140) in [#5727](https://github.com/PrefectHQ/fastmcp/pull/5727)
* Fix namespaced file resource reads while preserving URI normalization by [@BlueLi66](https://github.com/BlueLi66) in [#5716](https://github.com/PrefectHQ/fastmcp/pull/5716)
* fix(server): pass typed list request messages to list middleware hooks by [@BlueX888](https://github.com/BlueX888) in [#5732](https://github.com/PrefectHQ/fastmcp/pull/5732)
* Stop OpenAPI end-to-end tests from hitting the network by [@zzstoatzz](https://github.com/zzstoatzz) in [#6249](https://github.com/PrefectHQ/fastmcp/pull/6249)
* fix(auth): Preserve browser consent bindings across concurrent OAuth approvals by [@mikamikasuki](https://github.com/mikamikasuki) in [#5541](https://github.com/PrefectHQ/fastmcp/pull/5541)
* fix(openapi): serialize header and path parameters per the simple style by [@Harsh23Kashyap](https://github.com/Harsh23Kashyap) in [#5091](https://github.com/PrefectHQ/fastmcp/pull/5091)
* Fall back to method and path when an OpenAPI name slugs to nothing by [@asasemahmed](https://github.com/asasemahmed) in [#5699](https://github.com/PrefectHQ/fastmcp/pull/5699)
* Convert OpenAPI 3.0 boolean exclusive bounds to numeric bounds by [@asasemahmed](https://github.com/asasemahmed) in [#5697](https://github.com/PrefectHQ/fastmcp/pull/5697)
* Rewrite component refs under not, if/then/else and similar keywords by [@asasemahmed](https://github.com/asasemahmed) in [#5698](https://github.com/PrefectHQ/fastmcp/pull/5698)
* fix(openapi): keep media-type $defs beside component schemas by [@BlueX888](https://github.com/BlueX888) in [#5709](https://github.com/PrefectHQ/fastmcp/pull/5709)
* Omit readOnly properties from OpenAPI tool input schemas by [@AarnavNoble](https://github.com/AarnavNoble) in [#5753](https://github.com/PrefectHQ/fastmcp/pull/5753)
* fix: name root self-references after the generated root class by [@BlueX888](https://github.com/BlueX888) in [#5671](https://github.com/PrefectHQ/fastmcp/pull/5671)
* fix(proxy): keep stale list results out of cache by [@mikamikasuki](https://github.com/mikamikasuki) in [#5521](https://github.com/PrefectHQ/fastmcp/pull/5521)
* Match Claude Code project keys by path on Windows by [@zzstoatzz](https://github.com/zzstoatzz) and [@yongpange](https://github.com/yongpange) in [#6240](https://github.com/PrefectHQ/fastmcp/pull/6240)
* Stop preloading the server before launching the Inspector by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6241](https://github.com/PrefectHQ/fastmcp/pull/6241)
* Cull expired OAuth state from the default OAuthProxy file store by [@zzstoatzz](https://github.com/zzstoatzz), [@nosmile99](https://github.com/nosmile99), and [@mheidari98](https://github.com/mheidari98) in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* Reuse the stdio session after a cancelled startup by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6243](https://github.com/PrefectHQ/fastmcp/pull/6243)
* Match Gemini function responses to tool-use IDs by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6244](https://github.com/PrefectHQ/fastmcp/pull/6244)
* Replace parent type keywords when an ArgTransform changes the type by [@zzstoatzz](https://github.com/zzstoatzz), [@syf2211](https://github.com/syf2211), [@HootRock](https://github.com/HootRock), and [@chrikrah](https://github.com/chrikrah) in [#6246](https://github.com/PrefectHQ/fastmcp/pull/6246)
* Expire idle per-client rate limiters by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6247](https://github.com/PrefectHQ/fastmcp/pull/6247)
* Match resource templates that spell out a literal query by [@zzstoatzz](https://github.com/zzstoatzz) and [@arieleven](https://github.com/arieleven) in [#6248](https://github.com/PrefectHQ/fastmcp/pull/6248)
* fix(openapi): preserve explicit null in nullable JSON body properties by [@mumu-bird](https://github.com/mumu-bird) in [#5633](https://github.com/PrefectHQ/fastmcp/pull/5633)
* Keep OpenAPI refs that point into a component schema intact by [@zzstoatzz](https://github.com/zzstoatzz) and [@AarnavNoble](https://github.com/AarnavNoble) in [#6245](https://github.com/PrefectHQ/fastmcp/pull/6245)
* fix(telemetry): record mounted and nested server spans as INTERNAL by [@zzstoatzz](https://github.com/zzstoatzz) and [@sonmaximum](https://github.com/sonmaximum) in [#6252](https://github.com/PrefectHQ/fastmcp/pull/6252)
* fix(client): identify as fastmcp in clientInfo by default by [@zzstoatzz](https://github.com/zzstoatzz) in [#6254](https://github.com/PrefectHQ/fastmcp/pull/6254)
* fix(openapi): keep both values when a query object property matches another parameter by [@zzstoatzz](https://github.com/zzstoatzz) and [@alpaylan](https://github.com/alpaylan) in [#6256](https://github.com/PrefectHQ/fastmcp/pull/6256)
* fix(middleware): map exception subclasses in ErrorHandlingMiddleware by [@zzstoatzz](https://github.com/zzstoatzz) and [@zurmag](https://github.com/zurmag) in [#6257](https://github.com/PrefectHQ/fastmcp/pull/6257)
* fix(client): report a lost connection instead of 'Client is not connected' by [@zzstoatzz](https://github.com/zzstoatzz) and [@alex-feel](https://github.com/alex-feel) in [#6259](https://github.com/PrefectHQ/fastmcp/pull/6259)
* fix(client): keep ClientGroup tool routes after the group context exits by [@zzstoatzz](https://github.com/zzstoatzz), [@hntrl](https://github.com/hntrl), and [@YingzuoLiu](https://github.com/YingzuoLiu) in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* Accept structured skill metadata and allowed-tools lists by [@jakekaplan](https://github.com/jakekaplan) in [#6292](https://github.com/PrefectHQ/fastmcp/pull/6292)
* Preserve 4.1 skills type checks and resource-only manifest migration by [@zzstoatzz](https://github.com/zzstoatzz) in [#6305](https://github.com/PrefectHQ/fastmcp/pull/6305)
* Fix generated CLIs for tools named app, console or Client by [@andreivince](https://github.com/andreivince) in [#6056](https://github.com/PrefectHQ/fastmcp/pull/6056)
* Disambiguate colliding parameter flags in generate-cli by [@mohitdixit02](https://github.com/mohitdixit02) and [@andreivince](https://github.com/andreivince) in [#6311](https://github.com/PrefectHQ/fastmcp/pull/6311)
* fix: preserve CRLF descriptions in generated CLI parameter help by [@chris00234](https://github.com/chris00234) in [#6075](https://github.com/PrefectHQ/fastmcp/pull/6075)
* fix(agentic): repair baseline collection verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6313](https://github.com/PrefectHQ/fastmcp/pull/6313)
* Reject non-positive event retention limits by [@mikamikasuki](https://github.com/mikamikasuki) in [#5535](https://github.com/PrefectHQ/fastmcp/pull/5535)
* fix(search): rebuild the BM25 index when the tool name set changes by [@shi-felix](https://github.com/shi-felix) in [#6282](https://github.com/PrefectHQ/fastmcp/pull/6282)
* fix(tools): keep hidden parameter factories out of visible defaults by [@shi-felix](https://github.com/shi-felix) in [#6283](https://github.com/PrefectHQ/fastmcp/pull/6283)
* fix(auth): accept private-use scheme redirect URIs in CIMD documents by [@ColePBryan](https://github.com/ColePBryan) in [#6335](https://github.com/PrefectHQ/fastmcp/pull/6335)
* Report the stop reason from sampling handlers when no tools are offered by [@AarnavNoble](https://github.com/AarnavNoble) in [#6342](https://github.com/PrefectHQ/fastmcp/pull/6342)
* fix(auth): preserve empty authority on custom-scheme redirect URIs by [@codesphere-u](https://github.com/codesphere-u) and [@alpaylan](https://github.com/alpaylan) in [#6347](https://github.com/PrefectHQ/fastmcp/pull/6347)
* Declare items.type on multi-select list shorthand elicitations by [@zzstoatzz](https://github.com/zzstoatzz), [@shi-felix](https://github.com/shi-felix), [@Vivek1898](https://github.com/Vivek1898), and [@alpaylan](https://github.com/alpaylan) in [#6361](https://github.com/PrefectHQ/fastmcp/pull/6361)
* Mask prompt handler exceptions when mask_error_details=True by [@pratyu2h](https://github.com/pratyu2h) and [@maxmorrish](https://github.com/maxmorrish) in [#6277](https://github.com/PrefectHQ/fastmcp/pull/6277)
* Send `{}` for required OpenAPI object bodies with no fields by [@rome-xi](https://github.com/rome-xi) and [@wang1299](https://github.com/wang1299) in [#6340](https://github.com/PrefectHQ/fastmcp/pull/6340)
* fix(client): keep the response cache inert on legacy connections (#6298) by [@xunWhale](https://github.com/xunWhale) and [@alpaylan](https://github.com/alpaylan) in [#6321](https://github.com/PrefectHQ/fastmcp/pull/6321)
* Encode manifest paths in download_skill URIs by [@zzstoatzz](https://github.com/zzstoatzz), [@67-luck](https://github.com/67-luck), and [@BlueX888](https://github.com/BlueX888) in [#6376](https://github.com/PrefectHQ/fastmcp/pull/6376)
* Fix skill discovery for nested supporting files by [@mahekara28](https://github.com/mahekara28) and [@alpaylan](https://github.com/alpaylan) in [#6310](https://github.com/PrefectHQ/fastmcp/pull/6310)
### Docs 📚
* Consolidate skills docs into one Skills over MCP page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6049](https://github.com/PrefectHQ/fastmcp/pull/6049)
* Rewrite skills docs around Skill and SkillCatalogProvider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6066](https://github.com/PrefectHQ/fastmcp/pull/6066)
* Tighten skills docs examples by [@zzstoatzz](https://github.com/zzstoatzz) in [#6070](https://github.com/PrefectHQ/fastmcp/pull/6070)
* Shorten the skills docs page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6079](https://github.com/PrefectHQ/fastmcp/pull/6079)
* Badge the skills page as 4.2.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6083](https://github.com/PrefectHQ/fastmcp/pull/6083)
* Consolidate skills examples around verified Skill values by [@zzstoatzz](https://github.com/zzstoatzz) in [#6093](https://github.com/PrefectHQ/fastmcp/pull/6093)
* docs: add v4.2.0a1 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6105](https://github.com/PrefectHQ/fastmcp/pull/6105)
* Add MCP tool annotations to get_file example by [@gl1tchdust](https://github.com/gl1tchdust) in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* Fix dead links in current documentation by [@zzstoatzz](https://github.com/zzstoatzz) and [@Wilson0511](https://github.com/Wilson0511) in [#6142](https://github.com/PrefectHQ/fastmcp/pull/6142)
* docs: rename Horizon to FastMCP Gateway in current docs by [@parkedwards](https://github.com/parkedwards) in [#5653](https://github.com/PrefectHQ/fastmcp/pull/5653)
* Document strict-mode handling of undeclared OpenAPI arguments by [@zzstoatzz](https://github.com/zzstoatzz) in [#6169](https://github.com/PrefectHQ/fastmcp/pull/6169)
* docs: add v4.2.0a2 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6224](https://github.com/PrefectHQ/fastmcp/pull/6224)
* docs(settings): explain what FASTMCP_DEBUG actually does by [@zzstoatzz](https://github.com/zzstoatzz) and [@ianw](https://github.com/ianw) in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* docs: pass referrers on outbound links, add organization schema and page descriptions by [@madureira-gabriel](https://github.com/madureira-gabriel) in [#6287](https://github.com/PrefectHQ/fastmcp/pull/6287)
* docs: add v4.2.0a3 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6306](https://github.com/PrefectHQ/fastmcp/pull/6306)
* docs: preserve docs routing metadata and release guidance by [@zzstoatzz](https://github.com/zzstoatzz) in [#6320](https://github.com/PrefectHQ/fastmcp/pull/6320)
* Correct how tools docs describe bytes return values by [@DivyaNarahari97](https://github.com/DivyaNarahari97) in [#6275](https://github.com/PrefectHQ/fastmcp/pull/6275)
### Other Changes 🦾
* chore(deps): Update dependency ruff to v0.17.2 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6233
* chore(deps): Pin dependencies by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/6064
* Require patched joserfc by [@zzstoatzz](https://github.com/zzstoatzz) in [#6371](https://github.com/PrefectHQ/fastmcp/pull/6371)
* Keep colon-terminated prose lines in docstring tool descriptions by [@zzstoatzz](https://github.com/zzstoatzz), [@jlx1999s](https://github.com/jlx1999s), and [@ptrailblazer89](https://github.com/ptrailblazer89) in [#6372](https://github.com/PrefectHQ/fastmcp/pull/6372)

## New Contributors
* @fprieto14 made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @keremoktener made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @gaker made their first contribution in [#6170](https://github.com/PrefectHQ/fastmcp/pull/6170)
* @zhuweid made their first contribution in [#6337](https://github.com/PrefectHQ/fastmcp/pull/6337)
* @jaeminbird made their first contribution in [#6113](https://github.com/PrefectHQ/fastmcp/pull/6113)
* @mbishflavien made their first contribution in [#6113](https://github.com/PrefectHQ/fastmcp/pull/6113)
* @shi-felix made their first contribution in [#6352](https://github.com/PrefectHQ/fastmcp/pull/6352)
* @adam-zovos made their first contribution in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* @Yash-Tripath1 made their first contribution in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* @likecake made their first contribution in [#6191](https://github.com/PrefectHQ/fastmcp/pull/6191)
* @PennEwan made their first contribution in [#6200](https://github.com/PrefectHQ/fastmcp/pull/6200)
* @whoskn made their first contribution in [#6097](https://github.com/PrefectHQ/fastmcp/pull/6097)
* @eli-yip made their first contribution in [#5810](https://github.com/PrefectHQ/fastmcp/pull/5810)
* @gdut4140 made their first contribution in [#5727](https://github.com/PrefectHQ/fastmcp/pull/5727)
* @BlueLi66 made their first contribution in [#5716](https://github.com/PrefectHQ/fastmcp/pull/5716)
* @yongpange made their first contribution in [#6240](https://github.com/PrefectHQ/fastmcp/pull/6240)
* @nosmile99 made their first contribution in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* @mheidari98 made their first contribution in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* @arieleven made their first contribution in [#6248](https://github.com/PrefectHQ/fastmcp/pull/6248)
* @mumu-bird made their first contribution in [#5633](https://github.com/PrefectHQ/fastmcp/pull/5633)
* @sonmaximum made their first contribution in [#6252](https://github.com/PrefectHQ/fastmcp/pull/6252)
* @zurmag made their first contribution in [#6257](https://github.com/PrefectHQ/fastmcp/pull/6257)
* @mohitdixit02 made their first contribution in [#6311](https://github.com/PrefectHQ/fastmcp/pull/6311)
* @chris00234 made their first contribution in [#6075](https://github.com/PrefectHQ/fastmcp/pull/6075)
* @ColePBryan made their first contribution in [#6335](https://github.com/PrefectHQ/fastmcp/pull/6335)
* @codesphere-u made their first contribution in [#6347](https://github.com/PrefectHQ/fastmcp/pull/6347)
* @Vivek1898 made their first contribution in [#6361](https://github.com/PrefectHQ/fastmcp/pull/6361)
* @pratyu2h made their first contribution in [#6277](https://github.com/PrefectHQ/fastmcp/pull/6277)
* @maxmorrish made their first contribution in [#6277](https://github.com/PrefectHQ/fastmcp/pull/6277)
* @rome-xi made their first contribution in [#6340](https://github.com/PrefectHQ/fastmcp/pull/6340)
* @wang1299 made their first contribution in [#6340](https://github.com/PrefectHQ/fastmcp/pull/6340)
* @xunWhale made their first contribution in [#6321](https://github.com/PrefectHQ/fastmcp/pull/6321)
* @67-luck made their first contribution in [#6376](https://github.com/PrefectHQ/fastmcp/pull/6376)
* @mahekara28 made their first contribution in [#6310](https://github.com/PrefectHQ/fastmcp/pull/6310)
* @gl1tchdust made their first contribution in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* @ianw made their first contribution in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* @madureira-gabriel made their first contribution in [#6287](https://github.com/PrefectHQ/fastmcp/pull/6287)
* @DivyaNarahari97 made their first contribution in [#6275](https://github.com/PrefectHQ/fastmcp/pull/6275)
* @jlx1999s made their first contribution in [#6372](https://github.com/PrefectHQ/fastmcp/pull/6372)
* @ptrailblazer89 made their first contribution in [#6372](https://github.com/PrefectHQ/fastmcp/pull/6372)

**Full Changelog**: [v4.1.6...v4.2.0a4](https://github.com/PrefectHQ/fastmcp/compare/v4.1.6...v4.2.0a4)

</Update>

<Update label="v4.2.0a3" description="2026-11-03">

**[v4.2.0a3: A Particular Set of Skills](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a3)**

FastMCP 4.2.0a3 consolidates skills around `Skill`, `SkillCatalogProvider`, and the new strict `SkillsDirectoryProvider` in `fastmcp.skills.provider`. Directory loading validates each skill before publication, and skills with structured metadata or YAML `allowed-tools` lists are accepted without changing their values. This alpha also fixes stale proxy discovery caches, preserves OpenAPI schema references and explicit null values, and improves client connection recovery. Skills support remains experimental; this prerelease is intended for integration testing. If you import the 4.1 skills providers directly, they keep their behavior in 4.2 and now warn ahead of removal in 4.3. Move directory loading to `from fastmcp.skills.provider import SkillsDirectoryProvider`; its startup errors and the legacy providers' warnings identify folders that need fixing. For a single skill, use `Skill.from_directory(...)` with `SkillCatalogProvider` from `fastmcp.skills.provider`. `Client.list_skill_resources()` remains available for servers without the Skills extension. The old `experimental_skills=True` path redirects to the new provider for the base class and rejects subclasses to preserve access controls. Legacy `Skill` wire-model construction still works with a warning, wire entries retain `isinstance(entry, Skill)` behavior, and existing Pydantic `Skill` fields still validate wire payloads. Use `MCPSkill` for wire entries, annotations, and checks, and `Skill` for authoring. For manifest metadata on resource-only servers, read `skill://<name>/_manifest` with `client.read_resource()` and parse its JSON; `client.get_skill()` requires the Skills extension, while `client.read_skill()` downloads and validates the whole skill. Since a2, `ClientGroup` retains known tool routes after its context exits, OpenAPI tool inputs omit `readOnly` properties, and header and path parameters follow their declared simple serialization style. OAuth consent bindings survive concurrent approvals, exception middleware matches subclasses, and empty logging method filters mean “log nothing.” Thanks to our 46 contributors, including 29 first-time contributors.

### Breaking Changes ⚠️
* Make Skill a storage-neutral object with folders as one loader by [@zzstoatzz](https://github.com/zzstoatzz) in [#6065](https://github.com/PrefectHQ/fastmcp/pull/6065)
### Enhancements ✨
* Rename the resource-era list_skills helper to list_skill_summaries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6051](https://github.com/PrefectHQ/fastmcp/pull/6051)
* Discover skills through mounted servers by [@zzstoatzz](https://github.com/zzstoatzz) in [#6067](https://github.com/PrefectHQ/fastmcp/pull/6067)
* Share Prefab renderer resources across equivalent tools by [@jlowin](https://github.com/jlowin), [@fprieto14](https://github.com/fprieto14), and [@keremoktener](https://github.com/keremoktener) in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* Export Skill from fastmcp by [@zzstoatzz](https://github.com/zzstoatzz) in [#6071](https://github.com/PrefectHQ/fastmcp/pull/6071)
* Add skills discovery to ClientGroup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6072](https://github.com/PrefectHQ/fastmcp/pull/6072)
* Add --skills to fastmcp list by [@zzstoatzz](https://github.com/zzstoatzz) in [#6073](https://github.com/PrefectHQ/fastmcp/pull/6073)
* Add Client.read_skill and tighten skills docs by [@zzstoatzz](https://github.com/zzstoatzz) in [#6087](https://github.com/PrefectHQ/fastmcp/pull/6087)
* Verify and export skills with resource-manifest fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#6086](https://github.com/PrefectHQ/fastmcp/pull/6086)
* Forward Skills discovery through proxies by [@jakekaplan](https://github.com/jakekaplan) in [#5788](https://github.com/PrefectHQ/fastmcp/pull/5788)
* Share strict skill snapshot projection by [@zzstoatzz](https://github.com/zzstoatzz) in [#6089](https://github.com/PrefectHQ/fastmcp/pull/6089)
* Use scoped local tests and leave full suites to CI by [@zzstoatzz](https://github.com/zzstoatzz) in [#6094](https://github.com/PrefectHQ/fastmcp/pull/6094)
* Share ClientGroup skill client lookup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6101](https://github.com/PrefectHQ/fastmcp/pull/6101)
* Share filesystem skill supporting-file reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#6102](https://github.com/PrefectHQ/fastmcp/pull/6102)
* Deliver concurrent triage reviews, draft fixes and mutation proposals by [@zzstoatzz](https://github.com/zzstoatzz) in [#6116](https://github.com/PrefectHQ/fastmcp/pull/6116)
* Post Marvin's dedupe and too-long comments from workflow steps by [@gaker](https://github.com/gaker) in [#6170](https://github.com/PrefectHQ/fastmcp/pull/6170)
* Remove the unused triage mutation batch by [@zzstoatzz](https://github.com/zzstoatzz) in [#6208](https://github.com/PrefectHQ/fastmcp/pull/6208)
* Restore the status site by [@zzstoatzz](https://github.com/zzstoatzz) in [#6216](https://github.com/PrefectHQ/fastmcp/pull/6216)
* Add agno, Agent Framework, and OpenAI Agents SDK to downstream smoke by [@zzstoatzz](https://github.com/zzstoatzz) in [#6222](https://github.com/PrefectHQ/fastmcp/pull/6222)
* Close external PRs until their author is assigned again by [@zzstoatzz](https://github.com/zzstoatzz) in [#6227](https://github.com/PrefectHQ/fastmcp/pull/6227)
* Let private triage sweeps run without the Sol reviewer by [@zzstoatzz](https://github.com/zzstoatzz) in [#6229](https://github.com/PrefectHQ/fastmcp/pull/6229)
* Add named model tiers to the agentic triage plans by [@zzstoatzz](https://github.com/zzstoatzz) in [#6228](https://github.com/PrefectHQ/fastmcp/pull/6228)
* Add reproducible public triage leads to backlog dashboard by [@zzstoatzz](https://github.com/zzstoatzz) in [#6293](https://github.com/PrefectHQ/fastmcp/pull/6293)
* Add a strict SkillsDirectoryProvider to fastmcp.skills.provider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6278](https://github.com/PrefectHQ/fastmcp/pull/6278)
* Point experimental_skills at the new provider and drop alpha-only skills code by [@zzstoatzz](https://github.com/zzstoatzz) in [#6279](https://github.com/PrefectHQ/fastmcp/pull/6279)
* Deprecate the 4.1 skills API for removal in 4.3 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6280](https://github.com/PrefectHQ/fastmcp/pull/6280)
### Security 🔒
* Verify advertised skill frontmatter when reading content by [@zzstoatzz](https://github.com/zzstoatzz) in [#6090](https://github.com/PrefectHQ/fastmcp/pull/6090)
* Check skill limits before reading directory and remote files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6092](https://github.com/PrefectHQ/fastmcp/pull/6092)
* fix: preserve _list_query_params in FastMCPProviderResourceTemplate.wrap by [@RS-ITACHI](https://github.com/RS-ITACHI) in [#6130](https://github.com/PrefectHQ/fastmcp/pull/6130)
* Read composite action inputs from env and pin actions by digest by [@gaker](https://github.com/gaker) in [#6168](https://github.com/PrefectHQ/fastmcp/pull/6168)
* Scope the /marvin App token to the permissions it uses by [@zzstoatzz](https://github.com/zzstoatzz) in [#6206](https://github.com/PrefectHQ/fastmcp/pull/6206)
### Fixes 🐞
* Make the version-check InvalidURL regression independent of proxy parsing by [@HootRock](https://github.com/HootRock) in [#6048](https://github.com/PrefectHQ/fastmcp/pull/6048)
* Build the Prefab renderer page on read, not on resources/list by [@adam-zovos](https://github.com/adam-zovos) in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* Install mounted skills under their own name in sync_skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#6078](https://github.com/PrefectHQ/fastmcp/pull/6078)
* Stage skill exports before replacing installed files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6091](https://github.com/PrefectHQ/fastmcp/pull/6091)
* fix: Prefix backend hash addresses with double underscores by [@jlowin](https://github.com/jlowin) and [@BlueX888](https://github.com/BlueX888) in [#6100](https://github.com/PrefectHQ/fastmcp/pull/6100)
* Rebind pre-4.2 Prefab backend addresses through 4.2 proxies by [@jakekaplan](https://github.com/jakekaplan) in [#6108](https://github.com/PrefectHQ/fastmcp/pull/6108)
* Isolate and bound triage verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6109](https://github.com/PrefectHQ/fastmcp/pull/6109)
* Improve OpenAPI upstream error details by [@zzstoatzz](https://github.com/zzstoatzz) and [@mssaleh](https://github.com/mssaleh) in [#6141](https://github.com/PrefectHQ/fastmcp/pull/6141)
* Compare JSON const and enum values by JSON equality by [@prassu017](https://github.com/prassu017) and [@alpaylan](https://github.com/alpaylan) in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* Bound Skills proxy backend pagination by [@prassu017](https://github.com/prassu017) and [@Yash-Tripath1](https://github.com/Yash-Tripath1) in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* fix: forward script arguments in FastMCPStdioTransport by [@KashifManzer](https://github.com/KashifManzer) and [@BlueX888](https://github.com/BlueX888) in [#6119](https://github.com/PrefectHQ/fastmcp/pull/6119)
* Return invalid params for prompts/get with a missing required argument by [@asasemahmed](https://github.com/asasemahmed) and [@xubenqiang](https://github.com/xubenqiang) in [#6027](https://github.com/PrefectHQ/fastmcp/pull/6027)
* Fix kept-alive stdio transports ignoring client timeouts by [@HootRock](https://github.com/HootRock) and [@BlueX888](https://github.com/BlueX888) in [#6156](https://github.com/PrefectHQ/fastmcp/pull/6156)
* perf(schema): skip unnecessary reference sibling restoration by [@andreivince](https://github.com/andreivince) in [#6161](https://github.com/PrefectHQ/fastmcp/pull/6161)
* fix(cli): prefer Claude Code project servers by [@mikamikasuki](https://github.com/mikamikasuki) in [#5522](https://github.com/PrefectHQ/fastmcp/pull/5522)
* fix(cli): preserve JSON content block fields by [@mikamikasuki](https://github.com/mikamikasuki) in [#5530](https://github.com/PrefectHQ/fastmcp/pull/5530)
* Keep schema definitions when hydrating a wrapped tool result by [@asasemahmed](https://github.com/asasemahmed) in [#5927](https://github.com/PrefectHQ/fastmcp/pull/5927)
* Reject undeclared OpenAPI tool arguments under strict input validation by [@prassu017](https://github.com/prassu017) and [@mssaleh](https://github.com/mssaleh) in [#6140](https://github.com/PrefectHQ/fastmcp/pull/6140)
* fix(resources): reverse hostless URIs through Namespace unchanged by [@serhiizghama](https://github.com/serhiizghama) and [@andreivince](https://github.com/andreivince) in [#5230](https://github.com/PrefectHQ/fastmcp/pull/5230)
* fix(openapi): preserve timeouts so the server maps them to the actionable message by [@BlueX888](https://github.com/BlueX888) in [#5847](https://github.com/PrefectHQ/fastmcp/pull/5847)
* Keep posted review receipts on partial delivery and reject differing reviews by [@zzstoatzz](https://github.com/zzstoatzz) in [#6178](https://github.com/PrefectHQ/fastmcp/pull/6178)
* Drop client context holds left by finished tasks by [@zzstoatzz](https://github.com/zzstoatzz) in [#6205](https://github.com/PrefectHQ/fastmcp/pull/6205)
* Let clients with different timeouts share a kept-alive stdio session by [@zzstoatzz](https://github.com/zzstoatzz) in [#6223](https://github.com/PrefectHQ/fastmcp/pull/6223)
* fix(cli): preserve explicit null in generated tool commands by [@likecake](https://github.com/likecake) in [#6191](https://github.com/PrefectHQ/fastmcp/pull/6191)
* Honor empty tag inclusion filters in multi-server configs by [@PennEwan](https://github.com/PennEwan) in [#6200](https://github.com/PrefectHQ/fastmcp/pull/6200)
* fix(mcp-config): reuse one OAuth client per configured server by [@kbkb628](https://github.com/kbkb628) and [@whoskn](https://github.com/whoskn) in [#6097](https://github.com/PrefectHQ/fastmcp/pull/6097)
* Fix and quiet the triage alerts from 2026-11-02 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6235](https://github.com/PrefectHQ/fastmcp/pull/6235)
* fix(tasks): send task IDs in routing headers by [@eli-yip](https://github.com/eli-yip) in [#5810](https://github.com/PrefectHQ/fastmcp/pull/5810)
* fix(middleware): treat an empty methods allowlist as "log nothing" by [@gdut4140](https://github.com/gdut4140) in [#5727](https://github.com/PrefectHQ/fastmcp/pull/5727)
* Fix namespaced file resource reads while preserving URI normalization by [@BlueLi66](https://github.com/BlueLi66) in [#5716](https://github.com/PrefectHQ/fastmcp/pull/5716)
* fix(server): pass typed list request messages to list middleware hooks by [@BlueX888](https://github.com/BlueX888) in [#5732](https://github.com/PrefectHQ/fastmcp/pull/5732)
* Stop OpenAPI end-to-end tests from hitting the network by [@zzstoatzz](https://github.com/zzstoatzz) in [#6249](https://github.com/PrefectHQ/fastmcp/pull/6249)
* fix(auth): Preserve browser consent bindings across concurrent OAuth approvals by [@mikamikasuki](https://github.com/mikamikasuki) in [#5541](https://github.com/PrefectHQ/fastmcp/pull/5541)
* fix(openapi): serialize header and path parameters per the simple style by [@Harsh23Kashyap](https://github.com/Harsh23Kashyap) in [#5091](https://github.com/PrefectHQ/fastmcp/pull/5091)
* Fall back to method and path when an OpenAPI name slugs to nothing by [@asasemahmed](https://github.com/asasemahmed) in [#5699](https://github.com/PrefectHQ/fastmcp/pull/5699)
* Convert OpenAPI 3.0 boolean exclusive bounds to numeric bounds by [@asasemahmed](https://github.com/asasemahmed) in [#5697](https://github.com/PrefectHQ/fastmcp/pull/5697)
* Rewrite component refs under not, if/then/else and similar keywords by [@asasemahmed](https://github.com/asasemahmed) in [#5698](https://github.com/PrefectHQ/fastmcp/pull/5698)
* fix(openapi): keep media-type $defs beside component schemas by [@BlueX888](https://github.com/BlueX888) in [#5709](https://github.com/PrefectHQ/fastmcp/pull/5709)
* Omit readOnly properties from OpenAPI tool input schemas by [@AarnavNoble](https://github.com/AarnavNoble) in [#5753](https://github.com/PrefectHQ/fastmcp/pull/5753)
* fix: name root self-references after the generated root class by [@BlueX888](https://github.com/BlueX888) in [#5671](https://github.com/PrefectHQ/fastmcp/pull/5671)
* fix(proxy): keep stale list results out of cache by [@mikamikasuki](https://github.com/mikamikasuki) in [#5521](https://github.com/PrefectHQ/fastmcp/pull/5521)
* Match Claude Code project keys by path on Windows by [@zzstoatzz](https://github.com/zzstoatzz) and [@yongpange](https://github.com/yongpange) in [#6240](https://github.com/PrefectHQ/fastmcp/pull/6240)
* Stop preloading the server before launching the Inspector by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6241](https://github.com/PrefectHQ/fastmcp/pull/6241)
* Cull expired OAuth state from the default OAuthProxy file store by [@zzstoatzz](https://github.com/zzstoatzz), [@nosmile99](https://github.com/nosmile99), and [@mheidari98](https://github.com/mheidari98) in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* Reuse the stdio session after a cancelled startup by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6243](https://github.com/PrefectHQ/fastmcp/pull/6243)
* Match Gemini function responses to tool-use IDs by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6244](https://github.com/PrefectHQ/fastmcp/pull/6244)
* Replace parent type keywords when an ArgTransform changes the type by [@zzstoatzz](https://github.com/zzstoatzz), [@syf2211](https://github.com/syf2211), [@HootRock](https://github.com/HootRock), and [@chrikrah](https://github.com/chrikrah) in [#6246](https://github.com/PrefectHQ/fastmcp/pull/6246)
* Expire idle per-client rate limiters by [@zzstoatzz](https://github.com/zzstoatzz) and [@mikamikasuki](https://github.com/mikamikasuki) in [#6247](https://github.com/PrefectHQ/fastmcp/pull/6247)
* Match resource templates that spell out a literal query by [@zzstoatzz](https://github.com/zzstoatzz) and [@taltal-beep](https://github.com/taltal-beep) in [#6248](https://github.com/PrefectHQ/fastmcp/pull/6248)
* fix(openapi): preserve explicit null in nullable JSON body properties by [@mumu-bird](https://github.com/mumu-bird) in [#5633](https://github.com/PrefectHQ/fastmcp/pull/5633)
* Keep OpenAPI refs that point into a component schema intact by [@zzstoatzz](https://github.com/zzstoatzz) and [@AarnavNoble](https://github.com/AarnavNoble) in [#6245](https://github.com/PrefectHQ/fastmcp/pull/6245)
* fix(telemetry): record mounted and nested server spans as INTERNAL by [@zzstoatzz](https://github.com/zzstoatzz) and [@sonmaximum](https://github.com/sonmaximum) in [#6252](https://github.com/PrefectHQ/fastmcp/pull/6252)
* fix(client): identify as fastmcp in clientInfo by default by [@zzstoatzz](https://github.com/zzstoatzz) in [#6254](https://github.com/PrefectHQ/fastmcp/pull/6254)
* fix(openapi): keep both values when a query object property matches another parameter by [@zzstoatzz](https://github.com/zzstoatzz) and [@alpaylan](https://github.com/alpaylan) in [#6256](https://github.com/PrefectHQ/fastmcp/pull/6256)
* fix(middleware): map exception subclasses in ErrorHandlingMiddleware by [@zzstoatzz](https://github.com/zzstoatzz) and [@zurmag](https://github.com/zurmag) in [#6257](https://github.com/PrefectHQ/fastmcp/pull/6257)
* fix(client): report a lost connection instead of 'Client is not connected' by [@zzstoatzz](https://github.com/zzstoatzz) and [@alex-feel](https://github.com/alex-feel) in [#6259](https://github.com/PrefectHQ/fastmcp/pull/6259)
* fix(client): keep ClientGroup tool routes after the group context exits by [@zzstoatzz](https://github.com/zzstoatzz), [@hntrl](https://github.com/hntrl), and [@YingzuoLiu](https://github.com/YingzuoLiu) in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* Accept structured skill metadata and allowed-tools lists by [@jakekaplan](https://github.com/jakekaplan) in [#6292](https://github.com/PrefectHQ/fastmcp/pull/6292)
* Preserve 4.1 skills type checks and resource-only manifest migration by [@zzstoatzz](https://github.com/zzstoatzz) in [#6305](https://github.com/PrefectHQ/fastmcp/pull/6305)
### Docs 📚
* Consolidate skills docs into one Skills over MCP page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6049](https://github.com/PrefectHQ/fastmcp/pull/6049)
* Rewrite skills docs around Skill and SkillCatalogProvider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6066](https://github.com/PrefectHQ/fastmcp/pull/6066)
* Tighten skills docs examples by [@zzstoatzz](https://github.com/zzstoatzz) in [#6070](https://github.com/PrefectHQ/fastmcp/pull/6070)
* Shorten the skills docs page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6079](https://github.com/PrefectHQ/fastmcp/pull/6079)
* Badge the skills page as 4.2.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6083](https://github.com/PrefectHQ/fastmcp/pull/6083)
* Consolidate skills examples around verified Skill values by [@zzstoatzz](https://github.com/zzstoatzz) in [#6093](https://github.com/PrefectHQ/fastmcp/pull/6093)
* docs: add v4.2.0a1 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6105](https://github.com/PrefectHQ/fastmcp/pull/6105)
* Add MCP tool annotations to get_file example by [@gl1tchdust](https://github.com/gl1tchdust) in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* Fix dead links in current documentation by [@zzstoatzz](https://github.com/zzstoatzz) and [@Wilson0511](https://github.com/Wilson0511) in [#6142](https://github.com/PrefectHQ/fastmcp/pull/6142)
* docs: rename Horizon to FastMCP Gateway in current docs by [@parkedwards](https://github.com/parkedwards) in [#5653](https://github.com/PrefectHQ/fastmcp/pull/5653)
* Document strict-mode handling of undeclared OpenAPI arguments by [@zzstoatzz](https://github.com/zzstoatzz) in [#6169](https://github.com/PrefectHQ/fastmcp/pull/6169)
* docs: add v4.2.0a2 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6224](https://github.com/PrefectHQ/fastmcp/pull/6224)
* docs(settings): explain what FASTMCP_DEBUG actually does by [@zzstoatzz](https://github.com/zzstoatzz) and [@ianw](https://github.com/ianw) in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* docs: pass referrers on outbound links, add organization schema and page descriptions by [@madureira-gabriel](https://github.com/madureira-gabriel) in [#6287](https://github.com/PrefectHQ/fastmcp/pull/6287)
### Other Changes 🦾
* chore(deps): Update dependency ruff to v0.17.2 by [@prefect-renovate](https://github.com/prefect-renovate) in [#6233](https://github.com/PrefectHQ/fastmcp/pull/6233)
* chore(deps): Pin dependencies by [@prefect-renovate](https://github.com/prefect-renovate) in [#6064](https://github.com/PrefectHQ/fastmcp/pull/6064)
## New Contributors
* @adam-zovos made their first contribution in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* @alpaylan made their first contribution in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* @BlueLi66 made their first contribution in [#5716](https://github.com/PrefectHQ/fastmcp/pull/5716)
* @eli-yip made their first contribution in [#5810](https://github.com/PrefectHQ/fastmcp/pull/5810)
* @fprieto14 made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @gaker made their first contribution in [#6168](https://github.com/PrefectHQ/fastmcp/pull/6168)
* @gdut4140 made their first contribution in [#5727](https://github.com/PrefectHQ/fastmcp/pull/5727)
* @gl1tchdust made their first contribution in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* @hntrl made their first contribution in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* @ianw made their first contribution in [#6255](https://github.com/PrefectHQ/fastmcp/pull/6255)
* @KashifManzer made their first contribution in [#6119](https://github.com/PrefectHQ/fastmcp/pull/6119)
* @keremoktener made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @likecake made their first contribution in [#6191](https://github.com/PrefectHQ/fastmcp/pull/6191)
* @mheidari98 made their first contribution in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* @mssaleh made their first contribution in [#6141](https://github.com/PrefectHQ/fastmcp/pull/6141)
* @mumu-bird made their first contribution in [#5633](https://github.com/PrefectHQ/fastmcp/pull/5633)
* @nosmile99 made their first contribution in [#6242](https://github.com/PrefectHQ/fastmcp/pull/6242)
* @PennEwan made their first contribution in [#6200](https://github.com/PrefectHQ/fastmcp/pull/6200)
* @prassu017 made their first contribution in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* @RS-ITACHI made their first contribution in [#6130](https://github.com/PrefectHQ/fastmcp/pull/6130)
* @serhiizghama made their first contribution in [#5230](https://github.com/PrefectHQ/fastmcp/pull/5230)
* @sonmaximum made their first contribution in [#6252](https://github.com/PrefectHQ/fastmcp/pull/6252)
* @taltal-beep made their first contribution in [#6248](https://github.com/PrefectHQ/fastmcp/pull/6248)
* @whoskn made their first contribution in [#6097](https://github.com/PrefectHQ/fastmcp/pull/6097)
* @xubenqiang made their first contribution in [#6027](https://github.com/PrefectHQ/fastmcp/pull/6027)
* @Yash-Tripath1 made their first contribution in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* @YingzuoLiu made their first contribution in [#6268](https://github.com/PrefectHQ/fastmcp/pull/6268)
* @yongpange made their first contribution in [#6240](https://github.com/PrefectHQ/fastmcp/pull/6240)
* @zurmag made their first contribution in [#6257](https://github.com/PrefectHQ/fastmcp/pull/6257)

**Full Changelog**: [v4.1.6...v4.2.0a3](https://github.com/PrefectHQ/fastmcp/compare/v4.1.6...v4.2.0a3)

</Update>

<Update label="v4.2.0a2" description="2026-11-01">

**[v4.2.0a2: Skill Waters Run Deep](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a2)**

The second 4.2 alpha carries every fix from 4.1.5 plus the ones that only land on 4.2: Skills discovery through proxies pages its backends with a bound, pre-4.2 Prefab backend addresses rebind through 4.2 proxies, large tool catalogs expand their schemas faster, and kept-alive stdio transports respect each client's timeout. Before tagging, this build ran against pydantic-ai, langchain, agno, Microsoft Agent Framework, and the OpenAI Agents SDK. Skills support remains experimental; this prerelease is intended for integration testing. Behavior changes since a1: JSON Schema `const` and `enum` compare by JSON equality, so `true` no longer passes for `1`; `prompts/get` with a missing argument returns invalid params (`-32602`); OpenAPI upstream errors are cut to 1 KB with HTML bodies dropped, and strict input validation rejects undeclared OpenAPI arguments; a later client with a different timeout restarts an idle kept-alive stdio subprocess, while one nested inside a live client shares its session's timeout and logs a warning. Thanks to our 22 contributors, including 13 first-time contributors.

### Breaking Changes ⚠️
* Make Skill a storage-neutral object with folders as one loader by [@zzstoatzz](https://github.com/zzstoatzz) in [#6065](https://github.com/PrefectHQ/fastmcp/pull/6065)
### Enhancements ✨
* Rename the resource-era list_skills helper to list_skill_summaries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6051](https://github.com/PrefectHQ/fastmcp/pull/6051)
* Discover skills through mounted servers by [@zzstoatzz](https://github.com/zzstoatzz) in [#6067](https://github.com/PrefectHQ/fastmcp/pull/6067)
* Share Prefab renderer resources across equivalent tools by [@jlowin](https://github.com/jlowin), [@fprieto14](https://github.com/fprieto14), and [@keremoktener](https://github.com/keremoktener) in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* Export Skill from fastmcp by [@zzstoatzz](https://github.com/zzstoatzz) in [#6071](https://github.com/PrefectHQ/fastmcp/pull/6071)
* Add skills discovery to ClientGroup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6072](https://github.com/PrefectHQ/fastmcp/pull/6072)
* Add --skills to fastmcp list by [@zzstoatzz](https://github.com/zzstoatzz) in [#6073](https://github.com/PrefectHQ/fastmcp/pull/6073)
* Add Client.read_skill and tighten skills docs by [@zzstoatzz](https://github.com/zzstoatzz) in [#6087](https://github.com/PrefectHQ/fastmcp/pull/6087)
* Verify and export skills with resource-manifest fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#6086](https://github.com/PrefectHQ/fastmcp/pull/6086)
* Forward Skills discovery through proxies by [@jakekaplan](https://github.com/jakekaplan) in [#5788](https://github.com/PrefectHQ/fastmcp/pull/5788)
* Share strict skill snapshot projection by [@zzstoatzz](https://github.com/zzstoatzz) in [#6089](https://github.com/PrefectHQ/fastmcp/pull/6089)
* Use scoped local tests and leave full suites to CI by [@zzstoatzz](https://github.com/zzstoatzz) in [#6094](https://github.com/PrefectHQ/fastmcp/pull/6094)
* Share ClientGroup skill client lookup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6101](https://github.com/PrefectHQ/fastmcp/pull/6101)
* Share filesystem skill supporting-file reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#6102](https://github.com/PrefectHQ/fastmcp/pull/6102)
* Deliver concurrent triage reviews, draft fixes and mutation proposals by [@zzstoatzz](https://github.com/zzstoatzz) in [#6116](https://github.com/PrefectHQ/fastmcp/pull/6116)
* Post Marvin's dedupe and too-long comments from workflow steps by [@gaker](https://github.com/gaker) in [#6170](https://github.com/PrefectHQ/fastmcp/pull/6170)
* Remove the unused triage mutation batch by [@zzstoatzz](https://github.com/zzstoatzz) in [#6208](https://github.com/PrefectHQ/fastmcp/pull/6208)
* Restore the status site by [@zzstoatzz](https://github.com/zzstoatzz) in [#6216](https://github.com/PrefectHQ/fastmcp/pull/6216)
* Add agno, Agent Framework, and OpenAI Agents SDK to downstream smoke by [@zzstoatzz](https://github.com/zzstoatzz) in [#6222](https://github.com/PrefectHQ/fastmcp/pull/6222)
### Security 🔒
* Verify advertised skill frontmatter when reading content by [@zzstoatzz](https://github.com/zzstoatzz) in [#6090](https://github.com/PrefectHQ/fastmcp/pull/6090)
* Check skill limits before reading directory and remote files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6092](https://github.com/PrefectHQ/fastmcp/pull/6092)
* fix: preserve _list_query_params in FastMCPProviderResourceTemplate.wrap by [@RS-ITACHI](https://github.com/RS-ITACHI) in [#6130](https://github.com/PrefectHQ/fastmcp/pull/6130)
* Read composite action inputs from env and pin actions by digest by [@gaker](https://github.com/gaker) in [#6168](https://github.com/PrefectHQ/fastmcp/pull/6168)
* Scope the /marvin App token to the permissions it uses by [@zzstoatzz](https://github.com/zzstoatzz) in [#6206](https://github.com/PrefectHQ/fastmcp/pull/6206)
### Fixes 🐞
* Make the version-check InvalidURL regression independent of proxy parsing by [@HootRock](https://github.com/HootRock) in [#6048](https://github.com/PrefectHQ/fastmcp/pull/6048)
* Build the Prefab renderer page on read, not on resources/list by [@adam-zovos](https://github.com/adam-zovos) in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* Install mounted skills under their own name in sync_skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#6078](https://github.com/PrefectHQ/fastmcp/pull/6078)
* Stage skill exports before replacing installed files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6091](https://github.com/PrefectHQ/fastmcp/pull/6091)
* fix: Prefix backend hash addresses with double underscores by [@jlowin](https://github.com/jlowin) and [@BlueX888](https://github.com/BlueX888) in [#6100](https://github.com/PrefectHQ/fastmcp/pull/6100)
* Rebind pre-4.2 Prefab backend addresses through 4.2 proxies by [@jakekaplan](https://github.com/jakekaplan) in [#6108](https://github.com/PrefectHQ/fastmcp/pull/6108)
* Isolate and bound triage verification by [@zzstoatzz](https://github.com/zzstoatzz) in [#6109](https://github.com/PrefectHQ/fastmcp/pull/6109)
* Improve OpenAPI upstream error details by [@zzstoatzz](https://github.com/zzstoatzz) and [@mssaleh](https://github.com/mssaleh) in [#6141](https://github.com/PrefectHQ/fastmcp/pull/6141)
* Compare JSON const and enum values by JSON equality by [@prassu017](https://github.com/prassu017) and [@alpaylan](https://github.com/alpaylan) in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* Bound Skills proxy backend pagination by [@prassu017](https://github.com/prassu017) and [@Yash-Tripath1](https://github.com/Yash-Tripath1) in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)
* fix: forward script arguments in FastMCPStdioTransport by [@KashifManzer](https://github.com/KashifManzer) and [@BlueX888](https://github.com/BlueX888) in [#6119](https://github.com/PrefectHQ/fastmcp/pull/6119)
* Return invalid params for prompts/get with a missing required argument by [@asasemahmed](https://github.com/asasemahmed) and [@xubenqiang](https://github.com/xubenqiang) in [#6027](https://github.com/PrefectHQ/fastmcp/pull/6027)
* Fix kept-alive stdio transports ignoring client timeouts by [@HootRock](https://github.com/HootRock) and [@BlueX888](https://github.com/BlueX888) in [#6156](https://github.com/PrefectHQ/fastmcp/pull/6156)
* perf(schema): skip unnecessary reference sibling restoration by [@andreivince](https://github.com/andreivince) in [#6161](https://github.com/PrefectHQ/fastmcp/pull/6161)
* fix(cli): prefer Claude Code project servers by [@mikamikasuki](https://github.com/mikamikasuki) in [#5522](https://github.com/PrefectHQ/fastmcp/pull/5522)
* fix(cli): preserve JSON content block fields by [@mikamikasuki](https://github.com/mikamikasuki) in [#5530](https://github.com/PrefectHQ/fastmcp/pull/5530)
* Keep schema definitions when hydrating a wrapped tool result by [@asasemahmed](https://github.com/asasemahmed) in [#5927](https://github.com/PrefectHQ/fastmcp/pull/5927)
* Reject undeclared OpenAPI tool arguments under strict input validation by [@prassu017](https://github.com/prassu017) and [@mssaleh](https://github.com/mssaleh) in [#6140](https://github.com/PrefectHQ/fastmcp/pull/6140)
* fix(resources): reverse hostless URIs through Namespace unchanged by [@serhiizghama](https://github.com/serhiizghama) and [@andreivince](https://github.com/andreivince) in [#5230](https://github.com/PrefectHQ/fastmcp/pull/5230)
* fix(openapi): preserve timeouts so the server maps them to the actionable message by [@BlueX888](https://github.com/BlueX888) in [#5847](https://github.com/PrefectHQ/fastmcp/pull/5847)
* Keep posted review receipts on partial delivery and reject differing reviews by [@zzstoatzz](https://github.com/zzstoatzz) in [#6178](https://github.com/PrefectHQ/fastmcp/pull/6178)
* Drop client context holds left by finished tasks by [@zzstoatzz](https://github.com/zzstoatzz) in [#6205](https://github.com/PrefectHQ/fastmcp/pull/6205)
* Let clients with different timeouts share a kept-alive stdio session by [@zzstoatzz](https://github.com/zzstoatzz) in [#6223](https://github.com/PrefectHQ/fastmcp/pull/6223)
### Docs 📚
* Consolidate skills docs into one Skills over MCP page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6049](https://github.com/PrefectHQ/fastmcp/pull/6049)
* Rewrite skills docs around Skill and SkillCatalogProvider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6066](https://github.com/PrefectHQ/fastmcp/pull/6066)
* Tighten skills docs examples by [@zzstoatzz](https://github.com/zzstoatzz) in [#6070](https://github.com/PrefectHQ/fastmcp/pull/6070)
* Shorten the skills docs page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6079](https://github.com/PrefectHQ/fastmcp/pull/6079)
* Badge the skills page as 4.2.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6083](https://github.com/PrefectHQ/fastmcp/pull/6083)
* Consolidate skills examples around verified Skill values by [@zzstoatzz](https://github.com/zzstoatzz) in [#6093](https://github.com/PrefectHQ/fastmcp/pull/6093)
* Add v4.2.0a1 changelog entries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6105](https://github.com/PrefectHQ/fastmcp/pull/6105)
* Add MCP tool annotations to get_file example by [@gl1tchdust](https://github.com/gl1tchdust) in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* Fix dead links in current documentation by [@zzstoatzz](https://github.com/zzstoatzz) in [#6142](https://github.com/PrefectHQ/fastmcp/pull/6142)
* docs: rename Horizon to FastMCP Gateway in current docs by [@parkedwards](https://github.com/parkedwards) in [#5653](https://github.com/PrefectHQ/fastmcp/pull/5653)
* Document strict-mode handling of undeclared OpenAPI arguments by [@zzstoatzz](https://github.com/zzstoatzz) in [#6169](https://github.com/PrefectHQ/fastmcp/pull/6169)

## New Contributors
* @adam-zovos made their first contribution in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* @gl1tchdust made their first contribution in [#5976](https://github.com/PrefectHQ/fastmcp/pull/5976)
* @RS-ITACHI made their first contribution in [#6130](https://github.com/PrefectHQ/fastmcp/pull/6130)
* @prassu017 made their first contribution in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* @KashifManzer made their first contribution in [#6119](https://github.com/PrefectHQ/fastmcp/pull/6119)
* @serhiizghama made their first contribution in [#5230](https://github.com/PrefectHQ/fastmcp/pull/5230)
* @gaker made their first contribution in [#6168](https://github.com/PrefectHQ/fastmcp/pull/6168)
* @fprieto14 made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @keremoktener made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @mssaleh made their first contribution in [#6141](https://github.com/PrefectHQ/fastmcp/pull/6141)
* @alpaylan made their first contribution in [#6126](https://github.com/PrefectHQ/fastmcp/pull/6126)
* @xubenqiang made their first contribution in [#6027](https://github.com/PrefectHQ/fastmcp/pull/6027)
* @Yash-Tripath1 made their first contribution in [#6104](https://github.com/PrefectHQ/fastmcp/pull/6104)

**Full Changelog**: [v4.1.4...v4.2.0a2](https://github.com/PrefectHQ/fastmcp/compare/v4.1.4...v4.2.0a2)

</Update>

<Update label="v4.2.0a1" description="2026-10-27">

**[v4.2.0a1: Skill Issue](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a1)**

FastMCP 4.2's first alpha brings code-defined skills, discovery through mounted and proxied servers, and verified downloads into one workflow. Build a `Skill` in Python or load one from a folder or package, publish it through `SkillCatalogProvider`, and let clients discover its metadata or download and export its files. Proxy discovery is opt-in with `skills=True`. Skills support remains experimental; this prerelease is intended for integration testing. It also includes lazy, shared Prefab renderer resources and backend-addressing fixes. Migration: `Skill` now represents file contents; the wire metadata model is named `MCPSkill`. Whole-skill downloads require a standard `SKILL.md` with a `name` matching its URI and a `description`. Exports with `overwrite=True` replace the installed folder, including locally added files. Ordinary resource providers still support their existing document formats. Thanks to our 8 contributors, including 3 first-time contributors.

### Breaking Changes ⚠️
* Make Skill a storage-neutral object with folders as one loader by [@zzstoatzz](https://github.com/zzstoatzz) in [#6065](https://github.com/PrefectHQ/fastmcp/pull/6065)
### Enhancements ✨
* Rename the resource-era list_skills helper to list_skill_summaries by [@zzstoatzz](https://github.com/zzstoatzz) in [#6051](https://github.com/PrefectHQ/fastmcp/pull/6051)
* Discover skills through mounted servers by [@zzstoatzz](https://github.com/zzstoatzz) in [#6067](https://github.com/PrefectHQ/fastmcp/pull/6067)
* Share Prefab renderer resources across equivalent tools by [@jlowin](https://github.com/jlowin), [@fprieto14](https://github.com/fprieto14), and [@keremoktener](https://github.com/keremoktener) in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* Export Skill from fastmcp by [@zzstoatzz](https://github.com/zzstoatzz) in [#6071](https://github.com/PrefectHQ/fastmcp/pull/6071)
* Add skills discovery to ClientGroup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6072](https://github.com/PrefectHQ/fastmcp/pull/6072)
* Add --skills to fastmcp list by [@zzstoatzz](https://github.com/zzstoatzz) in [#6073](https://github.com/PrefectHQ/fastmcp/pull/6073)
* Add Client.read_skill and tighten skills docs by [@zzstoatzz](https://github.com/zzstoatzz) in [#6087](https://github.com/PrefectHQ/fastmcp/pull/6087)
* Verify and export skills with resource-manifest fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#6086](https://github.com/PrefectHQ/fastmcp/pull/6086)
* Forward Skills discovery through proxies by [@jakekaplan](https://github.com/jakekaplan) in [#5788](https://github.com/PrefectHQ/fastmcp/pull/5788)
* Share strict skill snapshot projection by [@zzstoatzz](https://github.com/zzstoatzz) in [#6089](https://github.com/PrefectHQ/fastmcp/pull/6089)
* Use scoped local tests and leave full suites to CI by [@zzstoatzz](https://github.com/zzstoatzz) in [#6094](https://github.com/PrefectHQ/fastmcp/pull/6094)
* Share ClientGroup skill client lookup by [@zzstoatzz](https://github.com/zzstoatzz) in [#6101](https://github.com/PrefectHQ/fastmcp/pull/6101)
* Share filesystem skill supporting-file reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#6102](https://github.com/PrefectHQ/fastmcp/pull/6102)
### Security 🔒
* Verify advertised skill frontmatter when reading content by [@zzstoatzz](https://github.com/zzstoatzz) in [#6090](https://github.com/PrefectHQ/fastmcp/pull/6090)
* Check skill limits before reading directory and remote files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6092](https://github.com/PrefectHQ/fastmcp/pull/6092)
### Fixes 🐞
* Make the version-check InvalidURL regression independent of proxy parsing by [@HootRock](https://github.com/HootRock) in [#6048](https://github.com/PrefectHQ/fastmcp/pull/6048)
* Build the Prefab renderer page on read, not on resources/list by [@adam-zovos](https://github.com/adam-zovos) in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)
* Install mounted skills under their own name in sync_skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#6078](https://github.com/PrefectHQ/fastmcp/pull/6078)
* Stage skill exports before replacing installed files by [@zzstoatzz](https://github.com/zzstoatzz) in [#6091](https://github.com/PrefectHQ/fastmcp/pull/6091)
* fix: Prefix backend hash addresses with double underscores by [@jlowin](https://github.com/jlowin) and [@BlueX888](https://github.com/BlueX888) in [#6100](https://github.com/PrefectHQ/fastmcp/pull/6100)
### Docs 📚
* Consolidate skills docs into one Skills over MCP page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6049](https://github.com/PrefectHQ/fastmcp/pull/6049)
* Rewrite skills docs around Skill and SkillCatalogProvider by [@zzstoatzz](https://github.com/zzstoatzz) in [#6066](https://github.com/PrefectHQ/fastmcp/pull/6066)
* Tighten skills docs examples by [@zzstoatzz](https://github.com/zzstoatzz) in [#6070](https://github.com/PrefectHQ/fastmcp/pull/6070)
* Shorten the skills docs page by [@zzstoatzz](https://github.com/zzstoatzz) in [#6079](https://github.com/PrefectHQ/fastmcp/pull/6079)
* Badge the skills page as 4.2.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6083](https://github.com/PrefectHQ/fastmcp/pull/6083)
* Consolidate skills examples around verified Skill values by [@zzstoatzz](https://github.com/zzstoatzz) in [#6093](https://github.com/PrefectHQ/fastmcp/pull/6093)

## New Contributors
* @fprieto14 made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @keremoktener made their first contribution in [#6077](https://github.com/PrefectHQ/fastmcp/pull/6077)
* @adam-zovos made their first contribution in [#6039](https://github.com/PrefectHQ/fastmcp/pull/6039)

**Full Changelog**: [v4.1.4...v4.2.0a1](https://github.com/PrefectHQ/fastmcp/compare/v4.1.4...v4.2.0a1)

</Update>

<Update label="v4.1.4" description="2026-10-26">

**[v4.1.4: Token Gesture](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.4)**

Generated CLIs now preserve remote transports, empty arrays, and parameters whose names collide with their own helpers; mounted servers honor session visibility and `mounted_components_raise_on_load_error`, a stale client context no longer closes a newer session, and OAuth provider wrappers accept identity assertions. Tasks accept a redis-py credential provider that returns current credentials for each new connection (streaming providers such as redis-entraid's are rejected until Docket can refresh them safely), Redis 8.1.0 is excluded, and custom `KeyringStore` users must now install `py-key-value-aio[keyring]` explicitly. Thanks to our 16 contributors, including 9 first-time contributors.

### Enhancements ✨
* Add server authoring guidance through the docs site by [@zzstoatzz](https://github.com/zzstoatzz) in [#5703](https://github.com/PrefectHQ/fastmcp/pull/5703)
* Support rotating Redis credentials for tasks by [@zzstoatzz](https://github.com/zzstoatzz) and [@nazarii-plebanskyi-rf](https://github.com/nazarii-plebanskyi-rf) in [#5970](https://github.com/PrefectHQ/fastmcp/pull/5970)
* fix(client): forward max_sse_event_size through StreamableHttpTransport by [@PrathmeshPawar2110](https://github.com/PrathmeshPawar2110) in [#6016](https://github.com/PrefectHQ/fastmcp/pull/6016)
* Add a downstream smoke for Redis credential providers by [@zzstoatzz](https://github.com/zzstoatzz) in [#6044](https://github.com/PrefectHQ/fastmcp/pull/6044)
### Security 🔒
* Bump certifi to 2026.10.19 by [@jakekaplan](https://github.com/jakekaplan) in [#5989](https://github.com/PrefectHQ/fastmcp/pull/5989)
* Let configured proxy headers replace forwarded ones regardless of case by [@leopranzl](https://github.com/leopranzl) in [#5972](https://github.com/PrefectHQ/fastmcp/pull/5972)
### Fixes 🐞
* Fix maintained skill discovery on the docs site by [@zzstoatzz](https://github.com/zzstoatzz) in [#5954](https://github.com/PrefectHQ/fastmcp/pull/5954)
* Publish regular skill files for Mintlify discovery by [@zzstoatzz](https://github.com/zzstoatzz) in [#5956](https://github.com/PrefectHQ/fastmcp/pull/5956)
* Serialize HTTP and SSE transports in generate-cli by [@asasemahmed](https://github.com/asasemahmed) in [#5891](https://github.com/PrefectHQ/fastmcp/pull/5891)
* fix(cli): preserve empty arrays in generated commands by [@dailyun](https://github.com/dailyun) in [#5961](https://github.com/PrefectHQ/fastmcp/pull/5961)
* Fix session visibility lookups through mounted servers by [@HootRock](https://github.com/HootRock) and [@leopranzl](https://github.com/leopranzl) in [#5966](https://github.com/PrefectHQ/fastmcp/pull/5966)
* Fix generated CLI JSON parameter name collisions by [@Vittuu](https://github.com/Vittuu) in [#5959](https://github.com/PrefectHQ/fastmcp/pull/5959)
* Escape server text in the fastmcp call elicitation prompt by [@asasemahmed](https://github.com/asasemahmed) in [#5909](https://github.com/PrefectHQ/fastmcp/pull/5909)
* Map common audio extensions when Audio is given a path by [@asasemahmed](https://github.com/asasemahmed) in [#5919](https://github.com/PrefectHQ/fastmcp/pull/5919)
* Drop clamped log records the logger is not enabled for by [@asasemahmed](https://github.com/asasemahmed) in [#5915](https://github.com/PrefectHQ/fastmcp/pull/5915)
* Omit the output schema when an OpenAPI success response has no body by [@asasemahmed](https://github.com/asasemahmed) in [#5913](https://github.com/PrefectHQ/fastmcp/pull/5913)
* Create the MCP config file on install when it is missing or empty by [@asasemahmed](https://github.com/asasemahmed) in [#5887](https://github.com/PrefectHQ/fastmcp/pull/5887)
* Preserve credential providers when cloning task extensions by [@zzstoatzz](https://github.com/zzstoatzz) and [@nazarii-plebanskyi-rf](https://github.com/nazarii-plebanskyi-rf) in [#5984](https://github.com/PrefectHQ/fastmcp/pull/5984)
* Exclude Redis 8.1.0 to preserve task reconnection by [@zzstoatzz](https://github.com/zzstoatzz) and [@nazarii-plebanskyi-rf](https://github.com/nazarii-plebanskyi-rf) in [#5985](https://github.com/PrefectHQ/fastmcp/pull/5985)
* Remove unused keyring dependency by [@zzstoatzz](https://github.com/zzstoatzz) and [@tom42-otera](https://github.com/tom42-otera) in [#5987](https://github.com/PrefectHQ/fastmcp/pull/5987)
* Fix static checks broken by ty 0.0.89 and pydantic 2.14 by [@zzstoatzz](https://github.com/zzstoatzz) in [#6001](https://github.com/PrefectHQ/fastmcp/pull/6001)
* Run dev inspector servers over stdio and stop mapping the deployment port to the proxy by [@asasemahmed](https://github.com/asasemahmed) in [#6029](https://github.com/PrefectHQ/fastmcp/pull/6029)
* fix(json-schema): apply a Draft-4 boolean exclusive bound to its sibling by [@kbkb628](https://github.com/kbkb628) in [#5234](https://github.com/PrefectHQ/fastmcp/pull/5234)
* Strip a URL scheme from a Clerk domain by [@asasemahmed](https://github.com/asasemahmed) in [#5921](https://github.com/PrefectHQ/fastmcp/pull/5921)
* Fix generate-cli commands for tools with a json parameter by [@andreivince](https://github.com/andreivince) in [#6032](https://github.com/PrefectHQ/fastmcp/pull/6032)
* Honor mounted_components_raise_on_load_error in AggregateProvider by [@asasemahmed](https://github.com/asasemahmed) in [#6026](https://github.com/PrefectHQ/fastmcp/pull/6026)
* Reject streaming credential providers in TasksExtension by [@zzstoatzz](https://github.com/zzstoatzz) in [#6043](https://github.com/PrefectHQ/fastmcp/pull/6043)
* fix(client): keep stale contexts from closing newer sessions by [@mikamikasuki](https://github.com/mikamikasuki) in [#6018](https://github.com/PrefectHQ/fastmcp/pull/6018)
* fix(auth): expose identity assertions on OAuth provider wrappers by [@computeaholic](https://github.com/computeaholic) and [@jonaseck2](https://github.com/jonaseck2) in [#6006](https://github.com/PrefectHQ/fastmcp/pull/6006)
* Measure blocking duration with perf_counter in transform_fn generator test by [@Lokeshrao69](https://github.com/Lokeshrao69) in [#6014](https://github.com/PrefectHQ/fastmcp/pull/6014)
### Docs 📚
* Clarify request state across mounted servers by [@HootRock](https://github.com/HootRock) and [@leopranzl](https://github.com/leopranzl) in [#5967](https://github.com/PrefectHQ/fastmcp/pull/5967)
* Pass mcp_path through the remote OAuth custom routes example by [@asasemahmed](https://github.com/asasemahmed) in [#5925](https://github.com/PrefectHQ/fastmcp/pull/5925)

## New Contributors
* @dailyun made their first contribution in [#5961](https://github.com/PrefectHQ/fastmcp/pull/5961)
* @Vittuu made their first contribution in [#5959](https://github.com/PrefectHQ/fastmcp/pull/5959)
* @leopranzl made their first contribution in [#5966](https://github.com/PrefectHQ/fastmcp/pull/5966)
* @nazarii-plebanskyi-rf made their first contribution in [#5970](https://github.com/PrefectHQ/fastmcp/pull/5970)
* @tom42-otera made their first contribution in [#5987](https://github.com/PrefectHQ/fastmcp/pull/5987)
* @computeaholic made their first contribution in [#6006](https://github.com/PrefectHQ/fastmcp/pull/6006)
* @jonaseck2 made their first contribution in [#6006](https://github.com/PrefectHQ/fastmcp/pull/6006)
* @PrathmeshPawar2110 made their first contribution in [#6016](https://github.com/PrefectHQ/fastmcp/pull/6016)
* @Lokeshrao69 made their first contribution in [#6014](https://github.com/PrefectHQ/fastmcp/pull/6014)

**Full Changelog**: [v4.1.3...v4.1.4](https://github.com/PrefectHQ/fastmcp/compare/v4.1.3...v4.1.4)

</Update>

<Update label="v4.1.3" description="2026-10-20">

**[v4.1.3: Root Awakening](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.3)**

This release updates certifi-backed dependencies following the eMudhra CA compromise and fixes public-client OAuth authentication, empty visibility selections, generator transforms, and per-server timeouts for ordinary requests. FastMCP 4 uses system trust by default: follow the [security notice](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026) to update operating-system, container, custom, and installer trust stores; upgrading FastMCP alone is insufficient. Thanks to our 11 contributors, including 6 first-time contributors.

### Security 🔒
* Require certifi 2026.10.19 or later for certifi-backed server dependencies and optional SDK integrations, and document system, custom, and installer trust-store updates by [@zzstoatzz](https://github.com/zzstoatzz) in [#5945](https://github.com/PrefectHQ/fastmcp/pull/5945).
### Enhancements ✨
* Chart public backlog counts and closure outcomes by [@zzstoatzz](https://github.com/zzstoatzz) in [#5942](https://github.com/PrefectHQ/fastmcp/pull/5942)
### Fixes 🐞
* Default the upstream token auth method to none without a client secret by [@asasemahmed](https://github.com/asasemahmed) in [#5879](https://github.com/PrefectHQ/fastmcp/pull/5879)
* fix: preserve empty session visibility selections by [@himanshuchawla0807-gif](https://github.com/himanshuchawla0807-gif) in [#5944](https://github.com/PrefectHQ/fastmcp/pull/5944)
* test(mount): make unreachable proxy failures deterministic by [@CharlesYXW](https://github.com/CharlesYXW) and [@ch-z-hc](https://github.com/ch-z-hc) in [#5584](https://github.com/PrefectHQ/fastmcp/pull/5584)
* fix(tools): materialize generator transform_fn results in TransformedTool.run by [@BlueX888](https://github.com/BlueX888) and [@nandanadileep](https://github.com/nandanadileep) in [#5672](https://github.com/PrefectHQ/fastmcp/pull/5672)
* Honor per-server MCP config timeouts by [@atty57](https://github.com/atty57), [@phnmn](https://github.com/phnmn), and [@CRYPTONIKAV](https://github.com/CRYPTONIKAV) in [#5758](https://github.com/PrefectHQ/fastmcp/pull/5758)
* fix: don't classify a tool body's own TimeoutError as the tool timeout by [@Wilson0511](https://github.com/Wilson0511) in [#5940](https://github.com/PrefectHQ/fastmcp/pull/5940)

## New Contributors
* @phnmn made their first contribution in [#5758](https://github.com/PrefectHQ/fastmcp/pull/5758)
* @CRYPTONIKAV made their first contribution in [#5758](https://github.com/PrefectHQ/fastmcp/pull/5758)
* @himanshuchawla0807-gif made their first contribution in [#5944](https://github.com/PrefectHQ/fastmcp/pull/5944)
* @CharlesYXW made their first contribution in [#5584](https://github.com/PrefectHQ/fastmcp/pull/5584)
* @atty57 made their first contribution in [#5758](https://github.com/PrefectHQ/fastmcp/pull/5758)
* @Wilson0511 made their first contribution in [#5940](https://github.com/PrefectHQ/fastmcp/pull/5940)

**Full Changelog**: [v4.1.2...v4.1.3](https://github.com/PrefectHQ/fastmcp/compare/v4.1.2...v4.1.3)

</Update>

<Update label="v4.1.2" description="2026-10-20">

**[v4.1.2: License to Deny](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.2)**

Component authorization now applies after transforms, denied resources cannot fall through matching templates, and OAuth client credentials providers support issuer binding across fresh and cached-token flows. Existing configurations remain compatible, but users of `ClientCredentialsOAuthProvider` or `PrivateKeyJWTOAuthProvider` must set `issuer` to enable this protection; upgrading alone is insufficient. Thanks to our 18 contributors, including 9 first-time contributors.

### Security 🔒
* Authorize transformed components and prevent denied-resource template fallback by [@zzstoatzz](https://github.com/zzstoatzz) and [@rishid](https://github.com/rishid) in [#5933](https://github.com/PrefectHQ/fastmcp/pull/5933)
* Bind OAuth client credentials to a configured issuer, including cached-token renewal, by [@zzstoatzz](https://github.com/zzstoatzz) and [@LHMisme420](https://github.com/LHMisme420) in [#5933](https://github.com/PrefectHQ/fastmcp/pull/5933)
### Enhancements ✨
* Add SEP-2640 Skills extension foundation by [@strawgate](https://github.com/strawgate) in [#5057](https://github.com/PrefectHQ/fastmcp/pull/5057)
* Write down triage and merge norms in docs/development by [@zzstoatzz](https://github.com/zzstoatzz) in [#5872](https://github.com/PrefectHQ/fastmcp/pull/5872)
* Add experimental Skills discovery to SkillsDirectoryProvider by [@zzstoatzz](https://github.com/zzstoatzz) in [#5704](https://github.com/PrefectHQ/fastmcp/pull/5704)
### Fixes 🐞
* Do not require websockets for the OAuth callback server by [@asasemahmed](https://github.com/asasemahmed) in [#5693](https://github.com/PrefectHQ/fastmcp/pull/5693)
* Keep fastmcp.json resolvable when deployment.cwd changes the working directory by [@asasemahmed](https://github.com/asasemahmed) in [#5700](https://github.com/PrefectHQ/fastmcp/pull/5700)
* Fix ctx.log() failing when extra contains LogRecord attribute names by [@asasemahmed](https://github.com/asasemahmed) in [#5688](https://github.com/PrefectHQ/fastmcp/pull/5688)
* Use a monotonic clock in the rate limiters by [@asasemahmed](https://github.com/asasemahmed) in [#5689](https://github.com/PrefectHQ/fastmcp/pull/5689)
* Escape server metadata in the fastmcp inspect text summary by [@asasemahmed](https://github.com/asasemahmed) in [#5701](https://github.com/PrefectHQ/fastmcp/pull/5701)
* Respect an explicit is_binary=False on FileResource by [@asasemahmed](https://github.com/asasemahmed) in [#5696](https://github.com/PrefectHQ/fastmcp/pull/5696)
* Follow pagination in the MCP format of fastmcp inspect by [@asasemahmed](https://github.com/asasemahmed) in [#5691](https://github.com/PrefectHQ/fastmcp/pull/5691)
* Visit each reference once when finding access-restricted properties by [@AarnavNoble](https://github.com/AarnavNoble) in [#5751](https://github.com/PrefectHQ/fastmcp/pull/5751)
* Run sync resource templates in the threadpool by [@hardness1020](https://github.com/hardness1020) in [#5742](https://github.com/PrefectHQ/fastmcp/pull/5742)
* Require openapi-pydantic 0.6.0 so OpenAPI 3.1.2 specs load by [@jsphbtst](https://github.com/jsphbtst) in [#5647](https://github.com/PrefectHQ/fastmcp/pull/5647)
* Scope FileUpload and session visibility to a stable client on MCP 2026-07-28 by [@zzstoatzz](https://github.com/zzstoatzz) in [#5651](https://github.com/PrefectHQ/fastmcp/pull/5651)
* fix(auth): accept private_key_jwt without form client_id by [@HootRock](https://github.com/HootRock) and [@imranq2](https://github.com/imranq2) in [#5832](https://github.com/PrefectHQ/fastmcp/pull/5832)
* fix(cli): honor explicit URL transport by [@mikamikasuki](https://github.com/mikamikasuki) in [#5529](https://github.com/PrefectHQ/fastmcp/pull/5529)
* Remove legacy logging state when HTTP sessions close by [@mikamikasuki](https://github.com/mikamikasuki) in [#5539](https://github.com/PrefectHQ/fastmcp/pull/5539)
* Name data-backed File resources consistently with their MIME subtype by [@nandanadileep](https://github.com/nandanadileep) in [#5568](https://github.com/PrefectHQ/fastmcp/pull/5568)
* fix(client): run Python stdio children in UTF-8 mode by [@ningmao-hlyz](https://github.com/ningmao-hlyz) in [#5642](https://github.com/PrefectHQ/fastmcp/pull/5642)
* Report an unbindable OAuth callback port instead of SystemExit by [@asasemahmed](https://github.com/asasemahmed) in [#5692](https://github.com/PrefectHQ/fastmcp/pull/5692)
* Accept ES256 and other RSA/EC algorithms for CIMD private_key_jwt assertions by [@asasemahmed](https://github.com/asasemahmed) in [#5695](https://github.com/PrefectHQ/fastmcp/pull/5695)
* Preserve icons on transformed tools by [@asasemahmed](https://github.com/asasemahmed) in [#5702](https://github.com/PrefectHQ/fastmcp/pull/5702)
* Hydrate valid schema defaults while preserving invalid defaults by [@nandanadileep](https://github.com/nandanadileep) in [#5738](https://github.com/PrefectHQ/fastmcp/pull/5738)
* fix(resources): preserve public metadata in built-in read contents by [@HootRock](https://github.com/HootRock) in [#5778](https://github.com/PrefectHQ/fastmcp/pull/5778)
* Preserve shared dependency scopes without optional task dependencies by [@HootRock](https://github.com/HootRock) and [@BlueX888](https://github.com/BlueX888) in [#5817](https://github.com/PrefectHQ/fastmcp/pull/5817)
* fix: treat non-string skill frontmatter descriptions as absent by [@BlueX888](https://github.com/BlueX888) in [#5823](https://github.com/PrefectHQ/fastmcp/pull/5823)
* fix(resources): preserve component meta for list[ResourceContent] returns by [@BlueX888](https://github.com/BlueX888) in [#5843](https://github.com/PrefectHQ/fastmcp/pull/5843)
* Fall back to the client timeout when resolving claimed results by [@marcinbelczewski](https://github.com/marcinbelczewski) in [#5190](https://github.com/PrefectHQ/fastmcp/pull/5190)
* Discover Goose Streamable HTTP extensions by [@jiuyueQ](https://github.com/jiuyueQ) and [@ch-z-hc](https://github.com/ch-z-hc) in [#5582](https://github.com/PrefectHQ/fastmcp/pull/5582)
* Raise ToolError when a tool with an output schema returns an unserializable value by [@massimiliano1991](https://github.com/massimiliano1991) in [#5063](https://github.com/PrefectHQ/fastmcp/pull/5063)
* Stop deploy tests from spawning PowerShell on every state access by [@zzstoatzz](https://github.com/zzstoatzz) in [#5874](https://github.com/PrefectHQ/fastmcp/pull/5874)
* Give the timeout-override test headroom for the follow-up tools/list by [@zzstoatzz](https://github.com/zzstoatzz) in [#5875](https://github.com/PrefectHQ/fastmcp/pull/5875)
* Keep disabled resources from being served by matching templates by [@zzstoatzz](https://github.com/zzstoatzz) in [#5876](https://github.com/PrefectHQ/fastmcp/pull/5876)
### Docs 📚
* Fix codespell typo in v4.1.1 changelog by [@zzstoatzz](https://github.com/zzstoatzz) in [#5818](https://github.com/PrefectHQ/fastmcp/pull/5818)
* context: stop documenting session_id as a cross-request key by [@zzstoatzz](https://github.com/zzstoatzz) in [#5862](https://github.com/PrefectHQ/fastmcp/pull/5862)
### Examples & Contrib 💡
* fix(contrib): preserve BulkToolCaller tool prefixes by [@mikamikasuki](https://github.com/mikamikasuki) in [#5555](https://github.com/PrefectHQ/fastmcp/pull/5555)
### Other Changes 🦾
* chore(deps): Update github actions by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/5707

## New Contributors
* @AarnavNoble made their first contribution in [#5751](https://github.com/PrefectHQ/fastmcp/pull/5751)
* @hardness1020 made their first contribution in [#5742](https://github.com/PrefectHQ/fastmcp/pull/5742)
* @jsphbtst made their first contribution in [#5647](https://github.com/PrefectHQ/fastmcp/pull/5647)
* @marcinbelczewski made their first contribution in [#5190](https://github.com/PrefectHQ/fastmcp/pull/5190)
* @jiuyueQ made their first contribution in [#5582](https://github.com/PrefectHQ/fastmcp/pull/5582)
* @massimiliano1991 made their first contribution in [#5063](https://github.com/PrefectHQ/fastmcp/pull/5063)

* @imranq2 made their first contribution in [#5832](https://github.com/PrefectHQ/fastmcp/pull/5832)
* @rishid made their first contribution in [#5933](https://github.com/PrefectHQ/fastmcp/pull/5933)
* @LHMisme420 made their first contribution in [#5933](https://github.com/PrefectHQ/fastmcp/pull/5933)

**Full Changelog**: [v4.1.1...v4.1.2](https://github.com/PrefectHQ/fastmcp/compare/v4.1.1...v4.1.2)

</Update>

<Update label="v4.1.1" description="2026-10-17">

**[v4.1.1: Regex Marks the Spot](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.1)**

Regex tool search now rejects patterns over 1,000 characters and stops after about a second, and `SkillsDirectoryProvider` discovers skill folders that are links again, including links to folders outside the skills root; a skill's own files must still resolve inside the folder it links to. All 4.x users are encouraged to upgrade. Thanks to our 4 contributors, including 1 first-time contributor.

### Security 🔒
* Keep linked skill folders discoverable by [@zzstoatzz](https://github.com/zzstoatzz) in [#5766](https://github.com/PrefectHQ/fastmcp/pull/5766)
* Bound regex tool search by pattern length and time by [@zzstoatzz](https://github.com/zzstoatzz) and [@SAYUTIM](https://github.com/SAYUTIM) in [#5771](https://github.com/PrefectHQ/fastmcp/pull/5771)
### Fixes 🐞
* Keep an unparsable proxy setting from aborting the update check by [@zzstoatzz](https://github.com/zzstoatzz) and [@ker2xu](https://github.com/ker2xu) in [#5639](https://github.com/PrefectHQ/fastmcp/pull/5639)
* Keep the JWKS refresh lock clear of subclass attributes by [@zzstoatzz](https://github.com/zzstoatzz) in [#5770](https://github.com/PrefectHQ/fastmcp/pull/5770)
### Examples & Contrib 💡
* fix: convert version query param to VersionSpec in component manager routes by [@BlueX888](https://github.com/BlueX888) in [#5575](https://github.com/PrefectHQ/fastmcp/pull/5575)


## New Contributors
* @ker2xu made their first contribution in [#5639](https://github.com/PrefectHQ/fastmcp/pull/5639)

**Full Changelog**: [v4.1.0...v4.1.1](https://github.com/PrefectHQ/fastmcp/compare/v4.1.0...v4.1.1)

</Update>

<Update label="v4.1.0" description="2026-10-08">

**[v4.1.0: Fourth and One](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.0)**

FastMCP 4.1.0 is a maintenance release at heart: a broad sweep of fixes across OpenAPI, proxies, auth, tasks, and the CLI, plus full Python 3.15 support. It doesn't change how most servers behave. A few security fixes do tighten inputs that FastMCP previously accepted, though, and our versioning policy keeps breaking changes out of patch releases, so this ships as a point-one release.

Check these before upgrading:

- **MultiAuth** now qualifies client IDs by source, so existing MultiAuth sessions and tasks start new ownership scopes. Finish pending tasks before upgrading.
- **Regex tool search** uses Pydantic's regex engine, which doesn't support lookarounds or backreferences.
- **Skill files** must resolve inside their configured directories.
- **OpenAPI path parameters** reject `.` and `..` segments.
- **HTTP sessions** now expire after the MCP SDK's 30-minute idle default instead of never.
- **CodeMode** requires Monty 1.1, which renames `max_duration_secs` to `max_feed_duration_secs`.

Thanks to our 48 contributors, including 21 first-time contributors!

### Breaking Changes ⚠️
* fix(http): preserve the SDK's default session idle timeout by [@asts-top](https://github.com/asts-top) in [#5229](https://github.com/PrefectHQ/fastmcp/pull/5229)
* Restore full Python 3.15 support by [@Kludex](https://github.com/Kludex) in [#5558](https://github.com/PrefectHQ/fastmcp/pull/5558)
### Enhancements ✨
* enhancement: Configure token introspection audiences by [@jlowin](https://github.com/jlowin) and [@sajdakabir](https://github.com/sajdakabir) in [#5461](https://github.com/PrefectHQ/fastmcp/pull/5461)
* fix: Make proxy HTTP header forwarding configurable by [@jlowin](https://github.com/jlowin) in [#5462](https://github.com/PrefectHQ/fastmcp/pull/5462)
* enhancement: Configure upload retention in memory by [@jlowin](https://github.com/jlowin) and [@warlocksmurf](https://github.com/warlocksmurf) in [#5463](https://github.com/PrefectHQ/fastmcp/pull/5463)
* Clarify maintainer review decisions by [@jlowin](https://github.com/jlowin) in [#5466](https://github.com/PrefectHQ/fastmcp/pull/5466)
* feat: persist encrypted CLI OAuth tokens by [@andreivince](https://github.com/andreivince) in [#5405](https://github.com/PrefectHQ/fastmcp/pull/5405)
* feat(auth): add TokenCache support to GoogleTokenVerifier and GoogleProvider by [@jerive](https://github.com/jerive) in [#5366](https://github.com/PrefectHQ/fastmcp/pull/5366)
* Add gitleaks secret scanning to prek by [@strawgate](https://github.com/strawgate) in [#5355](https://github.com/PrefectHQ/fastmcp/pull/5355)
* Keep review design decisions with maintainers by [@jlowin](https://github.com/jlowin) in [#5468](https://github.com/PrefectHQ/fastmcp/pull/5468)
### Security 🔒
* fix!: Qualify MultiAuth client identities by [@jlowin](https://github.com/jlowin) in [#5455](https://github.com/PrefectHQ/fastmcp/pull/5455)
* fix!: Validate OpenAPI path parameter segments by [@jlowin](https://github.com/jlowin) in [#5457](https://github.com/PrefectHQ/fastmcp/pull/5457)
* fix!: Resolve skill files within their configured directories by [@jlowin](https://github.com/jlowin) and [@GEONWOOHAN](https://github.com/GEONWOOHAN) in [#5459](https://github.com/PrefectHQ/fastmcp/pull/5459)
* fix!: Use Pydantic’s regex engine for tool search by [@jlowin](https://github.com/jlowin) in [#5467](https://github.com/PrefectHQ/fastmcp/pull/5467)
### Fixes 🐞
* fix: Share JWKS refreshes across key lookups by [@jlowin](https://github.com/jlowin) in [#5456](https://github.com/PrefectHQ/fastmcp/pull/5456)
* fix: Reuse shared OpenAPI composition members by [@jlowin](https://github.com/jlowin) in [#5460](https://github.com/PrefectHQ/fastmcp/pull/5460)
* Resolve app tool names against the transformed catalog by [@jlowin](https://github.com/jlowin) in [#5464](https://github.com/PrefectHQ/fastmcp/pull/5464)
* fix: keep generator iteration inside dependency lifetime by [@mikamikasuki](https://github.com/mikamikasuki) in [#5438](https://github.com/PrefectHQ/fastmcp/pull/5438)
* fix(tools): consume synchronous generators within dispatched invocation by [@HootRock](https://github.com/HootRock) in [#5376](https://github.com/PrefectHQ/fastmcp/pull/5376)
* fix(tools): reject results returned after timeout deadlines by [@HootRock](https://github.com/HootRock) in [#5379](https://github.com/PrefectHQ/fastmcp/pull/5379)
* Fix #5368: Tool.from_tool: a transform_fn that declares ctx: Context fails on eve by [@nandanadileep](https://github.com/nandanadileep) and [@chrikrah](https://github.com/chrikrah) in [#5371](https://github.com/PrefectHQ/fastmcp/pull/5371)
* fix(auth): preserve AuthKit issuer identity by [@mikamikasuki](https://github.com/mikamikasuki) and [@paddynatte](https://github.com/paddynatte) in [#5452](https://github.com/PrefectHQ/fastmcp/pull/5452)
* fix(auth): advertise resource_metadata only when a route serves it by [@alex-feel](https://github.com/alex-feel) in [#5363](https://github.com/PrefectHQ/fastmcp/pull/5363)
* fix: decode escaped JSON Pointer tokens during hydration by [@HuaTNA](https://github.com/HuaTNA) in [#5407](https://github.com/PrefectHQ/fastmcp/pull/5407)
* fix: read MCP config files as UTF-8 in the install commands by [@ch-z-hc](https://github.com/ch-z-hc) in [#5359](https://github.com/PrefectHQ/fastmcp/pull/5359)
* Add regression coverage for root-context schema caching by [@hulkbig](https://github.com/hulkbig) in [#5397](https://github.com/PrefectHQ/fastmcp/pull/5397)
* Keep the original cause when ErrorHandlingMiddleware re-raises an error unchanged by [@asasemahmed](https://github.com/asasemahmed) in [#5344](https://github.com/PrefectHQ/fastmcp/pull/5344)
* Resolve ASGIServer.http_client relative URLs against the server origin by [@asasemahmed](https://github.com/asasemahmed) in [#5341](https://github.com/PrefectHQ/fastmcp/pull/5341)
* Raise startup failures from run_server_async instead of hanging by [@asasemahmed](https://github.com/asasemahmed) in [#5340](https://github.com/PrefectHQ/fastmcp/pull/5340)
* Restrict Windows CLI state access without requiring SeSecurityPrivilege by [@asasemahmed](https://github.com/asasemahmed) in [#5312](https://github.com/PrefectHQ/fastmcp/pull/5312)
* Advertise the same list_changed capabilities over stdio as other transports by [@asasemahmed](https://github.com/asasemahmed) in [#5311](https://github.com/PrefectHQ/fastmcp/pull/5311)
* Validate responses to dict and nested-list elicitation choices by [@asasemahmed](https://github.com/asasemahmed) in [#5343](https://github.com/PrefectHQ/fastmcp/pull/5343)
* Inline enums shared by several fields in elicitation schemas by [@asasemahmed](https://github.com/asasemahmed) in [#5342](https://github.com/PrefectHQ/fastmcp/pull/5342)
* Honor the SDK ElicitResult returned by an elicitation handler by [@asasemahmed](https://github.com/asasemahmed) in [#5339](https://github.com/PrefectHQ/fastmcp/pull/5339)
* Look up call_tool output schemas across all tools/list pages by [@asasemahmed](https://github.com/asasemahmed) in [#5338](https://github.com/PrefectHQ/fastmcp/pull/5338)
* Deduplicate versions in PromptsAsTools and ResourcesAsTools list tools by [@asasemahmed](https://github.com/asasemahmed) in [#5331](https://github.com/PrefectHQ/fastmcp/pull/5331)
* Map File text formats to canonical text MIME types by [@asasemahmed](https://github.com/asasemahmed) in [#5334](https://github.com/PrefectHQ/fastmcp/pull/5334)
* Keep generated OpenAPI component names unique when a suffixed name is taken by [@asasemahmed](https://github.com/asasemahmed) in [#5337](https://github.com/PrefectHQ/fastmcp/pull/5337)
* Keep is_error when ResponseLimitingMiddleware truncates a result by [@asasemahmed](https://github.com/asasemahmed) in [#5309](https://github.com/PrefectHQ/fastmcp/pull/5309)
* Read +json OpenAPI resource responses as JSON text by [@asasemahmed](https://github.com/asasemahmed) in [#5310](https://github.com/PrefectHQ/fastmcp/pull/5310)
* Preserve provider challenge defaults through MultiAuth by [@taylorwilsdon](https://github.com/taylorwilsdon) in [#5454](https://github.com/PrefectHQ/fastmcp/pull/5454)
* Write generate-cli output as UTF-8 by [@asasemahmed](https://github.com/asasemahmed) and [@ch-z-hc](https://github.com/ch-z-hc) in [#5335](https://github.com/PrefectHQ/fastmcp/pull/5335)
* Strip internal visibility meta from prompt results and static resources by [@asasemahmed](https://github.com/asasemahmed) in [#5330](https://github.com/PrefectHQ/fastmcp/pull/5330)
* Register browser OAuth clients as public clients by [@goran-revops](https://github.com/goran-revops) in [#5231](https://github.com/PrefectHQ/fastmcp/pull/5231)
* fix(client): preserve unique JSON arrays by [@lzyruc](https://github.com/lzyruc) in [#5270](https://github.com/PrefectHQ/fastmcp/pull/5270)
* Keep filesystem reloads serialized during cancellation by [@sherxlg-gif](https://github.com/sherxlg-gif) in [#5184](https://github.com/PrefectHQ/fastmcp/pull/5184)
* Treat upstream HTTP errors from OpenAPI tools as HTTP status errors by [@asasemahmed](https://github.com/asasemahmed) in [#5308](https://github.com/PrefectHQ/fastmcp/pull/5308)
* chore(ty): pin the checked platform to the one CI uses (#5302) by [@sclfcz](https://github.com/sclfcz) in [#5303](https://github.com/PrefectHQ/fastmcp/pull/5303)
* fix(tools): take partial tool names and docstrings from the wrapped function by [@BlueX888](https://github.com/BlueX888) and [@Ares16x16](https://github.com/Ares16x16) in [#5269](https://github.com/PrefectHQ/fastmcp/pull/5269)
* fix(tools): keep structured content for object schemas without explicit type by [@BlueX888](https://github.com/BlueX888) in [#5271](https://github.com/PrefectHQ/fastmcp/pull/5271)
* fix: return current tool schemas from cached BM25 searches by [@baba9811](https://github.com/baba9811) in [#5153](https://github.com/PrefectHQ/fastmcp/pull/5153)
* fix(azure): send prompt=select_account to Entra instead of the consent URL by [@mayankkumar-cmd](https://github.com/mayankkumar-cmd) in [#5162](https://github.com/PrefectHQ/fastmcp/pull/5162)
* fix(auth): preserve upstream refresh error semantics by [@77cjj](https://github.com/77cjj) in [#5011](https://github.com/PrefectHQ/fastmcp/pull/5011)
* Clean up run_server_async when startup exits early by [@syf2211](https://github.com/syf2211) and [@asasemahmed](https://github.com/asasemahmed) in [#5469](https://github.com/PrefectHQ/fastmcp/pull/5469)
* Pass resource security policy through FileSystemProvider discovery by [@asasemahmed](https://github.com/asasemahmed) in [#5498](https://github.com/PrefectHQ/fastmcp/pull/5498)
* Forward annotations on proxied resources and resource templates by [@asasemahmed](https://github.com/asasemahmed) in [#5499](https://github.com/PrefectHQ/fastmcp/pull/5499)
* Forward the resources/read result meta through proxies by [@asasemahmed](https://github.com/asasemahmed) in [#5500](https://github.com/PrefectHQ/fastmcp/pull/5500)
* Fix proxy dropping log messages whose data is not a msg/extra dict by [@asasemahmed](https://github.com/asasemahmed) in [#5501](https://github.com/PrefectHQ/fastmcp/pull/5501)
* Forward stop_sequences in the proxy's sampling relay by [@asasemahmed](https://github.com/asasemahmed) in [#5502](https://github.com/PrefectHQ/fastmcp/pull/5502)
* Treat non-Bearer Authorization schemes as missing authentication by [@asasemahmed](https://github.com/asasemahmed) in [#5503](https://github.com/PrefectHQ/fastmcp/pull/5503)
* Reject positional-only parameters in prompts and resource templates by [@asasemahmed](https://github.com/asasemahmed) in [#5505](https://github.com/PrefectHQ/fastmcp/pull/5505)
* Carry domain and prefers_border onto the Prefab renderer resource by [@asasemahmed](https://github.com/asasemahmed) in [#5611](https://github.com/PrefectHQ/fastmcp/pull/5611)
* Keep GenerativeUI CSP on the renderer resource only by [@asasemahmed](https://github.com/asasemahmed) in [#5612](https://github.com/PrefectHQ/fastmcp/pull/5612)
* Keep OpenAPI path segments that contain a colon by [@asasemahmed](https://github.com/asasemahmed) in [#5613](https://github.com/PrefectHQ/fastmcp/pull/5613)
* Print install mcp-json and inspect JSON without Rich wrapping by [@asasemahmed](https://github.com/asasemahmed) in [#5615](https://github.com/PrefectHQ/fastmcp/pull/5615)
* Coerce optional parameters in fastmcp call by their non-null type by [@asasemahmed](https://github.com/asasemahmed) in [#5616](https://github.com/PrefectHQ/fastmcp/pull/5616)
* Return the existing component when an ignored duplicate is added by [@asasemahmed](https://github.com/asasemahmed) in [#5617](https://github.com/PrefectHQ/fastmcp/pull/5617)
* Keep a config client's servers connected when a new() clone connects by [@asasemahmed](https://github.com/asasemahmed) in [#5618](https://github.com/PrefectHQ/fastmcp/pull/5618)
* Strip discriminator under properties named default, const, enum or examples by [@asasemahmed](https://github.com/asasemahmed) in [#5619](https://github.com/PrefectHQ/fastmcp/pull/5619)
* Keep a finished task's status when it is cancelled by [@asasemahmed](https://github.com/asasemahmed) in [#5621](https://github.com/PrefectHQ/fastmcp/pull/5621)
* Forward --skip-source to the uv run subprocess in fastmcp run by [@asasemahmed](https://github.com/asasemahmed) in [#5623](https://github.com/PrefectHQ/fastmcp/pull/5623)
* Send numeric and boolean OpenAPI raw bodies as text by [@asasemahmed](https://github.com/asasemahmed) in [#5624](https://github.com/PrefectHQ/fastmcp/pull/5624)
* Map Anthropic stop_sequence to the MCP stopSequence stop reason by [@asasemahmed](https://github.com/asasemahmed) in [#5625](https://github.com/PrefectHQ/fastmcp/pull/5625)
* Escape the server spec and name in the generate-cli header docstring by [@asasemahmed](https://github.com/asasemahmed) in [#5626](https://github.com/PrefectHQ/fastmcp/pull/5626)
* Fix context docs: request_context.meta is a dict, not an attribute object by [@asasemahmed](https://github.com/asasemahmed) in [#5631](https://github.com/PrefectHQ/fastmcp/pull/5631)
* Validate strict tool input in JSON mode by [@asasemahmed](https://github.com/asasemahmed) in [#5504](https://github.com/PrefectHQ/fastmcp/pull/5504)
* Raise when a required OpenAPI path parameter is missing by [@asasemahmed](https://github.com/asasemahmed) in [#5614](https://github.com/PrefectHQ/fastmcp/pull/5614)
* Omit writeOnly properties from OpenAPI tool output schemas by [@asasemahmed](https://github.com/asasemahmed) in [#5336](https://github.com/PrefectHQ/fastmcp/pull/5336)
* fix(tasks): keep stored arguments alive with the other per-task keys by [@sclfcz](https://github.com/sclfcz) in [#5144](https://github.com/PrefectHQ/fastmcp/pull/5144)
* fix(auth): omit scopes from generic authorization code exchange by [@liang0417](https://github.com/liang0417) and [@kiranthakkar](https://github.com/kiranthakkar) in [#5183](https://github.com/PrefectHQ/fastmcp/pull/5183)
* Reject missing and unexpected arguments at task submission by [@asasemahmed](https://github.com/asasemahmed) in [#5622](https://github.com/PrefectHQ/fastmcp/pull/5622)
* fix(auth): preserve verifier-defined challenge scopes through wrappers by [@mikamikasuki](https://github.com/mikamikasuki) in [#5478](https://github.com/PrefectHQ/fastmcp/pull/5478)
* fix(server): VersionFilter get_tool/get_resource/get_prompt respect include_unversioned=False by [@Ashfaqbs](https://github.com/Ashfaqbs) and [@Purin1410](https://github.com/Purin1410) in [#4949](https://github.com/PrefectHQ/fastmcp/pull/4949)
* Stop asserting that the GitHub remote server lacks structured content by [@jlowin](https://github.com/jlowin) in [#5634](https://github.com/PrefectHQ/fastmcp/pull/5634)
* Skip skills whose SKILL.md is not valid UTF-8 during directory discovery by [@asasemahmed](https://github.com/asasemahmed) in [#5497](https://github.com/PrefectHQ/fastmcp/pull/5497)
* Fix tool body validation errors at the MCP boundary by [@qingshungLI](https://github.com/qingshungLI) and [@alastair](https://github.com/alastair) in [#5485](https://github.com/PrefectHQ/fastmcp/pull/5485)
* Detect client extensions without requiring clientInfo by [@alex-feel](https://github.com/alex-feel) in [#5196](https://github.com/PrefectHQ/fastmcp/pull/5196)
* Propagate child cancellation from gather by [@dennisimoo](https://github.com/dennisimoo) and [@lokesh0186](https://github.com/lokesh0186) in [#5161](https://github.com/PrefectHQ/fastmcp/pull/5161)
* fix(resources): separate URI fragments from query values by [@Harsh23Kashyap](https://github.com/Harsh23Kashyap) in [#5132](https://github.com/PrefectHQ/fastmcp/pull/5132)
* fix: preserve input requests in resource and prompt tools by [@HootRock](https://github.com/HootRock) and [@andreivince](https://github.com/andreivince) in [#5476](https://github.com/PrefectHQ/fastmcp/pull/5476)
* fix(docstrings): don't leak Returns/Raises into description for parameterless functions by [@Ashfaqbs](https://github.com/Ashfaqbs) and [@pvliesdonk](https://github.com/pvliesdonk) in [#5067](https://github.com/PrefectHQ/fastmcp/pull/5067)
* fix(client): hydrate formatted scalars and positional array items by [@FanouZeng-TT](https://github.com/FanouZeng-TT), [@MarcHuang168](https://github.com/MarcHuang168), [@lzyruc](https://github.com/lzyruc), and [@onk3sh](https://github.com/onk3sh) in [#5203](https://github.com/PrefectHQ/fastmcp/pull/5203)
### Docs 📚
* docs: credit contributors in v4.0.11 changelog entries by [@jlowin](https://github.com/jlowin) in [#5449](https://github.com/PrefectHQ/fastmcp/pull/5449)
* Clarify CodeMode execution context by [@jlowin](https://github.com/jlowin) in [#5458](https://github.com/PrefectHQ/fastmcp/pull/5458)
* docs: explain Inspector entrypoint initialization by [@andreivince](https://github.com/andreivince) and [@nick-youngblut](https://github.com/nick-youngblut) in [#5404](https://github.com/PrefectHQ/fastmcp/pull/5404)
* Docs: show post-call inspection of tool text results by [@Amazinghorseli](https://github.com/Amazinghorseli) and [@roli-lpci](https://github.com/roli-lpci) in [#5385](https://github.com/PrefectHQ/fastmcp/pull/5385)
* Document FastMCP Client use cases by [@andreivince](https://github.com/andreivince) in [#5482](https://github.com/PrefectHQ/fastmcp/pull/5482)
* docs: show tests for MCP mounted in FastAPI by [@andreivince](https://github.com/andreivince) and [@DeoLeung](https://github.com/DeoLeung) in [#5471](https://github.com/PrefectHQ/fastmcp/pull/5471)
* Document OpenTelemetry log export by [@andreivince](https://github.com/andreivince) in [#5483](https://github.com/PrefectHQ/fastmcp/pull/5483)
* docs: explain OpenAPI client timeouts by [@andreivince](https://github.com/andreivince) and [@dimitribarbot](https://github.com/dimitribarbot) in [#5470](https://github.com/PrefectHQ/fastmcp/pull/5470)
* Clarify Python projects and Cursor workspaces in install docs by [@andreivince](https://github.com/andreivince) and [@nick-youngblut](https://github.com/nick-youngblut) in [#5475](https://github.com/PrefectHQ/fastmcp/pull/5475)
* Remove comments from fastmcp.json docs examples by [@asasemahmed](https://github.com/asasemahmed) in [#5627](https://github.com/PrefectHQ/fastmcp/pull/5627)
* Fix mcp-json Advanced Configuration example output by [@asasemahmed](https://github.com/asasemahmed) in [#5628](https://github.com/PrefectHQ/fastmcp/pull/5628)
* Remove FASTMCP_SERVER_DEPENDENCIES from the settings reference by [@asasemahmed](https://github.com/asasemahmed) in [#5629](https://github.com/PrefectHQ/fastmcp/pull/5629)
* Fix versioning docs: get_tool takes a VersionSpec and returns None for a missing version by [@asasemahmed](https://github.com/asasemahmed) in [#5630](https://github.com/PrefectHQ/fastmcp/pull/5630)
* Fix authorization docs: AccessToken field types and built-in check count by [@asasemahmed](https://github.com/asasemahmed) in [#5632](https://github.com/PrefectHQ/fastmcp/pull/5632)
### Examples & Contrib 💡
* Don't evaluate properties when registering MCPMixin methods by [@asasemahmed](https://github.com/asasemahmed) in [#5620](https://github.com/PrefectHQ/fastmcp/pull/5620)
### Dependencies 📦
* chore(deps): bump the uv group across 2 directories with 2 updates by @dependabot[bot] in https://github.com/PrefectHQ/fastmcp/pull/5393

## New Contributors
* @mikamikasuki made their first contribution in [#5438](https://github.com/PrefectHQ/fastmcp/pull/5438)
* @HootRock made their first contribution in [#5376](https://github.com/PrefectHQ/fastmcp/pull/5376)
* @alex-feel made their first contribution in [#5363](https://github.com/PrefectHQ/fastmcp/pull/5363)
* @HuaTNA made their first contribution in [#5407](https://github.com/PrefectHQ/fastmcp/pull/5407)
* @andreivince made their first contribution in [#5404](https://github.com/PrefectHQ/fastmcp/pull/5404)
* @ch-z-hc made their first contribution in [#5359](https://github.com/PrefectHQ/fastmcp/pull/5359)
* @Amazinghorseli made their first contribution in [#5385](https://github.com/PrefectHQ/fastmcp/pull/5385)
* @hulkbig made their first contribution in [#5397](https://github.com/PrefectHQ/fastmcp/pull/5397)
* @jerive made their first contribution in [#5366](https://github.com/PrefectHQ/fastmcp/pull/5366)
* @goran-revops made their first contribution in [#5231](https://github.com/PrefectHQ/fastmcp/pull/5231)
* @lzyruc made their first contribution in [#5270](https://github.com/PrefectHQ/fastmcp/pull/5270)
* @sherxlg-gif made their first contribution in [#5184](https://github.com/PrefectHQ/fastmcp/pull/5184)
* @baba9811 made their first contribution in [#5153](https://github.com/PrefectHQ/fastmcp/pull/5153)
* @mayankkumar-cmd made their first contribution in [#5162](https://github.com/PrefectHQ/fastmcp/pull/5162)
* @77cjj made their first contribution in [#5011](https://github.com/PrefectHQ/fastmcp/pull/5011)
* @liang0417 made their first contribution in [#5183](https://github.com/PrefectHQ/fastmcp/pull/5183)
* @Ashfaqbs made their first contribution in [#4949](https://github.com/PrefectHQ/fastmcp/pull/4949)
* @qingshungLI made their first contribution in [#5485](https://github.com/PrefectHQ/fastmcp/pull/5485)
* @dennisimoo made their first contribution in [#5161](https://github.com/PrefectHQ/fastmcp/pull/5161)
* @FanouZeng-TT made their first contribution in [#5203](https://github.com/PrefectHQ/fastmcp/pull/5203)
* @GEONWOOHAN made their first contribution in [#5459](https://github.com/PrefectHQ/fastmcp/pull/5459)

**Full Changelog**: [v4.0.11...v4.1.0](https://github.com/PrefectHQ/fastmcp/compare/v4.0.11...v4.1.0)

</Update>

<Update label="v4.0.11" description="2026-10-04">

**[v4.0.11: Fort Knocks](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.11)**

This release contains important security and bug fixes. All users are encouraged to upgrade. Thanks to our 10 contributors, including 6 first-time contributors.

### Enhancements ✨
* agents: make AGENTS.md the entry point and tighten repo skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#5278](https://github.com/PrefectHQ/fastmcp/pull/5278)
* ci: publish maintenance status and add MAINTAINING.md by [@zzstoatzz](https://github.com/zzstoatzz) in [#5284](https://github.com/PrefectHQ/fastmcp/pull/5284)
* rate_limiting: deprecate a burst_capacity below 1 by [@zzstoatzz](https://github.com/zzstoatzz) and [@sclfcz](https://github.com/sclfcz) in [#5296](https://github.com/PrefectHQ/fastmcp/pull/5296)
* agents: consolidate PR review guidance by [@zzstoatzz](https://github.com/zzstoatzz) in [#5297](https://github.com/PrefectHQ/fastmcp/pull/5297)
* status: unify dashboard and terminal issue ranking by [@zzstoatzz](https://github.com/zzstoatzz) in [#5300](https://github.com/PrefectHQ/fastmcp/pull/5300)
* Enable ruff flake8-bandit (S) rules on the library by [@strawgate](https://github.com/strawgate) in [#5356](https://github.com/PrefectHQ/fastmcp/pull/5356)
* Bundle extensions with providers by [@jlowin](https://github.com/jlowin) in [#5360](https://github.com/PrefectHQ/fastmcp/pull/5360)
* Expand supported Python CI coverage by [@jlowin](https://github.com/jlowin) in [#5391](https://github.com/PrefectHQ/fastmcp/pull/5391)
* docs: credit issue authors in maintainer implementations by [@jlowin](https://github.com/jlowin) in [#5410](https://github.com/PrefectHQ/fastmcp/pull/5410)
* enhancement: scan release notes for shared contributor credit by [@jlowin](https://github.com/jlowin) in [#5433](https://github.com/PrefectHQ/fastmcp/pull/5433)
### Security 🔒
* Pass client CLI arguments literally to Windows .cmd wrappers by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5419](https://github.com/PrefectHQ/fastmcp/pull/5419)
* Build client schema types with create_model and bounded caches by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5413](https://github.com/PrefectHQ/fastmcp/pull/5413)
* Bound schema nesting before client type conversion by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5434](https://github.com/PrefectHQ/fastmcp/pull/5434)
* OpenAPI components send only declared arguments and keep configured headers by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5423](https://github.com/PrefectHQ/fastmcp/pull/5423)
* Use the server's auth provider for component manager routes by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5425](https://github.com/PrefectHQ/fastmcp/pull/5425)
* Apply Host/Origin protection settings to the SSE transport by [@jlowin](https://github.com/jlowin) in [#5427](https://github.com/PrefectHQ/fastmcp/pull/5427)
* Require a startup-URL session for the fastmcp dev apps preview by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5417](https://github.com/PrefectHQ/fastmcp/pull/5417)
* Apply transforms, enabled state, and auth to hashed tool lookups by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5415](https://github.com/PrefectHQ/fastmcp/pull/5415)
* Key cached schema adapters by the normalized schema by [@jlowin](https://github.com/jlowin) in [#5436](https://github.com/PrefectHQ/fastmcp/pull/5436)
* Resolve injected tools through the server's tool lookup by [@jlowin](https://github.com/jlowin) in [#5431](https://github.com/PrefectHQ/fastmcp/pull/5431)
* Keep $ref pointers when inlining would produce an oversized schema by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5421](https://github.com/PrefectHQ/fastmcp/pull/5421)
### Fixes 🐞
* rate_limiting: default burst capacity to at least 1 by [@zzstoatzz](https://github.com/zzstoatzz) and [@Patrick-SCH03](https://github.com/Patrick-SCH03) in [#5293](https://github.com/PrefectHQ/fastmcp/pull/5293)
* types: map Image jpg/svg/tif formats to canonical MIME types by [@zzstoatzz](https://github.com/zzstoatzz) and [@Patrick-SCH03](https://github.com/Patrick-SCH03) in [#5294](https://github.com/PrefectHQ/fastmcp/pull/5294)
* client: decode empty structured content into CallToolResult.data by [@zzstoatzz](https://github.com/zzstoatzz) and [@Patrick-SCH03](https://github.com/Patrick-SCH03) in [#5291](https://github.com/PrefectHQ/fastmcp/pull/5291)
* fix: use portable issue ranking cache filenames by [@zzstoatzz](https://github.com/zzstoatzz) in [#5314](https://github.com/PrefectHQ/fastmcp/pull/5314)
* fix: validate cached version timestamp types by [@Harsh23Kashyap](https://github.com/Harsh23Kashyap) in [#5351](https://github.com/PrefectHQ/fastmcp/pull/5351)
* cli: read MCP and fastmcp.json config files as utf-8 by [@zzstoatzz](https://github.com/zzstoatzz) and [@asasemahmed](https://github.com/asasemahmed) in [#5345](https://github.com/PrefectHQ/fastmcp/pull/5345)
* Support Python 3.15 by [@Kludex](https://github.com/Kludex) in [#5374](https://github.com/PrefectHQ/fastmcp/pull/5374)
* Revert "Support Python 3.15" by [@jlowin](https://github.com/jlowin) in [#5389](https://github.com/PrefectHQ/fastmcp/pull/5389)
* examples: handle malformed media links and concurrent Fire TV setup by [@jlowin](https://github.com/jlowin) in [#5390](https://github.com/PrefectHQ/fastmcp/pull/5390)
* Fix mounted extension runtime tracking by [@jlowin](https://github.com/jlowin) in [#5392](https://github.com/PrefectHQ/fastmcp/pull/5392)
* Fall back to pure Python YAML loader in schema tests by [@jlowin](https://github.com/jlowin) in [#5395](https://github.com/PrefectHQ/fastmcp/pull/5395)
* tools: keep explicit Field(title=...) on parameters in the input schema by [@zzstoatzz](https://github.com/zzstoatzz) and [@TJReinert](https://github.com/TJReinert) in [#5388](https://github.com/PrefectHQ/fastmcp/pull/5388)
* Run Windows tests on code pull requests by [@jlowin](https://github.com/jlowin) in [#5408](https://github.com/PrefectHQ/fastmcp/pull/5408)
* Avoid repeated traversal of shared tool schema definitions by [@jlowin](https://github.com/jlowin) in [#5412](https://github.com/PrefectHQ/fastmcp/pull/5412)
* Keep referenced body fields when a request body schema adds sibling properties by [@jlowin](https://github.com/jlowin) in [#5440](https://github.com/PrefectHQ/fastmcp/pull/5440)
* Require pydocket 0.26.0 so a cancelled task cannot stop the worker by [@jlowin](https://github.com/jlowin) in [#5444](https://github.com/PrefectHQ/fastmcp/pull/5444)
### Docs 📚
* docs: consolidate developer and maintainer guidance by [@zzstoatzz](https://github.com/zzstoatzz) in [#5298](https://github.com/PrefectHQ/fastmcp/pull/5298)
* examples: add interactive media picker MCP app by [@zzstoatzz](https://github.com/zzstoatzz) in [#5281](https://github.com/PrefectHQ/fastmcp/pull/5281)
* docs: route SDK v1 users to the correct upgrade guide by [@aritejhg](https://github.com/aritejhg) in [#5372](https://github.com/PrefectHQ/fastmcp/pull/5372)
* Clarify app visibility and configurable security guarantees by [@jlowin](https://github.com/jlowin) in [#5409](https://github.com/PrefectHQ/fastmcp/pull/5409)
* Clarify declared header parameters in the OpenAPI docs by [@jlowin](https://github.com/jlowin) and [@strawgate](https://github.com/strawgate) in [#5437](https://github.com/PrefectHQ/fastmcp/pull/5437)
* docs: add v4.0.11 changelog entries by [@jlowin](https://github.com/jlowin) in [#5446](https://github.com/PrefectHQ/fastmcp/pull/5446)
### Dependencies 📦
* chore(deps): bump the uv group across 2 directories with 2 updates by @dependabot[bot] in https://github.com/PrefectHQ/fastmcp/pull/5361
### Other Changes 🦾
* chore(deps): Update astral-sh/setup-uv action to v10.2.0 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/5347

## New Contributors
* @Harsh23Kashyap made their first contribution in [#5351](https://github.com/PrefectHQ/fastmcp/pull/5351)
* @aritejhg made their first contribution in [#5372](https://github.com/PrefectHQ/fastmcp/pull/5372)
* @Patrick-SCH03 made their first contribution in [#5291](https://github.com/PrefectHQ/fastmcp/pull/5291)
* @sclfcz made their first contribution in [#5296](https://github.com/PrefectHQ/fastmcp/pull/5296)
* @asasemahmed made their first contribution in [#5345](https://github.com/PrefectHQ/fastmcp/pull/5345)
* @TJReinert made their first contribution in [#5388](https://github.com/PrefectHQ/fastmcp/pull/5388)

**Full Changelog**: [v4.0.10...v4.0.11](https://github.com/PrefectHQ/fastmcp/compare/v4.0.10...v4.0.11)

</Update>

<Update label="v4.0.10" description="2026-09-25">

**[v4.0.10: Inside Job](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.10)**

Task-enabled tools now work behind search transforms and CodeMode: they're registered with the task backend even when hidden, and a tool, resource, or prompt that calls one through `ctx.fastmcp.call_tool()` (including the search `call_tool` proxy and CodeMode's `execute`) now gets its result instead of an empty task receipt.

### Fixes 🐞
* fix(stdio): tolerate a transport whose construction failed in `__del__` by [@kbkb628](https://github.com/kbkb628) in [#5256](https://github.com/PrefectHQ/fastmcp/pull/5256)
* tasks: register task tools hidden by search and CodeMode by [@zzstoatzz](https://github.com/zzstoatzz) in [#5262](https://github.com/PrefectHQ/fastmcp/pull/5262)
* tasks: run tools called from another tool in the foreground by [@zzstoatzz](https://github.com/zzstoatzz) in [#5275](https://github.com/PrefectHQ/fastmcp/pull/5275)
### Docs 📚
* Add Bluesky to docs footer by [@zzstoatzz](https://github.com/zzstoatzz) in [#5274](https://github.com/PrefectHQ/fastmcp/pull/5274)

## New Contributors
* @kbkb628 made their first contribution in [#5256](https://github.com/PrefectHQ/fastmcp/pull/5256)

**Full Changelog**: [v4.0.9...v4.0.10](https://github.com/PrefectHQ/fastmcp/compare/v4.0.9...v4.0.10)

</Update>

<Update label="v4.0.9" description="2026-09-24">

**[v4.0.9: Cache and Release](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.9)**

`ResourceTemplate` now keeps its compiled URI pattern for its own lifetime while the shared cache is bounded again, preventing dynamic proxies from growing process memory without restoring the 4,096-template performance cliff.

### Fixes 🐞
* resources: keep each template's compiled pattern on the template by [@zzstoatzz](https://github.com/zzstoatzz) in [#5253](https://github.com/PrefectHQ/fastmcp/pull/5253)


**Full Changelog**: [v4.0.8...v4.0.9](https://github.com/PrefectHQ/fastmcp/compare/v4.0.8...v4.0.9)

</Update>

<Update label="v4.0.8" description="2026-09-23">

**[v4.0.8: Take Three](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.8)**

Completion goes back to its 4.0.5 behavior. The visibility check added in 4.0.6 and reworked in 4.0.7 simulated list requests through middleware, and in 4.0.7 that could let a response cache serve hidden prompts to other clients. New tests pin both problems, and withholding suggestions for hidden references will return with a proper design. Resource template patterns are now cached without a size limit, so servers with thousands of templates read fast again, and OAuthProxy revokes the upstream refresh token instead of sending its own token upstream.

### Security 🔒
* completions: revert the list-based visibility check (#5240, #5244) by [@zzstoatzz](https://github.com/zzstoatzz) in [#5250](https://github.com/PrefectHQ/fastmcp/pull/5250)
### Fixes 🐞
* Fix OAuthProxy upstream refresh token revocation by [@Ujemny](https://github.com/Ujemny) in [#5243](https://github.com/PrefectHQ/fastmcp/pull/5243)
* resources: keep every compiled template pattern cached by [@zzstoatzz](https://github.com/zzstoatzz) in [#5248](https://github.com/PrefectHQ/fastmcp/pull/5248)

## New Contributors
* @Ujemny made their first contribution in [#5243](https://github.com/PrefectHQ/fastmcp/pull/5243)

**Full Changelog**: [v4.0.7...v4.0.8](https://github.com/PrefectHQ/fastmcp/compare/v4.0.7...v4.0.8)

</Update>

<Update label="v4.0.7" description="2026-09-23">

**[v4.0.7: Double Take](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.7)**

Fixes two regressions from 4.0.6. The completion visibility check runs only the list-specific middleware hooks, so rate limits, logging, and metrics see a single request per completion again. Resource template patterns are cached, which makes template reads faster than in 4.0.5.

### Fixes 🐞
* completions: check reference visibility through typed list hooks only by [@zzstoatzz](https://github.com/zzstoatzz) in [#5244](https://github.com/PrefectHQ/fastmcp/pull/5244)
* resources: cache compiled URI template patterns by [@zzstoatzz](https://github.com/zzstoatzz) in [#5245](https://github.com/PrefectHQ/fastmcp/pull/5245)


**Full Changelog**: [v4.0.6...v4.0.7](https://github.com/PrefectHQ/fastmcp/compare/v4.0.6...v4.0.7)

</Update>

<Update label="v4.0.6" description="2026-09-23">

**[v4.0.6: Comma Chameleon](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.6)**

Resource templates now match what clients actually send: literals raw or percent-encoded, and list query parameters exploded or comma-joined. A `Client` whose exit is cancelled releases its session instead of leaking it, completion no longer answers for prompts and templates the caller can't see, and JSON schemas with float or oversized length limits load instead of failing. The auth fixes cache OIDC discovery and keep Google tokens out of request URLs.

### Enhancements ✨
* Name nested fields in detailed CodeMode schemas by [@zzstoatzz](https://github.com/zzstoatzz) in [#5111](https://github.com/PrefectHQ/fastmcp/pull/5111)
* Add a docs skill by [@zzstoatzz](https://github.com/zzstoatzz) in [#5175](https://github.com/PrefectHQ/fastmcp/pull/5175)
* Add constrained Fire TV tools to the smart-home example by [@zzstoatzz](https://github.com/zzstoatzz) in [#5187](https://github.com/PrefectHQ/fastmcp/pull/5187)
* transforms: add experimental JevSearchTransform by [@zzstoatzz](https://github.com/zzstoatzz) in [#5170](https://github.com/PrefectHQ/fastmcp/pull/5170)
* Expose FileSystemProvider discovery failures by [@spark-328](https://github.com/spark-328) in [#5164](https://github.com/PrefectHQ/fastmcp/pull/5164)
* Run Windows tests on main and manual runs only by [@zzstoatzz](https://github.com/zzstoatzz) in [#5198](https://github.com/PrefectHQ/fastmcp/pull/5198)
* Add langchain.mcp, ClientGroup, and a FastMCP proxy to the downstream smoke by [@zzstoatzz](https://github.com/zzstoatzz) in [#5222](https://github.com/PrefectHQ/fastmcp/pull/5222)
### Security 🔒
* fix(auth): keep Google access tokens out of request URLs by [@zzstoatzz](https://github.com/zzstoatzz) in [#5185](https://github.com/PrefectHQ/fastmcp/pull/5185)
* completions: answer only references the caller can list by [@zzstoatzz](https://github.com/zzstoatzz) in [#5240](https://github.com/PrefectHQ/fastmcp/pull/5240)
### Fixes 🐞
* codemode: raise legible errors in the sandbox; render enums and defaults in `get_schema` by [@zzstoatzz](https://github.com/zzstoatzz) in [#4970](https://github.com/PrefectHQ/fastmcp/pull/4970)
* fix(ci): stabilize Marvin label triage by [@zzstoatzz](https://github.com/zzstoatzz) in [#5197](https://github.com/PrefectHQ/fastmcp/pull/5197)
* fix(resources): percent-encode URI template literals (RFC 6570 §3.1) by [@LGUIUX](https://github.com/LGUIUX) in [#5167](https://github.com/PrefectHQ/fastmcp/pull/5167)
* fix(resources): encode data-backed file names by [@RaycarlLei](https://github.com/RaycarlLei) in [#5140](https://github.com/PrefectHQ/fastmcp/pull/5140)
* Preserve binary resource contents in response cache by [@brennanbutler01](https://github.com/brennanbutler01) in [#5181](https://github.com/PrefectHQ/fastmcp/pull/5181)
* fix(auth): preserve DNS resolver order when deduplicating resolved IP addresses (#5151) by [@seotarek](https://github.com/seotarek) in [#5157](https://github.com/PrefectHQ/fastmcp/pull/5157)
* Keep shared stdio sessions alive until the last client exits by [@Aurelucien](https://github.com/Aurelucien) in [#5180](https://github.com/PrefectHQ/fastmcp/pull/5180)
* fix(transforms): bound Jev search narrowing by [@zzstoatzz](https://github.com/zzstoatzz) in [#5199](https://github.com/PrefectHQ/fastmcp/pull/5199)
* fix(auth): cache OIDC discovery configuration by [@sui-ni2](https://github.com/sui-ni2) in [#4861](https://github.com/PrefectHQ/fastmcp/pull/4861)
* fix(resources): support exploded list query parameters by [@zzstoatzz](https://github.com/zzstoatzz) in [#5206](https://github.com/PrefectHQ/fastmcp/pull/5206)
* Keep string length and pattern constraints when a format is set by [@zzstoatzz](https://github.com/zzstoatzz) in [#5208](https://github.com/PrefectHQ/fastmcp/pull/5208)
* fix(openapi): rewrite model references in prefixItems by [@asts-top](https://github.com/asts-top) in [#5131](https://github.com/PrefectHQ/fastmcp/pull/5131)
* Accept integral float counts like minLength 2.0 in JSON schemas by [@zzstoatzz](https://github.com/zzstoatzz) in [#5214](https://github.com/PrefectHQ/fastmcp/pull/5214)
* Stop an unshared stdio subprocess when its session exits under cancellation by [@zzstoatzz](https://github.com/zzstoatzz) in [#5215](https://github.com/PrefectHQ/fastmcp/pull/5215)
* Match resource template literals whether they arrive raw or percent-encoded by [@zzstoatzz](https://github.com/zzstoatzz) in [#5216](https://github.com/PrefectHQ/fastmcp/pull/5216)
* Accept non-exploded list query params as comma-joined values by [@zzstoatzz](https://github.com/zzstoatzz) in [#5218](https://github.com/PrefectHQ/fastmcp/pull/5218)
* Revert shared keep_alive=False stdio sessions (#5180, #5215) by [@zzstoatzz](https://github.com/zzstoatzz) in [#5219](https://github.com/PrefectHQ/fastmcp/pull/5219)
* Render non-JSON schema defaults and enums in the markdown tool serializer by [@zzstoatzz](https://github.com/zzstoatzz) in [#5220](https://github.com/PrefectHQ/fastmcp/pull/5220)
* Tolerate JSON schema counts larger than any real length by [@zzstoatzz](https://github.com/zzstoatzz) in [#5221](https://github.com/PrefectHQ/fastmcp/pull/5221)
* Release a Client's session hold before any await when a context exits by [@zzstoatzz](https://github.com/zzstoatzz) in [#5223](https://github.com/PrefectHQ/fastmcp/pull/5223)
* ci: retry downstream version lookups and bind the wedge test's names by [@zzstoatzz](https://github.com/zzstoatzz) in [#5239](https://github.com/PrefectHQ/fastmcp/pull/5239)
### Docs 📚
* docs: explain HttpResource uri versus url by [@zzstoatzz](https://github.com/zzstoatzz) in [#5168](https://github.com/PrefectHQ/fastmcp/pull/5168)
* docs: fix version label and language dropdown overlap by [@zzstoatzz](https://github.com/zzstoatzz) in [#5172](https://github.com/PrefectHQ/fastmcp/pull/5172)
* docs: accessibility sweep by [@zzstoatzz](https://github.com/zzstoatzz) in [#5174](https://github.com/PrefectHQ/fastmcp/pull/5174)
* docs: fix dead links to relocated Anthropic and Docket docs by [@uhhgxg](https://github.com/uhhgxg) in [#5205](https://github.com/PrefectHQ/fastmcp/pull/5205)
* Update the Pydantic AI integration docs for MCPToolset and the 2.45 floor by [@zzstoatzz](https://github.com/zzstoatzz) in [#5211](https://github.com/PrefectHQ/fastmcp/pull/5211)
### Dependencies 📦
* chore(deps): bump the uv group across 2 directories with 3 updates by @dependabot[bot] in https://github.com/PrefectHQ/fastmcp/pull/5171
### Other Changes 🦾
* chore(deps): Update astral-sh/setup-uv action to v10.1.0 by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/5191

## New Contributors
* @LGUIUX made their first contribution in [#5167](https://github.com/PrefectHQ/fastmcp/pull/5167)
* @RaycarlLei made their first contribution in [#5140](https://github.com/PrefectHQ/fastmcp/pull/5140)
* @brennanbutler01 made their first contribution in [#5181](https://github.com/PrefectHQ/fastmcp/pull/5181)
* @seotarek made their first contribution in [#5157](https://github.com/PrefectHQ/fastmcp/pull/5157)
* @spark-328 made their first contribution in [#5164](https://github.com/PrefectHQ/fastmcp/pull/5164)
* @Aurelucien made their first contribution in [#5180](https://github.com/PrefectHQ/fastmcp/pull/5180)
* @uhhgxg made their first contribution in [#5205](https://github.com/PrefectHQ/fastmcp/pull/5205)

**Full Changelog**: [v4.0.5...v4.0.6](https://github.com/PrefectHQ/fastmcp/compare/v4.0.5...v4.0.6)

</Update>

<Update label="v4.0.5" description="2026-09-17">

**[v4.0.5: No Country for Loose Ints](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.5)**

Tool parameters declared strict with `Field(strict=True)`, `StrictInt`, or a strict model config are honored again, on both direct calls and task submission. Since the SDK v2 migration the server's lax default overrode them and silently coerced values.

### Security 🔒
* Add regression test for the unconfigured ID-JAG guard by [@zzstoatzz](https://github.com/zzstoatzz) in [#5146](https://github.com/PrefectHQ/fastmcp/pull/5146)
### Fixes 🐞
* Preserve field-level strict validation in lax mode by [@zzstoatzz](https://github.com/zzstoatzz) in [#5141](https://github.com/PrefectHQ/fastmcp/pull/5141)


**Full Changelog**: [v4.0.4...v4.0.5](https://github.com/PrefectHQ/fastmcp/compare/v4.0.4...v4.0.5)

</Update>

<Update label="v4.0.4" description="2026-09-15">

**[v4.0.4: Here Be No Dragons](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.4)**

OpenAPI request bodies get most of the attention in this patch: multipart string arrays are sent as repeated fields, whole-body arguments no longer clobber same-named HTTP parameters, dictionary bodies and raw content types survive intact, and JSON scalar bodies are encoded. On the auth side, OAuthProxy rejects ID-JAG tokens unless identity assertion is configured and refuses non-positive upstream token expiries. Clients now follow empty pagination cursors and servers reject malformed ones.

### Enhancements ✨
* Refresh the smart-home example with Hue V2 and native effects by [@zzstoatzz](https://github.com/zzstoatzz) in [#5009](https://github.com/PrefectHQ/fastmcp/pull/5009)
* Update CodeMode for pydantic-monty 0.0.21 by [@strawgate](https://github.com/strawgate) in [#5033](https://github.com/PrefectHQ/fastmcp/pull/5033)
* Keep linked contributor PRs open while awaiting assignment by [@zzstoatzz](https://github.com/zzstoatzz) in [#5048](https://github.com/PrefectHQ/fastmcp/pull/5048)
* Reduce redundant CI execution while preserving required checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#5049](https://github.com/PrefectHQ/fastmcp/pull/5049)
* Share and streamline repository skills by [@zzstoatzz](https://github.com/zzstoatzz) in [#5013](https://github.com/PrefectHQ/fastmcp/pull/5013)
* Support anthropic 1.x alongside 0.x by [@tdsmith](https://github.com/tdsmith) in [#5066](https://github.com/PrefectHQ/fastmcp/pull/5066)
* renovate: cap routine PRs at 5 concurrent and 5 per hour by [@zzstoatzz](https://github.com/zzstoatzz) in [#5110](https://github.com/PrefectHQ/fastmcp/pull/5110)
* Give docs quality checks a corpus-wide timeout by [@zzstoatzz](https://github.com/zzstoatzz) in [#5109](https://github.com/PrefectHQ/fastmcp/pull/5109)
* Resolve ty 0.0.79 warnings from upgrade checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#5123](https://github.com/PrefectHQ/fastmcp/pull/5123)
### Security 🔒
* Fix #5115: OAuthProxy accepts self-contained ID-JAG tokens even when identity_ass by [@nandanadileep](https://github.com/nandanadileep) in [#5119](https://github.com/PrefectHQ/fastmcp/pull/5119)
### Fixes 🐞
* Fix upgrade checks for the M2M storage warning test by [@zzstoatzz](https://github.com/zzstoatzz) in [#5040](https://github.com/PrefectHQ/fastmcp/pull/5040)
* Fix OpenAPI query explode defaults by [@zzstoatzz](https://github.com/zzstoatzz) in [#5065](https://github.com/PrefectHQ/fastmcp/pull/5065)
* fix(openapi): encode JSON scalar request bodies by [@Gonghan-Princess](https://github.com/Gonghan-Princess) in [#5052](https://github.com/PrefectHQ/fastmcp/pull/5052)
* fix(versions): deterministic meta.fastmcp.versions ordering by [@feiiiiii5](https://github.com/feiiiiii5) in [#4880](https://github.com/PrefectHQ/fastmcp/pull/4880)
* Parse skills frontmatter with yaml.safe_load, falling back to the line parser by [@vishnujayvel](https://github.com/vishnujayvel) in [#4701](https://github.com/PrefectHQ/fastmcp/pull/4701)
* Keep client data out of tool validation warnings by [@zzstoatzz](https://github.com/zzstoatzz) in [#5106](https://github.com/PrefectHQ/fastmcp/pull/5106)
* fix: follow empty pagination cursors in client lists by [@sicauzxl](https://github.com/sicauzxl) in [#5026](https://github.com/PrefectHQ/fastmcp/pull/5026)
* fix: reject non-positive upstream token expiry by [@sui-ni2](https://github.com/sui-ni2) in [#4849](https://github.com/PrefectHQ/fastmcp/pull/4849)
* fix(server): reject a malformed pagination cursor offset by [@L4XB](https://github.com/L4XB) in [#5071](https://github.com/PrefectHQ/fastmcp/pull/5071)
* fix(openapi): preserve dictionary request bodies by [@asts-top](https://github.com/asts-top) in [#5097](https://github.com/PrefectHQ/fastmcp/pull/5097)
* Preserve OpenAPI raw body content types by [@pentaoa](https://github.com/pentaoa) in [#5093](https://github.com/PrefectHQ/fastmcp/pull/5093)
* fix(openapi): preserve HTTP parameters that match whole-body names by [@asts-top](https://github.com/asts-top) in [#5113](https://github.com/PrefectHQ/fastmcp/pull/5113)
* fix(local-provider): apply transforms in get_tasks by [@BlueX888](https://github.com/BlueX888) in [#5117](https://github.com/PrefectHQ/fastmcp/pull/5117)
* Fix multipart string-array default encoding by [@zzstoatzz](https://github.com/zzstoatzz) in [#5121](https://github.com/PrefectHQ/fastmcp/pull/5121)
### Other Changes 🦾
* chore(deps): Update github actions (major) by @prefect-renovate[bot] in https://github.com/PrefectHQ/fastmcp/pull/4890

## New Contributors
* @Gonghan-Princess made their first contribution in [#5052](https://github.com/PrefectHQ/fastmcp/pull/5052)
* @tdsmith made their first contribution in [#5066](https://github.com/PrefectHQ/fastmcp/pull/5066)
* @feiiiiii5 made their first contribution in [#4880](https://github.com/PrefectHQ/fastmcp/pull/4880)
* @vishnujayvel made their first contribution in [#4701](https://github.com/PrefectHQ/fastmcp/pull/4701)
* @sicauzxl made their first contribution in [#5026](https://github.com/PrefectHQ/fastmcp/pull/5026)
* @sui-ni2 made their first contribution in [#4849](https://github.com/PrefectHQ/fastmcp/pull/4849)
* @L4XB made their first contribution in [#5071](https://github.com/PrefectHQ/fastmcp/pull/5071)
* @asts-top made their first contribution in [#5097](https://github.com/PrefectHQ/fastmcp/pull/5097)
* @pentaoa made their first contribution in [#5093](https://github.com/PrefectHQ/fastmcp/pull/5093)
* @BlueX888 made their first contribution in [#5117](https://github.com/PrefectHQ/fastmcp/pull/5117)
* @nandanadileep made their first contribution in [#5119](https://github.com/PrefectHQ/fastmcp/pull/5119)

**Full Changelog**: [v4.0.3...v4.0.4](https://github.com/PrefectHQ/fastmcp/compare/v4.0.3...v4.0.4)

</Update>

<Update label="v4.0.3" description="2026-09-04">

**[v4.0.3: Once Is Enough](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.3)**

Multi-server clients with legacy-only backends now avoid unnecessary startup retries, and tools returning unconstrained sequences no longer send images twice. This patch also fixes task timing values rejected by strict clients and cleans up unfinished Monty callbacks when execution ends.

### Enhancements ✨
* ci: deploy docs through Mintlify's admin API and wait for a verdict by [@zzstoatzz](https://github.com/zzstoatzz) in [#4996](https://github.com/PrefectHQ/fastmcp/pull/4996)
* perf: avoid duplicate startup for mixed-era backends by [@ningmao-hlyz](https://github.com/ningmao-hlyz) in [#4971](https://github.com/PrefectHQ/fastmcp/pull/4971)
* docs: clarify release title history lookup by [@zzstoatzz](https://github.com/zzstoatzz) in [#5006](https://github.com/PrefectHQ/fastmcp/pull/5006)
### Fixes 🐞
* fix: don't infer an output schema for unconstrained sequences by [@fsecada01](https://github.com/fsecada01) in [#4999](https://github.com/PrefectHQ/fastmcp/pull/4999)
* Clean up unfinished Monty callbacks by [@zzstoatzz](https://github.com/zzstoatzz) in [#5005](https://github.com/PrefectHQ/fastmcp/pull/5005)
* Fix task timing field serialization by [@LarryHu0217](https://github.com/LarryHu0217) in [#5003](https://github.com/PrefectHQ/fastmcp/pull/5003)
### Docs 📚
* docs: point What's New at the changelog for later releases by [@zzstoatzz](https://github.com/zzstoatzz) in [#4992](https://github.com/PrefectHQ/fastmcp/pull/4992)
* docs: attribute the back-channel removal to SEP-2322/2575, not SEP-2577 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4988](https://github.com/PrefectHQ/fastmcp/pull/4988)

## New Contributors
* @fsecada01 made their first contribution in [#4999](https://github.com/PrefectHQ/fastmcp/pull/4999)
* @ningmao-hlyz made their first contribution in [#4971](https://github.com/PrefectHQ/fastmcp/pull/4971)

**Full Changelog**: [v4.0.2...v4.0.3](https://github.com/PrefectHQ/fastmcp/compare/v4.0.2...v4.0.3)

</Update>

<Update label="v4.0.2" description="2026-09-02">

**[v4.0.2: Root Access](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.2)**

`ClientGroup` is now importable from the package root, `from fastmcp import ClientGroup`, with the same lazy export and install hint as `Client`, so integrations no longer couple to FastMCP's internal module layout.

### Enhancements ✨
* Expose ClientGroup from package root by [@jlowin](https://github.com/jlowin) in [#4987](https://github.com/PrefectHQ/fastmcp/pull/4987)
* skills: add release skill with changelog entry helper by [@zzstoatzz](https://github.com/zzstoatzz) in [#4982](https://github.com/PrefectHQ/fastmcp/pull/4982)
### Fixes 🐞
* docs: escape `<1` in changelog so MDX parses by [@zzstoatzz](https://github.com/zzstoatzz) in [#4978](https://github.com/PrefectHQ/fastmcp/pull/4978)
### Docs 📚
* docs: note the 4.0.1 floor for ClientGroup reentrancy by [@zzstoatzz](https://github.com/zzstoatzz) in [#4980](https://github.com/PrefectHQ/fastmcp/pull/4980)
* docs: link the GA announcement and blog from What's New by [@zzstoatzz](https://github.com/zzstoatzz) in [#4984](https://github.com/PrefectHQ/fastmcp/pull/4984)


**Full Changelog**: [v4.0.1...v4.0.2](https://github.com/PrefectHQ/fastmcp/compare/v4.0.1...v4.0.2)

</Update>

<Update label="v4.0.1" description="2026-09-01">

**[v4.0.1: Come Back Any Time](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.1)**

`ClientGroup` now reference-counts its context the way `Client` does, so entering a connected group from a nested block or a concurrent task reuses the existing connections instead of raising. Adapters written against `Client`'s reentrancy can hold a `ClientGroup` the same way.

### Fixes 🐞
* client: make ClientGroup context reentrant by [@zzstoatzz](https://github.com/zzstoatzz) in [#4975](https://github.com/PrefectHQ/fastmcp/pull/4975)
* ci: fix the published-docs PR step's working base by [@zzstoatzz](https://github.com/zzstoatzz) in [#4960](https://github.com/PrefectHQ/fastmcp/pull/4960)
### Docs 📚
* docs: update banner for FastMCP 4 GA by [@zzstoatzz](https://github.com/zzstoatzz) in [#4958](https://github.com/PrefectHQ/fastmcp/pull/4958)
* docs: correct whats-new and upgrade guide for GA by [@zzstoatzz](https://github.com/zzstoatzz) in [#4961](https://github.com/PrefectHQ/fastmcp/pull/4961)
* docs: drop prerelease install framing from installation and SDK migration guides by [@zzstoatzz](https://github.com/zzstoatzz) in [#4963](https://github.com/PrefectHQ/fastmcp/pull/4963)
* docs: refresh sidebar tags and fix audit findings by [@zzstoatzz](https://github.com/zzstoatzz) in [#4965](https://github.com/PrefectHQ/fastmcp/pull/4965)

**Full Changelog**: [v4.0.0...v4.0.1](https://github.com/PrefectHQ/fastmcp/compare/v4.0.0...v4.0.1)

</Update>

<Update label="v4.0.0" description="2026-08-31">

**[v4.0.0: Four Real](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0)**

FastMCP 4 is the FastMCP release for the new MCP: full support for the `2026-07-28` protocol revision and the rewritten Python SDK v2, with per-connection negotiation so old-protocol clients keep working against upgraded servers. Interactive tools, background tasks via the `io.modelcontextprotocol/tasks` extension, a first-class extension model, identity assertion, dependency injection with call-argument binding, and `ClientGroup` all land as stable surfaces. Most FastMCP 3 applications upgrade without code changes.

### New Features 🎉
* Migrate to MCP Python SDK v2 by [@jlowin](https://github.com/jlowin) in [#4437](https://github.com/PrefectHQ/fastmcp/pull/4437)
* Teach fastmcp.Client the modern protocol: mode negotiation, MRTR driver, response cache by [@jlowin](https://github.com/jlowin) in [#4450](https://github.com/PrefectHQ/fastmcp/pull/4450)
* Forward-port Hugging Face auth provider by [@jlowin](https://github.com/jlowin) in [#4475](https://github.com/PrefectHQ/fastmcp/pull/4475)
* Add server-side identity assertion (SEP-990 ID-JAG) by [@jlowin](https://github.com/jlowin) in [#4483](https://github.com/PrefectHQ/fastmcp/pull/4483)
* Add guard-mode multi-round-trip tools (SEP-2322) by [@jlowin](https://github.com/jlowin) in [#4544](https://github.com/PrefectHQ/fastmcp/pull/4544)
* Add FastMCP-native server extension API (SEP-2133) by [@jlowin](https://github.com/jlowin) in [#4602](https://github.com/PrefectHQ/fastmcp/pull/4602)
* Add stateless session state (UserSession / SessionId) by [@jlowin](https://github.com/jlowin) in [#4604](https://github.com/PrefectHQ/fastmcp/pull/4604)
* Add background tasks via the io.modelcontextprotocol/tasks extension (SEP-2663) by [@jlowin](https://github.com/jlowin) in [#4603](https://github.com/PrefectHQ/fastmcp/pull/4603)
### Breaking Changes ⚠️
* Emit one SERVER span per request and adopt spec-correct error codes by [@jlowin](https://github.com/jlowin) in [#4445](https://github.com/PrefectHQ/fastmcp/pull/4445)
* Remove 3.x deprecated module shims and dead parameters by [@jlowin](https://github.com/jlowin) in [#4447](https://github.com/PrefectHQ/fastmcp/pull/4447)
* Remove 3.0-deprecated FastMCP server methods by [@jlowin](https://github.com/jlowin) in [#4451](https://github.com/PrefectHQ/fastmcp/pull/4451)
* Remove 3.x deprecated parameters and object-mode decorators by [@jlowin](https://github.com/jlowin) in [#4453](https://github.com/PrefectHQ/fastmcp/pull/4453)
* Migrate to MCP SDK v2.0.0b2 (httpx2) by [@jlowin](https://github.com/jlowin) in [#4503](https://github.com/PrefectHQ/fastmcp/pull/4503)
* Fix typos by [@szepeviktor](https://github.com/szepeviktor) in [#4498](https://github.com/PrefectHQ/fastmcp/pull/4498)
* Stop proxies from validating backend results or mutating shared transports by [@jlowin](https://github.com/jlowin) in [#4552](https://github.com/PrefectHQ/fastmcp/pull/4552)
* Surface resource, prompt, and proxy errors on the modern protocol by [@jlowin](https://github.com/jlowin) in [#4579](https://github.com/PrefectHQ/fastmcp/pull/4579)
* Negotiate the best mutual protocol era by default by [@jlowin](https://github.com/jlowin) in [#4572](https://github.com/PrefectHQ/fastmcp/pull/4572)
* Remove server-initiated sampling and roots from the server API by [@jlowin](https://github.com/jlowin) in [#4648](https://github.com/PrefectHQ/fastmcp/pull/4648)
* Remove 3.x-era compatibility shims by [@jlowin](https://github.com/jlowin) in [#4661](https://github.com/PrefectHQ/fastmcp/pull/4661)
### Enhancements ✨
* Deprecate ctx.sample and add clear errors for push features on 2026 connections by [@jlowin](https://github.com/jlowin) in [#4448](https://github.com/PrefectHQ/fastmcp/pull/4448)
* Add server-level cache hints (SEP-2549) by [@jlowin](https://github.com/jlowin) in [#4464](https://github.com/PrefectHQ/fastmcp/pull/4464)
* Add KeyValueResponseCacheStore for distributed client response caching by [@jlowin](https://github.com/jlowin) in [#4479](https://github.com/PrefectHQ/fastmcp/pull/4479)
* Test lifespan fires once per process over HTTP by [@jlowin](https://github.com/jlowin) in [#4480](https://github.com/PrefectHQ/fastmcp/pull/4480)
* Add telemetry off-switch and mcp.protocol.version span attribute by [@jlowin](https://github.com/jlowin) in [#4481](https://github.com/PrefectHQ/fastmcp/pull/4481)
* Trace client task management requests by [@jlowin](https://github.com/jlowin) in [#4525](https://github.com/PrefectHQ/fastmcp/pull/4525)
* Stabilize upgraded ty checks by [@jlowin](https://github.com/jlowin) in [#4526](https://github.com/PrefectHQ/fastmcp/pull/4526)
* Improve DescopeProvider scope discovery and well-known URL support by [@gaokevin1](https://github.com/gaokevin1) in [#4489](https://github.com/PrefectHQ/fastmcp/pull/4489)
* Add examples/ to the ty static-analysis gate by [@jlowin](https://github.com/jlowin) in [#4466](https://github.com/PrefectHQ/fastmcp/pull/4466)
* Expose telemetry attributes on span start by [@zzstoatzz](https://github.com/zzstoatzz) in [#4487](https://github.com/PrefectHQ/fastmcp/pull/4487)
* Fix-issue-4284 : Add Auth0MCPProvider for Auth0 Auth for MCP by [@vijaydeepsinha](https://github.com/vijaydeepsinha) in [#4411](https://github.com/PrefectHQ/fastmcp/pull/4411)
* Run FastMCP middleware for every inbound message by [@jlowin](https://github.com/jlowin) in [#4553](https://github.com/PrefectHQ/fastmcp/pull/4553)
* Add 'prs welcome' label to waive the PR assignment gate by [@jlowin](https://github.com/jlowin) in [#4557](https://github.com/PrefectHQ/fastmcp/pull/4557)
* Rename martian workflows to marvin by [@jlowin](https://github.com/jlowin) in [#4558](https://github.com/PrefectHQ/fastmcp/pull/4558)
* Bump pinned Claude models to current versions by [@jlowin](https://github.com/jlowin) in [#4561](https://github.com/PrefectHQ/fastmcp/pull/4561)
* Make the unit suite fast: in-process HTTP tests, no real sleeps, parallel Windows CI by [@jlowin](https://github.com/jlowin) in [#4554](https://github.com/PrefectHQ/fastmcp/pull/4554)
* Mirror the frontend's protocol era on a proxy's backend connection by [@jlowin](https://github.com/jlowin) in [#4573](https://github.com/PrefectHQ/fastmcp/pull/4573)
* Drop forked client protocol helpers in favor of the SDK's by [@jlowin](https://github.com/jlowin) in [#4574](https://github.com/PrefectHQ/fastmcp/pull/4574)
* Bring the v4 developer notes up to date with what shipped by [@jlowin](https://github.com/jlowin) in [#4581](https://github.com/PrefectHQ/fastmcp/pull/4581)
* Trim fastmcp.types to FastMCP-unique types by [@jlowin](https://github.com/jlowin) in [#4584](https://github.com/PrefectHQ/fastmcp/pull/4584)
* Let a server answer argument-completion requests by [@jlowin](https://github.com/jlowin) in [#4582](https://github.com/PrefectHQ/fastmcp/pull/4582)
* Add machine-to-machine client authentication by [@jlowin](https://github.com/jlowin) in [#4583](https://github.com/PrefectHQ/fastmcp/pull/4583)
* Expose era-neutral client server metadata by [@zzstoatzz](https://github.com/zzstoatzz) in [#4599](https://github.com/PrefectHQ/fastmcp/pull/4599)
* Support routable transport headers for gateways (SEP-2243) by [@jlowin](https://github.com/jlowin) in [#4622](https://github.com/PrefectHQ/fastmcp/pull/4622)
* Emit scope step-up challenges for incremental authorization (SEP-2350) by [@jlowin](https://github.com/jlowin) in [#4623](https://github.com/PrefectHQ/fastmcp/pull/4623)
* Honor OAuth application_type in DCR (SEP-837) by [@jlowin](https://github.com/jlowin) in [#4621](https://github.com/PrefectHQ/fastmcp/pull/4621)
* Drop stale label-noting instructions from CLAUDE.md by [@jlowin](https://github.com/jlowin) in [#4654](https://github.com/PrefectHQ/fastmcp/pull/4654)
* Add require_roles auth check by [@jlowin](https://github.com/jlowin) in [#4656](https://github.com/PrefectHQ/fastmcp/pull/4656)
* Add `valid_scopes` parameter to OIDC proxy valid scopes by [@Educg550](https://github.com/Educg550) in [#4660](https://github.com/PrefectHQ/fastmcp/pull/4660)
* feat: Add telemetry interop mode for FastMCP by [@strawgate](https://github.com/strawgate) in [#4046](https://github.com/PrefectHQ/fastmcp/pull/4046)
* Note that review comment threads should get an acknowledgement by [@jlowin](https://github.com/jlowin) in [#4678](https://github.com/PrefectHQ/fastmcp/pull/4678)
* Soften the review-comment reply guidance by [@jlowin](https://github.com/jlowin) in [#4683](https://github.com/PrefectHQ/fastmcp/pull/4683)
* Resolve review threads on fix, reply on decline by [@jlowin](https://github.com/jlowin) in [#4685](https://github.com/PrefectHQ/fastmcp/pull/4685)
* Move to the stable MCP Python SDK 2.0.0 by [@jlowin](https://github.com/jlowin) in [#4655](https://github.com/PrefectHQ/fastmcp/pull/4655)
* Add comprehensive Codex code review rules by [@jlowin](https://github.com/jlowin) in [#4710](https://github.com/PrefectHQ/fastmcp/pull/4710)
* Give parallel Windows CI more timeout headroom by [@zzstoatzz](https://github.com/zzstoatzz) in [#4680](https://github.com/PrefectHQ/fastmcp/pull/4680)
* add language dropdown to docs sidebar by [@znicholasbrown](https://github.com/znicholasbrown) in [#4716](https://github.com/PrefectHQ/fastmcp/pull/4716)
* Route published docs through pull requests by [@jlowin](https://github.com/jlowin) in [#4713](https://github.com/PrefectHQ/fastmcp/pull/4713)
* Improve HTTP server startup performance by [@jlowin](https://github.com/jlowin) in [#4729](https://github.com/PrefectHQ/fastmcp/pull/4729)
* Avoid loading MCP and CLI stacks during lightweight imports by [@jlowin](https://github.com/jlowin) in [#4763](https://github.com/PrefectHQ/fastmcp/pull/4763)
* Preserve legacy httpx compatibility without importing it by [@jlowin](https://github.com/jlowin) in [#4766](https://github.com/PrefectHQ/fastmcp/pull/4766)
* Clarify review of closed contributor PRs by [@jlowin](https://github.com/jlowin) in [#4780](https://github.com/PrefectHQ/fastmcp/pull/4780)
* Support EdDSA verification in JWTVerifier by [@zzstoatzz](https://github.com/zzstoatzz) in [#4752](https://github.com/PrefectHQ/fastmcp/pull/4752)
* Forward proxy server metadata across protocol eras by [@jakekaplan](https://github.com/jakekaplan) in [#4776](https://github.com/PrefectHQ/fastmcp/pull/4776)
* feat(renovate): migrate to Renovate, retire Dependabot by [@jamiezieziula](https://github.com/jamiezieziula) in [#4754](https://github.com/PrefectHQ/fastmcp/pull/4754)
* Add Prefect Horizon authentication client and local state by [@parkedwards](https://github.com/parkedwards) in [#4785](https://github.com/PrefectHQ/fastmcp/pull/4785)
* Clarify auto-closed PR message by [@jlowin](https://github.com/jlowin) in [#4820](https://github.com/PrefectHQ/fastmcp/pull/4820)
* Support CallArgument and Depends bindings from uncalled-for 0.4.0 by [@chrisguidry](https://github.com/chrisguidry) in [#4802](https://github.com/PrefectHQ/fastmcp/pull/4802)
* Fix static analysis under newer ty releases by [@zzstoatzz](https://github.com/zzstoatzz) in [#4831](https://github.com/PrefectHQ/fastmcp/pull/4831)
* Cover CallArgument resolution in background tasks by [@zzstoatzz](https://github.com/zzstoatzz) in [#4833](https://github.com/PrefectHQ/fastmcp/pull/4833)
* Scalekit issuer updates backward compatibility by [@AkshayParihar33](https://github.com/AkshayParihar33) in [#4798](https://github.com/PrefectHQ/fastmcp/pull/4798)
* Add Prefect Horizon account commands by [@parkedwards](https://github.com/parkedwards) in [#4786](https://github.com/PrefectHQ/fastmcp/pull/4786)
* Cap anthropic dependency to `<1` by [@craigie-ant](https://github.com/craigie-ant) in [#4864](https://github.com/PrefectHQ/fastmcp/pull/4864)
* Remove obsolete Docket memory-server reset fixtures by [@TyceHerrman](https://github.com/TyceHerrman) in [#4912](https://github.com/PrefectHQ/fastmcp/pull/4912)
* add independent client groups by [@zzstoatzz](https://github.com/zzstoatzz) in [#4904](https://github.com/PrefectHQ/fastmcp/pull/4904)
### Security 🔒
* Drive the FastMCP lifespan through the SDK session manager by [@jlowin](https://github.com/jlowin) in [#4446](https://github.com/PrefectHQ/fastmcp/pull/4446)
* Route skill file access through SDK path-security primitives by [@jlowin](https://github.com/jlowin) in [#4449](https://github.com/PrefectHQ/fastmcp/pull/4449)
* Screen templated resource parameters for path traversal by default by [@jlowin](https://github.com/jlowin) in [#4482](https://github.com/PrefectHQ/fastmcp/pull/4482)
* [codex] Add OAuthProxy RFC 9207 issuer responses by [@jlowin](https://github.com/jlowin) in [#4438](https://github.com/PrefectHQ/fastmcp/pull/4438)
* Apply app visibility where no host can by [@jlowin](https://github.com/jlowin) in [#4692](https://github.com/PrefectHQ/fastmcp/pull/4692)
* Encrypt task context snapshots at rest by [@chrisguidry](https://github.com/chrisguidry) in [#4772](https://github.com/PrefectHQ/fastmcp/pull/4772)
* Add audience pinning to GoogleTokenVerifier by [@zzstoatzz](https://github.com/zzstoatzz) in [#4827](https://github.com/PrefectHQ/fastmcp/pull/4827)
* Bump cryptography to 50.0.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4836](https://github.com/PrefectHQ/fastmcp/pull/4836)
* Scope Marvin App token to each job's declared permissions by [@zzstoatzz](https://github.com/zzstoatzz) in [#4834](https://github.com/PrefectHQ/fastmcp/pull/4834)
* Exclude Cookie from forwarded HTTP headers by [@zzstoatzz](https://github.com/zzstoatzz) in [#4843](https://github.com/PrefectHQ/fastmcp/pull/4843)
* Bump cryptography to 50.0.0 in the testing_demo example by [@zzstoatzz](https://github.com/zzstoatzz) in [#4844](https://github.com/PrefectHQ/fastmcp/pull/4844)
* Bound CIMD cache growth by [@jlowin](https://github.com/jlowin) in [#4852](https://github.com/PrefectHQ/fastmcp/pull/4852)
* client: deprecate inferring stdio transports from str, prefer Path by [@zzstoatzz](https://github.com/zzstoatzz) in [#4941](https://github.com/PrefectHQ/fastmcp/pull/4941)
### Fixes 🐞
* Capture SharedContext for task-enabled Docket servers by [@jlowin](https://github.com/jlowin) in [#4443](https://github.com/PrefectHQ/fastmcp/pull/4443)
* Fix stale mcp.types imports in examples by [@jlowin](https://github.com/jlowin) in [#4452](https://github.com/PrefectHQ/fastmcp/pull/4452)
* Forward-port HTTP host guard compatibility by [@jlowin](https://github.com/jlowin) in [#4474](https://github.com/PrefectHQ/fastmcp/pull/4474)
* Fix Azure scope fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#4469](https://github.com/PrefectHQ/fastmcp/pull/4469)
* fix(server): omit ScalarElicitationType wrapper title from elicitation schemas by [@syf2211](https://github.com/syf2211) in [#4502](https://github.com/PrefectHQ/fastmcp/pull/4502)
* Skip unsupported JWKS keys instead of failing the whole key set (#4515) by [@earfman](https://github.com/earfman) in [#4517](https://github.com/PrefectHQ/fastmcp/pull/4517)
* Don't mutate the caller's schema in compress_schema by [@winklemad](https://github.com/winklemad) in [#4492](https://github.com/PrefectHQ/fastmcp/pull/4492)
* Forward upstream instructions through create_proxy by [@verdie-g](https://github.com/verdie-g) in [#4512](https://github.com/PrefectHQ/fastmcp/pull/4512)
* Serialize deep object query parameters by [@jlowin](https://github.com/jlowin) in [#4523](https://github.com/PrefectHQ/fastmcp/pull/4523)
* Reject positional-only tool parameters by [@jlowin](https://github.com/jlowin) in [#4524](https://github.com/PrefectHQ/fastmcp/pull/4524)
* Clarify PR-reopen flow and fix label-race that broke auto-reopen by [@jlowin](https://github.com/jlowin) in [#4518](https://github.com/PrefectHQ/fastmcp/pull/4518)
* Clean up disconnected task sessions by [@jlowin](https://github.com/jlowin) in [#4519](https://github.com/PrefectHQ/fastmcp/pull/4519)
* Handle expired OAuth client registrations by [@jlowin](https://github.com/jlowin) in [#4520](https://github.com/PrefectHQ/fastmcp/pull/4520)
* Fix OAuth request annotation after httpx2 migration by [@jlowin](https://github.com/jlowin) in [#4534](https://github.com/PrefectHQ/fastmcp/pull/4534)
* Fix docs banner contrast by [@jlowin](https://github.com/jlowin) in [#4522](https://github.com/PrefectHQ/fastmcp/pull/4522)
* Preserve component metadata in response cache by [@jlowin](https://github.com/jlowin) in [#4521](https://github.com/PrefectHQ/fastmcp/pull/4521)
* Clean up task sessions on connection exit by [@jlowin](https://github.com/jlowin) in [#4535](https://github.com/PrefectHQ/fastmcp/pull/4535)
* Include scopes in auth challenges by [@jlowin](https://github.com/jlowin) in [#4527](https://github.com/PrefectHQ/fastmcp/pull/4527)
* Make examples/ actually trigger the ty gate by [@jlowin](https://github.com/jlowin) in [#4541](https://github.com/PrefectHQ/fastmcp/pull/4541)
* Add subject field to AccessToken initialization by [@piaudonn](https://github.com/piaudonn) in [#4267](https://github.com/PrefectHQ/fastmcp/pull/4267)
* Restore Mintlify's fixed banner positioning by [@jlowin](https://github.com/jlowin) in [#4542](https://github.com/PrefectHQ/fastmcp/pull/4542)
* Fix #4292: SSRF guard breaks OAuth/JWKS fetches behind a corporate HTTP proxy by [@endofcake](https://github.com/endofcake) in [#4412](https://github.com/PrefectHQ/fastmcp/pull/4412)
* Preserve telemetry attributes when a sampler does not forward them by [@jlowin](https://github.com/jlowin) in [#4539](https://github.com/PrefectHQ/fastmcp/pull/4539)
* Speed up the unit test suite, and fix the task-notification race it surfaced by [@jlowin](https://github.com/jlowin) in [#4550](https://github.com/PrefectHQ/fastmcp/pull/4550)
* Fix label triage applying no labels, and make blocked tool calls fail by [@jlowin](https://github.com/jlowin) in [#4555](https://github.com/PrefectHQ/fastmcp/pull/4555)
* Fix AI workflow allowlists being destroyed by tokenization by [@jlowin](https://github.com/jlowin) in [#4560](https://github.com/PrefectHQ/fastmcp/pull/4560)
* Make transformed tool `required` order deterministic by [@Kludex](https://github.com/Kludex) in [#4564](https://github.com/PrefectHQ/fastmcp/pull/4564)
* Stop gather() from creating coroutines it may never schedule by [@jlowin](https://github.com/jlowin) in [#4559](https://github.com/PrefectHQ/fastmcp/pull/4559)
* Restore upgraded dependency checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#4576](https://github.com/PrefectHQ/fastmcp/pull/4576)
* Fix skill frontmatter parsing with UTF-8 BOM by [@hxaxd](https://github.com/hxaxd) in [#4533](https://github.com/PrefectHQ/fastmcp/pull/4533)
* Fix File helper extension handling by [@VectorPeak](https://github.com/VectorPeak) in [#4531](https://github.com/PrefectHQ/fastmcp/pull/4531)
* Fix percent-encoded skill file names unreadable in resources mode by [@jlowin](https://github.com/jlowin) in [#4590](https://github.com/PrefectHQ/fastmcp/pull/4590)
* Fix flaky stdio crash-recovery tests by [@jlowin](https://github.com/jlowin) in [#4594](https://github.com/PrefectHQ/fastmcp/pull/4594)
* Bridge camelCase ToolAnnotations reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#4597](https://github.com/PrefectHQ/fastmcp/pull/4597)
* Preserve raw CallToolResult tool returns by [@LarryHu0217](https://github.com/LarryHu0217) in [#4587](https://github.com/PrefectHQ/fastmcp/pull/4587)
* Advertise only supported token endpoint auth methods in OAuthProxy metadata by [@jlowin](https://github.com/jlowin) in [#4608](https://github.com/PrefectHQ/fastmcp/pull/4608)
* Fix OAuth proxy override typing by [@zzstoatzz](https://github.com/zzstoatzz) in [#4612](https://github.com/PrefectHQ/fastmcp/pull/4612)
* Pin burner-redis below the Windows-crashing 0.1.7 release by [@jlowin](https://github.com/jlowin) in [#4618](https://github.com/PrefectHQ/fastmcp/pull/4618)
* fix : canonical mime type mapping from formats to remove inconsistency #4627 by [@Aman071106](https://github.com/Aman071106) in [#4628](https://github.com/PrefectHQ/fastmcp/pull/4628)
* fix: accept callable roots handlers by [@ShuyingZhang](https://github.com/ShuyingZhang) in [#4639](https://github.com/PrefectHQ/fastmcp/pull/4639)
* Pass the MCP conformance suite's draft and pending scenarios by [@jlowin](https://github.com/jlowin) in [#4650](https://github.com/PrefectHQ/fastmcp/pull/4650)
* Use issuer_url for OAuth issuer identity by [@jlowin](https://github.com/jlowin) in [#4652](https://github.com/PrefectHQ/fastmcp/pull/4652)
* Fix the ty failure blocking upgrade checks on main by [@jlowin](https://github.com/jlowin) in [#4657](https://github.com/PrefectHQ/fastmcp/pull/4657)
* Bind CIMD assertion audience to the advertised token endpoint by [@jlowin](https://github.com/jlowin) in [#4659](https://github.com/PrefectHQ/fastmcp/pull/4659)
* Record effective scopes on the OAuth transaction by [@jlowin](https://github.com/jlowin) in [#4670](https://github.com/PrefectHQ/fastmcp/pull/4670)
* Copy schemas iteratively so deep nesting still compresses by [@jlowin](https://github.com/jlowin) in [#4671](https://github.com/PrefectHQ/fastmcp/pull/4671)
* Fix OpenAPI allOf reference fields by [@hxaxd](https://github.com/hxaxd) in [#4653](https://github.com/PrefectHQ/fastmcp/pull/4653)
* Flatten OpenAPI discriminator subtypes into request bodies by [@jlowin](https://github.com/jlowin) in [#4677](https://github.com/PrefectHQ/fastmcp/pull/4677)
* Let maintenance releases publish without fastmcp-tasks by [@jlowin](https://github.com/jlowin) in [#4676](https://github.com/PrefectHQ/fastmcp/pull/4676)
* Read CLI-scanned MCP config files as UTF-8 explicitly by [@jlowin](https://github.com/jlowin) in [#4690](https://github.com/PrefectHQ/fastmcp/pull/4690)
* Late-bind app tool names so UIs survive composition by [@jlowin](https://github.com/jlowin) in [#4682](https://github.com/PrefectHQ/fastmcp/pull/4682)
* Always emit a tool title, derived from name when unset by [@jlowin](https://github.com/jlowin) in [#4694](https://github.com/PrefectHQ/fastmcp/pull/4694)
* Fix self-referential connection error causes by [@jakekaplan](https://github.com/jakekaplan) in [#4720](https://github.com/PrefectHQ/fastmcp/pull/4720)
* Write downloaded skill text as UTF-8 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4715](https://github.com/PrefectHQ/fastmcp/pull/4715)
* Fix CodeMode tool error propagation by [@YAO-001](https://github.com/YAO-001) in [#4704](https://github.com/PrefectHQ/fastmcp/pull/4704)
* Forward enable_cimd to Auth0, AWS Cognito and OCI providers by [@StykMartin](https://github.com/StykMartin) in [#4719](https://github.com/PrefectHQ/fastmcp/pull/4719)
* fix: preserve valid servers during CLI discovery by [@ShuyingZhang](https://github.com/ShuyingZhang) in [#4714](https://github.com/PrefectHQ/fastmcp/pull/4714)
* Preserve string-compatible prompt arguments by [@jlowin](https://github.com/jlowin) in [#4730](https://github.com/PrefectHQ/fastmcp/pull/4730)
* Canonicalize response cache arguments by [@jlowin](https://github.com/jlowin) in [#4753](https://github.com/PrefectHQ/fastmcp/pull/4753)
* Serve empty list results from the response cache by [@LHMQ878](https://github.com/LHMQ878) in [#4738](https://github.com/PrefectHQ/fastmcp/pull/4738)
* Don't cache error results in ResponseCachingMiddleware by [@SaiMouli3](https://github.com/SaiMouli3) in [#4705](https://github.com/PrefectHQ/fastmcp/pull/4705)
* Declare run-claude extra allowed tools input by [@zzstoatzz](https://github.com/zzstoatzz) in [#4740](https://github.com/PrefectHQ/fastmcp/pull/4740)
* Sanitize forwarded request metadata where the proxy copies it by [@jakekaplan](https://github.com/jakekaplan) in [#4770](https://github.com/PrefectHQ/fastmcp/pull/4770)
* fix(context): move elicit overload docs inside the stubs so mypy sees the chain by [@yonatangross](https://github.com/yonatangross) in [#4774](https://github.com/PrefectHQ/fastmcp/pull/4774)
* Delegate typed tool output serialization to Pydantic by [@jlowin](https://github.com/jlowin) in [#4771](https://github.com/PrefectHQ/fastmcp/pull/4771)
* Serialize the event store's stream list read-modify-write by [@SaiMouli3](https://github.com/SaiMouli3) in [#4758](https://github.com/PrefectHQ/fastmcp/pull/4758)
* Fix partial parameter hints on Python 3.14 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4796](https://github.com/PrefectHQ/fastmcp/pull/4796)
* fix(openapi): extract parameter-level example and examples by [@doneman536](https://github.com/doneman536) in [#4793](https://github.com/PrefectHQ/fastmcp/pull/4793)
* Keep earlier consent CSRF tokens valid within a transaction by [@trevhud](https://github.com/trevhud) in [#4818](https://github.com/PrefectHQ/fastmcp/pull/4818)
* Fix StatefulProxyClient reconnection after session failure by [@jlowin](https://github.com/jlowin) in [#4829](https://github.com/PrefectHQ/fastmcp/pull/4829)
* Fix instructions in MCP inspect output by [@zzstoatzz](https://github.com/zzstoatzz) in [#4873](https://github.com/PrefectHQ/fastmcp/pull/4873)
* fix: support Unicode tokens in BM25 search by [@zzstoatzz](https://github.com/zzstoatzz) in [#4889](https://github.com/PrefectHQ/fastmcp/pull/4889)
* fix: support modern protocol in multi-server clients by [@zzstoatzz](https://github.com/zzstoatzz) in [#4893](https://github.com/PrefectHQ/fastmcp/pull/4893)
* fix(ci): satisfy latest ty control-flow checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#4928](https://github.com/PrefectHQ/fastmcp/pull/4928)
* fix(middleware): align response limits with output schemas by [@zzstoatzz](https://github.com/zzstoatzz) in [#4931](https://github.com/PrefectHQ/fastmcp/pull/4931)
* Accept any issuer scoped to the Descope project by [@gaokevin1](https://github.com/gaokevin1) in [#4909](https://github.com/PrefectHQ/fastmcp/pull/4909)
* Fix response cache partitioning for versioned components by [@CoralGarden52](https://github.com/CoralGarden52) in [#4948](https://github.com/PrefectHQ/fastmcp/pull/4948)
### Docs 📚
* Docs: forward-port v3.4.4 changelog entries by [@jlowin](https://github.com/jlowin) in [#4476](https://github.com/PrefectHQ/fastmcp/pull/4476)
* Document icon theme support by [@jlowin](https://github.com/jlowin) in [#4537](https://github.com/PrefectHQ/fastmcp/pull/4537)
* Add missing 4.0.0 version badge to Path Security docs by [@jlowin](https://github.com/jlowin) in [#4540](https://github.com/PrefectHQ/fastmcp/pull/4540)
* Align server component docs by [@strawgate](https://github.com/strawgate) in [#4260](https://github.com/PrefectHQ/fastmcp/pull/4260)
* Align CLI, deployment, and config docs by [@strawgate](https://github.com/strawgate) in [#4259](https://github.com/PrefectHQ/fastmcp/pull/4259)
* Align client, Apps, and integration docs by [@strawgate](https://github.com/strawgate) in [#4261](https://github.com/PrefectHQ/fastmcp/pull/4261)
* Fix stale MRTR/elicitation framing in client and upgrade docs by [@jlowin](https://github.com/jlowin) in [#4551](https://github.com/PrefectHQ/fastmcp/pull/4551)
* docs: quote pip extras install examples by [@RachGranville](https://github.com/RachGranville) in [#4568](https://github.com/PrefectHQ/fastmcp/pull/4568)
* Document Windows CI parallelism and the subprocess_heavy marker by [@jlowin](https://github.com/jlowin) in [#4575](https://github.com/PrefectHQ/fastmcp/pull/4575)
* Document v3->v4 removals and add upgrade-reality tests by [@jlowin](https://github.com/jlowin) in [#4585](https://github.com/PrefectHQ/fastmcp/pull/4585)
* Archive v3 docs and publish v4 as the primary version by [@jlowin](https://github.com/jlowin) in [#4613](https://github.com/PrefectHQ/fastmcp/pull/4613)
* Document targeted v4 prerelease installation by [@zzstoatzz](https://github.com/zzstoatzz) in [#4598](https://github.com/PrefectHQ/fastmcp/pull/4598)
* Fix stale Mac/Windows-vs-Linux OAuth key/storage docs by [@jlowin](https://github.com/jlowin) in [#4617](https://github.com/PrefectHQ/fastmcp/pull/4617)
* v4 docs quality pass: stale task/era claims, broken links, polish by [@jlowin](https://github.com/jlowin) in [#4619](https://github.com/PrefectHQ/fastmcp/pull/4619)
* whats-new: add the argument completion capability by [@jlowin](https://github.com/jlowin) in [#4620](https://github.com/PrefectHQ/fastmcp/pull/4620)
* docs: fix ProxyProvider docstring example calling nonexistent with_namespace() by [@andrew-stelmach-fleet](https://github.com/andrew-stelmach-fleet) in [#4633](https://github.com/PrefectHQ/fastmcp/pull/4633)
* Unpublish v4 development notes; prep docs for beta 1 by [@jlowin](https://github.com/jlowin) in [#4644](https://github.com/PrefectHQ/fastmcp/pull/4644)
* Expand the FAQ for the v4 transition by [@jlowin](https://github.com/jlowin) in [#4649](https://github.com/PrefectHQ/fastmcp/pull/4649)
* Document the issuer_url identity change for upgraders by [@jlowin](https://github.com/jlowin) in [#4658](https://github.com/PrefectHQ/fastmcp/pull/4658)
* Cover require_roles in the v4 highlights by [@jlowin](https://github.com/jlowin) in [#4666](https://github.com/PrefectHQ/fastmcp/pull/4666)
* Fix FAQ: sampling/roots/elicitation legacy-mode advice, SessionProvider registration by [@jlowin](https://github.com/jlowin) in [#4672](https://github.com/PrefectHQ/fastmcp/pull/4672)
* Audit v4 docs: fix missing version badges, fill whats-new gaps by [@jlowin](https://github.com/jlowin) in [#4668](https://github.com/PrefectHQ/fastmcp/pull/4668)
* Docs: add v3.4.5 changelog entries to main by [@jlowin](https://github.com/jlowin) in [#4674](https://github.com/PrefectHQ/fastmcp/pull/4674)
* Split the SDK upgrade guides by SDK version by [@jlowin](https://github.com/jlowin) in [#4684](https://github.com/PrefectHQ/fastmcp/pull/4684)
* Add v4.0.0b1 changelog and updates entries by [@jlowin](https://github.com/jlowin) in [#4681](https://github.com/PrefectHQ/fastmcp/pull/4681)
* Use mcp.types directly instead of aliasing to mcp_types in docs by [@jlowin](https://github.com/jlowin) in [#4696](https://github.com/PrefectHQ/fastmcp/pull/4696)
* Rewrite the v4 What's New page and document server extensions by [@jlowin](https://github.com/jlowin) in [#4698](https://github.com/PrefectHQ/fastmcp/pull/4698)
* Improve the v4 docs by [@jlowin](https://github.com/jlowin) in [#4707](https://github.com/PrefectHQ/fastmcp/pull/4707)
* Rewrite the FastMCP docs welcome page by [@jlowin](https://github.com/jlowin) in [#4709](https://github.com/PrefectHQ/fastmcp/pull/4709)
* docs: clarify external OAuth consent mode by [@jlowin](https://github.com/jlowin) in [#4746](https://github.com/PrefectHQ/fastmcp/pull/4746)
* Docs: mirror v3.4.6 changelog entries by [@jlowin](https://github.com/jlowin) in [#4764](https://github.com/PrefectHQ/fastmcp/pull/4764)
* Document MCP protocol support and conformance by [@jlowin](https://github.com/jlowin) in [#4781](https://github.com/PrefectHQ/fastmcp/pull/4781)
* Docs language dropdown  by [@znicholasbrown](https://github.com/znicholasbrown) in [#4801](https://github.com/PrefectHQ/fastmcp/pull/4801)
* Docs: mirror v3.4.7 release notes by [@jlowin](https://github.com/jlowin) in [#4811](https://github.com/PrefectHQ/fastmcp/pull/4811)
* docs: prepare FastMCP 4 beta 3 by [@jlowin](https://github.com/jlowin) in [#4840](https://github.com/PrefectHQ/fastmcp/pull/4840)
* docs: add FastMCP 4 beta 3 release entries by [@jlowin](https://github.com/jlowin) in [#4841](https://github.com/PrefectHQ/fastmcp/pull/4841)
* docs: fix idempotent tool hint wording by [@Theater-ahyeon](https://github.com/Theater-ahyeon) in [#4875](https://github.com/PrefectHQ/fastmcp/pull/4875)
* docs: prepare FastMCP 4 beta 4 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4914](https://github.com/PrefectHQ/fastmcp/pull/4914)
* docs: fix beta 4 changelog MDX by [@zzstoatzz](https://github.com/zzstoatzz) in [#4916](https://github.com/PrefectHQ/fastmcp/pull/4916)
* docs: prepare FastMCP 4 beta 5 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4934](https://github.com/PrefectHQ/fastmcp/pull/4934)
* docs: cover list_tools and restore client modules in the SDK reference by [@zzstoatzz](https://github.com/zzstoatzz) in [#4936](https://github.com/PrefectHQ/fastmcp/pull/4936)
* docs: transport inference trust contract; trim SDK session-group comparison by [@zzstoatzz](https://github.com/zzstoatzz) in [#4940](https://github.com/PrefectHQ/fastmcp/pull/4940)
### Dependencies 📦
* chore(deps): bump mcp from 1.26.0 to 1.27.2 in /examples/testing_demo in the uv group across 1 directory by [@dependabot[bot]](https://github.com/dependabot[bot]) in [#4514](https://github.com/PrefectHQ/fastmcp/pull/4514)
* chore(deps): bump actions/setup-node from 6 to 7 by [@dependabot[bot]](https://github.com/dependabot[bot]) in [#4546](https://github.com/PrefectHQ/fastmcp/pull/4546)
* Bump actions/upload-artifact from 4 to 7 by [@dependabot[bot]](https://github.com/dependabot[bot]) in [#4640](https://github.com/PrefectHQ/fastmcp/pull/4640)
* Bump actions/setup-python from 6 to 7 by [@dependabot[bot]](https://github.com/dependabot[bot]) in [#4641](https://github.com/PrefectHQ/fastmcp/pull/4641)
* chore(deps): bump mcp from 1.27.2 to 1.28.1 in /examples/testing_demo in the uv group across 1 directory by [@dependabot[bot]](https://github.com/dependabot[bot]) in [#4614](https://github.com/PrefectHQ/fastmcp/pull/4614)
### Other Changes 🦾
* Test: HTTP lifespan fires once per process across sessions by [@jlowin](https://github.com/jlowin) in [#4470](https://github.com/PrefectHQ/fastmcp/pull/4470)
* Fix static analysis with latest ty by [@zzstoatzz](https://github.com/zzstoatzz) in [#4739](https://github.com/PrefectHQ/fastmcp/pull/4739)
* Quote run-claude allowed tools argument by [@zzstoatzz](https://github.com/zzstoatzz) in [#4741](https://github.com/PrefectHQ/fastmcp/pull/4741)
* chore(deps): Update j178/prek-action action to v3 by [@prefect-renovate[bot]](https://github.com/prefect-renovate[bot]) in [#4808](https://github.com/PrefectHQ/fastmcp/pull/4808)
* chore(deps): Update dependency node to v24 by [@prefect-renovate[bot]](https://github.com/prefect-renovate[bot]) in [#4807](https://github.com/PrefectHQ/fastmcp/pull/4807)
* chore(deps): Update astral-sh/setup-uv action to v9 by [@prefect-renovate[bot]](https://github.com/prefect-renovate[bot]) in [#4806](https://github.com/PrefectHQ/fastmcp/pull/4806)
* Fix proxy forwarding of MCP transport headers by [@jakekaplan](https://github.com/jakekaplan) in [#4853](https://github.com/PrefectHQ/fastmcp/pull/4853)
* Add FastMCP security report review skill by [@zzstoatzz](https://github.com/zzstoatzz) in [#4859](https://github.com/PrefectHQ/fastmcp/pull/4859)

## New Contributors
* @syf2211 made their first contribution in [#4502](https://github.com/PrefectHQ/fastmcp/pull/4502)
* @earfman made their first contribution in [#4517](https://github.com/PrefectHQ/fastmcp/pull/4517)
* @winklemad made their first contribution in [#4492](https://github.com/PrefectHQ/fastmcp/pull/4492)
* @verdie-g made their first contribution in [#4512](https://github.com/PrefectHQ/fastmcp/pull/4512)
* @vijaydeepsinha made their first contribution in [#4411](https://github.com/PrefectHQ/fastmcp/pull/4411)
* @piaudonn made their first contribution in [#4267](https://github.com/PrefectHQ/fastmcp/pull/4267)
* @szepeviktor made their first contribution in [#4498](https://github.com/PrefectHQ/fastmcp/pull/4498)
* @endofcake made their first contribution in [#4412](https://github.com/PrefectHQ/fastmcp/pull/4412)
* @Kludex made their first contribution in [#4564](https://github.com/PrefectHQ/fastmcp/pull/4564)
* @RachGranville made their first contribution in [#4568](https://github.com/PrefectHQ/fastmcp/pull/4568)
* @hxaxd made their first contribution in [#4533](https://github.com/PrefectHQ/fastmcp/pull/4533)
* @VectorPeak made their first contribution in [#4531](https://github.com/PrefectHQ/fastmcp/pull/4531)
* @LarryHu0217 made their first contribution in [#4587](https://github.com/PrefectHQ/fastmcp/pull/4587)
* @andrew-stelmach-fleet made their first contribution in [#4633](https://github.com/PrefectHQ/fastmcp/pull/4633)
* @Aman071106 made their first contribution in [#4628](https://github.com/PrefectHQ/fastmcp/pull/4628)
* @ShuyingZhang made their first contribution in [#4639](https://github.com/PrefectHQ/fastmcp/pull/4639)
* @Educg550 made their first contribution in [#4660](https://github.com/PrefectHQ/fastmcp/pull/4660)
* @znicholasbrown made their first contribution in [#4716](https://github.com/PrefectHQ/fastmcp/pull/4716)
* @YAO-001 made their first contribution in [#4704](https://github.com/PrefectHQ/fastmcp/pull/4704)
* @StykMartin made their first contribution in [#4719](https://github.com/PrefectHQ/fastmcp/pull/4719)
* @LHMQ878 made their first contribution in [#4738](https://github.com/PrefectHQ/fastmcp/pull/4738)
* @SaiMouli3 made their first contribution in [#4705](https://github.com/PrefectHQ/fastmcp/pull/4705)
* @yonatangross made their first contribution in [#4774](https://github.com/PrefectHQ/fastmcp/pull/4774)
* @jamiezieziula made their first contribution in [#4754](https://github.com/PrefectHQ/fastmcp/pull/4754)
* @parkedwards made their first contribution in [#4785](https://github.com/PrefectHQ/fastmcp/pull/4785)
* @trevhud made their first contribution in [#4818](https://github.com/PrefectHQ/fastmcp/pull/4818)
* @prefect-renovate[bot] made their first contribution in [#4808](https://github.com/PrefectHQ/fastmcp/pull/4808)
* @craigie-ant made their first contribution in [#4864](https://github.com/PrefectHQ/fastmcp/pull/4864)
* @Theater-ahyeon made their first contribution in [#4875](https://github.com/PrefectHQ/fastmcp/pull/4875)
* @TyceHerrman made their first contribution in [#4912](https://github.com/PrefectHQ/fastmcp/pull/4912)
* @CoralGarden52 made their first contribution in [#4948](https://github.com/PrefectHQ/fastmcp/pull/4948)

**Full Changelog**: [v3.4.7...v4.0.0](https://github.com/PrefectHQ/fastmcp/compare/v3.4.7...v4.0.0)

</Update>

<Update label="v4.0.0b5" description="2026-08-28">

**[v4.0.0b5: Group Effourt](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b5)**

FastMCP 4 beta 5 introduces `ClientGroup` — one managed client per server, each negotiating its own protocol era independently, with collision-checked tool namespacing and call routing and no proxy in the middle — and aligns middleware response limits with output schemas.

### Enhancements ✨
* Remove obsolete Docket memory-server reset fixtures by [@TyceHerrman](https://github.com/TyceHerrman) in [#4912](https://github.com/PrefectHQ/fastmcp/pull/4912)
* add independent client groups by [@zzstoatzz](https://github.com/zzstoatzz) in [#4904](https://github.com/PrefectHQ/fastmcp/pull/4904)

### Fixes 🐞
* fix(ci): satisfy latest ty control-flow checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#4928](https://github.com/PrefectHQ/fastmcp/pull/4928)
* fix(middleware): align response limits with output schemas by [@zzstoatzz](https://github.com/zzstoatzz) in [#4931](https://github.com/PrefectHQ/fastmcp/pull/4931)

### Docs 📚
* docs: fix beta 4 changelog MDX by [@zzstoatzz](https://github.com/zzstoatzz) in [#4916](https://github.com/PrefectHQ/fastmcp/pull/4916)

## New Contributors
* @TyceHerrman made their first contribution in [#4912](https://github.com/PrefectHQ/fastmcp/pull/4912)

**Full Changelog**: [v4.0.0b4...v4.0.0b5](https://github.com/PrefectHQ/fastmcp/compare/v4.0.0b4...v4.0.0b5)

</Update>

<Update label="v4.0.0b4" description="2026-08-26">

**[v4.0.0b4: Calm Befour the Storm](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b4)**

FastMCP 4 beta 4 improves modern multi-server clients and adds Prefect Horizon account commands, while tightening proxy and CIMD security boundaries and fixing Unicode search and inspect output.

### Enhancements ✨
* Add Prefect Horizon account commands by [@parkedwards](https://github.com/parkedwards) in [#4786](https://github.com/PrefectHQ/fastmcp/pull/4786)
* Cap anthropic dependency to &lt;1 by [@craigie-ant](https://github.com/craigie-ant) in [#4864](https://github.com/PrefectHQ/fastmcp/pull/4864)

### Security 🔒
* Scope Marvin App token to each job's declared permissions by [@zzstoatzz](https://github.com/zzstoatzz) in [#4834](https://github.com/PrefectHQ/fastmcp/pull/4834)
* Exclude Cookie from forwarded HTTP headers by [@zzstoatzz](https://github.com/zzstoatzz) in [#4843](https://github.com/PrefectHQ/fastmcp/pull/4843)
* Bump cryptography to 50.0.0 in the testing_demo example by [@zzstoatzz](https://github.com/zzstoatzz) in [#4844](https://github.com/PrefectHQ/fastmcp/pull/4844)
* Bound CIMD cache growth by [@jlowin](https://github.com/jlowin) in [#4852](https://github.com/PrefectHQ/fastmcp/pull/4852)

### Fixes 🐞
* Fix instructions in MCP inspect output by [@zzstoatzz](https://github.com/zzstoatzz) in [#4873](https://github.com/PrefectHQ/fastmcp/pull/4873)
* fix: support Unicode tokens in BM25 search by [@zzstoatzz](https://github.com/zzstoatzz) in [#4889](https://github.com/PrefectHQ/fastmcp/pull/4889)
* fix: support modern protocol in multi-server clients by [@zzstoatzz](https://github.com/zzstoatzz) in [#4893](https://github.com/PrefectHQ/fastmcp/pull/4893)

### Docs 📚
* docs: fix idempotent tool hint wording by [@Theater-ahyeon](https://github.com/Theater-ahyeon) in [#4875](https://github.com/PrefectHQ/fastmcp/pull/4875)
* docs: prepare FastMCP 4 beta 4 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4914](https://github.com/PrefectHQ/fastmcp/pull/4914)

### Other Changes 🦾
* chore(deps): Update j178/prek-action action to v3 by [@prefect-renovate](https://github.com/apps/prefect-renovate)[bot] in [#4808](https://github.com/PrefectHQ/fastmcp/pull/4808)
* chore(deps): Update dependency node to v24 by [@prefect-renovate](https://github.com/apps/prefect-renovate)[bot] in [#4807](https://github.com/PrefectHQ/fastmcp/pull/4807)
* chore(deps): Update astral-sh/setup-uv action to v9 by [@prefect-renovate](https://github.com/apps/prefect-renovate)[bot] in [#4806](https://github.com/PrefectHQ/fastmcp/pull/4806)
* Fix proxy forwarding of MCP transport headers by [@jakekaplan](https://github.com/jakekaplan) in [#4853](https://github.com/PrefectHQ/fastmcp/pull/4853)
* Add FastMCP security report review skill by [@zzstoatzz](https://github.com/zzstoatzz) in [#4859](https://github.com/PrefectHQ/fastmcp/pull/4859)

## New Contributors
* @prefect-renovate[bot] made their first contribution in [#4808](https://github.com/PrefectHQ/fastmcp/pull/4808)
* @craigie-ant made their first contribution in [#4864](https://github.com/PrefectHQ/fastmcp/pull/4864)
* @Theater-ahyeon made their first contribution in [#4875](https://github.com/PrefectHQ/fastmcp/pull/4875)

**Full Changelog**: [v4.0.0b3...v4.0.0b4](https://github.com/PrefectHQ/fastmcp/compare/v4.0.0b3...v4.0.0b4)

</Update>

<Update label="v4.0.0b3" description="2026-08-14">

**[v4.0.0b3: Fast Fourward](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b3)**

FastMCP 4 beta 3 moves the v4 line toward general availability with Prefect Horizon authentication, `CallArgument` and `Depends` bindings for tools and background tasks, and a round of OAuth, proxy, OpenAPI, and Python 3.14 compatibility hardening.

### Enhancements ✨
* Add Prefect Horizon authentication client and local state by [@parkedwards](https://github.com/parkedwards) in [#4785](https://github.com/PrefectHQ/fastmcp/pull/4785)
* Clarify auto-closed PR message by [@jlowin](https://github.com/jlowin) in [#4820](https://github.com/PrefectHQ/fastmcp/pull/4820)
* Support CallArgument and Depends bindings from uncalled-for 0.4.0 by [@chrisguidry](https://github.com/chrisguidry) in [#4802](https://github.com/PrefectHQ/fastmcp/pull/4802)
* Fix static analysis under newer ty releases by [@zzstoatzz](https://github.com/zzstoatzz) in [#4831](https://github.com/PrefectHQ/fastmcp/pull/4831)
* Cover CallArgument resolution in background tasks by [@zzstoatzz](https://github.com/zzstoatzz) in [#4833](https://github.com/PrefectHQ/fastmcp/pull/4833)
* Scalekit issuer updates backward compatibility by [@AkshayParihar33](https://github.com/AkshayParihar33) in [#4798](https://github.com/PrefectHQ/fastmcp/pull/4798)

### Security 🔒
* Add audience pinning to GoogleTokenVerifier by [@zzstoatzz](https://github.com/zzstoatzz) in [#4827](https://github.com/PrefectHQ/fastmcp/pull/4827)
* Bump cryptography to 50.0.0 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4836](https://github.com/PrefectHQ/fastmcp/pull/4836)

### Fixes 🐞
* Fix partial parameter hints on Python 3.14 by [@zzstoatzz](https://github.com/zzstoatzz) in [#4796](https://github.com/PrefectHQ/fastmcp/pull/4796)
* fix(openapi): extract parameter-level example and examples by [@doneman536](https://github.com/doneman536) in [#4793](https://github.com/PrefectHQ/fastmcp/pull/4793)
* Keep earlier consent CSRF tokens valid within a transaction by [@trevhud](https://github.com/trevhud) in [#4818](https://github.com/PrefectHQ/fastmcp/pull/4818)
* Fix StatefulProxyClient reconnection after session failure by [@jlowin](https://github.com/jlowin) in [#4829](https://github.com/PrefectHQ/fastmcp/pull/4829)

### Docs 📚
* Docs language dropdown by [@znicholasbrown](https://github.com/znicholasbrown) in [#4801](https://github.com/PrefectHQ/fastmcp/pull/4801)
* Docs: mirror v3.4.7 release notes by [@jlowin](https://github.com/jlowin) in [#4811](https://github.com/PrefectHQ/fastmcp/pull/4811)
* docs: prepare FastMCP 4 beta 3 by [@jlowin](https://github.com/jlowin) in [#4840](https://github.com/PrefectHQ/fastmcp/pull/4840)
* docs: add FastMCP 4 beta 3 release entries by [@jlowin](https://github.com/jlowin) in [#4841](https://github.com/PrefectHQ/fastmcp/pull/4841)

## New Contributors
* @parkedwards made their first contribution in [#4785](https://github.com/PrefectHQ/fastmcp/pull/4785)
* @trevhud made their first contribution in [#4818](https://github.com/PrefectHQ/fastmcp/pull/4818)

**Full Changelog**: [v4.0.0b2...v4.0.0b3](https://github.com/PrefectHQ/fastmcp/compare/v4.0.0b2...v4.0.0b3)

</Update>

<Update label="v3.4.7" description="2026-08-10">

**[v3.4.7: Know Your Audience](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.7)**

FastMCP 3.4.7 fixes CIMD `private_key_jwt` authentication on bare-origin OAuth proxy deployments by validating client assertions against the exact token endpoint advertised in OAuth metadata.

### Security 🔒
* Backport CIMD assertion audience fix to v3 by [@jlowin](https://github.com/jlowin) in [#4799](https://github.com/PrefectHQ/fastmcp/pull/4799)

### Docs 📚
* Docs: add v3.4.7 changelog entries by [@jlowin](https://github.com/jlowin) in [#4810](https://github.com/PrefectHQ/fastmcp/pull/4810)

**Full Changelog**: [v3.4.6...v3.4.7](https://github.com/PrefectHQ/fastmcp/compare/v3.4.6...v3.4.7)

</Update>

<Update label="v3.4.6" description="2026-08-05">

**[v3.4.6: Trust, but Proxy](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.6)**

FastMCP 3.4.6 backports trusted-proxy support for SSRF-protected OAuth metadata and JWKS fetches. Deployments can now route these requests through a mandated corporate proxy while preserving custom CA certificates; FastMCP refuses the fetch when no proxy is configured instead of risking an unprotected direct request.

### Fixes 🐞
* Backport #4412 to 3.x: support trusted SSRF proxies by [@jlowin](https://github.com/jlowin) in [#4755](https://github.com/PrefectHQ/fastmcp/pull/4755)

### Docs 📚
* Docs: add v3.4.6 changelog entries by [@jlowin](https://github.com/jlowin) in [#4761](https://github.com/PrefectHQ/fastmcp/pull/4761)

**Full Changelog**: [v3.4.5...v3.4.6](https://github.com/PrefectHQ/fastmcp/compare/v3.4.5...v3.4.6)

</Update>

<Update label="v4.0.0b1" description="2026-07-28">

**[v4.0.0b1: Fourgone Conclusion](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b1)**

FastMCP 4 makes stateful MCP applications work on the sessionless `2026-07-28` protocol while one deployment continues serving handshake-era clients. Tools can ask follow-up questions across requests, preserve authenticated user state, and move long-running work into background tasks without sticky sessions. Protocol extensions and enterprise identity become first-class surfaces, and most FastMCP 3 servers upgrade unchanged even though MCP Python SDK v2 rewrote the engine underneath them. Server-initiated sampling and roots are removed from the server API; the [upgrade guide](/getting-started/upgrading/from-fastmcp-3) covers their replacements.

### New Features 🎉
* Migrate to MCP Python SDK v2 by [@jlowin](https://github.com/jlowin) in [#4437](https://github.com/PrefectHQ/fastmcp/pull/4437)
* Teach fastmcp.Client the modern protocol: mode negotiation, MRTR driver, response cache by [@jlowin](https://github.com/jlowin) in [#4450](https://github.com/PrefectHQ/fastmcp/pull/4450)
* Forward-port Hugging Face auth provider by [@jlowin](https://github.com/jlowin) in [#4475](https://github.com/PrefectHQ/fastmcp/pull/4475)
* Add server-side identity assertion (SEP-990 ID-JAG) by [@jlowin](https://github.com/jlowin) in [#4483](https://github.com/PrefectHQ/fastmcp/pull/4483)
* Add guard-mode multi-round-trip tools (SEP-2322) by [@jlowin](https://github.com/jlowin) in [#4544](https://github.com/PrefectHQ/fastmcp/pull/4544)
* Add FastMCP-native server extension API (SEP-2133) by [@jlowin](https://github.com/jlowin) in [#4602](https://github.com/PrefectHQ/fastmcp/pull/4602)
* Add stateless session state (UserSession / SessionId) by [@jlowin](https://github.com/jlowin) in [#4604](https://github.com/PrefectHQ/fastmcp/pull/4604)
* Add background tasks via the io.modelcontextprotocol/tasks extension (SEP-2663) by [@jlowin](https://github.com/jlowin) in [#4603](https://github.com/PrefectHQ/fastmcp/pull/4603)
### Breaking Changes ⚠️
* Emit one SERVER span per request and adopt spec-correct error codes by [@jlowin](https://github.com/jlowin) in [#4445](https://github.com/PrefectHQ/fastmcp/pull/4445)
* Remove 3.x deprecated module shims and dead parameters by [@jlowin](https://github.com/jlowin) in [#4447](https://github.com/PrefectHQ/fastmcp/pull/4447)
* Remove 3.0-deprecated FastMCP server methods by [@jlowin](https://github.com/jlowin) in [#4451](https://github.com/PrefectHQ/fastmcp/pull/4451)
* Remove 3.x deprecated parameters and object-mode decorators by [@jlowin](https://github.com/jlowin) in [#4453](https://github.com/PrefectHQ/fastmcp/pull/4453)
* Migrate to MCP SDK v2.0.0b2 (httpx2) by [@jlowin](https://github.com/jlowin) in [#4503](https://github.com/PrefectHQ/fastmcp/pull/4503)
* Fix typos by [@szepeviktor](https://github.com/szepeviktor) in [#4498](https://github.com/PrefectHQ/fastmcp/pull/4498)
* Stop proxies from validating backend results or mutating shared transports by [@jlowin](https://github.com/jlowin) in [#4552](https://github.com/PrefectHQ/fastmcp/pull/4552)
* Surface resource, prompt, and proxy errors on the modern protocol by [@jlowin](https://github.com/jlowin) in [#4579](https://github.com/PrefectHQ/fastmcp/pull/4579)
* Negotiate the best mutual protocol era by default by [@jlowin](https://github.com/jlowin) in [#4572](https://github.com/PrefectHQ/fastmcp/pull/4572)
* Remove server-initiated sampling and roots from the server API by [@jlowin](https://github.com/jlowin) in [#4648](https://github.com/PrefectHQ/fastmcp/pull/4648)
* Remove 3.x-era compatibility shims by [@jlowin](https://github.com/jlowin) in [#4661](https://github.com/PrefectHQ/fastmcp/pull/4661)
### Enhancements ✨
* Deprecate ctx.sample and add clear errors for push features on 2026 connections by [@jlowin](https://github.com/jlowin) in [#4448](https://github.com/PrefectHQ/fastmcp/pull/4448)
* Add server-level cache hints (SEP-2549) by [@jlowin](https://github.com/jlowin) in [#4464](https://github.com/PrefectHQ/fastmcp/pull/4464)
* Add KeyValueResponseCacheStore for distributed client response caching by [@jlowin](https://github.com/jlowin) in [#4479](https://github.com/PrefectHQ/fastmcp/pull/4479)
* Test lifespan fires once per process over HTTP by [@jlowin](https://github.com/jlowin) in [#4480](https://github.com/PrefectHQ/fastmcp/pull/4480)
* Add telemetry off-switch and mcp.protocol.version span attribute by [@jlowin](https://github.com/jlowin) in [#4481](https://github.com/PrefectHQ/fastmcp/pull/4481)
* Trace client task management requests by [@jlowin](https://github.com/jlowin) in [#4525](https://github.com/PrefectHQ/fastmcp/pull/4525)
* Stabilize upgraded ty checks by [@jlowin](https://github.com/jlowin) in [#4526](https://github.com/PrefectHQ/fastmcp/pull/4526)
* Improve DescopeProvider scope discovery and well-known URL support by [@gaokevin1](https://github.com/gaokevin1) in [#4489](https://github.com/PrefectHQ/fastmcp/pull/4489)
* Add examples/ to the ty static-analysis gate by [@jlowin](https://github.com/jlowin) in [#4466](https://github.com/PrefectHQ/fastmcp/pull/4466)
* Expose telemetry attributes on span start by [@zzstoatzz](https://github.com/zzstoatzz) in [#4487](https://github.com/PrefectHQ/fastmcp/pull/4487)
* Fix-issue-4284 : Add Auth0MCPProvider for Auth0 Auth for MCP by [@vijaydeepsinha](https://github.com/vijaydeepsinha) in [#4411](https://github.com/PrefectHQ/fastmcp/pull/4411)
* Run FastMCP middleware for every inbound message by [@jlowin](https://github.com/jlowin) in [#4553](https://github.com/PrefectHQ/fastmcp/pull/4553)
* Add 'prs welcome' label to waive the PR assignment gate by [@jlowin](https://github.com/jlowin) in [#4557](https://github.com/PrefectHQ/fastmcp/pull/4557)
* Rename martian workflows to marvin by [@jlowin](https://github.com/jlowin) in [#4558](https://github.com/PrefectHQ/fastmcp/pull/4558)
* Bump pinned Claude models to current versions by [@jlowin](https://github.com/jlowin) in [#4561](https://github.com/PrefectHQ/fastmcp/pull/4561)
* Make the unit suite fast: in-process HTTP tests, no real sleeps, parallel Windows CI by [@jlowin](https://github.com/jlowin) in [#4554](https://github.com/PrefectHQ/fastmcp/pull/4554)
* Mirror the frontend's protocol era on a proxy's backend connection by [@jlowin](https://github.com/jlowin) in [#4573](https://github.com/PrefectHQ/fastmcp/pull/4573)
* Drop forked client protocol helpers in favor of the SDK's by [@jlowin](https://github.com/jlowin) in [#4574](https://github.com/PrefectHQ/fastmcp/pull/4574)
* Bring the v4 developer notes up to date with what shipped by [@jlowin](https://github.com/jlowin) in [#4581](https://github.com/PrefectHQ/fastmcp/pull/4581)
* Trim fastmcp.types to FastMCP-unique types by [@jlowin](https://github.com/jlowin) in [#4584](https://github.com/PrefectHQ/fastmcp/pull/4584)
* Let a server answer argument-completion requests by [@jlowin](https://github.com/jlowin) in [#4582](https://github.com/PrefectHQ/fastmcp/pull/4582)
* Add machine-to-machine client authentication by [@jlowin](https://github.com/jlowin) in [#4583](https://github.com/PrefectHQ/fastmcp/pull/4583)
* Expose era-neutral client server metadata by [@zzstoatzz](https://github.com/zzstoatzz) in [#4599](https://github.com/PrefectHQ/fastmcp/pull/4599)
* Support routable transport headers for gateways (SEP-2243) by [@jlowin](https://github.com/jlowin) in [#4622](https://github.com/PrefectHQ/fastmcp/pull/4622)
* Emit scope step-up challenges for incremental authorization (SEP-2350) by [@jlowin](https://github.com/jlowin) in [#4623](https://github.com/PrefectHQ/fastmcp/pull/4623)
* Honor OAuth application_type in DCR (SEP-837) by [@jlowin](https://github.com/jlowin) in [#4621](https://github.com/PrefectHQ/fastmcp/pull/4621)
* Drop stale label-noting instructions from CLAUDE.md by [@jlowin](https://github.com/jlowin) in [#4654](https://github.com/PrefectHQ/fastmcp/pull/4654)
* Add require_roles auth check by [@jlowin](https://github.com/jlowin) in [#4656](https://github.com/PrefectHQ/fastmcp/pull/4656)
* Add `valid_scopes` parameter to OIDC proxy valid scopes by [@Educg550](https://github.com/Educg550) in [#4660](https://github.com/PrefectHQ/fastmcp/pull/4660)
* feat: Add telemetry interop mode for FastMCP by [@strawgate](https://github.com/strawgate) in [#4046](https://github.com/PrefectHQ/fastmcp/pull/4046)
* Note that review comment threads should get an acknowledgement by [@jlowin](https://github.com/jlowin) in [#4678](https://github.com/PrefectHQ/fastmcp/pull/4678)
* Soften the review-comment reply guidance by [@jlowin](https://github.com/jlowin) in [#4683](https://github.com/PrefectHQ/fastmcp/pull/4683)
* Resolve review threads on fix, reply on decline by [@jlowin](https://github.com/jlowin) in [#4685](https://github.com/PrefectHQ/fastmcp/pull/4685)
* Move to the stable MCP Python SDK 2.0.0 by [@jlowin](https://github.com/jlowin) in [#4655](https://github.com/PrefectHQ/fastmcp/pull/4655)
### Security 🔒
* Drive the FastMCP lifespan through the SDK session manager by [@jlowin](https://github.com/jlowin) in [#4446](https://github.com/PrefectHQ/fastmcp/pull/4446)
* Route skill file access through SDK path-security primitives by [@jlowin](https://github.com/jlowin) in [#4449](https://github.com/PrefectHQ/fastmcp/pull/4449)
* Screen templated resource parameters for path traversal by default by [@jlowin](https://github.com/jlowin) in [#4482](https://github.com/PrefectHQ/fastmcp/pull/4482)
* [codex] Add OAuthProxy RFC 9207 issuer responses by [@jlowin](https://github.com/jlowin) in [#4438](https://github.com/PrefectHQ/fastmcp/pull/4438)
* Apply app visibility where no host can by [@jlowin](https://github.com/jlowin) in [#4692](https://github.com/PrefectHQ/fastmcp/pull/4692)
### Fixes 🐞
* Capture SharedContext for task-enabled Docket servers by [@jlowin](https://github.com/jlowin) in [#4443](https://github.com/PrefectHQ/fastmcp/pull/4443)
* Fix stale mcp.types imports in examples by [@jlowin](https://github.com/jlowin) in [#4452](https://github.com/PrefectHQ/fastmcp/pull/4452)
* Forward-port HTTP host guard compatibility by [@jlowin](https://github.com/jlowin) in [#4474](https://github.com/PrefectHQ/fastmcp/pull/4474)
* Fix Azure scope fallback by [@zzstoatzz](https://github.com/zzstoatzz) in [#4469](https://github.com/PrefectHQ/fastmcp/pull/4469)
* fix(server): omit ScalarElicitationType wrapper title from elicitation schemas by [@syf2211](https://github.com/syf2211) in [#4502](https://github.com/PrefectHQ/fastmcp/pull/4502)
* Skip unsupported JWKS keys instead of failing the whole key set (#4515) by [@earfman](https://github.com/earfman) in [#4517](https://github.com/PrefectHQ/fastmcp/pull/4517)
* Don't mutate the caller's schema in compress_schema by [@winklemad](https://github.com/winklemad) in [#4492](https://github.com/PrefectHQ/fastmcp/pull/4492)
* Forward upstream instructions through create_proxy by [@verdie-g](https://github.com/verdie-g) in [#4512](https://github.com/PrefectHQ/fastmcp/pull/4512)
* Serialize deep object query parameters by [@jlowin](https://github.com/jlowin) in [#4523](https://github.com/PrefectHQ/fastmcp/pull/4523)
* Reject positional-only tool parameters by [@jlowin](https://github.com/jlowin) in [#4524](https://github.com/PrefectHQ/fastmcp/pull/4524)
* Clarify PR-reopen flow and fix label-race that broke auto-reopen by [@jlowin](https://github.com/jlowin) in [#4518](https://github.com/PrefectHQ/fastmcp/pull/4518)
* Clean up disconnected task sessions by [@jlowin](https://github.com/jlowin) in [#4519](https://github.com/PrefectHQ/fastmcp/pull/4519)
* Handle expired OAuth client registrations by [@jlowin](https://github.com/jlowin) in [#4520](https://github.com/PrefectHQ/fastmcp/pull/4520)
* Fix OAuth request annotation after httpx2 migration by [@jlowin](https://github.com/jlowin) in [#4534](https://github.com/PrefectHQ/fastmcp/pull/4534)
* Fix docs banner contrast by [@jlowin](https://github.com/jlowin) in [#4522](https://github.com/PrefectHQ/fastmcp/pull/4522)
* Preserve component metadata in response cache by [@jlowin](https://github.com/jlowin) in [#4521](https://github.com/PrefectHQ/fastmcp/pull/4521)
* Clean up task sessions on connection exit by [@jlowin](https://github.com/jlowin) in [#4535](https://github.com/PrefectHQ/fastmcp/pull/4535)
* Include scopes in auth challenges by [@jlowin](https://github.com/jlowin) in [#4527](https://github.com/PrefectHQ/fastmcp/pull/4527)
* Make examples/ actually trigger the ty gate by [@jlowin](https://github.com/jlowin) in [#4541](https://github.com/PrefectHQ/fastmcp/pull/4541)
* Add subject field to AccessToken initialization by [@piaudonn](https://github.com/piaudonn) in [#4267](https://github.com/PrefectHQ/fastmcp/pull/4267)
* Restore Mintlify's fixed banner positioning by [@jlowin](https://github.com/jlowin) in [#4542](https://github.com/PrefectHQ/fastmcp/pull/4542)
* Fix #4292: SSRF guard breaks OAuth/JWKS fetches behind a corporate HTTP proxy by [@endofcake](https://github.com/endofcake) in [#4412](https://github.com/PrefectHQ/fastmcp/pull/4412)
* Preserve telemetry attributes when a sampler does not forward them by [@jlowin](https://github.com/jlowin) in [#4539](https://github.com/PrefectHQ/fastmcp/pull/4539)
* Speed up the unit test suite, and fix the task-notification race it surfaced by [@jlowin](https://github.com/jlowin) in [#4550](https://github.com/PrefectHQ/fastmcp/pull/4550)
* Fix label triage applying no labels, and make blocked tool calls fail by [@jlowin](https://github.com/jlowin) in [#4555](https://github.com/PrefectHQ/fastmcp/pull/4555)
* Fix AI workflow allowlists being destroyed by tokenization by [@jlowin](https://github.com/jlowin) in [#4560](https://github.com/PrefectHQ/fastmcp/pull/4560)
* Make transformed tool `required` order deterministic by [@Kludex](https://github.com/Kludex) in [#4564](https://github.com/PrefectHQ/fastmcp/pull/4564)
* Stop gather() from creating coroutines it may never schedule by [@jlowin](https://github.com/jlowin) in [#4559](https://github.com/PrefectHQ/fastmcp/pull/4559)
* Restore upgraded dependency checks by [@zzstoatzz](https://github.com/zzstoatzz) in [#4576](https://github.com/PrefectHQ/fastmcp/pull/4576)
* Fix skill frontmatter parsing with UTF-8 BOM by [@hxaxd](https://github.com/hxaxd) in [#4533](https://github.com/PrefectHQ/fastmcp/pull/4533)
* Fix File helper extension handling by [@VectorPeak](https://github.com/VectorPeak) in [#4531](https://github.com/PrefectHQ/fastmcp/pull/4531)
* Fix percent-encoded skill file names unreadable in resources mode by [@jlowin](https://github.com/jlowin) in [#4590](https://github.com/PrefectHQ/fastmcp/pull/4590)
* Fix flaky stdio crash-recovery tests by [@jlowin](https://github.com/jlowin) in [#4594](https://github.com/PrefectHQ/fastmcp/pull/4594)
* Bridge camelCase ToolAnnotations reads by [@zzstoatzz](https://github.com/zzstoatzz) in [#4597](https://github.com/PrefectHQ/fastmcp/pull/4597)
* Preserve raw CallToolResult tool returns by [@LarryHu0217](https://github.com/LarryHu0217) in [#4587](https://github.com/PrefectHQ/fastmcp/pull/4587)
* Advertise only supported token endpoint auth methods in OAuthProxy metadata by [@jlowin](https://github.com/jlowin) in [#4608](https://github.com/PrefectHQ/fastmcp/pull/4608)
* Fix OAuth proxy override typing by [@zzstoatzz](https://github.com/zzstoatzz) in [#4612](https://github.com/PrefectHQ/fastmcp/pull/4612)
* Pin burner-redis below the Windows-crashing 0.1.7 release by [@jlowin](https://github.com/jlowin) in [#4618](https://github.com/PrefectHQ/fastmcp/pull/4618)
* fix : canonical mime type mapping from formats to remove inconsistency #4627 by [@Aman071106](https://github.com/Aman071106) in [#4628](https://github.com/PrefectHQ/fastmcp/pull/4628)
* fix: accept callable roots handlers by [@ShuyingZhang](https://github.com/ShuyingZhang) in [#4639](https://github.com/PrefectHQ/fastmcp/pull/4639)
* Pass the MCP conformance suite's draft and pending scenarios by [@jlowin](https://github.com/jlowin) in [#4650](https://github.com/PrefectHQ/fastmcp/pull/4650)
* Use issuer_url for OAuth issuer identity by [@jlowin](https://github.com/jlowin) in [#4652](https://github.com/PrefectHQ/fastmcp/pull/4652)
* Fix the ty failure blocking upgrade checks on main by [@jlowin](https://github.com/jlowin) in [#4657](https://github.com/PrefectHQ/fastmcp/pull/4657)
* Bind CIMD assertion audience to the advertised token endpoint by [@jlowin](https://github.com/jlowin) in [#4659](https://github.com/PrefectHQ/fastmcp/pull/4659)
* Record effective scopes on the OAuth transaction by [@jlowin](https://github.com/jlowin) in [#4670](https://github.com/PrefectHQ/fastmcp/pull/4670)
* Copy schemas iteratively so deep nesting still compresses by [@jlowin](https://github.com/jlowin) in [#4671](https://github.com/PrefectHQ/fastmcp/pull/4671)
* Fix OpenAPI allOf reference fields by [@hxaxd](https://github.com/hxaxd) in [#4653](https://github.com/PrefectHQ/fastmcp/pull/4653)
* Flatten OpenAPI discriminator subtypes into request bodies by [@jlowin](https://github.com/jlowin) in [#4677](https://github.com/PrefectHQ/fastmcp/pull/4677)
* Let maintenance releases publish without fastmcp-tasks by [@jlowin](https://github.com/jlowin) in [#4676](https://github.com/PrefectHQ/fastmcp/pull/4676)
* Read CLI-scanned MCP config files as UTF-8 explicitly by [@jlowin](https://github.com/jlowin) in [#4690](https://github.com/PrefectHQ/fastmcp/pull/4690)
* Late-bind app tool names so UIs survive composition by [@jlowin](https://github.com/jlowin) in [#4682](https://github.com/PrefectHQ/fastmcp/pull/4682)
### Docs 📚
* Docs: forward-port v3.4.4 changelog entries by [@jlowin](https://github.com/jlowin) in [#4476](https://github.com/PrefectHQ/fastmcp/pull/4476)
* Document icon theme support by [@jlowin](https://github.com/jlowin) in [#4537](https://github.com/PrefectHQ/fastmcp/pull/4537)
* Add missing 4.0.0 version badge to Path Security docs by [@jlowin](https://github.com/jlowin) in [#4540](https://github.com/PrefectHQ/fastmcp/pull/4540)
* Align server component docs by [@strawgate](https://github.com/strawgate) in [#4260](https://github.com/PrefectHQ/fastmcp/pull/4260)
* Align CLI, deployment, and config docs by [@strawgate](https://github.com/strawgate) in [#4259](https://github.com/PrefectHQ/fastmcp/pull/4259)
* Align client, Apps, and integration docs by [@strawgate](https://github.com/strawgate) in [#4261](https://github.com/PrefectHQ/fastmcp/pull/4261)
* Fix stale MRTR/elicitation framing in client and upgrade docs by [@jlowin](https://github.com/jlowin) in [#4551](https://github.com/PrefectHQ/fastmcp/pull/4551)
* docs: quote pip extras install examples by [@RachGranville](https://github.com/RachGranville) in [#4568](https://github.com/PrefectHQ/fastmcp/pull/4568)
* Document Windows CI parallelism and the subprocess_heavy marker by [@jlowin](https://github.com/jlowin) in [#4575](https://github.com/PrefectHQ/fastmcp/pull/4575)
* Document v3->v4 removals and add upgrade-reality tests by [@jlowin](https://github.com/jlowin) in [#4585](https://github.com/PrefectHQ/fastmcp/pull/4585)
* Archive v3 docs and publish v4 as the primary version by [@jlowin](https://github.com/jlowin) in [#4613](https://github.com/PrefectHQ/fastmcp/pull/4613)
* Document targeted v4 prerelease installation by [@zzstoatzz](https://github.com/zzstoatzz) in [#4598](https://github.com/PrefectHQ/fastmcp/pull/4598)
* Fix stale Mac/Windows-vs-Linux OAuth key/storage docs by [@jlowin](https://github.com/jlowin) in [#4617](https://github.com/PrefectHQ/fastmcp/pull/4617)
* v4 docs quality pass: stale task/era claims, broken links, polish by [@jlowin](https://github.com/jlowin) in [#4619](https://github.com/PrefectHQ/fastmcp/pull/4619)
* whats-new: add the argument completion capability by [@jlowin](https://github.com/jlowin) in [#4620](https://github.com/PrefectHQ/fastmcp/pull/4620)
* docs: fix ProxyProvider docstring example calling nonexistent with_namespace() by [@andrew-stelmach-fleet](https://github.com/andrew-stelmach-fleet) in [#4633](https://github.com/PrefectHQ/fastmcp/pull/4633)
* Unpublish v4 development notes; prep docs for beta 1 by [@jlowin](https://github.com/jlowin) in [#4644](https://github.com/PrefectHQ/fastmcp/pull/4644)
* Expand the FAQ for the v4 transition by [@jlowin](https://github.com/jlowin) in [#4649](https://github.com/PrefectHQ/fastmcp/pull/4649)
* Document the issuer_url identity change for upgraders by [@jlowin](https://github.com/jlowin) in [#4658](https://github.com/PrefectHQ/fastmcp/pull/4658)
* Cover require_roles in the v4 highlights by [@jlowin](https://github.com/jlowin) in [#4666](https://github.com/PrefectHQ/fastmcp/pull/4666)
* Fix FAQ: sampling/roots/elicitation legacy-mode advice, SessionProvider registration by [@jlowin](https://github.com/jlowin) in [#4672](https://github.com/PrefectHQ/fastmcp/pull/4672)
* Audit v4 docs: fix missing version badges, fill whats-new gaps by [@jlowin](https://github.com/jlowin) in [#4668](https://github.com/PrefectHQ/fastmcp/pull/4668)
* Docs: add v3.4.5 changelog entries to main by [@jlowin](https://github.com/jlowin) in [#4674](https://github.com/PrefectHQ/fastmcp/pull/4674)
* Split the SDK upgrade guides by SDK version by [@jlowin](https://github.com/jlowin) in [#4684](https://github.com/PrefectHQ/fastmcp/pull/4684)
### Dependencies 📦
* chore(deps): bump mcp from 1.26.0 to 1.27.2 in /examples/testing_demo in the uv group across 1 directory by [@dependabot](https://github.com/apps/dependabot) in [#4514](https://github.com/PrefectHQ/fastmcp/pull/4514)
* chore(deps): bump actions/setup-node from 6 to 7 by [@dependabot](https://github.com/apps/dependabot) in [#4546](https://github.com/PrefectHQ/fastmcp/pull/4546)
* Bump actions/upload-artifact from 4 to 7 by [@dependabot](https://github.com/apps/dependabot) in [#4640](https://github.com/PrefectHQ/fastmcp/pull/4640)
* Bump actions/setup-python from 6 to 7 by [@dependabot](https://github.com/apps/dependabot) in [#4641](https://github.com/PrefectHQ/fastmcp/pull/4641)
* chore(deps): bump mcp from 1.27.2 to 1.28.1 in /examples/testing_demo in the uv group across 1 directory by [@dependabot](https://github.com/apps/dependabot) in [#4614](https://github.com/PrefectHQ/fastmcp/pull/4614)
### Other Changes 🦾
* Test: HTTP lifespan fires once per process across sessions by [@jlowin](https://github.com/jlowin) in [#4470](https://github.com/PrefectHQ/fastmcp/pull/4470)
## New Contributors
* @syf2211 made their first contribution in [#4502](https://github.com/PrefectHQ/fastmcp/pull/4502)
* @earfman made their first contribution in [#4517](https://github.com/PrefectHQ/fastmcp/pull/4517)
* @winklemad made their first contribution in [#4492](https://github.com/PrefectHQ/fastmcp/pull/4492)
* @verdie-g made their first contribution in [#4512](https://github.com/PrefectHQ/fastmcp/pull/4512)
* @vijaydeepsinha made their first contribution in [#4411](https://github.com/PrefectHQ/fastmcp/pull/4411)
* @piaudonn made their first contribution in [#4267](https://github.com/PrefectHQ/fastmcp/pull/4267)
* @szepeviktor made their first contribution in [#4498](https://github.com/PrefectHQ/fastmcp/pull/4498)
* @endofcake made their first contribution in [#4412](https://github.com/PrefectHQ/fastmcp/pull/4412)
* @Kludex made their first contribution in [#4564](https://github.com/PrefectHQ/fastmcp/pull/4564)
* @RachGranville made their first contribution in [#4568](https://github.com/PrefectHQ/fastmcp/pull/4568)
* @hxaxd made their first contribution in [#4533](https://github.com/PrefectHQ/fastmcp/pull/4533)
* @VectorPeak made their first contribution in [#4531](https://github.com/PrefectHQ/fastmcp/pull/4531)
* @LarryHu0217 made their first contribution in [#4587](https://github.com/PrefectHQ/fastmcp/pull/4587)
* @andrew-stelmach-fleet made their first contribution in [#4633](https://github.com/PrefectHQ/fastmcp/pull/4633)
* @Aman071106 made their first contribution in [#4628](https://github.com/PrefectHQ/fastmcp/pull/4628)
* @ShuyingZhang made their first contribution in [#4639](https://github.com/PrefectHQ/fastmcp/pull/4639)
* @Educg550 made their first contribution in [#4660](https://github.com/PrefectHQ/fastmcp/pull/4660)

**Full Changelog**: [v3.4.5...v4.0.0b1](https://github.com/PrefectHQ/fastmcp/compare/v3.4.5...v4.0.0b1)

</Update>

<Update label="v3.4.5" description="2026-07-27">

**[v3.4.5: Key Change](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.5)**

FastMCP 3.4.5 collects five fixes for the 3.x line, led by `JWTVerifier` no longer rejecting every token when an authorization server publishes an unrecognized key type such as Ed25519.

### Fixes 🐞
* Backport #4517 to release/3.x: skip unsupported JWKS keys (#4515) by [@kakiii](https://github.com/kakiii) in [#4631](https://github.com/PrefectHQ/fastmcp/pull/4631)
* Backport #4469 to release/3.x: fix Azure scope fallback by [@jlowin](https://github.com/jlowin) in [#4662](https://github.com/PrefectHQ/fastmcp/pull/4662)
* Backport #4523 to release/3.x: serialize deep object query parameters by [@jlowin](https://github.com/jlowin) in [#4664](https://github.com/PrefectHQ/fastmcp/pull/4664)
* Backport #4564 to release/3.x: make transformed tool required order deterministic by [@jlowin](https://github.com/jlowin) in [#4665](https://github.com/PrefectHQ/fastmcp/pull/4665)
* Backport #4492 to release/3.x: don't mutate the caller's schema in compress_schema by [@jlowin](https://github.com/jlowin) in [#4663](https://github.com/PrefectHQ/fastmcp/pull/4663)

## New Contributors
* @kakiii made their first contribution in [#4631](https://github.com/PrefectHQ/fastmcp/pull/4631)

**Full Changelog**: [v3.4.4...v3.4.5](https://github.com/PrefectHQ/fastmcp/compare/v3.4.4...v3.4.5)

</Update>

<Update label="v3.4.4" description="2026-07-08">

**[v3.4.4: Host in Translation](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.4)**

FastMCP 3.4.4 restores HTTP deployment compatibility after the 3.4.3 Host/Origin guard changed default behavior for existing ASGI, serverless, and reverse-proxy deployments. The guard implementation remains available for deployments that opt in with explicit trusted hosts and origins, while 3.x returns to accepting traffic that worked before the patch. This release also adds Hugging Face OAuth provider support, with docs and examples for public and private apps, PKCE, Dynamic Client Registration, and CIMD.

### Enhancements ✨
* Hugging Face Auth Integration by [@evalstate](https://github.com/evalstate) in [#4385](https://github.com/PrefectHQ/fastmcp/pull/4385)
### Fixes 🐞
* Relax host origin guard defaults by [@jlowin](https://github.com/jlowin) in [#4439](https://github.com/PrefectHQ/fastmcp/pull/4439)
* Restore HTTP host guard compatibility by [@jlowin](https://github.com/jlowin) in [#4472](https://github.com/PrefectHQ/fastmcp/pull/4472)

## New Contributors
* @evalstate made their first contribution in [#4385](https://github.com/PrefectHQ/fastmcp/pull/4385)

**Full Changelog**: [v3.4.3...v3.4.4](https://github.com/PrefectHQ/fastmcp/compare/v3.4.3...v3.4.4)

</Update>

<Update label="v3.4.3" description="2026-07-05">

**[v3.4.3: The Fast and the Secure-ious](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.3)**

FastMCP 3.4.3 closes out a month of SSRF and OAuth hardening: NAT64, 6to4, Teredo, and ISATAP transition addresses can no longer smuggle private IPv4 targets past the SSRF allow-list, Streamable HTTP now validates Host and Origin before session handling to block DNS rebinding against localhost-bound servers, and OAuth redirect validation rejects unsafe schemes and unregistered DCR redirect URIs. Alongside the security work, this release also fixes proxy session teardown races, discriminator-tag handling in JSON schema conversion, and several smaller reliability issues.

### Enhancements ✨
* Dedupe discriminator-required helper across schema converters by [@jlowin](https://github.com/jlowin) in [#4362](https://github.com/PrefectHQ/fastmcp/pull/4362)
* Add real Monty sandbox e2e coverage for CodeMode call_tool by [@AlexlaGuardia](https://github.com/AlexlaGuardia) in [#4274](https://github.com/PrefectHQ/fastmcp/pull/4274)
* Switch prettier hook to rbubley/mirrors-prettier by [@jlowin](https://github.com/jlowin) in [#4366](https://github.com/PrefectHQ/fastmcp/pull/4366)
* feat(remote): add --verify flag for TLS certificate verification by [@jlowin](https://github.com/jlowin) in [#4369](https://github.com/PrefectHQ/fastmcp/pull/4369)
### Security 🔒
* fix(deps): clear Dependabot security alerts via lockfile bumps by [@jlowin](https://github.com/jlowin) in [#4393](https://github.com/PrefectHQ/fastmcp/pull/4393)
* Clarify resource path parameter safety by [@jlowin](https://github.com/jlowin) in [#4398](https://github.com/PrefectHQ/fastmcp/pull/4398)
* Fix dev apps launch escaping by [@jlowin](https://github.com/jlowin) in [#4399](https://github.com/PrefectHQ/fastmcp/pull/4399)
* Block NAT64 SSRF bypass by [@jlowin](https://github.com/jlowin) in [#4400](https://github.com/PrefectHQ/fastmcp/pull/4400)
* [codex] Fix event store replay isolation by [@jlowin](https://github.com/jlowin) in [#4402](https://github.com/PrefectHQ/fastmcp/pull/4402)
* Fix DCR redirect URI validation by [@jlowin](https://github.com/jlowin) in [#4408](https://github.com/PrefectHQ/fastmcp/pull/4408)
* Protect streamable HTTP from DNS rebinding by [@jlowin](https://github.com/jlowin) in [#4405](https://github.com/PrefectHQ/fastmcp/pull/4405)
* Block unsafe OAuth redirect schemes by [@jlowin](https://github.com/jlowin) in [#4419](https://github.com/PrefectHQ/fastmcp/pull/4419)
* Block IPv6 transition SSRF bypasses by [@jlowin](https://github.com/jlowin) in [#4426](https://github.com/PrefectHQ/fastmcp/pull/4426)
### Fixes 🐞
* fix: caching middleware TypeError on cache miss due to mismatched call_next parameter by [@gmenziesint](https://github.com/gmenziesint) in [#4301](https://github.com/PrefectHQ/fastmcp/pull/4301)
* Fix: async rate limiting middleware get_client_id callbacks by [@Chotom](https://github.com/Chotom) in [#4319](https://github.com/PrefectHQ/fastmcp/pull/4319)
* Recognize all GitHub issue-link forms in require-issue-link workflow by [@jlowin](https://github.com/jlowin) in [#4359](https://github.com/PrefectHQ/fastmcp/pull/4359)
* fix: preserve required discriminator tags by [@he-yufeng](https://github.com/he-yufeng) in [#4297](https://github.com/PrefectHQ/fastmcp/pull/4297)
* fix(proxy): shield stateful proxy disconnect during session teardown by [@jlowin](https://github.com/jlowin) in [#4363](https://github.com/PrefectHQ/fastmcp/pull/4363)
* fix(fs): isolate same-named package imports across providers by [@jlowin](https://github.com/jlowin) in [#4361](https://github.com/PrefectHQ/fastmcp/pull/4361)
* fix: StatefulProxyClient.clear() no longer causes KeyError on session teardown by [@tcconnally](https://github.com/tcconnally) in [#4328](https://github.com/PrefectHQ/fastmcp/pull/4328)
* fix: guard recursive refs in json_schema_to_type by [@Epochex](https://github.com/Epochex) in [#4312](https://github.com/PrefectHQ/fastmcp/pull/4312)
* Forward IdP auth errors to MCP client instead of showing HTML error page by [@bobbyjames839](https://github.com/bobbyjames839) in [#4293](https://github.com/PrefectHQ/fastmcp/pull/4293)
* fix(resources): round-trip path values with reserved characters in URI templates by [@jlowin](https://github.com/jlowin) in [#4368](https://github.com/PrefectHQ/fastmcp/pull/4368)
* fix: bracket IPv6 hosts in server startup log URL by [@jlowin](https://github.com/jlowin) in [#4372](https://github.com/PrefectHQ/fastmcp/pull/4372)
* fix: bound default OIDC discovery timeout and expose it on provider wrappers by [@jlowin](https://github.com/jlowin) in [#4374](https://github.com/PrefectHQ/fastmcp/pull/4374)
* fix: validate task tool arguments against declared types by [@jlowin](https://github.com/jlowin) in [#4373](https://github.com/PrefectHQ/fastmcp/pull/4373)
* fix(tools): honor serialize_by_alias in tool result serialization by [@jlowin](https://github.com/jlowin) in [#4391](https://github.com/PrefectHQ/fastmcp/pull/4391)
* Fix/cimd flow issue by [@twjackysu](https://github.com/twjackysu) in [#4206](https://github.com/PrefectHQ/fastmcp/pull/4206)
* Reject empty env var keys by [@CodingFeng101](https://github.com/CodingFeng101) in [#4410](https://github.com/PrefectHQ/fastmcp/pull/4410)
* fix: correct replace_type docstring parameter descriptions by [@hiSandog](https://github.com/hiSandog) in [#4375](https://github.com/PrefectHQ/fastmcp/pull/4375)
* Fix ty 0.0.55 diagnostics and prefab-ui protocol version drift by [@jlowin](https://github.com/jlowin) in [#4428](https://github.com/PrefectHQ/fastmcp/pull/4428)
* [codex] Fix OpenAPI resource template requests by [@jlowin](https://github.com/jlowin) in [#4407](https://github.com/PrefectHQ/fastmcp/pull/4407)
### Docs 📚
* fix: RST docstrings in fastmcp.types render raw on gofastmcp.com by [@jlowin](https://github.com/jlowin) in [#4367](https://github.com/PrefectHQ/fastmcp/pull/4367)
* docs: fix 5 broken internal links (auth & providers pages) by [@Michael-WhiteCapData](https://github.com/Michael-WhiteCapData) in [#4344](https://github.com/PrefectHQ/fastmcp/pull/4344)
* docs: add audit/event-record recipe for tool-call middleware by [@AlexlaGuardia](https://github.com/AlexlaGuardia) in [#4345](https://github.com/PrefectHQ/fastmcp/pull/4345)
### Dependencies 📦
* chore(deps): bump actions/checkout from 6 to 7 by [@dependabot](https://github.com/apps/dependabot) in [#4343](https://github.com/PrefectHQ/fastmcp/pull/4343)
* chore(deps): bump joserfc from 1.6.5 to 1.6.7 in the uv group across 1 directory by [@dependabot](https://github.com/apps/dependabot) in [#4394](https://github.com/PrefectHQ/fastmcp/pull/4394)
* chore(deps): bump joserfc from 1.6.7 to 1.6.8 in the uv group across 1 directory by [@dependabot](https://github.com/apps/dependabot) in [#4429](https://github.com/PrefectHQ/fastmcp/pull/4429)
### Other Changes 🦾
* Raise fastmcp.ValidationError for invalid tool arguments by [@jlowin](https://github.com/jlowin) in [#4392](https://github.com/PrefectHQ/fastmcp/pull/4392)
* Fix versioned auth middleware checks by [@jlowin](https://github.com/jlowin) in [#4401](https://github.com/PrefectHQ/fastmcp/pull/4401)

## New Contributors
* @gmenziesint made their first contribution in [#4301](https://github.com/PrefectHQ/fastmcp/pull/4301)
* @Chotom made their first contribution in [#4319](https://github.com/PrefectHQ/fastmcp/pull/4319)
* @he-yufeng made their first contribution in [#4297](https://github.com/PrefectHQ/fastmcp/pull/4297)
* @AlexlaGuardia made their first contribution in [#4274](https://github.com/PrefectHQ/fastmcp/pull/4274)
* @tcconnally made their first contribution in [#4328](https://github.com/PrefectHQ/fastmcp/pull/4328)
* @Epochex made their first contribution in [#4312](https://github.com/PrefectHQ/fastmcp/pull/4312)
* @Michael-WhiteCapData made their first contribution in [#4344](https://github.com/PrefectHQ/fastmcp/pull/4344)
* @bobbyjames839 made their first contribution in [#4293](https://github.com/PrefectHQ/fastmcp/pull/4293)
* @twjackysu made their first contribution in [#4206](https://github.com/PrefectHQ/fastmcp/pull/4206)
* @CodingFeng101 made their first contribution in [#4410](https://github.com/PrefectHQ/fastmcp/pull/4410)
* @hiSandog made their first contribution in [#4375](https://github.com/PrefectHQ/fastmcp/pull/4375)

**Full Changelog**: [v3.4.2...v3.4.3](https://github.com/PrefectHQ/fastmcp/compare/v3.4.2...v3.4.3)

</Update>

<Update label="v3.4.2" description="2026-06-06">

**[v3.4.2: Heads Up](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.2)**

FastMCP 3.4.2 restores JWT compatibility for providers that include private, non-critical JWS header parameters. Tokens from providers like Clerk can carry header metadata such as `cat` without being rejected before signature and claim validation, while unsupported critical headers are still rejected.

### Fixes 🐞
* Allow private JWT headers by [@jlowin](https://github.com/jlowin) in [#4290](https://github.com/PrefectHQ/fastmcp/pull/4290)
### Docs 📚
* Docs: add v3.4.1 changelog entries by [@jlowin](https://github.com/jlowin) in [#4289](https://github.com/PrefectHQ/fastmcp/pull/4289)

**Full Changelog**: [v3.4.1...v3.4.2](https://github.com/PrefectHQ/fastmcp/compare/v3.4.1...v3.4.2)

</Update>

<Update label="v3.4.1" description="2026-06-05">

**[v3.4.1: Floor It](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.1)**

FastMCP 3.4.1 floors Starlette at `>=1.0.1` so installs can no longer resolve to a version affected by CVE-2026-48710, which was previously only constrained transitively through `mcp`. It also makes OAuthProxy log refresh-token cache misses instead of failing silently.

### Enhancements ✨
* Log refresh-token misses in OAuthProxy instead of failing silently by [@jlowin](https://github.com/jlowin) in [#4276](https://github.com/PrefectHQ/fastmcp/pull/4276)
### Security 🔒
* Add explicit starlette>=1.0.1 floor (CVE-2026-48710) by [@jlowin](https://github.com/jlowin) in [#4286](https://github.com/PrefectHQ/fastmcp/pull/4286)
### Docs 📚
* Document --notes-start-tag in release instructions by [@jlowin](https://github.com/jlowin) in [#4275](https://github.com/PrefectHQ/fastmcp/pull/4275)

**Full Changelog**: [v3.4.0...v3.4.1](https://github.com/PrefectHQ/fastmcp/compare/v3.4.0...v3.4.1)

</Update>

<Update label="v3.4.0" description="2026-06-02">

**[v3.4.0: Remote Control](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.0)**

FastMCP 3.4 is about reaching servers that live somewhere else. The headline is `fastmcp-remote`, a standalone bridge that connects stdio-only MCP hosts to servers hosted over HTTP. Around it, the proxy layer those connections depend on is hardened: a proxy now forwards `initialize` upstream and fails loudly when the backend is missing or misconfigured, instead of reporting a connected-but-empty proxy. And FastMCP-issued access tokens can now outlive short-lived upstream tokens, so authenticated sessions survive the long idle periods remote clients are prone to.

### New Features 🎉
* Add fastmcp-remote bridge package by [@jlowin](https://github.com/jlowin) in [#4208](https://github.com/PrefectHQ/fastmcp/pull/4208)
### Breaking Changes ⚠️
* Forward proxy initialize as bridge behavior by [@jlowin](https://github.com/jlowin) in [#4228](https://github.com/PrefectHQ/fastmcp/pull/4228)
### Enhancements ✨
* ci: require external PRs to link a tracked issue by [@strawgate](https://github.com/strawgate) in [#4173](https://github.com/PrefectHQ/fastmcp/pull/4173)
* feat: new options --host and --no-log-panel | --log-panel  to cli dev apps by [@itaru2622](https://github.com/itaru2622) in [#4123](https://github.com/PrefectHQ/fastmcp/pull/4123)
* Add valid_scopes and extra_authorize_params to WorkOSProvider by [@tiagoskaneta](https://github.com/tiagoskaneta) in [#4135](https://github.com/PrefectHQ/fastmcp/pull/4135)
* Add token_expiry_threshold_seconds for proactive token refresh by [@mohankumarelec](https://github.com/mohankumarelec) in [#4142](https://github.com/PrefectHQ/fastmcp/pull/4142)
* Add review-issue skill for triaging gated external contributions by [@jlowin](https://github.com/jlowin) in [#4212](https://github.com/PrefectHQ/fastmcp/pull/4212)
* Add contract gate to review-issue skill by [@jlowin](https://github.com/jlowin) in [#4214](https://github.com/PrefectHQ/fastmcp/pull/4214)
* Let ToolResult return an error result via is_error by [@jlowin](https://github.com/jlowin) in [#4217](https://github.com/PrefectHQ/fastmcp/pull/4217)
* Update published docs after PyPI release by [@jlowin](https://github.com/jlowin) in [#4211](https://github.com/PrefectHQ/fastmcp/pull/4211)
* Allow pre-bound HTTP sockets by [@jlowin](https://github.com/jlowin) in [#4222](https://github.com/PrefectHQ/fastmcp/pull/4222)
* Add targeted coverage tests by [@strawgate](https://github.com/strawgate) in [#4230](https://github.com/PrefectHQ/fastmcp/pull/4230)
* Upgrade ty to 0.0.39 by [@jlowin](https://github.com/jlowin) in [#4225](https://github.com/PrefectHQ/fastmcp/pull/4225)
* Decouple FastMCP access token lifetime from upstream expires_in by [@jlowin](https://github.com/jlowin) in [#4254](https://github.com/PrefectHQ/fastmcp/pull/4254)
### Security 🔒
* feat(code-mode): default sandbox limits and per-execution tool-call cap by [@strawgate](https://github.com/strawgate) in [#4170](https://github.com/PrefectHQ/fastmcp/pull/4170)
* Security: Fix 3 findings in GitHub Actions workflows by [@jpr5](https://github.com/jpr5) in [#4183](https://github.com/PrefectHQ/fastmcp/pull/4183)
* Add outbound comment guardrails by [@jlowin](https://github.com/jlowin) in [#4196](https://github.com/PrefectHQ/fastmcp/pull/4196)
* Add uv dependency cooldown by [@jlowin](https://github.com/jlowin) in [#4213](https://github.com/PrefectHQ/fastmcp/pull/4213)
### Fixes 🐞
* fix: VersionSpec eq matching normalizes versions and selects deterministically by [@strawgate](https://github.com/strawgate) in [#4058](https://github.com/PrefectHQ/fastmcp/pull/4058)
* fix(tests): hoist azure-identity import out of the OBO test timeout window by [@strawgate](https://github.com/strawgate) in [#4176](https://github.com/PrefectHQ/fastmcp/pull/4176)
* fix(auth): disambiguate auth-denied vs missing component messages by [@strawgate](https://github.com/strawgate) in [#4165](https://github.com/PrefectHQ/fastmcp/pull/4165)
* fix: preserve annotations, meta, title, icons when creating resources from templates by [@strawgate](https://github.com/strawgate) in [#4061](https://github.com/PrefectHQ/fastmcp/pull/4061)
* fix: add OTEL spans to sampling step and tool execution by [@strawgate](https://github.com/strawgate) in [#4059](https://github.com/PrefectHQ/fastmcp/pull/4059)
* fix(config): read MCP config files as UTF-8 by [@pragnyanramtha](https://github.com/pragnyanramtha) in [#4164](https://github.com/PrefectHQ/fastmcp/pull/4164)
* fix(schema): preserve root metadata on fallback by [@yuyua9](https://github.com/yuyua9) in [#4178](https://github.com/PrefectHQ/fastmcp/pull/4178)
* fix(proxy): restore _current_server in _restore_request_context by [@strawgate](https://github.com/strawgate) in [#4168](https://github.com/PrefectHQ/fastmcp/pull/4168)
* fix(auth): add /.well-known/openid-configuration alias for OAuth server metadata by [@shigechika](https://github.com/shigechika) in [#4167](https://github.com/PrefectHQ/fastmcp/pull/4167)
* fix(code-mode): cancel Monty sandbox future on task cancellation by [@strawgate](https://github.com/strawgate) in [#4169](https://github.com/PrefectHQ/fastmcp/pull/4169)
* fix(auth): unprefix Azure scopes echoed back to MCP clients by [@rgillinlz](https://github.com/rgillinlz) in [#4130](https://github.com/PrefectHQ/fastmcp/pull/4130)
* fix(cli): forward stateless flag in uv run path by [@yuyua9](https://github.com/yuyua9) in [#4177](https://github.com/PrefectHQ/fastmcp/pull/4177)
* fix(ci): scope minimize-reviews concurrency by event name by [@strawgate](https://github.com/strawgate) in [#4174](https://github.com/PrefectHQ/fastmcp/pull/4174)
* Fix docs app demo iframe assets by [@jlowin](https://github.com/jlowin) in [#4194](https://github.com/PrefectHQ/fastmcp/pull/4194)
* Guard require-issue-link check job to pull_request_target events by [@jlowin](https://github.com/jlowin) in [#4209](https://github.com/PrefectHQ/fastmcp/pull/4209)
* Migrate auth JWTs to joserfc by [@jlowin](https://github.com/jlowin) in [#4221](https://github.com/PrefectHQ/fastmcp/pull/4221)
* Skip published docs update for prereleases by [@jlowin](https://github.com/jlowin) in [#4224](https://github.com/PrefectHQ/fastmcp/pull/4224)
* Surface proxy upstream failures by [@jlowin](https://github.com/jlowin) in [#4227](https://github.com/PrefectHQ/fastmcp/pull/4227)
* Close upstream OAuth clients by [@jlowin](https://github.com/jlowin) in [#4248](https://github.com/PrefectHQ/fastmcp/pull/4248)
* Fix GitHub MCP resource integration test by [@jlowin](https://github.com/jlowin) in [#4253](https://github.com/PrefectHQ/fastmcp/pull/4253)
* Fix resource templates with query params on proxied servers by [@rene84](https://github.com/rene84) in [#4251](https://github.com/PrefectHQ/fastmcp/pull/4251)
### Docs 📚
* Document pip upgrade recovery for the fastmcp-slim package split by [@jlowin](https://github.com/jlowin) in [#4215](https://github.com/PrefectHQ/fastmcp/pull/4215)
* Move pip upgrade recovery into a Troubleshooting section by [@jlowin](https://github.com/jlowin) in [#4219](https://github.com/PrefectHQ/fastmcp/pull/4219)
* Restore Horizon docs banner by [@jlowin](https://github.com/jlowin) in [#4240](https://github.com/PrefectHQ/fastmcp/pull/4240)
* fix: Trendshift link and badge in README.md by [@bhantos](https://github.com/bhantos) in [#4236](https://github.com/PrefectHQ/fastmcp/pull/4236)
* docs: add tool fingerprinting recipe by [@dgenio](https://github.com/dgenio) in [#4233](https://github.com/PrefectHQ/fastmcp/pull/4233)
### Dependencies 📦
* chore(deps): bump the uv group across 2 directories with 1 update by [@dependabot](https://github.com/dependabot) in [#4113](https://github.com/PrefectHQ/fastmcp/pull/4113)
* chore(deps-dev): bump pydantic-monty from 0.0.16 to 0.0.17 by [@dependabot](https://github.com/dependabot) in [#4023](https://github.com/PrefectHQ/fastmcp/pull/4023)
### Other Changes 🦾
* Exempt maintainers from MRE auto-close by [@jlowin](https://github.com/jlowin) in [#4220](https://github.com/PrefectHQ/fastmcp/pull/4220)

## New Contributors
* @pragnyanramtha made their first contribution in [#4164](https://github.com/PrefectHQ/fastmcp/pull/4164)
* @yuyua9 made their first contribution in [#4178](https://github.com/PrefectHQ/fastmcp/pull/4178)
* @tiagoskaneta made their first contribution in [#4135](https://github.com/PrefectHQ/fastmcp/pull/4135)
* @mohankumarelec made their first contribution in [#4142](https://github.com/PrefectHQ/fastmcp/pull/4142)
* @rgillinlz made their first contribution in [#4130](https://github.com/PrefectHQ/fastmcp/pull/4130)
* @jpr5 made their first contribution in [#4183](https://github.com/PrefectHQ/fastmcp/pull/4183)
* @bhantos made their first contribution in [#4236](https://github.com/PrefectHQ/fastmcp/pull/4236)
* @rene84 made their first contribution in [#4251](https://github.com/PrefectHQ/fastmcp/pull/4251)

**Full Changelog**: [v3.3.1...v3.4.0](https://github.com/PrefectHQ/fastmcp/compare/v3.3.1...v3.4.0)

</Update>

<Update label="v3.3.1" description="2026-05-15">

**[v3.3.1: Loop There It Is](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.3.1)**

A hotfix for the 3.3 packaging split. Clean installs could fail on standalone component imports like `from fastmcp.tools import tool`, because component modules reached auth and task primitives through `fastmcp.server` and pulled in the full server/provider stack. Those primitives now live in lightweight utility modules, with the old server import paths preserved as compatibility re-exports.

### Fixes 🐞
* fix(docs): use valid FA icon on client-only package page by [@jlowin](https://github.com/jlowin) in [#4139](https://github.com/PrefectHQ/fastmcp/pull/4139)
* Decouple component imports from server by [@jlowin](https://github.com/jlowin) in [#4150](https://github.com/PrefectHQ/fastmcp/pull/4150)


**Full Changelog**: [v3.3.0...v3.3.1](https://github.com/PrefectHQ/fastmcp/compare/v3.3.0...v3.3.1)

</Update>

<Update label="v3.3.0" description="2026-05-15">

**[v3.3.0: Slim Reaper](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.3.0)**

FastMCP 3.3 ships `fastmcp-slim`, a dependency-light distribution that separates the client from the server stack — install FastMCP's client and transport layer without Starlette, Uvicorn, or the rest of the server machinery. The import namespace is unchanged. It also closes out a backlog of OAuth proxy security hardening, MCP-compliant OTEL instrumentation, and auth additions that accumulated through the 3.2 cycle.

### New Features 🎉
* Add fastmcp-slim for client-only installs by [@jlowin](https://github.com/jlowin) in [#4122](https://github.com/PrefectHQ/fastmcp/pull/4122)
### Enhancements ✨
* Add default prefill to FormInput.collect_input by [@jlowin](https://github.com/jlowin) in [#3937](https://github.com/PrefectHQ/fastmcp/pull/3937)
* OTEL: Fix attribute compliance with MCP semantic conventions by [@strawgate](https://github.com/strawgate) in [#3889](https://github.com/PrefectHQ/fastmcp/pull/3889)
* OTEL: Instrument all MCP list operations and enrich delegate spans by [@strawgate](https://github.com/strawgate) in [#3890](https://github.com/PrefectHQ/fastmcp/pull/3890)
* Improve real-world schema crash test: failure dump, cluster analysis, TypeErrors baseline ratchet by [@jlowin](https://github.com/jlowin) in [#3958](https://github.com/PrefectHQ/fastmcp/pull/3958)
* feat: add AzureB2CProvider for Azure AD B2C user flows by [@carlos-rian](https://github.com/carlos-rian) in [#3995](https://github.com/PrefectHQ/fastmcp/pull/3995)
* Add run_in_thread opt-out for sync tools with thread affinity by [@jlowin](https://github.com/jlowin) in [#4010](https://github.com/PrefectHQ/fastmcp/pull/4010)
* Add missing return type annotation to __getattr__ by [@ZLeventer](https://github.com/ZLeventer) in [#4026](https://github.com/PrefectHQ/fastmcp/pull/4026)
* Add experimental_capabilities kwarg to FastMCP constructor by [@jlowin](https://github.com/jlowin) in [#4042](https://github.com/PrefectHQ/fastmcp/pull/4042)
* Add log_level parameter to FastMCP errors by [@daniel-tsiang](https://github.com/daniel-tsiang) in [#4036](https://github.com/PrefectHQ/fastmcp/pull/4036)
* Bump pydocket to 0.20.0 by [@chrisguidry](https://github.com/chrisguidry) in [#4031](https://github.com/PrefectHQ/fastmcp/pull/4031)
* enh: Add public API for updating OAuthProxy scopes after initialization by [@taylorwilsdon](https://github.com/taylorwilsdon) in [#4091](https://github.com/PrefectHQ/fastmcp/pull/4091)
* Refine fastmcp-slim packaging by [@jlowin](https://github.com/jlowin) in [#4125](https://github.com/PrefectHQ/fastmcp/pull/4125)
### Security 🔒
* Harden OAuth Proxy silent consent against AS-in-the-middle by [@jlowin](https://github.com/jlowin) in [#3960](https://github.com/PrefectHQ/fastmcp/pull/3960)
* Reject dot-segments in redirect URI allowlist matching by [@jlowin](https://github.com/jlowin) in [#3963](https://github.com/PrefectHQ/fastmcp/pull/3963)
* Bump deps with open dependabot alerts by [@jlowin](https://github.com/jlowin) in [#3965](https://github.com/PrefectHQ/fastmcp/pull/3965)
* Partition ResponseCachingMiddleware cache by access token by [@jlowin](https://github.com/jlowin) in [#4041](https://github.com/PrefectHQ/fastmcp/pull/4041)
### Fixes 🐞
* fix: reject self-mount to prevent infinite recursion by [@strawgate](https://github.com/strawgate) in [#3925](https://github.com/PrefectHQ/fastmcp/pull/3925)
* fix: ProxyTool crashes on non-TextContent error responses by [@strawgate](https://github.com/strawgate) in [#3926](https://github.com/PrefectHQ/fastmcp/pull/3926)
* fix: _prune_param and _convert_nullable_field mutate input schemas by [@strawgate](https://github.com/strawgate) in [#3927](https://github.com/PrefectHQ/fastmcp/pull/3927)
* fix: narrow OpenAI audio format dict to Literal for ty by [@jlowin](https://github.com/jlowin) in [#3936](https://github.com/PrefectHQ/fastmcp/pull/3936)
* fix: allow hyphens in resource template parameter names by [@strawgate](https://github.com/strawgate) in [#3929](https://github.com/PrefectHQ/fastmcp/pull/3929)
* fix: OpenAPI request director sends multipart and form-urlencoded as JSON by [@strawgate](https://github.com/strawgate) in [#3932](https://github.com/PrefectHQ/fastmcp/pull/3932)
* Fix raise_on_error handling for tool tasks by [@gnanirahulnutakki](https://github.com/gnanirahulnutakki) in [#3946](https://github.com/PrefectHQ/fastmcp/pull/3946)
* fix: FileSystemProvider reload race condition by [@strawgate](https://github.com/strawgate) in [#3938](https://github.com/PrefectHQ/fastmcp/pull/3938)
* fix tests that relied on task=True returning error results by [@jlowin](https://github.com/jlowin) in [#3954](https://github.com/PrefectHQ/fastmcp/pull/3954)
* Restore task snapshot via a worker-level dependency by [@chrisguidry](https://github.com/chrisguidry) in [#3945](https://github.com/PrefectHQ/fastmcp/pull/3945)
* Forward backend capabilities in ProxyProvider by [@jlowin](https://github.com/jlowin) in [#3956](https://github.com/PrefectHQ/fastmcp/pull/3956)
* Allow upstream client_id to be used directly without DCR by [@jlowin](https://github.com/jlowin) in [#3957](https://github.com/PrefectHQ/fastmcp/pull/3957)
* Graceful fallback for unsupported regex patterns in json_schema_to_type by [@jlowin](https://github.com/jlowin) in [#3959](https://github.com/PrefectHQ/fastmcp/pull/3959)
* Revert "Forward backend capabilities in ProxyProvider (#3956)" by [@jlowin](https://github.com/jlowin) in [#3964](https://github.com/PrefectHQ/fastmcp/pull/3964)
* fix: skip stdio subprocess test on Windows CI by [@jlowin](https://github.com/jlowin) in [#3966](https://github.com/PrefectHQ/fastmcp/pull/3966)
* fix: bound _refresh_locks with LRU eviction to prevent memory leak by [@jlowin](https://github.com/jlowin) in [#3968](https://github.com/PrefectHQ/fastmcp/pull/3968)
* fix: handle circular JSON Pointer $ref in dereference_refs by [@lawrence3699](https://github.com/lawrence3699) in [#3896](https://github.com/PrefectHQ/fastmcp/pull/3896)
* fix: honor upstream refresh token expiry in OAuthProxy by [@jlowin](https://github.com/jlowin) in [#3990](https://github.com/PrefectHQ/fastmcp/pull/3990)
* fix: narrow _token_validator with isinstance for ty in AzureProvider.from_b2c by [@jlowin](https://github.com/jlowin) in [#4007](https://github.com/PrefectHQ/fastmcp/pull/4007)
* fix: cancel orphaned session_task when Client._disconnect times out by [@jlowin](https://github.com/jlowin) in [#4011](https://github.com/PrefectHQ/fastmcp/pull/4011)
* fix: preserve @tool metadata in from_function by [@lawrence3699](https://github.com/lawrence3699) in [#4072](https://github.com/PrefectHQ/fastmcp/pull/4072)
* fix(openapi): keep blank values in parse_qs (refs #4056) by [@MukundaKatta](https://github.com/MukundaKatta) in [#4076](https://github.com/PrefectHQ/fastmcp/pull/4076)
* Fix #4056: keep blank query values, add token bucket regression test by [@MukundaKatta](https://github.com/MukundaKatta) in [#4069](https://github.com/PrefectHQ/fastmcp/pull/4069)
* fix(ping): exit ping loop cleanly when session stream is closed by [@ashwin153](https://github.com/ashwin153) in [#4087](https://github.com/PrefectHQ/fastmcp/pull/4087)
* Fix sampling from background tasks by [@cuyua9](https://github.com/cuyua9) in [#4068](https://github.com/PrefectHQ/fastmcp/pull/4068)
* Make Docket reentrant; mounted servers enter their own lifespan by [@jlowin](https://github.com/jlowin) in [#4095](https://github.com/PrefectHQ/fastmcp/pull/4095)
* fix(tool_transform): hoist $defs to schema root when ArgTransform introduces them by [@SarthakB11](https://github.com/SarthakB11) in [#4101](https://github.com/PrefectHQ/fastmcp/pull/4101)
* fix(auth): silence authlib.jose DeprecationWarning at JWT import by [@SarthakB11](https://github.com/SarthakB11) in [#4100](https://github.com/PrefectHQ/fastmcp/pull/4100)
* fix: don't cache import map in dev apps bundle by [@jlowin](https://github.com/jlowin) in [#4106](https://github.com/PrefectHQ/fastmcp/pull/4106)
* #4084 [Issues] Windows startup crash due to UnicodeDecodeError when l… by [@doneman536](https://github.com/doneman536) in [#4092](https://github.com/PrefectHQ/fastmcp/pull/4092)
* fix: drop exc_info for expected tool failures, remove unreachable ValidationError by [@sergeykad](https://github.com/sergeykad) in [#4029](https://github.com/PrefectHQ/fastmcp/pull/4029)
* fix: cli option --no-banner is NOT passed to cli but server-spec in-correctly when cli --reload option is specified. by [@itaru2622](https://github.com/itaru2622) in [#4083](https://github.com/PrefectHQ/fastmcp/pull/4083)
* Fix None backend_* span attributes on un-renamed proxy components by [@ringerc](https://github.com/ringerc) in [#4109](https://github.com/PrefectHQ/fastmcp/pull/4109)
* Fix OCI Provider issue in 3.x version. Add OCI auth provider example … by [@kiranthakkar](https://github.com/kiranthakkar) in [#4116](https://github.com/PrefectHQ/fastmcp/pull/4116)
* fix(http): terminate active streamable-HTTP transports before lifespan shutdown by [@SarthakB11](https://github.com/SarthakB11) in [#4118](https://github.com/PrefectHQ/fastmcp/pull/4118)
### Docs 📚
* Restructure docs navigation by [@jlowin](https://github.com/jlowin) in [#3951](https://github.com/PrefectHQ/fastmcp/pull/3951)
* docs: standardize ToolAnnotations examples by [@gnanirahulnutakki](https://github.com/gnanirahulnutakki) in [#3952](https://github.com/PrefectHQ/fastmcp/pull/3952)
* Be constructively skeptical of bot reviews on own PRs by [@jlowin](https://github.com/jlowin) in [#3971](https://github.com/PrefectHQ/fastmcp/pull/3971)
* Add UTM params to Horizon docs links by [@aaazzam](https://github.com/aaazzam) in [#4018](https://github.com/PrefectHQ/fastmcp/pull/4018)
* Add a sandboxed-agents deployment guide by [@strawgate](https://github.com/strawgate) in [#4027](https://github.com/PrefectHQ/fastmcp/pull/4027)
* docs: add best practices for custom telemetry spans by [@MukundaKatta](https://github.com/MukundaKatta) in [#4001](https://github.com/PrefectHQ/fastmcp/pull/4001)
* Refresh landing page copy by [@jlowin](https://github.com/jlowin) in [#4043](https://github.com/PrefectHQ/fastmcp/pull/4043)
* Refresh landing page copy by [@jlowin](https://github.com/jlowin) in [#4047](https://github.com/PrefectHQ/fastmcp/pull/4047)
* Add UTM tracking to Horizon links by [@jlowin](https://github.com/jlowin) in [#4064](https://github.com/PrefectHQ/fastmcp/pull/4064)
* docs(integrations): add Pydantic AI FastMCP toolset guide by [@MukundaKatta](https://github.com/MukundaKatta) in [#4070](https://github.com/PrefectHQ/fastmcp/pull/4070)
* docs: fix broken links in Pydantic AI guide by [@jlowin](https://github.com/jlowin) in [#4094](https://github.com/PrefectHQ/fastmcp/pull/4094)
### Dependencies 📦
* chore(deps-dev): bump pydantic-monty from 0.0.11 to 0.0.12 by [@dependabot](https://github.com/dependabot) in [#3940](https://github.com/PrefectHQ/fastmcp/pull/3940)
* chore(deps-dev): bump pydantic-monty from 0.0.14 to 0.0.16 by [@dependabot](https://github.com/dependabot) in [#3984](https://github.com/PrefectHQ/fastmcp/pull/3984)
### Other Changes 🦾
* fix: Don't completely hide plain mcp.tool app-only tools by [@owtaylor](https://github.com/owtaylor) in [#4112](https://github.com/PrefectHQ/fastmcp/pull/4112)

## New Contributors
* @gnanirahulnutakki made their first contribution in [#3946](https://github.com/PrefectHQ/fastmcp/pull/3946)
* @lawrence3699 made their first contribution in [#3896](https://github.com/PrefectHQ/fastmcp/pull/3896)
* @carlos-rian made their first contribution in [#3995](https://github.com/PrefectHQ/fastmcp/pull/3995)
* @ZLeventer made their first contribution in [#4026](https://github.com/PrefectHQ/fastmcp/pull/4026)
* @MukundaKatta made their first contribution in [#4001](https://github.com/PrefectHQ/fastmcp/pull/4001)
* @daniel-tsiang made their first contribution in [#4036](https://github.com/PrefectHQ/fastmcp/pull/4036)
* @ashwin153 made their first contribution in [#4087](https://github.com/PrefectHQ/fastmcp/pull/4087)
* @cuyua9 made their first contribution in [#4068](https://github.com/PrefectHQ/fastmcp/pull/4068)
* @taylorwilsdon made their first contribution in [#4091](https://github.com/PrefectHQ/fastmcp/pull/4091)
* @SarthakB11 made their first contribution in [#4101](https://github.com/PrefectHQ/fastmcp/pull/4101)
* @doneman536 made their first contribution in [#4092](https://github.com/PrefectHQ/fastmcp/pull/4092)
* @sergeykad made their first contribution in [#4029](https://github.com/PrefectHQ/fastmcp/pull/4029)
* @ringerc made their first contribution in [#4109](https://github.com/PrefectHQ/fastmcp/pull/4109)

**Full Changelog**: [v3.2.4...v3.3.0](https://github.com/PrefectHQ/fastmcp/compare/v3.2.4...v3.3.0)

</Update>

<Update label="v3.2.4" description="2026-04-14">

**[v3.2.4: Patch Me If You Can](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.4)**

A grab bag of fixes, hardening, and polish. The headline behavior change: background tasks are now scoped to the authorization context rather than the MCP session, so a task survives session churn and stays tied to who started it — a breaking change for anyone relying on the old session-scoped semantics. Plus actual-size validation in `FileUpload`, a Keycloak OAuth provider, automatic parameter descriptions from docstrings, and dozens of schema and sampling fixes.

### Breaking Changes ⚠️
* Scope tasks to authorization context, not session by [@chrisguidry](https://github.com/chrisguidry) in [#3800](https://github.com/PrefectHQ/fastmcp/pull/3800)
### Enhancements ✨
* Bump pydocket>=0.19.0, drop fakeredis pin by [@chrisguidry](https://github.com/chrisguidry) in [#3822](https://github.com/PrefectHQ/fastmcp/pull/3822)
* Add real-world schema crash test (232K schemas from APIs.guru) by [@strawgate](https://github.com/strawgate) in [#3826](https://github.com/PrefectHQ/fastmcp/pull/3826)
* Enable 7 zero-violation ruff rules by [@strawgate](https://github.com/strawgate) in [#3841](https://github.com/PrefectHQ/fastmcp/pull/3841)
* Promote 7 ty rules from ignore to warn by [@strawgate](https://github.com/strawgate) in [#3852](https://github.com/PrefectHQ/fastmcp/pull/3852)
* Replace ___ with hash-based backend tool routing and per-tool prefab resources by [@jlowin](https://github.com/jlowin) in [#3824](https://github.com/PrefectHQ/fastmcp/pull/3824)
* Enable 4 ruff rules (DTZ, ERA, ISC, INP) and fix 9 violations by [@strawgate](https://github.com/strawgate) in [#3842](https://github.com/PrefectHQ/fastmcp/pull/3842)
* Extract parameter descriptions from docstrings by [@jlowin](https://github.com/jlowin) in [#3872](https://github.com/PrefectHQ/fastmcp/pull/3872)
* ci: speed up schema crash test (CSafeLoader + xdist-safe aggregation) by [@jlowin](https://github.com/jlowin) in [#3873](https://github.com/PrefectHQ/fastmcp/pull/3873)
* test: bump OpenAPI init perf threshold to 200ms for Windows CI by [@jlowin](https://github.com/jlowin) in [#3879](https://github.com/PrefectHQ/fastmcp/pull/3879)
* refactor: unify object-schema conversion through _object_schema_to_type by [@jlowin](https://github.com/jlowin) in [#3884](https://github.com/PrefectHQ/fastmcp/pull/3884)
* Add Keycloak OAuth Provider for Enterprise Authentication and local dev by [@stephaneberle9](https://github.com/stephaneberle9) in [#1937](https://github.com/PrefectHQ/fastmcp/pull/1937)
* Allow auth providers to override protected resource base URLs by [@aaazzam](https://github.com/aaazzam) in [#3900](https://github.com/PrefectHQ/fastmcp/pull/3900)
* Enable PERF and T20 ruff rules by [@strawgate](https://github.com/strawgate) in [#3845](https://github.com/PrefectHQ/fastmcp/pull/3845)
* Add response_title and response_description to ctx.elicit() by [@jlowin](https://github.com/jlowin) in [#3912](https://github.com/PrefectHQ/fastmcp/pull/3912)
* Deprecate ctx.elicit() without response_type by [@jlowin](https://github.com/jlowin) in [#3916](https://github.com/PrefectHQ/fastmcp/pull/3916)
### Security 🔒
* Validate actual base64 data size in FileUpload, not client-reported size by [@strawgate](https://github.com/strawgate) in [#3816](https://github.com/PrefectHQ/fastmcp/pull/3816)
* Stop forwarding inbound HTTP headers to unrelated remote servers by [@jlowin](https://github.com/jlowin) in [#3837](https://github.com/PrefectHQ/fastmcp/pull/3837)
* AuthKit: auto-bind token audience to resource URL (RFC 8707) by [@jlowin](https://github.com/jlowin) in [#3905](https://github.com/PrefectHQ/fastmcp/pull/3905)
### Fixes 🐞
* Version-check is_docket_available() to avoid transitive pydocket crash by [@jlowin](https://github.com/jlowin) in [#3807](https://github.com/PrefectHQ/fastmcp/pull/3807)
* fix: materialize generators before result conversion, handle bytes gracefully by [@strawgate](https://github.com/strawgate) in [#3830](https://github.com/PrefectHQ/fastmcp/pull/3830)
* Fix json_schema_to_type crashes on keywords, boolean schemas, empty enums, and name collisions by [@strawgate](https://github.com/strawgate) in [#3818](https://github.com/PrefectHQ/fastmcp/pull/3818)
* fix: replace `or` with `is not None` checks for config/override merging by [@strawgate](https://github.com/strawgate) in [#3833](https://github.com/PrefectHQ/fastmcp/pull/3833)
* fix: TransformedTool sync fn crash and schema mutation by [@strawgate](https://github.com/strawgate) in [#3823](https://github.com/PrefectHQ/fastmcp/pull/3823)
* fix: cross-provider duplicate detection, error visibility, mask propagation by [@strawgate](https://github.com/strawgate) in [#3827](https://github.com/PrefectHQ/fastmcp/pull/3827)
* fix: don't pass HTTP kwargs when transport is unspecified by [@strawgate](https://github.com/strawgate) in [#3838](https://github.com/PrefectHQ/fastmcp/pull/3838)
* fix: strip title fields from tool schemas for Gemini 2.5 Flash compatibility by [@strawgate](https://github.com/strawgate) in [#3861](https://github.com/PrefectHQ/fastmcp/pull/3861)
* fix: retry when LLM returns text instead of calling final_response by [@strawgate](https://github.com/strawgate) in [#3850](https://github.com/PrefectHQ/fastmcp/pull/3850)
* Raise on unhandled content types in sampling handler dispatch chains by [@strawgate](https://github.com/strawgate) in [#3857](https://github.com/PrefectHQ/fastmcp/pull/3857)
* Fix broken code examples in docs by [@strawgate](https://github.com/strawgate) in [#3869](https://github.com/PrefectHQ/fastmcp/pull/3869)
* fix: GoogleGenaiSamplingHandler leaks thought parts and gives unhelpful errors on empty responses by [@strawgate](https://github.com/strawgate) in [#3849](https://github.com/PrefectHQ/fastmcp/pull/3849)
* fix: cap consecutive final_response validation retries by [@strawgate](https://github.com/strawgate) in [#3851](https://github.com/PrefectHQ/fastmcp/pull/3851)
* Fix test quality issues by [@strawgate](https://github.com/strawgate) in [#3854](https://github.com/PrefectHQ/fastmcp/pull/3854)
* Fix MCP tool on docs welcome page by [@lkiesow](https://github.com/lkiesow) in [#3874](https://github.com/PrefectHQ/fastmcp/pull/3874)
* Fix CIMD clients getting required_scopes instead of valid_scopes by [@jlowin](https://github.com/jlowin) in [#3836](https://github.com/PrefectHQ/fastmcp/pull/3836)
* Rename filesystem-provider example dir to avoid mcp/ collision by [@jlowin](https://github.com/jlowin) in [#3878](https://github.com/PrefectHQ/fastmcp/pull/3878)
* fix: drop configurable dedupe from AggregateProvider, always warn by [@jlowin](https://github.com/jlowin) in [#3877](https://github.com/PrefectHQ/fastmcp/pull/3877)
* fix: resolve list[dict] return type producing Root() instead of dicts by [@KeWang0622](https://github.com/KeWang0622) in [#3880](https://github.com/PrefectHQ/fastmcp/pull/3880)
* fix: strip titles from bare-metadata nodes (Gemini 2.5 Flash) by [@jlowin](https://github.com/jlowin) in [#3881](https://github.com/PrefectHQ/fastmcp/pull/3881)
* Fix wildcard resource template params in mounted servers by [@jlowin](https://github.com/jlowin) in [#3899](https://github.com/PrefectHQ/fastmcp/pull/3899)
* Harden forced client disconnect cleanup by [@vonbai](https://github.com/vonbai) in [#3885](https://github.com/PrefectHQ/fastmcp/pull/3885)
* fix: elicitation scalar return, resource auto-serialization, Client.new() state, prompt errors by [@strawgate](https://github.com/strawgate) in [#3859](https://github.com/PrefectHQ/fastmcp/pull/3859)
* fix: task.wait() hangs indefinitely when task enters input_required by [@mrishav](https://github.com/mrishav) in [#3798](https://github.com/PrefectHQ/fastmcp/pull/3798)
* Fix RetryMiddleware not retrying tool errors by [@strawgate](https://github.com/strawgate) in [#3858](https://github.com/PrefectHQ/fastmcp/pull/3858)
* Stop pydantic 2.13 from leaking _WrappedResult docstring into tool output schemas by [@jlowin](https://github.com/jlowin) in [#3918](https://github.com/PrefectHQ/fastmcp/pull/3918)
### Docs 📚
* Note generate-notes API in release workflow docs by [@jlowin](https://github.com/jlowin) in [#3806](https://github.com/PrefectHQ/fastmcp/pull/3806)
* docs: require agents to respect DNM markers on PRs by [@jlowin](https://github.com/jlowin) in [#3871](https://github.com/PrefectHQ/fastmcp/pull/3871)
* docs: add uv-managed dependencies and uvx examples to mcp-json configuration by [@vincent067](https://github.com/vincent067) in [#3843](https://github.com/PrefectHQ/fastmcp/pull/3843)
* docs: link fastmcp-keycloak-local companion project from Keycloak integration page by [@stephaneberle9](https://github.com/stephaneberle9) in [#3904](https://github.com/PrefectHQ/fastmcp/pull/3904)
* Overhaul apps docs by [@jlowin](https://github.com/jlowin) in [#3915](https://github.com/PrefectHQ/fastmcp/pull/3915)
### Dependencies 📦
* chore(deps): bump extractions/setup-just from 3 to 4 by [@dependabot](https://github.com/dependabot) in [#3863](https://github.com/PrefectHQ/fastmcp/pull/3863)
* chore(deps): bump astral-sh/setup-uv from 6 to 7 by [@dependabot](https://github.com/dependabot) in [#3865](https://github.com/PrefectHQ/fastmcp/pull/3865)
* chore(deps): bump actions/checkout from 4 to 6 by [@dependabot](https://github.com/dependabot) in [#3864](https://github.com/PrefectHQ/fastmcp/pull/3864)
* chore(deps-dev): bump pydantic-monty from 0.0.9 to 0.0.10 by [@dependabot](https://github.com/dependabot) in [#3809](https://github.com/PrefectHQ/fastmcp/pull/3809)
* chore(deps): bump the uv group across 2 directories with 1 update by [@dependabot](https://github.com/dependabot) in [#3913](https://github.com/PrefectHQ/fastmcp/pull/3913)

## New Contributors
* @lkiesow made their first contribution in [#3874](https://github.com/PrefectHQ/fastmcp/pull/3874)
* @KeWang0622 made their first contribution in [#3880](https://github.com/PrefectHQ/fastmcp/pull/3880)
* @vonbai made their first contribution in [#3885](https://github.com/PrefectHQ/fastmcp/pull/3885)

**Full Changelog**: [v3.2.3...v3.2.4](https://github.com/PrefectHQ/fastmcp/compare/v3.2.3...v3.2.4)

</Update>

<Update label="v3.2.3" description="2026-04-09">

**[v3.2.3: Redis or Not](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.3)**

A stopgap pin: fakeredis 2.35.0 shipped an undocumented rename that broke pydocket's `memory://` backend, causing `fastmcp[tasks]` installs to fail at startup with an `ImportError`. This pins `fakeredis<2.35.0` in the `tasks` extra until a fixed pydocket ships.

### Fixes 🐞
* Pin `fakeredis<2.35.0` in tasks extra by [@jlowin](https://github.com/jlowin) in [#3804](https://github.com/PrefectHQ/fastmcp/pull/3804)
### Docs 📚
* Document session state isolation across mount boundaries by [@jlowin](https://github.com/jlowin) in [#3801](https://github.com/PrefectHQ/fastmcp/pull/3801)


**Full Changelog**: [v3.2.2...v3.2.3](https://github.com/PrefectHQ/fastmcp/compare/v3.2.2...v3.2.3)

</Update>

<Update label="v3.2.2" description="2026-04-09">

**[v3.2.2: Audience Appreciation](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.2)**

Fixes the Azure audience regression from 3.2.1: validation switched from `client_id` to `identifier_uri`, which fixed custom Application ID URIs but broke the default case where Azure AD v2 tokens set `aud` to the bare client ID GUID. Both formats are now accepted.

### Fixes 🐞
* fix: accept both client_id and identifier_uri as Azure audience by [@jlowin](https://github.com/jlowin) in [#3797](https://github.com/PrefectHQ/fastmcp/pull/3797)
### Dependencies 📦
* chore(deps): bump the uv group across 2 directories with 1 update by [@dependabot](https://github.com/dependabot) in [#3795](https://github.com/PrefectHQ/fastmcp/pull/3795)


**Full Changelog**: [v3.2.1...v3.2.2](https://github.com/PrefectHQ/fastmcp/compare/v3.2.1...v3.2.2)

</Update>

<Update label="v3.2.1" description="2026-04-08">

**[v3.2.1: Audience Participation](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.1)**

A patch focused on auth-provider audience validation. Cognito tokens now validate on `client_id` (they carry no `aud`), Azure honors the `identifier_uri` parameter for Entra v2.0 tokens, and consent cookies are LRU-capped to prevent unbounded growth past reverse proxy header limits. Also fixes OpenAPI 3.0 `nullable` fields leaking into tool input schemas and server-variable substitution in base URLs.

### Breaking Changes ⚠️
* fix(google): use sub (user ID) for client_id instead of aud (app ID) by [@shigechika](https://github.com/shigechika) in [#3722](https://github.com/PrefectHQ/fastmcp/pull/3722)
* fix: remove CSP from tool metadata, keep on resource only by [@jlowin](https://github.com/jlowin) in [#3754](https://github.com/PrefectHQ/fastmcp/pull/3754)
### Enhancements ✨
* [codex] Add FastMCP docs telemetry by [@aaazzam](https://github.com/aaazzam) in [#3727](https://github.com/PrefectHQ/fastmcp/pull/3727)
* chore: split SDK navigation into standalone $ref file by [@jlowin](https://github.com/jlowin) in [#3773](https://github.com/PrefectHQ/fastmcp/pull/3773)
* fix: bump ty to >=0.0.29 and suppress new false positives by [@jlowin](https://github.com/jlowin) in [#3790](https://github.com/PrefectHQ/fastmcp/pull/3790)
### Fixes 🐞
* fix: use explicit None checks for JWT exp validation by [@jlowin](https://github.com/jlowin) in [#3724](https://github.com/PrefectHQ/fastmcp/pull/3724)
* Unify background task context forwarding, fix concurrent dependency bugs by [@chrisguidry](https://github.com/chrisguidry) in [#3710](https://github.com/PrefectHQ/fastmcp/pull/3710)
* fix: add proxy timeouts and modernize networking in apps dev by [@mateeaaa](https://github.com/mateeaaa) in [#3741](https://github.com/PrefectHQ/fastmcp/pull/3741)
* fix: ResponseLimitingMiddleware no longer breaks outputSchema tools by [@jlowin](https://github.com/jlowin) in [#3756](https://github.com/PrefectHQ/fastmcp/pull/3756)
* fix: substitute server variable defaults when building base URL from OpenAPI spec by [@mrishav](https://github.com/mrishav) in [#3770](https://github.com/PrefectHQ/fastmcp/pull/3770)
* fix: FastAPI TestClient compatibility and lifespan re-initialization by [@kvdhanush06](https://github.com/kvdhanush06) in [#3736](https://github.com/PrefectHQ/fastmcp/pull/3736)
* fix: propagate upstream_claims in load_access_token by [@kvdhanush06](https://github.com/kvdhanush06) in [#3750](https://github.com/PrefectHQ/fastmcp/pull/3750)
* Remove deprecated asyncio.iscoroutinefunction fallback by [@kaiisfree](https://github.com/kaiisfree) in [#3767](https://github.com/PrefectHQ/fastmcp/pull/3767)
* fix: changeable allowed_client_redirect_uris on OAuthProxy by [@fengarix](https://github.com/fengarix) in [#3772](https://github.com/PrefectHQ/fastmcp/pull/3772)
* fix: broken link in changelog by [@jlowin](https://github.com/jlowin) in [#3775](https://github.com/PrefectHQ/fastmcp/pull/3775)
* fix(docs): correct FastMCP tool name in welcome docs by [@buyua9](https://github.com/buyua9) in [#3781](https://github.com/PrefectHQ/fastmcp/pull/3781)
* fix: cap consent cookie size to prevent header overflow by [@jlowin](https://github.com/jlowin) in [#3784](https://github.com/PrefectHQ/fastmcp/pull/3784)
* Fix boolean property schemas in JSON Schema parsing by [@jlowin](https://github.com/jlowin) in [#3785](https://github.com/PrefectHQ/fastmcp/pull/3785)
* Fix OpenAPI 3.0 nullable fields in tool input schemas by [@kvdhanush06](https://github.com/kvdhanush06) in [#3768](https://github.com/PrefectHQ/fastmcp/pull/3768)
* fix: Cognito token verification checks client_id instead of aud by [@jlowin](https://github.com/jlowin) in [#3786](https://github.com/PrefectHQ/fastmcp/pull/3786)
* fix: use identifier_uri as audience for Azure token validation by [@jlowin](https://github.com/jlowin) in [#3787](https://github.com/PrefectHQ/fastmcp/pull/3787)
* Harden client tool result error handling by [@aimable100](https://github.com/aimable100) in [#3778](https://github.com/PrefectHQ/fastmcp/pull/3778)
### Docs 📚
* Github integraiton documentation fix: use result.data otherwise CallToolResult not scriptable by [@c4jquick](https://github.com/c4jquick) in [#3753](https://github.com/PrefectHQ/fastmcp/pull/3753)
* chore: split v2 docs navigation into separate file by [@jlowin](https://github.com/jlowin) in [#3762](https://github.com/PrefectHQ/fastmcp/pull/3762)
* docs: document forward_resource parameter on OAuthProxy by [@jlowin](https://github.com/jlowin) in [#3788](https://github.com/PrefectHQ/fastmcp/pull/3788)
### Examples & Contrib 💡
* fix: boolean false values dropped in form submissions by [@jlowin](https://github.com/jlowin) in [#3776](https://github.com/PrefectHQ/fastmcp/pull/3776)
### Dependencies 📦
* chore(deps): bump fastmcp from 3.1.1 to 3.2.0 in /examples/testing_demo in the uv group across 1 directory by [@dependabot](https://github.com/dependabot) in [#3728](https://github.com/PrefectHQ/fastmcp/pull/3728)
* chore(deps): bump anthropic from 0.86.0 to 0.87.0 in the uv group across 1 directory by [@dependabot](https://github.com/dependabot) in [#3742](https://github.com/PrefectHQ/fastmcp/pull/3742)

## New Contributors
* @c4jquick made their first contribution in [#3753](https://github.com/PrefectHQ/fastmcp/pull/3753)
* @mateeaaa made their first contribution in [#3741](https://github.com/PrefectHQ/fastmcp/pull/3741)
* @mrishav made their first contribution in [#3770](https://github.com/PrefectHQ/fastmcp/pull/3770)
* @kvdhanush06 made their first contribution in [#3736](https://github.com/PrefectHQ/fastmcp/pull/3736)
* @kaiisfree made their first contribution in [#3767](https://github.com/PrefectHQ/fastmcp/pull/3767)
* @fengarix made their first contribution in [#3772](https://github.com/PrefectHQ/fastmcp/pull/3772)
* @buyua9 made their first contribution in [#3781](https://github.com/PrefectHQ/fastmcp/pull/3781)
* @aimable100 made their first contribution in [#3778](https://github.com/PrefectHQ/fastmcp/pull/3778)

**Full Changelog**: [v3.2.0...v3.2.1](https://github.com/PrefectHQ/fastmcp/compare/v3.2.0...v3.2.1)

</Update>

<Update label="v3.2.0" description="2026-03-30">

**[v3.2.0: Show Don't Tool](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.0)**

FastMCP 3.2 is the Apps release: your tools can now return interactive UIs — charts, dashboards, forms, maps — rendered right inside the conversation. `FastMCPApp` separates the tools the LLM sees from the backend tools the UI calls, five built-in providers (FileUpload, Approval, Choice, FormInput, GenerativeUI) cover common interaction patterns, and `fastmcp dev apps` gives you a browser preview. The release also lands a significant security hardening pass across SSRF/path-traversal, JWT algorithm restrictions, OAuth scope enforcement, and CSRF.

### New Features 🎉
* Add FastMCPApp — a Provider for composable MCP applications by [@jlowin](https://github.com/jlowin) in [#3385](https://github.com/PrefectHQ/fastmcp/pull/3385)
* Add fastmcp dev apps command with browser UI preview by [@jlowin](https://github.com/jlowin) in [#3489](https://github.com/PrefectHQ/fastmcp/pull/3489)
* Add GenerativeUI provider, bump prefab-ui 0.14.0 by [@jlowin](https://github.com/jlowin) in [#3647](https://github.com/PrefectHQ/fastmcp/pull/3647)
* Add FileUpload provider by [@jlowin](https://github.com/jlowin) in [#3669](https://github.com/PrefectHQ/fastmcp/pull/3669)
* Add Approval and Choice providers by [@jlowin](https://github.com/jlowin) in [#3686](https://github.com/PrefectHQ/fastmcp/pull/3686)
* Add FormInput provider, bump prefab-ui to 0.15.0 by [@jlowin](https://github.com/jlowin) in [#3687](https://github.com/PrefectHQ/fastmcp/pull/3687)
### Breaking Changes ⚠️
* Route app tool calls via ___-prefixed names by [@jlowin](https://github.com/jlowin) in [#3667](https://github.com/PrefectHQ/fastmcp/pull/3667)
### Enhancements ✨
* feat: add `--config-path` flag to claude-desktop install command by [@Sumanshu-Nankana](https://github.com/Sumanshu-Nankana) in [#3380](https://github.com/PrefectHQ/fastmcp/pull/3380)
* Support ImageContent and AudioContent in Message class by [@ericrobinson-indeed](https://github.com/ericrobinson-indeed) in [#3396](https://github.com/PrefectHQ/fastmcp/pull/3396)
* Deprecate PromptToolMiddleware and ResourceToolMiddleware by [@jlowin](https://github.com/jlowin) in [#3389](https://github.com/PrefectHQ/fastmcp/pull/3389)
* Block HS* algorithms when JWTVerifier is configured with JWKS by [@jlowin](https://github.com/jlowin) in [#3419](https://github.com/PrefectHQ/fastmcp/pull/3419)
* Remove prek from Marvin workflows by [@jlowin](https://github.com/jlowin) in [#3444](https://github.com/PrefectHQ/fastmcp/pull/3444)
* Add dependency version compatibility guidance to code-review skill by [@jlowin](https://github.com/jlowin) in [#3475](https://github.com/PrefectHQ/fastmcp/pull/3475)
* Remove "good first issue" label by [@jlowin](https://github.com/jlowin) in [#3482](https://github.com/PrefectHQ/fastmcp/pull/3482)
* Cache component lists in ProxyProvider by [@jlowin](https://github.com/jlowin) in [#3479](https://github.com/PrefectHQ/fastmcp/pull/3479)
* Support logging/setLevel and add client_log_level by [@jlowin](https://github.com/jlowin) in [#3491](https://github.com/PrefectHQ/fastmcp/pull/3491)
* Propagate x-fastmcp-wrap-result in tool result _meta by [@jlowin](https://github.com/jlowin) in [#3490](https://github.com/PrefectHQ/fastmcp/pull/3490)
* feat(auth): add external_consent param to suppress misleading warning by [@mtthidoteu](https://github.com/mtthidoteu) in [#3473](https://github.com/PrefectHQ/fastmcp/pull/3473)
* Add `verify` parameter for SSL certificate configuration by [@jlowin](https://github.com/jlowin) in [#3487](https://github.com/PrefectHQ/fastmcp/pull/3487)
* Expose minimum_check_interval, reduce task pickup latency by [@jlowin](https://github.com/jlowin) in [#3500](https://github.com/PrefectHQ/fastmcp/pull/3500)
* Fix test timeouts, suppress deprecation warnings, speed up auth tests by [@jlowin](https://github.com/jlowin) in [#3504](https://github.com/PrefectHQ/fastmcp/pull/3504)
* Auto-close upgrade check issue when build passes by [@jlowin](https://github.com/jlowin) in [#3505](https://github.com/PrefectHQ/fastmcp/pull/3505)
* feat: make upstream_client_secret optional in OAuthProxy by [@jlowin](https://github.com/jlowin) in [#3486](https://github.com/PrefectHQ/fastmcp/pull/3486)
* Add security label to triage workflow and release notes by [@jlowin](https://github.com/jlowin) in [#3516](https://github.com/PrefectHQ/fastmcp/pull/3516)
* Claude/review contributor guidelines by [@jlowin](https://github.com/jlowin) in [#3517](https://github.com/PrefectHQ/fastmcp/pull/3517)
* pin pydantic-monty to 0.0.8 by [@jlowin](https://github.com/jlowin) in [#3539](https://github.com/PrefectHQ/fastmcp/pull/3539)
* Support ImageContent and AudioContent in sampling handlers by [@jlowin](https://github.com/jlowin) in [#3550](https://github.com/PrefectHQ/fastmcp/pull/3550)
* Graceful degradation for multi-server proxy setup by [@jlowin](https://github.com/jlowin) in [#3546](https://github.com/PrefectHQ/fastmcp/pull/3546)
* Extract TokenCache utility, add caching to GitHubTokenVerifier by [@jlowin](https://github.com/jlowin) in [#3547](https://github.com/PrefectHQ/fastmcp/pull/3547)
* Add review-pr skill for Codex bot workflow by [@jlowin](https://github.com/jlowin) in [#3552](https://github.com/PrefectHQ/fastmcp/pull/3552)
* Add MCP message inspector to dev apps UI by [@jlowin](https://github.com/jlowin) in [#3570](https://github.com/PrefectHQ/fastmcp/pull/3570)
* Comprehensive MCP Apps docs, string CallTool resolution by [@jlowin](https://github.com/jlowin) in [#3575](https://github.com/PrefectHQ/fastmcp/pull/3575)
* Replace UUID global keys with (app_name, tool_name) registry by [@jlowin](https://github.com/jlowin) in [#3585](https://github.com/PrefectHQ/fastmcp/pull/3585)
* Route app tool calls through provider chain by [@jlowin](https://github.com/jlowin) in [#3587](https://github.com/PrefectHQ/fastmcp/pull/3587)
* Dev apps: show more/less for long tool descriptions by [@jlowin](https://github.com/jlowin) in [#3600](https://github.com/PrefectHQ/fastmcp/pull/3600)
* Apps Phase 1: docs, examples, app-only tool filtering by [@jlowin](https://github.com/jlowin) in [#3593](https://github.com/PrefectHQ/fastmcp/pull/3593)
* Forward enable_cimd to OAuthProxy in all provider subclasses by [@jlowin](https://github.com/jlowin) in [#3608](https://github.com/PrefectHQ/fastmcp/pull/3608)
* Tune too-long triage heuristic by [@jlowin](https://github.com/jlowin) in [#3610](https://github.com/PrefectHQ/fastmcp/pull/3610)
* Update ty ignore comments for 0.0.25 compatibility by [@jlowin](https://github.com/jlowin) in [#3614](https://github.com/PrefectHQ/fastmcp/pull/3614)
* Move app modules to fastmcp.apps package by [@jlowin](https://github.com/jlowin) in [#3616](https://github.com/PrefectHQ/fastmcp/pull/3616)
* Tighten too-long heuristic for design-document issues by [@jlowin](https://github.com/jlowin) in [#3620](https://github.com/PrefectHQ/fastmcp/pull/3620)
* Run MCP conformance tests by [@strawgate](https://github.com/strawgate) in [#3628](https://github.com/PrefectHQ/fastmcp/pull/3628)
* Add PrefabAppConfig for customizable Prefab tool setup by [@jlowin](https://github.com/jlowin) in [#3648](https://github.com/PrefectHQ/fastmcp/pull/3648)
* Clean error when dev apps ports are in use by [@jlowin](https://github.com/jlowin) in [#3658](https://github.com/PrefectHQ/fastmcp/pull/3658)
* Add Clerk OAuth provider by [@mostafa6765](https://github.com/mostafa6765) in [#3677](https://github.com/PrefectHQ/fastmcp/pull/3677)
* Add interactive map example with geocoding by [@jlowin](https://github.com/jlowin) in [#3702](https://github.com/PrefectHQ/fastmcp/pull/3702)
* Bump pydantic-monty to 0.0.9 by [@jlowin](https://github.com/jlowin) in [#3707](https://github.com/PrefectHQ/fastmcp/pull/3707)
* Add forward_resource flag to OAuthProxy by [@jlowin](https://github.com/jlowin) in [#3711](https://github.com/PrefectHQ/fastmcp/pull/3711)
### Security 🔒
* fix: enforce per-tool auth checks in sampling tool wrapper by [@jlowin](https://github.com/jlowin) in [#3494](https://github.com/PrefectHQ/fastmcp/pull/3494)
* fix: handle re.error from malformed URI templates by [@jlowin](https://github.com/jlowin) in [#3501](https://github.com/PrefectHQ/fastmcp/pull/3501)
* fix: reject empty/OIDC-only required_scopes in AzureProvider by [@jlowin](https://github.com/jlowin) in [#3503](https://github.com/PrefectHQ/fastmcp/pull/3503)
* fix: restrict $ref resolution to local refs only (SSRF/LFI) by [@jlowin](https://github.com/jlowin) in [#3502](https://github.com/PrefectHQ/fastmcp/pull/3502)
* fix: URL-encode path params to prevent SSRF/path traversal (GHSA-vv7q-7jx5-f767) by [@jlowin](https://github.com/jlowin) in [#3507](https://github.com/PrefectHQ/fastmcp/pull/3507)
* fix: prevent path traversal in skill download by [@jlowin](https://github.com/jlowin) in [#3493](https://github.com/PrefectHQ/fastmcp/pull/3493)
* fix: prefer IdP-granted scopes over client-requested scopes in OAuthProxy by [@jlowin](https://github.com/jlowin) in [#3492](https://github.com/PrefectHQ/fastmcp/pull/3492)
* fix: remove forced follow_redirects from httpx_client_factory calls by [@jlowin](https://github.com/jlowin) in [#3496](https://github.com/PrefectHQ/fastmcp/pull/3496)
* Bump PyJWT >= 2.12.0 (CVE-2026-32597) by [@jlowin](https://github.com/jlowin) in [#3515](https://github.com/PrefectHQ/fastmcp/pull/3515)
* Drop diskcache from examples/testing_demo lockfile (CVE-2025-69872) by [@jlowin](https://github.com/jlowin) in [#3518](https://github.com/PrefectHQ/fastmcp/pull/3518)
* fix: CSRF double-submit cookie check in consent flow by [@jlowin](https://github.com/jlowin) in [#3519](https://github.com/PrefectHQ/fastmcp/pull/3519)
* fix: validate server names in install commands by [@jlowin](https://github.com/jlowin) in [#3522](https://github.com/PrefectHQ/fastmcp/pull/3522)
* fix: reject refresh tokens used as Bearer access tokens by [@jlowin](https://github.com/jlowin) in [#3524](https://github.com/PrefectHQ/fastmcp/pull/3524)
* fix: route ResourcesAsTools/PromptsAsTools through server middleware by [@jlowin](https://github.com/jlowin) in [#3495](https://github.com/PrefectHQ/fastmcp/pull/3495)
### Fixes 🐞
* Update docs banner and fix mobile layout by [@jlowin](https://github.com/jlowin) in [#3370](https://github.com/PrefectHQ/fastmcp/pull/3370)
* Remove form-action from consent CSP, forward consent_csp_policy in providers by [@jlowin](https://github.com/jlowin) in [#3372](https://github.com/PrefectHQ/fastmcp/pull/3372)
* Fix resource templates with query params on mounted servers by [@jlowin](https://github.com/jlowin) in [#3373](https://github.com/PrefectHQ/fastmcp/pull/3373)
* Increase uv transport test timeout for CI cold starts by [@jlowin](https://github.com/jlowin) in [#3376](https://github.com/PrefectHQ/fastmcp/pull/3376)
* Fix stale catalog in CodeMode execute by [@jlowin](https://github.com/jlowin) in [#3375](https://github.com/PrefectHQ/fastmcp/pull/3375)
* Deduplicate versioned tools in CatalogTransform catalog by [@jlowin](https://github.com/jlowin) in [#3374](https://github.com/PrefectHQ/fastmcp/pull/3374)
* Fix ty 0.0.20 compatibility by [@jlowin](https://github.com/jlowin) in [#3377](https://github.com/PrefectHQ/fastmcp/pull/3377)
* Forward scopes_supported through RemoteAuthProvider subclasses by [@jlowin](https://github.com/jlowin) in [#3388](https://github.com/PrefectHQ/fastmcp/pull/3388)
* Enforce token scopes in WorkOS verifier to prevent scope bypass by [@jlowin](https://github.com/jlowin) in [#3407](https://github.com/PrefectHQ/fastmcp/pull/3407)
* Bind Discord token verification to configured client_id by [@jlowin](https://github.com/jlowin) in [#3405](https://github.com/PrefectHQ/fastmcp/pull/3405)
* Return after `McpError` in initialization middleware to prevent fallthrough by [@jlowin](https://github.com/jlowin) in [#3413](https://github.com/PrefectHQ/fastmcp/pull/3413)
* Escape client_id in OAuth consent advanced details by [@jlowin](https://github.com/jlowin) in [#3418](https://github.com/PrefectHQ/fastmcp/pull/3418)
* Bound client auto-pagination loops to prevent unbounded list fetches by [@jlowin](https://github.com/jlowin) in [#3411](https://github.com/PrefectHQ/fastmcp/pull/3411)
* Raise ValueError for invalid boolean query params in resource templates by [@jlowin](https://github.com/jlowin) in [#3434](https://github.com/PrefectHQ/fastmcp/pull/3434)
* Validate workspace path is a directory in cursor install by [@jlowin](https://github.com/jlowin) in [#3435](https://github.com/PrefectHQ/fastmcp/pull/3435)
* Validate version metadata to reject non-scalar types by [@jlowin](https://github.com/jlowin) in [#3437](https://github.com/PrefectHQ/fastmcp/pull/3437)
* Bind AWS Cognito token verification to configured app client by [@jlowin](https://github.com/jlowin) in [#3406](https://github.com/PrefectHQ/fastmcp/pull/3406)
* Avoid stale context leakage when proxying with an already‑connected ProxyClient by [@jlowin](https://github.com/jlowin) in [#3408](https://github.com/PrefectHQ/fastmcp/pull/3408)
* Prevent skills manifests from hashing files outside the skill directory by [@jlowin](https://github.com/jlowin) in [#3410](https://github.com/PrefectHQ/fastmcp/pull/3410)
* Harden fastmcp metadata parsing in proxy paths by [@jlowin](https://github.com/jlowin) in [#3412](https://github.com/PrefectHQ/fastmcp/pull/3412)
* Re-hash response caching keys to avoid persisting raw request input by [@jlowin](https://github.com/jlowin) in [#3414](https://github.com/PrefectHQ/fastmcp/pull/3414)
* Handle Windows npx detection when npx.cmd is missing by [@jlowin](https://github.com/jlowin) in [#3416](https://github.com/PrefectHQ/fastmcp/pull/3416)
* Guard OAuth callback result from post-completion overwrites by [@jlowin](https://github.com/jlowin) in [#3417](https://github.com/PrefectHQ/fastmcp/pull/3417)
* Fix tool argument rename collisions with passthrough params by [@jlowin](https://github.com/jlowin) in [#3431](https://github.com/PrefectHQ/fastmcp/pull/3431)
* Guard default progress handler against total=0 notifications by [@jlowin](https://github.com/jlowin) in [#3432](https://github.com/PrefectHQ/fastmcp/pull/3432)
* Fix get_* returning None when latest version is disabled by [@jlowin](https://github.com/jlowin) in [#3439](https://github.com/PrefectHQ/fastmcp/pull/3439)
* Fix server lifespan overlap teardown by [@jlowin](https://github.com/jlowin) in [#3415](https://github.com/PrefectHQ/fastmcp/pull/3415)
* Fix $ref output schema object detection regression by [@jlowin](https://github.com/jlowin) in [#3420](https://github.com/PrefectHQ/fastmcp/pull/3420)
* Preserve kw-only defaults when rebuilding functions for resolved annotations by [@jlowin](https://github.com/jlowin) in [#3429](https://github.com/PrefectHQ/fastmcp/pull/3429)
* Redact sensitive headers in OpenAPI provider debug logging by [@jlowin](https://github.com/jlowin) in [#3436](https://github.com/PrefectHQ/fastmcp/pull/3436)
* Fix async partial callables rejected by iscoroutinefunction by [@jlowin](https://github.com/jlowin) in [#3438](https://github.com/PrefectHQ/fastmcp/pull/3438)
* Block insecure HS* JWT verification with JWKS/public keys by [@jlowin](https://github.com/jlowin) in [#3430](https://github.com/PrefectHQ/fastmcp/pull/3430)
* Sanitize untrusted output in `fastmcp list` and `fastmcp call` by [@jlowin](https://github.com/jlowin) in [#3409](https://github.com/PrefectHQ/fastmcp/pull/3409)
* fix: propagate `version` to components in FileSystemProvider by [@martimfasantos](https://github.com/martimfasantos) in [#3458](https://github.com/PrefectHQ/fastmcp/pull/3458)
* fix: use intent-based flag for OIDC scope patch in load_access_token by [@voidborne-d](https://github.com/voidborne-d) in [#3465](https://github.com/PrefectHQ/fastmcp/pull/3465)
* Set readOnlyHint=True on ResourcesAsTools generated tools by [@jlowin](https://github.com/jlowin) in [#3476](https://github.com/PrefectHQ/fastmcp/pull/3476)
* fix: normalize Google scope shorthands and surface valid_scopes by [@jlowin](https://github.com/jlowin) in [#3477](https://github.com/PrefectHQ/fastmcp/pull/3477)
* fix: resolve ty 0.0.23 type-checking errors by [@jlowin](https://github.com/jlowin) in [#3481](https://github.com/PrefectHQ/fastmcp/pull/3481)
* fix: shield lifespan teardown from cancellation by [@jlowin](https://github.com/jlowin) in [#3480](https://github.com/PrefectHQ/fastmcp/pull/3480)
* fix: forward custom_route endpoints from mounted servers by [@voidborne-d](https://github.com/voidborne-d) in [#3462](https://github.com/PrefectHQ/fastmcp/pull/3462)
* fix: use dynamic version in CLI help text instead of hardcoded 2.0 by [@saschabuehrle](https://github.com/saschabuehrle) in [#3456](https://github.com/PrefectHQ/fastmcp/pull/3456)
* Fix Monty 0.0.8 compatibility by [@hkc5](https://github.com/hkc5) in [#3468](https://github.com/PrefectHQ/fastmcp/pull/3468)
* Fix task test teardown hanging 5s per test by [@jlowin](https://github.com/jlowin) in [#3499](https://github.com/PrefectHQ/fastmcp/pull/3499)
* fix: validate workspace path is a directory before cursor install by [@nightcityblade](https://github.com/nightcityblade) in [#3440](https://github.com/PrefectHQ/fastmcp/pull/3440)
* Treat `refresh_expires_in=0` as missing, fall back to 30-day default by [@jlowin](https://github.com/jlowin) in [#3514](https://github.com/PrefectHQ/fastmcp/pull/3514)
* fix: use raw strings for regex in pytest.raises match by [@jlowin](https://github.com/jlowin) in [#3523](https://github.com/PrefectHQ/fastmcp/pull/3523)
* fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators by [@jlowin](https://github.com/jlowin) in [#3540](https://github.com/PrefectHQ/fastmcp/pull/3540)
* fix: flaky KEY_PREFIX warning test in lowest-direct deps by [@jlowin](https://github.com/jlowin) in [#3549](https://github.com/PrefectHQ/fastmcp/pull/3549)
* fix: suppress output schema for ToolResult subclass annotations by [@jlowin](https://github.com/jlowin) in [#3548](https://github.com/PrefectHQ/fastmcp/pull/3548)
* Bump anthropic minimum to 0.48.0 by [@jlowin](https://github.com/jlowin) in [#3553](https://github.com/PrefectHQ/fastmcp/pull/3553)
* Update startup banner deploy URL to Prefect Horizon by [@zzstoatzz](https://github.com/zzstoatzz) in [#3557](https://github.com/PrefectHQ/fastmcp/pull/3557)
* fix: increase sleep duration in proxy cache tests by [@strawgate](https://github.com/strawgate) in [#3567](https://github.com/PrefectHQ/fastmcp/pull/3567)
* fix: store absolute token expiry to prevent stale expires_in on reload by [@jlowin](https://github.com/jlowin) in [#3572](https://github.com/PrefectHQ/fastmcp/pull/3572)
* fix: preserve tool properties named 'title' during schema compression by [@jlowin](https://github.com/jlowin) in [#3582](https://github.com/PrefectHQ/fastmcp/pull/3582)
* Add `encoding` parameter to `FileResource` by [@shulkx](https://github.com/shulkx) in [#3580](https://github.com/PrefectHQ/fastmcp/pull/3580)
* Transparently refresh upstream token in OAuthProxy.load_access_token() by [@jlowin](https://github.com/jlowin) in [#3584](https://github.com/PrefectHQ/fastmcp/pull/3584)
* Fix loopback redirect URI port matching per RFC 8252 §7.3 by [@radoshi](https://github.com/radoshi) in [#3589](https://github.com/PrefectHQ/fastmcp/pull/3589)
* Fix app tool routing: visibility check and middleware propagation by [@jlowin](https://github.com/jlowin) in [#3591](https://github.com/PrefectHQ/fastmcp/pull/3591)
* Fix query parameter serialization to respect OpenAPI explode setting by [@jlowin](https://github.com/jlowin) in [#3595](https://github.com/PrefectHQ/fastmcp/pull/3595)
* Fix dev apps form: union types, textarea support, JSON parsing by [@jlowin](https://github.com/jlowin) in [#3597](https://github.com/PrefectHQ/fastmcp/pull/3597)
* Respect OpenAPI content type in request body serialization by [@jlowin](https://github.com/jlowin) in [#3611](https://github.com/PrefectHQ/fastmcp/pull/3611)
* fix(google): replace deprecated /oauth2/v1/tokeninfo with /oauth2/v3/userinfo by [@shigechika](https://github.com/shigechika) in [#3603](https://github.com/PrefectHQ/fastmcp/pull/3603)
* fix: resolve EntraOBOToken dependency injection through MultiAuth by [@jer805](https://github.com/jer805) in [#3609](https://github.com/PrefectHQ/fastmcp/pull/3609)
* fix: filesystem provider import machinery by [@strawgate](https://github.com/strawgate) in [#3626](https://github.com/PrefectHQ/fastmcp/pull/3626)
* fix: recover StdioTransport after subprocess exits by [@strawgate](https://github.com/strawgate) in [#3630](https://github.com/PrefectHQ/fastmcp/pull/3630)
* fix(server): preserve mounted tool task metadata by [@pandego](https://github.com/pandego) in [#3632](https://github.com/PrefectHQ/fastmcp/pull/3632)
* fix: scope deprecation warning filter to FastMCPDeprecationWarning by [@jlowin](https://github.com/jlowin) in [#3649](https://github.com/PrefectHQ/fastmcp/pull/3649)
* fix: resolve CurrentFastMCP/ctx.fastmcp to child server in mounted background tasks by [@jlowin](https://github.com/jlowin) in [#3651](https://github.com/PrefectHQ/fastmcp/pull/3651)
* Fix blocking docs issues: chart imports, Select API, Rx consistency by [@jlowin](https://github.com/jlowin) in [#3652](https://github.com/PrefectHQ/fastmcp/pull/3652)
* Fix prompt caching round-trip on cache miss by [@strawgate](https://github.com/strawgate) in [#3666](https://github.com/PrefectHQ/fastmcp/pull/3666)
* fix: serialize object query params per OpenAPI style/explode rules by [@4444J99](https://github.com/4444J99) in [#3662](https://github.com/PrefectHQ/fastmcp/pull/3662)
* fix: HTTP request headers not accessible in background task workers by [@pandego](https://github.com/pandego) in [#3631](https://github.com/PrefectHQ/fastmcp/pull/3631)
* fix: restore HTTP headers in worker execution path for background tasks by [@jlowin](https://github.com/jlowin) in [#3681](https://github.com/PrefectHQ/fastmcp/pull/3681)
* fix: strip discriminator after dereferencing schemas by [@jlowin](https://github.com/jlowin) in [#3682](https://github.com/PrefectHQ/fastmcp/pull/3682)
* fix: remove stale ty:ignore directives for ty 0.0.26 by [@jlowin](https://github.com/jlowin) in [#3684](https://github.com/PrefectHQ/fastmcp/pull/3684)
* fix: dev apps log panel UX improvements by [@jlowin](https://github.com/jlowin) in [#3698](https://github.com/PrefectHQ/fastmcp/pull/3698)
* Add quiz example app, fix dev server empty string args by [@jlowin](https://github.com/jlowin) in [#3700](https://github.com/PrefectHQ/fastmcp/pull/3700)
### Docs 📚
* Add early-development warning to Prefab docs by [@jlowin](https://github.com/jlowin) in [#3362](https://github.com/PrefectHQ/fastmcp/pull/3362)
* Add tag to docs by [@jlowin](https://github.com/jlowin) in [#3382](https://github.com/PrefectHQ/fastmcp/pull/3382)
* Add settings and environment variables reference by [@jlowin](https://github.com/jlowin) in [#3384](https://github.com/PrefectHQ/fastmcp/pull/3384)
* Add contributing guidelines and update issue/PR templates by [@jlowin](https://github.com/jlowin) in [#3485](https://github.com/PrefectHQ/fastmcp/pull/3485)
* [Documentation] Move stateless_http transport kwarg to http_app as FastMCP constructor… by [@mhallo](https://github.com/mhallo) in [#3510](https://github.com/PrefectHQ/fastmcp/pull/3510)
* Update security policy by [@jlowin](https://github.com/jlowin) in [#3521](https://github.com/PrefectHQ/fastmcp/pull/3521)
* Add release instructions to CLAUDE.md by [@jlowin](https://github.com/jlowin) in [#3583](https://github.com/PrefectHQ/fastmcp/pull/3583)
* fix(docs): correct misleading stateless_http header by [@jlowin](https://github.com/jlowin) in [#3622](https://github.com/PrefectHQ/fastmcp/pull/3622)
* Add tag to deployment pages by [@jlowin](https://github.com/jlowin) in [#3624](https://github.com/PrefectHQ/fastmcp/pull/3624)
* Docs: generative UI page, fix imports, add PrefabAppConfig by [@jlowin](https://github.com/jlowin) in [#3650](https://github.com/PrefectHQ/fastmcp/pull/3650)
* docs: improve contributor guidelines for framework contributions by [@jlowin](https://github.com/jlowin) in [#3653](https://github.com/PrefectHQ/fastmcp/pull/3653)
* Add release notes for v3.1.0, v3.1.1, and v2.14.6 by [@jlowin](https://github.com/jlowin) in [#3659](https://github.com/PrefectHQ/fastmcp/pull/3659)
* Docs: showcase hero, narrative improvements, panel closed by default by [@jlowin](https://github.com/jlowin) in [#3657](https://github.com/PrefectHQ/fastmcp/pull/3657)
* Docs: add FileTreeStore sanitization warnings and update examples by [@strawgate](https://github.com/strawgate) in [#3661](https://github.com/PrefectHQ/fastmcp/pull/3661)
* Add prefab-ui version pinning warning to docs by [@jlowin](https://github.com/jlowin) in [#3688](https://github.com/PrefectHQ/fastmcp/pull/3688)
* Reorganize apps overview TOC by [@jlowin](https://github.com/jlowin) in [#3689](https://github.com/PrefectHQ/fastmcp/pull/3689)
* Fix docs gaps in app provider pages by [@jlowin](https://github.com/jlowin) in [#3690](https://github.com/PrefectHQ/fastmcp/pull/3690)
* Polish apps docs for 3.2 release by [@jlowin](https://github.com/jlowin) in [#3693](https://github.com/PrefectHQ/fastmcp/pull/3693)
* Add apps quickstart tutorial by [@jlowin](https://github.com/jlowin) in [#3695](https://github.com/PrefectHQ/fastmcp/pull/3695)
* Improve quickstart: pie chart, interactive row selection, screenshots by [@jlowin](https://github.com/jlowin) in [#3699](https://github.com/PrefectHQ/fastmcp/pull/3699)
* Add sales dashboard and live system monitor examples, bump prefab-ui to 0.17 by [@jlowin](https://github.com/jlowin) in [#3696](https://github.com/PrefectHQ/fastmcp/pull/3696)
* Add examples gallery page by [@jlowin](https://github.com/jlowin) in [#3705](https://github.com/PrefectHQ/fastmcp/pull/3705)
* docs: note that custom routes are unauthenticated by [@jlowin](https://github.com/jlowin) in [#3706](https://github.com/PrefectHQ/fastmcp/pull/3706)
* Remove hardcoded prefab-ui version from pinning warnings by [@jlowin](https://github.com/jlowin) in [#3708](https://github.com/PrefectHQ/fastmcp/pull/3708)
### Examples & Contrib 💡
* Block recursive self-invocation in BulkToolCaller by [@jlowin](https://github.com/jlowin) in [#3433](https://github.com/PrefectHQ/fastmcp/pull/3433)
### Dependencies 📦
* Bump authlib from 1.6.6 to 1.6.7 in /examples/testing_demo in the uv group across 1 directory by [@dependabot](https://github.com/dependabot) in [#3390](https://github.com/PrefectHQ/fastmcp/pull/3390)
* Bump actions/create-github-app-token from 2 to 3 by [@dependabot](https://github.com/dependabot) in [#3511](https://github.com/PrefectHQ/fastmcp/pull/3511)
* chore(deps): bump pyasn1 from 0.6.2 to 0.6.3 in the uv group across 1 directory by [@dependabot](https://github.com/dependabot) in [#3538](https://github.com/PrefectHQ/fastmcp/pull/3538)
* chore(deps): bump j178/prek-action from 1 to 2 by [@dependabot](https://github.com/dependabot) in [#3578](https://github.com/PrefectHQ/fastmcp/pull/3578)
* chore(deps): bump requests from 2.32.5 to 2.33.0 in the uv group across 1 directory by [@dependabot](https://github.com/dependabot) in [#3638](https://github.com/PrefectHQ/fastmcp/pull/3638)
* chore(deps): bump cryptography from 46.0.5 to 46.0.6 in /examples/testing_demo in the uv group across 1 directory by [@dependabot](https://github.com/dependabot) in [#3685](https://github.com/PrefectHQ/fastmcp/pull/3685)
* chore(deps): bump actions/setup-node from 4 to 6 by [@dependabot](https://github.com/dependabot) in [#3691](https://github.com/PrefectHQ/fastmcp/pull/3691)

## New Contributors
* @Sumanshu-Nankana made their first contribution in [#3380](https://github.com/PrefectHQ/fastmcp/pull/3380)
* @ericrobinson-indeed made their first contribution in [#3396](https://github.com/PrefectHQ/fastmcp/pull/3396)
* @voidborne-d made their first contribution in [#3465](https://github.com/PrefectHQ/fastmcp/pull/3465)
* @mtthidoteu made their first contribution in [#3473](https://github.com/PrefectHQ/fastmcp/pull/3473)
* @saschabuehrle made their first contribution in [#3456](https://github.com/PrefectHQ/fastmcp/pull/3456)
* @hkc5 made their first contribution in [#3468](https://github.com/PrefectHQ/fastmcp/pull/3468)
* @nightcityblade made their first contribution in [#3440](https://github.com/PrefectHQ/fastmcp/pull/3440)
* @mhallo made their first contribution in [#3510](https://github.com/PrefectHQ/fastmcp/pull/3510)
* @radoshi made their first contribution in [#3589](https://github.com/PrefectHQ/fastmcp/pull/3589)
* @shigechika made their first contribution in [#3603](https://github.com/PrefectHQ/fastmcp/pull/3603)
* @pandego made their first contribution in [#3632](https://github.com/PrefectHQ/fastmcp/pull/3632)
* @4444J99 made their first contribution in [#3662](https://github.com/PrefectHQ/fastmcp/pull/3662)
* @mostafa6765 made their first contribution in [#3677](https://github.com/PrefectHQ/fastmcp/pull/3677)

**Full Changelog**: [v3.1.0...v3.2.0](https://github.com/PrefectHQ/fastmcp/compare/v3.1.0...v3.2.0)

</Update>

<Update label="v3.1.1" description="2026-03-14">

**[v3.1.1: 'Tis But a Patch](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.1.1)**

Pins `pydantic-monty` below 0.0.8 to fix a breaking change in Monty that affects code mode. Monty 0.0.8 removed the `external_functions` constructor parameter, causing `MontySandboxProvider` to fail. This patch caps the version so existing installs work correctly.

### Fixes 🐞
* Pin pydantic-monty below 0.0.8 to fix code mode by [@jlowin](https://github.com/jlowin) in [#3497](https://github.com/PrefectHQ/fastmcp/pull/3497)

**Full Changelog**: [v3.1.0...v3.1.1](https://github.com/PrefectHQ/fastmcp/compare/v3.1.0...v3.1.1)

</Update>

<Update label="v3.1.0" description="2026-03-03">

**[v3.1.0: Code to Joy](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.1.0)**

FastMCP 3.1 is the Code Mode release. The 3.0 architecture introduced providers and transforms as the extensibility layer — 3.1 puts that architecture to work, shipping the most requested capability since launch: servers that can find and execute code on behalf of agents, without requiring clients to know what tools exist.

### New Features 🎉
* feat: Search transforms for tool discovery by [@jlowin](https://github.com/jlowin) in [#3154](https://github.com/PrefectHQ/fastmcp/pull/3154)
* Add experimental CodeMode transform by [@aaazzam](https://github.com/aaazzam) in [#3297](https://github.com/PrefectHQ/fastmcp/pull/3297)
* Add Prefab Apps integration for MCP tool UIs by [@jlowin](https://github.com/jlowin) in [#3316](https://github.com/PrefectHQ/fastmcp/pull/3316)
### Enhancements 🔧
* Lazy-load heavy imports to reduce import time by [@jlowin](https://github.com/jlowin) in [#3295](https://github.com/PrefectHQ/fastmcp/pull/3295)
* Add http_client parameter to all token verifiers for connection pooling by [@jlowin](https://github.com/jlowin) in [#3300](https://github.com/PrefectHQ/fastmcp/pull/3300)
* Add in-memory caching for token introspection results by [@jlowin](https://github.com/jlowin) in [#3298](https://github.com/PrefectHQ/fastmcp/pull/3298)
* Add SessionStart hook to install gh CLI in cloud sessions by [@jlowin](https://github.com/jlowin) in [#3308](https://github.com/PrefectHQ/fastmcp/pull/3308)
* Fix ty 0.0.19 type errors by [@jlowin](https://github.com/jlowin) in [#3310](https://github.com/PrefectHQ/fastmcp/pull/3310)
* Code Mode: Add resource limits to MontySandboxProvider by [@jlowin](https://github.com/jlowin) in [#3326](https://github.com/PrefectHQ/fastmcp/pull/3326)
* Accept transforms as FastMCP init kwarg by [@jlowin](https://github.com/jlowin) in [#3324](https://github.com/PrefectHQ/fastmcp/pull/3324)
* Split large test files to comply with loq line limit by [@jlowin](https://github.com/jlowin) in [#3328](https://github.com/PrefectHQ/fastmcp/pull/3328)
* Add -m/--module flag to `fastmcp run` and `dev inspector` by [@dgenio](https://github.com/dgenio) in [#3331](https://github.com/PrefectHQ/fastmcp/pull/3331)
* Add search_result_serializer hook and serialize_tools_for_output_markdown by [@MagnusS0](https://github.com/MagnusS0) in [#3337](https://github.com/PrefectHQ/fastmcp/pull/3337)
* Add MultiAuth for composing multiple token verification sources by [@jlowin](https://github.com/jlowin) in [#3335](https://github.com/PrefectHQ/fastmcp/pull/3335)
* Adds PropelAuth as an AuthProvider by [@andrew-propelauth](https://github.com/andrew-propelauth) in [#3358](https://github.com/PrefectHQ/fastmcp/pull/3358)
* Replace vendored DI with uncalled-for by [@chrisguidry](https://github.com/chrisguidry) in [#3301](https://github.com/PrefectHQ/fastmcp/pull/3301)
* Decompose CodeMode into composable discovery tools by [@jlowin](https://github.com/jlowin) in [#3354](https://github.com/PrefectHQ/fastmcp/pull/3354)
* feat(contrib): auto-sync MCPMixin decorators with from_function signatures by [@AnkeshThakur](https://github.com/AnkeshThakur) in [#3323](https://github.com/PrefectHQ/fastmcp/pull/3323)
* Add Google GenAI Sampling Handler by [@strawgate](https://github.com/strawgate) in [#2977](https://github.com/PrefectHQ/fastmcp/pull/2977)
* Add ListTools, search limit, and catalog size annotation to CodeMode by [@jlowin](https://github.com/jlowin) in [#3359](https://github.com/PrefectHQ/fastmcp/pull/3359)
* Allow configuring FastMCP transport setting in the same way as other configuration by [@jvdmr](https://github.com/jvdmr) in [#1796](https://github.com/PrefectHQ/fastmcp/pull/1796)
* Add include_unversioned option to VersionFilter by [@yangbaechu](https://github.com/yangbaechu) in [#3349](https://github.com/PrefectHQ/fastmcp/pull/3349)
### Fixes 🐞
* Fix docs banner pushing nav down by [@jlowin](https://github.com/jlowin) in [#3282](https://github.com/PrefectHQ/fastmcp/pull/3282)
* fix: Replace hardcoded TTL with DEFAULT_TTL_MS - issue #3279 by [@cedric57](https://github.com/cedric57) in [#3280](https://github.com/PrefectHQ/fastmcp/pull/3280)
* fix: stop suppressing server stderr in fastmcp call by [@jlowin](https://github.com/jlowin) in [#3283](https://github.com/PrefectHQ/fastmcp/pull/3283)
* fix: skip max_completion_tokens when maxTokens is None by [@eon01](https://github.com/eon01) in [#3284](https://github.com/PrefectHQ/fastmcp/pull/3284)
* OpenAPI: rewrite $ref under propertyNames and patternProperties in _replace_ref_with_defs; add regression test for dict[StrEnum, Model] by [@manojPal23234](https://github.com/manojPal23234) in [#3306](https://github.com/PrefectHQ/fastmcp/pull/3306)
* Remove stale add_resource() key parameter from docs by [@jlowin](https://github.com/jlowin) in [#3309](https://github.com/PrefectHQ/fastmcp/pull/3309)
* Handle AuthorizationError as exclusion in AuthMiddleware list hooks by [@yangbaechu](https://github.com/yangbaechu) in [#3338](https://github.com/PrefectHQ/fastmcp/pull/3338)
* Fix flaky OpenAPI performance test threshold by [@jlowin](https://github.com/jlowin) in [#3355](https://github.com/PrefectHQ/fastmcp/pull/3355)
* Fix flaky SSE timeout test by [@jlowin](https://github.com/jlowin) in [#3343](https://github.com/PrefectHQ/fastmcp/pull/3343)
* Remove system role references from docs by [@jlowin](https://github.com/jlowin) in [#3356](https://github.com/PrefectHQ/fastmcp/pull/3356)
* Fix session persistence across tool calls in multi-server MCPConfigTransport by [@jer805](https://github.com/jer805) in [#3330](https://github.com/PrefectHQ/fastmcp/pull/3330)
### Docs 📚
* Add v3.0.2 release notes by [@jlowin](https://github.com/jlowin) in [#3276](https://github.com/PrefectHQ/fastmcp/pull/3276)
* Fix "FastMCP Constructor Parameters" in documentation server.mdx (Remove old parameters & Add new parameter) by [@wangyy04](https://github.com/wangyy04) in [#3317](https://github.com/PrefectHQ/fastmcp/pull/3317)
* Fix stale docs: tag filtering API and missing output_schema param by [@jlowin](https://github.com/jlowin) in [#3322](https://github.com/PrefectHQ/fastmcp/pull/3322)
* Narrate search example clients by [@jlowin](https://github.com/jlowin) in [#3321](https://github.com/PrefectHQ/fastmcp/pull/3321)
* Code Mode: Document resource limits and fix docs formatting by [@jlowin](https://github.com/jlowin) in [#3327](https://github.com/PrefectHQ/fastmcp/pull/3327)
* Add reverse proxy (nginx) section to HTTP deployment docs by [@dgenio](https://github.com/dgenio) in [#3344](https://github.com/PrefectHQ/fastmcp/pull/3344)
* Restructure docs navigation: CLI section, Composition, More by [@jlowin](https://github.com/jlowin) in [#3361](https://github.com/PrefectHQ/fastmcp/pull/3361)
### Other Changes 🦾
* Don't advertise sampling.tools capability by default by [@jlowin](https://github.com/jlowin) in [#3334](https://github.com/PrefectHQ/fastmcp/pull/3334)

## New Contributors
* @cedric57 made their first contribution in [#3280](https://github.com/PrefectHQ/fastmcp/pull/3280)
* @eon01 made their first contribution in [#3284](https://github.com/PrefectHQ/fastmcp/pull/3284)
* @manojPal23234 made their first contribution in [#3306](https://github.com/PrefectHQ/fastmcp/pull/3306)
* @wangyy04 made their first contribution in [#3317](https://github.com/PrefectHQ/fastmcp/pull/3317)
* @yangbaechu made their first contribution in [#3338](https://github.com/PrefectHQ/fastmcp/pull/3338)
* @andrew-propelauth made their first contribution in [#3358](https://github.com/PrefectHQ/fastmcp/pull/3358)
* @jer805 made their first contribution in [#3330](https://github.com/PrefectHQ/fastmcp/pull/3330)
* @jvdmr made their first contribution in [#1796](https://github.com/PrefectHQ/fastmcp/pull/1796)

**Full Changelog**: [v3.0.2...v3.1.0](https://github.com/PrefectHQ/fastmcp/compare/v3.0.2...v3.1.0)

</Update>

<Update label="v3.0.2" description="2026-02-22">

**[v3.0.2: Threecovery Mode II](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.2)**

Two community-contributed fixes: auth headers from MCP transport no longer leak through to downstream OpenAPI APIs, and background task workers now correctly receive the originating request ID. Plus a new docs example for context-aware tool factories.

### Fixes 🐞
* fix: prevent MCP transport auth header from leaking to downstream OpenAPI APIs by [@stakeswky](https://github.com/stakeswky) in [#3262](https://github.com/PrefectHQ/fastmcp/pull/3262)
* fix: propagate origin_request_id to background task workers by [@gfortaine](https://github.com/gfortaine) in [#3175](https://github.com/PrefectHQ/fastmcp/pull/3175)
### Docs 📚
* Add v3.0.1 release notes by [@jlowin](https://github.com/jlowin) in [#3259](https://github.com/PrefectHQ/fastmcp/pull/3259)
* docs: add context-aware tool factory example by [@machov](https://github.com/machov) in [#3264](https://github.com/PrefectHQ/fastmcp/pull/3264)

**Full Changelog**: [v3.0.1...v3.0.2](https://github.com/PrefectHQ/fastmcp/compare/v3.0.1...v3.0.2)

</Update>

<Update label="v3.0.1" description="2026-02-20">

**[v3.0.1: Three-covery Mode](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.1)**

First patch after 3.0 — mostly smoothing out rough edges discovered in the wild. The big ones: middleware state that wasn't surviving the trip to tool handlers now does, `Tool.from_tool()` accepts callables again, OpenAPI schemas with circular references no longer crash discovery, and decorator overloads now return the correct types in function mode. Also adds `verify_id_token` to OIDCProxy for providers (like some Azure AD configs) that issue opaque access tokens but standard JWT id_tokens.

### Enhancements 🔧
* Add verify_id_token option to OIDCProxy by [@jlowin](https://github.com/jlowin) in [#3248](https://github.com/PrefectHQ/fastmcp/pull/3248)
### Fixes 🐞
* Fix v3.0.0 changelog compare link by [@jlowin](https://github.com/jlowin) in [#3223](https://github.com/PrefectHQ/fastmcp/pull/3223)
* Fix MDX parse error in upgrade guide prompts by [@jlowin](https://github.com/jlowin) in [#3227](https://github.com/PrefectHQ/fastmcp/pull/3227)
* Fix non-serializable state lost between middleware and tools by [@jlowin](https://github.com/jlowin) in [#3234](https://github.com/PrefectHQ/fastmcp/pull/3234)
* Accept callables in Tool.from_tool() by [@jlowin](https://github.com/jlowin) in [#3235](https://github.com/PrefectHQ/fastmcp/pull/3235)
* Preserve skill metadata through provider wrapping by [@jlowin](https://github.com/jlowin) in [#3237](https://github.com/PrefectHQ/fastmcp/pull/3237)
* Fix circular reference crash in OpenAPI schemas by [@jlowin](https://github.com/jlowin) in [#3245](https://github.com/PrefectHQ/fastmcp/pull/3245)
* Fix NameError with future annotations and Context/Depends parameters by [@jlowin](https://github.com/jlowin) in [#3243](https://github.com/PrefectHQ/fastmcp/pull/3243)
* Fix ty ignore syntax in OpenAPI provider by [@jlowin](https://github.com/jlowin) in [#3253](https://github.com/PrefectHQ/fastmcp/pull/3253)
* Use max_completion_tokens instead of deprecated max_tokens in OpenAI handler by [@jlowin](https://github.com/jlowin) in [#3254](https://github.com/PrefectHQ/fastmcp/pull/3254)
* Fix ty compatibility with upgraded deps by [@jlowin](https://github.com/jlowin) in [#3257](https://github.com/PrefectHQ/fastmcp/pull/3257)
* Fix decorator overload return types for function mode by [@jlowin](https://github.com/jlowin) in [#3258](https://github.com/PrefectHQ/fastmcp/pull/3258)


### Docs 📚
* Sync README with welcome.mdx, fix install count by [@jlowin](https://github.com/jlowin) in [#3224](https://github.com/PrefectHQ/fastmcp/pull/3224)
* Document dict-to-Message prompt migration in upgrade guides by [@jlowin](https://github.com/jlowin) in [#3225](https://github.com/PrefectHQ/fastmcp/pull/3225)
* Fix v2 upgrade guide: remove incorrect v1 import advice by [@jlowin](https://github.com/jlowin) in [#3226](https://github.com/PrefectHQ/fastmcp/pull/3226)
* Animated banner by [@jlowin](https://github.com/jlowin) in [#3231](https://github.com/PrefectHQ/fastmcp/pull/3231)
* Document mounted server state store isolation in upgrade guide by [@jlowin](https://github.com/jlowin) in [#3236](https://github.com/PrefectHQ/fastmcp/pull/3236)

**Full Changelog**: [v3.0.0...v3.0.1](https://github.com/PrefectHQ/fastmcp/compare/v3.0.0...v3.0.1)

</Update>

<Update label="v3.0.0" description="2026-02-18">

**[v3.0.0: Three at Last](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0)**

FastMCP 3.0 is stable. Two betas, two release candidates, 21 new contributors, and more than 100,000 pre-release installs later — the architecture held up, the upgrade path was smooth, and we're shipping it.

The surface API is largely unchanged — `@mcp.tool()` still works exactly as before. What changed is everything underneath: a provider/transform architecture that makes FastMCP extensible, observable, and composable in ways v2 couldn't support. If we did our jobs right, you'll barely notice the redesign. You'll just notice that more is possible.

This is also the release where FastMCP moves from [jlowin/fastmcp](https://github.com/jlowin/fastmcp) to [PrefectHQ/fastmcp](https://github.com/PrefectHQ/fastmcp). GitHub forwards all links, PyPI is the same, imports are the same. A major version felt like the right moment to make it official.

### Build servers from anything

🔌 Components no longer have to live in one file with one server. `FileSystemProvider` discovers tools from directories with hot-reload. `OpenAPIProvider` wraps REST APIs. `ProxyProvider` proxies remote MCP servers. `SkillsProvider` delivers agent skills as resources. Write your own provider for whatever source makes sense. Compose multiple providers into one server, share one across many, or chain them with **transforms** that rename, namespace, filter, version, and secure components as they flow to clients. `ResourcesAsTools` and `PromptsAsTools` expose non-tool components to tool-only clients.

### Ship to production

🔐 Component versioning: serve `@tool(version="2.0")` alongside older versions from one codebase. Granular authorization on individual components with async auth checks, server-wide policies via `AuthMiddleware`, and scope-based access control. OAuth gets CIMD, Static Client Registration, Azure OBO via dependency injection, JWT audience validation, and confused-deputy protections. OpenTelemetry tracing with MCP semantic conventions. Response size limiting. Background tasks with distributed Redis notification and `ctx.elicit()` relay. Security fixes include dropping `diskcache` (CVE-2025-69872) and upgrading `python-multipart` and `protobuf` for additional CVEs.

### Adapt per session

💾 Session state persists across requests via `ctx.set_state()` / `ctx.get_state()`. `ctx.enable_components()` and `ctx.disable_components()` let servers adapt dynamically per client — show admin tools after authentication, progressively reveal capabilities, or scope access by role.

### Develop faster

⚡ `--reload` auto-restarts on file changes. Standalone decorators return the original function, so decorated tools stay callable in tests and non-MCP contexts. Sync functions auto-dispatch to a threadpool. Tool timeouts, MCP-compliant pagination, composable lifespans, `PingMiddleware` for keepalive, and concurrent tool execution when the LLM returns multiple calls in one response.

### Use FastMCP as a CLI

🖥️ `fastmcp list` and `fastmcp call` query and invoke tools on any server from a terminal. `fastmcp discover` scans your editor configs (Claude Desktop, Cursor, Goose, Gemini CLI) and finds configured servers by name. `fastmcp generate-cli` writes a standalone typed CLI where every tool is a subcommand. `fastmcp install` registers your server with Claude Desktop, Cursor, or Goose in one command.

### Build apps (3.1 preview)

📱 Spec-level support for MCP Apps is in: `ui://` resource scheme, typed UI metadata via `AppConfig`, extension negotiation, and runtime detection. The full Apps experience lands in 3.1.

---

If you hit 3.0 because you didn't pin your dependencies and something breaks — the [upgrade guides](https://gofastmcp.com/getting-started/upgrading/from-fastmcp-2) will get you sorted. We minimized breaking changes, but a major version is a major version.

```bash
pip install fastmcp -U
```

📖 [Documentation](https://gofastmcp.com)
🚀 [Upgrade from FastMCP v2](https://gofastmcp.com/getting-started/upgrading/from-fastmcp-2)
🔀 [Upgrade from MCP Python SDK](https://gofastmcp.com/getting-started/upgrading/from-mcp-sdk)

## What's Changed
### New Features 🎉
* Refactor resource behavior and add meta support by [@jlowin](https://github.com/jlowin) in [#2611](https://github.com/PrefectHQ/fastmcp/pull/2611)
* Refactor prompt behavior and add meta support by [@jlowin](https://github.com/jlowin) in [#2610](https://github.com/PrefectHQ/fastmcp/pull/2610)
* feat: Provider abstraction for dynamic MCP components by [@jlowin](https://github.com/jlowin) in [#2622](https://github.com/PrefectHQ/fastmcp/pull/2622)
* Unify component storage in LocalProvider by [@jlowin](https://github.com/jlowin) in [#2680](https://github.com/PrefectHQ/fastmcp/pull/2680)
* Introduce ResourceResult as canonical resource return type by [@jlowin](https://github.com/jlowin) in [#2734](https://github.com/PrefectHQ/fastmcp/pull/2734)
* Introduce Message and PromptResult as canonical prompt types by [@jlowin](https://github.com/jlowin) in [#2738](https://github.com/PrefectHQ/fastmcp/pull/2738)
* Add --reload flag for auto-restart on file changes by [@jlowin](https://github.com/jlowin) in [#2816](https://github.com/PrefectHQ/fastmcp/pull/2816)
* Add FileSystemProvider for filesystem-based component discovery by [@jlowin](https://github.com/jlowin) in [#2823](https://github.com/PrefectHQ/fastmcp/pull/2823)
* Add standalone decorators and eliminate fastmcp.fs module by [@jlowin](https://github.com/jlowin) in [#2832](https://github.com/PrefectHQ/fastmcp/pull/2832)
* Add authorization checks to components and servers by [@jlowin](https://github.com/jlowin) in [#2855](https://github.com/PrefectHQ/fastmcp/pull/2855)
* Decorators return functions instead of component objects by [@jlowin](https://github.com/jlowin) in [#2856](https://github.com/PrefectHQ/fastmcp/pull/2856)
* Add transform system for modifying components in provider chains by [@jlowin](https://github.com/jlowin) in [#2836](https://github.com/PrefectHQ/fastmcp/pull/2836)
* Add OpenTelemetry tracing support by [@chrisguidry](https://github.com/chrisguidry) in [#2869](https://github.com/PrefectHQ/fastmcp/pull/2869)
* Add component versioning and VersionFilter transform by [@jlowin](https://github.com/jlowin) in [#2894](https://github.com/PrefectHQ/fastmcp/pull/2894)
* Add version discovery and calling a certain version for components by [@jlowin](https://github.com/jlowin) in [#2897](https://github.com/PrefectHQ/fastmcp/pull/2897)
* Refactor visibility to mark-based enabled system by [@jlowin](https://github.com/jlowin) in [#2912](https://github.com/PrefectHQ/fastmcp/pull/2912)
* Add session-specific visibility control via Context by [@jlowin](https://github.com/jlowin) in [#2917](https://github.com/PrefectHQ/fastmcp/pull/2917)
* Add Skills Provider for exposing agent skills as MCP resources by [@jlowin](https://github.com/jlowin) in [#2944](https://github.com/PrefectHQ/fastmcp/pull/2944)
* Add MCP Apps Phase 1 — SDK compatibility (SEP-1865) by [@jlowin](https://github.com/jlowin) in [#3009](https://github.com/PrefectHQ/fastmcp/pull/3009)
* Add `fastmcp list` and `fastmcp call` CLI commands by [@jlowin](https://github.com/jlowin) in [#3054](https://github.com/PrefectHQ/fastmcp/pull/3054)
* Add `fastmcp generate-cli` command by [@jlowin](https://github.com/jlowin) in [#3065](https://github.com/PrefectHQ/fastmcp/pull/3065)
* Add CIMD (Client ID Metadata Document) support for OAuth by [@jlowin](https://github.com/jlowin) in [#2871](https://github.com/PrefectHQ/fastmcp/pull/2871)


### Enhancements 🔧
* Convert mounted servers to MountedProvider by [@jlowin](https://github.com/jlowin) in [#2635](https://github.com/PrefectHQ/fastmcp/pull/2635)
* Simplify .key as computed property by [@jlowin](https://github.com/jlowin) in [#2648](https://github.com/PrefectHQ/fastmcp/pull/2648)
* Refactor MountedProvider into FastMCPProvider + TransformingProvider by [@jlowin](https://github.com/jlowin) in [#2653](https://github.com/PrefectHQ/fastmcp/pull/2653)
* Enable background task support for custom component subclasses by [@jlowin](https://github.com/jlowin) in [#2657](https://github.com/PrefectHQ/fastmcp/pull/2657)
* Use CreateTaskResult for background task creation by [@jlowin](https://github.com/jlowin) in [#2660](https://github.com/PrefectHQ/fastmcp/pull/2660)
* Refactor provider execution: components own their execution by [@jlowin](https://github.com/jlowin) in [#2663](https://github.com/PrefectHQ/fastmcp/pull/2663)
* Add supports_tasks() method to replace string mode checks by [@jlowin](https://github.com/jlowin) in [#2664](https://github.com/PrefectHQ/fastmcp/pull/2664)
* Replace type: ignore[attr-defined] with isinstance assertions in tests by [@jlowin](https://github.com/jlowin) in [#2665](https://github.com/PrefectHQ/fastmcp/pull/2665)
* Add poll_interval to TaskConfig by [@jlowin](https://github.com/jlowin) in [#2666](https://github.com/PrefectHQ/fastmcp/pull/2666)
* Refactor task module: rename protocol.py to requests.py and reduce redundancy by [@jlowin](https://github.com/jlowin) in [#2667](https://github.com/PrefectHQ/fastmcp/pull/2667)
* Refactor FastMCPProxy into ProxyProvider by [@jlowin](https://github.com/jlowin) in [#2669](https://github.com/PrefectHQ/fastmcp/pull/2669)
* Move OpenAPI to providers/openapi submodule by [@jlowin](https://github.com/jlowin) in [#2672](https://github.com/PrefectHQ/fastmcp/pull/2672)
* Use ergonomic provider initialization pattern by [@jlowin](https://github.com/jlowin) in [#2675](https://github.com/PrefectHQ/fastmcp/pull/2675)
* Fix ty 0.0.5 type errors by [@jlowin](https://github.com/jlowin) in [#2676](https://github.com/PrefectHQ/fastmcp/pull/2676)
* Remove execution methods from Provider base class by [@jlowin](https://github.com/jlowin) in [#2681](https://github.com/PrefectHQ/fastmcp/pull/2681)
* Add type-prefixed keys for globally unique component identification by [@jlowin](https://github.com/jlowin) in [#2704](https://github.com/PrefectHQ/fastmcp/pull/2704)
* Consolidate notification system with unified API by [@jlowin](https://github.com/jlowin) in [#2710](https://github.com/PrefectHQ/fastmcp/pull/2710)
* Parallelize provider operations by [@jlowin](https://github.com/jlowin) in [#2716](https://github.com/PrefectHQ/fastmcp/pull/2716)
* Consolidate get_* and _list_* methods into single API by [@jlowin](https://github.com/jlowin) in [#2719](https://github.com/PrefectHQ/fastmcp/pull/2719)
* Consolidate execution method chains into single public API by [@jlowin](https://github.com/jlowin) in [#2728](https://github.com/PrefectHQ/fastmcp/pull/2728)
* Parallelize list_* calls in Provider.get_tasks() by [@jlowin](https://github.com/jlowin) in [#2731](https://github.com/PrefectHQ/fastmcp/pull/2731)
* Consistent decorator-based MCP handler registration by [@jlowin](https://github.com/jlowin) in [#2732](https://github.com/PrefectHQ/fastmcp/pull/2732)
* Make ToolResult a BaseModel for serialization support by [@jlowin](https://github.com/jlowin) in [#2736](https://github.com/PrefectHQ/fastmcp/pull/2736)
* Align prompt handler with resource pattern by [@jlowin](https://github.com/jlowin) in [#2740](https://github.com/PrefectHQ/fastmcp/pull/2740)
* Update classes to inherit from FastMCPBaseModel instead of BaseModel by [@jlowin](https://github.com/jlowin) in [#2739](https://github.com/PrefectHQ/fastmcp/pull/2739)
* Add explicit task_meta parameter to FastMCP.call_tool() by [@jlowin](https://github.com/jlowin) in [#2749](https://github.com/PrefectHQ/fastmcp/pull/2749)
* Add task_meta parameter to read_resource() for explicit task control by [@jlowin](https://github.com/jlowin) in [#2750](https://github.com/PrefectHQ/fastmcp/pull/2750)
* Add task_meta to prompts and centralize fn_key enrichment by [@jlowin](https://github.com/jlowin) in [#2751](https://github.com/PrefectHQ/fastmcp/pull/2751)
* Remove unused include_tags/exclude_tags settings by [@jlowin](https://github.com/jlowin) in [#2756](https://github.com/PrefectHQ/fastmcp/pull/2756)
* Parallelize provider access when executing components by [@jlowin](https://github.com/jlowin) in [#2744](https://github.com/PrefectHQ/fastmcp/pull/2744)
* Deprecate tool_serializer parameter by [@jlowin](https://github.com/jlowin) in [#2753](https://github.com/PrefectHQ/fastmcp/pull/2753)
* Feature/supabase custom auth route by [@EloiZalczer](https://github.com/EloiZalczer) in [#2632](https://github.com/PrefectHQ/fastmcp/pull/2632)
* Remove deprecated WSTransport by [@jlowin](https://github.com/jlowin) in [#2826](https://github.com/PrefectHQ/fastmcp/pull/2826)
* Add composable lifespans by [@jlowin](https://github.com/jlowin) in [#2828](https://github.com/PrefectHQ/fastmcp/pull/2828)
* Replace FastMCP.as_proxy() with create_proxy() function by [@jlowin](https://github.com/jlowin) in [#2829](https://github.com/PrefectHQ/fastmcp/pull/2829)
* Add PingMiddleware for keepalive connections by [@jlowin](https://github.com/jlowin) in [#2838](https://github.com/PrefectHQ/fastmcp/pull/2838)
* Run sync tools/resources/prompts in threadpool automatically by [@jlowin](https://github.com/jlowin) in [#2865](https://github.com/PrefectHQ/fastmcp/pull/2865)
* Add timeout parameter for tool foreground execution by [@jlowin](https://github.com/jlowin) in [#2872](https://github.com/PrefectHQ/fastmcp/pull/2872)
* Adopt OpenTelemetry MCP semantic conventions by [@chrisguidry](https://github.com/chrisguidry) in [#2886](https://github.com/PrefectHQ/fastmcp/pull/2886)
* Add client_secret_post authentication to IntrospectionTokenVerifier by [@shulkx](https://github.com/shulkx) in [#2884](https://github.com/PrefectHQ/fastmcp/pull/2884)
* Add enable_rich_logging setting to disable rich formatting by [@strawgate](https://github.com/strawgate) in [#2893](https://github.com/PrefectHQ/fastmcp/pull/2893)
* Rename _fastmcp metadata namespace to fastmcp and make non-optional by [@jlowin](https://github.com/jlowin) in [#2895](https://github.com/PrefectHQ/fastmcp/pull/2895)
* Refactor FastMCP to inherit from Provider by [@jlowin](https://github.com/jlowin) in [#2901](https://github.com/PrefectHQ/fastmcp/pull/2901)
* Swap public/private method naming in Provider by [@jlowin](https://github.com/jlowin) in [#2902](https://github.com/PrefectHQ/fastmcp/pull/2902)
* Add MCP-compliant pagination support by [@jlowin](https://github.com/jlowin) in [#2903](https://github.com/PrefectHQ/fastmcp/pull/2903)
* Support VersionSpec in enable/disable for range-based filtering by [@jlowin](https://github.com/jlowin) in [#2914](https://github.com/PrefectHQ/fastmcp/pull/2914)
* Immutable transform wrapping for providers by [@jlowin](https://github.com/jlowin) in [#2913](https://github.com/PrefectHQ/fastmcp/pull/2913)
* Unify discovery API: deduplicate at protocol layer only by [@jlowin](https://github.com/jlowin) in [#2919](https://github.com/PrefectHQ/fastmcp/pull/2919)
* Add ResourcesAsTools transform by [@jlowin](https://github.com/jlowin) in [#2943](https://github.com/PrefectHQ/fastmcp/pull/2943)
* Add PromptsAsTools transform by [@jlowin](https://github.com/jlowin) in [#2946](https://github.com/PrefectHQ/fastmcp/pull/2946)
* Rename Enabled transform to Visibility by [@jlowin](https://github.com/jlowin) in [#2950](https://github.com/PrefectHQ/fastmcp/pull/2950)
* feat: option to add upstream claims to the FastMCP proxy JWT by [@JonasKs](https://github.com/JonasKs) in [#2997](https://github.com/PrefectHQ/fastmcp/pull/2997)
* fix: automatically include offline_access as a scope in the Azure provider by [@JonasKs](https://github.com/JonasKs) in [#3001](https://github.com/PrefectHQ/fastmcp/pull/3001)
* feat: expand --reload to watch frontend file types by [@jlowin](https://github.com/jlowin) in [#3028](https://github.com/PrefectHQ/fastmcp/pull/3028)
* Add `fastmcp install stdio` command by [@jlowin](https://github.com/jlowin) in [#3032](https://github.com/PrefectHQ/fastmcp/pull/3032)
* feat: Goose integration + dedicated install command by [@jlowin](https://github.com/jlowin) in [#3040](https://github.com/PrefectHQ/fastmcp/pull/3040)
* Add `fastmcp discover` and name-based server resolution by [@jlowin](https://github.com/jlowin) in [#3055](https://github.com/PrefectHQ/fastmcp/pull/3055)
* feat(context): Add background task support for Context by [@gfortaine](https://github.com/gfortaine) in [#2905](https://github.com/PrefectHQ/fastmcp/pull/2905)
* Add server version to banner by [@richardkmichael](https://github.com/richardkmichael) in [#3076](https://github.com/PrefectHQ/fastmcp/pull/3076)
* Add @handle_tool_errors decorator for standardized error handling by [@dgenio](https://github.com/dgenio) in [#2885](https://github.com/PrefectHQ/fastmcp/pull/2885)
* Add ResponseLimitingMiddleware for tool response size control by [@dgenio](https://github.com/dgenio) in [#3072](https://github.com/PrefectHQ/fastmcp/pull/3072)
* Infer MIME types from OpenAPI response definitions by [@jlowin](https://github.com/jlowin) in [#3101](https://github.com/PrefectHQ/fastmcp/pull/3101)
* Remove require_auth in favor of scope-based authorization by [@jlowin](https://github.com/jlowin) in [#3103](https://github.com/PrefectHQ/fastmcp/pull/3103)
* generate-cli: auto-generate SKILL.md agent skill by [@jlowin](https://github.com/jlowin) in [#3115](https://github.com/PrefectHQ/fastmcp/pull/3115)
* Add Azure OBO dependencies, auth token injection, and documentation by [@jlowin](https://github.com/jlowin) in [#2918](https://github.com/PrefectHQ/fastmcp/pull/2918)
* feat: add Static Client Registration by [@martimfasantos](https://github.com/martimfasantos) in [#3086](https://github.com/PrefectHQ/fastmcp/pull/3086)
* Add concurrent tool execution with sequential flag by [@strawgate](https://github.com/strawgate) in [#3022](https://github.com/PrefectHQ/fastmcp/pull/3022)
* Add validate_output option for OpenAPI tools by [@jlowin](https://github.com/jlowin) in [#3134](https://github.com/PrefectHQ/fastmcp/pull/3134)
* Relay task elicitation through standard MCP protocol by [@chrisguidry](https://github.com/chrisguidry) in [#3136](https://github.com/PrefectHQ/fastmcp/pull/3136)
* Support async auth checks by [@jlowin](https://github.com/jlowin) in [#3152](https://github.com/PrefectHQ/fastmcp/pull/3152)
* Make $ref dereferencing optional via FastMCP(dereference_refs=...) by [@jlowin](https://github.com/jlowin) in [#3151](https://github.com/PrefectHQ/fastmcp/pull/3151)
* Expose local_provider property, deprecate FastMCP.remove_tool() by [@jlowin](https://github.com/jlowin) in [#3155](https://github.com/PrefectHQ/fastmcp/pull/3155)
* Add helpers for converting FunctionTool and TransformedTool to SamplingTool by [@strawgate](https://github.com/strawgate) in [#3062](https://github.com/PrefectHQ/fastmcp/pull/3062)
### Fixes 🐞
* Let FastMCPError propagate from dependencies by [@chrisguidry](https://github.com/chrisguidry) in [#2646](https://github.com/PrefectHQ/fastmcp/pull/2646)
* Fix task execution for tools with custom names by [@chrisguidry](https://github.com/chrisguidry) in [#2645](https://github.com/PrefectHQ/fastmcp/pull/2645)
* fix: check the cause of the tool error by [@rjolaverria](https://github.com/rjolaverria) in [#2674](https://github.com/PrefectHQ/fastmcp/pull/2674)
* Fix uvicorn 0.39+ test timeouts and FastMCPError propagation by [@jlowin](https://github.com/jlowin) in [#2699](https://github.com/PrefectHQ/fastmcp/pull/2699)
* Fix: resolve root-level $ref in outputSchema for MCP spec compliance by [@majiayu000](https://github.com/majiayu000) in [#2720](https://github.com/PrefectHQ/fastmcp/pull/2720)
* Fix Proxy provider to return all resource contents by [@jlowin](https://github.com/jlowin) in [#2742](https://github.com/PrefectHQ/fastmcp/pull/2742)
* fix: Client OAuth async_auth_flow() method causing MCP-SDK lock error by [@lgndluke](https://github.com/lgndluke) in [#2644](https://github.com/PrefectHQ/fastmcp/pull/2644)
* Fix rate limit detection during teardown phase by [@jlowin](https://github.com/jlowin) in [#2757](https://github.com/PrefectHQ/fastmcp/pull/2757)
* Fix OAuth Proxy resource parameter validation by [@jlowin](https://github.com/jlowin) in [#2764](https://github.com/PrefectHQ/fastmcp/pull/2764)
* Fix `openapi_version` check so 3.1 is included by [@deeleeramone](https://github.com/deeleeramone) in [#2768](https://github.com/PrefectHQ/fastmcp/pull/2768)
* Fix base_url fallback when url is not set by [@bhbs](https://github.com/bhbs) in [#2776](https://github.com/PrefectHQ/fastmcp/pull/2776)
* Lazy import DiskStore to avoid sqlite3 dependency on import by [@jlowin](https://github.com/jlowin) in [#2784](https://github.com/PrefectHQ/fastmcp/pull/2784)
* Fix OAuth token storage TTL calculation by [@jlowin](https://github.com/jlowin) in [#2796](https://github.com/PrefectHQ/fastmcp/pull/2796)
* Fix client hanging on HTTP 4xx/5xx errors by [@jlowin](https://github.com/jlowin) in [#2803](https://github.com/PrefectHQ/fastmcp/pull/2803)
* Fix keep_alive passthrough in StdioMCPServer.to_transport() by [@jlowin](https://github.com/jlowin) in [#2791](https://github.com/PrefectHQ/fastmcp/pull/2791)
* Dereference $ref in tool schemas for MCP client compatibility by [@jlowin](https://github.com/jlowin) in [#2808](https://github.com/PrefectHQ/fastmcp/pull/2808)
* Fix timeout not propagating to proxy clients in multi-server MCPConfig by [@jlowin](https://github.com/jlowin) in [#2809](https://github.com/PrefectHQ/fastmcp/pull/2809)
* Fix ContextVar propagation for ASGI-mounted servers with tasks by [@chrisguidry](https://github.com/chrisguidry) in [#2844](https://github.com/PrefectHQ/fastmcp/pull/2844)
* Fix HTTP transport timeout defaulting to 5 seconds by [@jlowin](https://github.com/jlowin) in [#2849](https://github.com/PrefectHQ/fastmcp/pull/2849)
* Fix task capabilities location (issue #2870) by [@jlowin](https://github.com/jlowin) in [#2875](https://github.com/PrefectHQ/fastmcp/pull/2875)
* fix: broaden combine_lifespans type to accept Mapping return types by [@aminsamir45](https://github.com/aminsamir45) in [#3005](https://github.com/PrefectHQ/fastmcp/pull/3005)
* fix: correctly send resource when exchanging code for upstream by [@JonasKs](https://github.com/JonasKs) in [#3013](https://github.com/PrefectHQ/fastmcp/pull/3013)
* chore: upgrade python-multipart to 0.0.22 (CVE-2026-24486) by [@jlowin](https://github.com/jlowin) in [#3042](https://github.com/PrefectHQ/fastmcp/pull/3042)
* chore: upgrade protobuf to 6.33.5 (CVE-2026-0994) by [@jlowin](https://github.com/jlowin) in [#3043](https://github.com/PrefectHQ/fastmcp/pull/3043)
* fix: use MCP spec error code -32002 for resource not found by [@jlowin](https://github.com/jlowin) in [#3041](https://github.com/PrefectHQ/fastmcp/pull/3041)
* Fix tool_choice reset for structured output sampling by [@strawgate](https://github.com/strawgate) in [#3014](https://github.com/PrefectHQ/fastmcp/pull/3014)
* fix: Preserve metadata in FastMCPProvider component wrappers by [@NeelayS](https://github.com/NeelayS) in [#3057](https://github.com/PrefectHQ/fastmcp/pull/3057)
* fix: enforce redirect URI validation when allowed_client_redirect_uris is supplied by [@nathanwelsh8](https://github.com/nathanwelsh8) in [#3066](https://github.com/PrefectHQ/fastmcp/pull/3066)
* Fix --reload port conflict when using explicit port by [@jlowin](https://github.com/jlowin) in [#3070](https://github.com/PrefectHQ/fastmcp/pull/3070)
* Fix compress_schema to preserve additionalProperties: false by [@jlowin](https://github.com/jlowin) in [#3102](https://github.com/PrefectHQ/fastmcp/pull/3102)
* Fix CIMD redirect allowlist bypass and cache revalidation by [@jlowin](https://github.com/jlowin) in [#3098](https://github.com/PrefectHQ/fastmcp/pull/3098)
* Fix session visibility marks leaking across sessions by [@jlowin](https://github.com/jlowin) in [#3132](https://github.com/PrefectHQ/fastmcp/pull/3132)
* Fix unhandled exceptions in OpenAPI POST tool calls by [@jlowin](https://github.com/jlowin) in [#3133](https://github.com/PrefectHQ/fastmcp/pull/3133)
* feat: distributed notification queue + BLPOP elicitation for background tasks by [@gfortaine](https://github.com/gfortaine) in [#2906](https://github.com/PrefectHQ/fastmcp/pull/2906)
* fix: snapshot access token for background tasks by [@gfortaine](https://github.com/gfortaine) in [#3138](https://github.com/PrefectHQ/fastmcp/pull/3138)
* fix: guard client pagination loops against misbehaving servers by [@jlowin](https://github.com/jlowin) in [#3167](https://github.com/PrefectHQ/fastmcp/pull/3167)
* Support non-serializable values in Context.set_state by [@jlowin](https://github.com/jlowin) in [#3171](https://github.com/PrefectHQ/fastmcp/pull/3171)
* Fix stale request context in StatefulProxyClient handlers by [@jlowin](https://github.com/jlowin) in [#3172](https://github.com/PrefectHQ/fastmcp/pull/3172)
* Drop diskcache dependency (CVE-2025-69872) by [@jlowin](https://github.com/jlowin) in [#3185](https://github.com/PrefectHQ/fastmcp/pull/3185)
* Fix confused deputy attack via consent binding cookie by [@jlowin](https://github.com/jlowin) in [#3201](https://github.com/PrefectHQ/fastmcp/pull/3201)
* Add JWT audience validation and RFC 8707 warnings to auth providers by [@jlowin](https://github.com/jlowin) in [#3204](https://github.com/PrefectHQ/fastmcp/pull/3204)
* Cache OBO credentials on AzureProvider for token reuse by [@jlowin](https://github.com/jlowin) in [#3212](https://github.com/PrefectHQ/fastmcp/pull/3212)
* Fix invalid uv add command in upgrade guide by [@jlowin](https://github.com/jlowin) in [#3217](https://github.com/PrefectHQ/fastmcp/pull/3217)
* Use standard traceparent/tracestate keys per OTel MCP semconv by [@chrisguidry](https://github.com/chrisguidry) in [#3221](https://github.com/PrefectHQ/fastmcp/pull/3221)
### Breaking Changes 🛫
* Add VisibilityFilter for hierarchical enable/disable by [@jlowin](https://github.com/jlowin) in [#2708](https://github.com/PrefectHQ/fastmcp/pull/2708)
* Remove automatic environment variable loading from auth providers by [@jlowin](https://github.com/jlowin) in [#2752](https://github.com/PrefectHQ/fastmcp/pull/2752)
* Make pydocket optional and unify DI systems by [@jlowin](https://github.com/jlowin) in [#2835](https://github.com/PrefectHQ/fastmcp/pull/2835)
* Add session-scoped state persistence by [@jlowin](https://github.com/jlowin) in [#2873](https://github.com/PrefectHQ/fastmcp/pull/2873)
* Rename ui= to app= and consolidate ToolUI/ResourceUI into AppConfig by [@jlowin](https://github.com/jlowin) in [#3117](https://github.com/PrefectHQ/fastmcp/pull/3117)
* Remove deprecated FastMCP() constructor kwargs by [@jlowin](https://github.com/jlowin) in [#3148](https://github.com/PrefectHQ/fastmcp/pull/3148)
* Move `fastmcp dev` to `fastmcp dev inspector` by [@jlowin](https://github.com/jlowin) in [#3188](https://github.com/PrefectHQ/fastmcp/pull/3188)

## New Contributors
* [@ivanbelenky](https://github.com/ivanbelenky) made their first contribution in [#2656](https://github.com/PrefectHQ/fastmcp/pull/2656)
* [@rjolaverria](https://github.com/rjolaverria) made their first contribution in [#2674](https://github.com/PrefectHQ/fastmcp/pull/2674)
* [@mgoldsborough](https://github.com/mgoldsborough) made their first contribution in [#2701](https://github.com/PrefectHQ/fastmcp/pull/2701)
* [@Ashif4354](https://github.com/Ashif4354) made their first contribution in [#2707](https://github.com/PrefectHQ/fastmcp/pull/2707)
* [@majiayu000](https://github.com/majiayu000) made their first contribution in [#2720](https://github.com/PrefectHQ/fastmcp/pull/2720)
* [@lgndluke](https://github.com/lgndluke) made their first contribution in [#2644](https://github.com/PrefectHQ/fastmcp/pull/2644)
* [@EloiZalczer](https://github.com/EloiZalczer) made their first contribution in [#2632](https://github.com/PrefectHQ/fastmcp/pull/2632)
* [@deeleeramone](https://github.com/deeleeramone) made their first contribution in [#2768](https://github.com/PrefectHQ/fastmcp/pull/2768)
* [@shea-parkes](https://github.com/shea-parkes) made their first contribution in [#2781](https://github.com/PrefectHQ/fastmcp/pull/2781)
* [@bryankthompson](https://github.com/bryankthompson) made their first contribution in [#2777](https://github.com/PrefectHQ/fastmcp/pull/2777)
* [@bhbs](https://github.com/bhbs) made their first contribution in [#2776](https://github.com/PrefectHQ/fastmcp/pull/2776)
* [@shulkx](https://github.com/shulkx) made their first contribution in [#2884](https://github.com/PrefectHQ/fastmcp/pull/2884)
* [@abhijeethp](https://github.com/abhijeethp) made their first contribution in [#2967](https://github.com/PrefectHQ/fastmcp/pull/2967)
* [@aminsamir45](https://github.com/aminsamir45) made their first contribution in [#3005](https://github.com/PrefectHQ/fastmcp/pull/3005)
* [@JonasKs](https://github.com/JonasKs) made their first contribution in [#2997](https://github.com/PrefectHQ/fastmcp/pull/2997)
* [@NeelayS](https://github.com/NeelayS) made their first contribution in [#3057](https://github.com/PrefectHQ/fastmcp/pull/3057)
* [@gfortaine](https://github.com/gfortaine) made their first contribution in [#2905](https://github.com/PrefectHQ/fastmcp/pull/2905)
* [@nathanwelsh8](https://github.com/nathanwelsh8) made their first contribution in [#3066](https://github.com/PrefectHQ/fastmcp/pull/3066)
* [@dgenio](https://github.com/dgenio) made their first contribution in [#2885](https://github.com/PrefectHQ/fastmcp/pull/2885)
* [@martimfasantos](https://github.com/martimfasantos) made their first contribution in [#3086](https://github.com/PrefectHQ/fastmcp/pull/3086)
* [@jfBiswajit](https://github.com/jfBiswajit) made their first contribution in [#3193](https://github.com/PrefectHQ/fastmcp/pull/3193)

**Full Changelog**: https://github.com/PrefectHQ/fastmcp/compare/v2.14.5...v3.0.0

</Update>

<Update label="v3.0.0rc1" description="2026-02-12">

**[v3.0.0rc1: RC-ing is Believing](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0rc1)**

FastMCP 3 RC1 means we believe the API is stable. Beta 2 drew a wave of real-world adoption — production deployments, migration reports, integration testing — and the feedback overwhelmingly confirmed that the architecture works. This release closes gaps that surfaced under load: auth flows that needed to be async, background tasks that needed reliable notification delivery, and APIs still carrying beta-era naming. If nothing unexpected surfaces, this is what 3.0.0 looks like.

🚨 **Breaking Changes** — The `ui=` parameter is now `app=` with a unified `AppConfig` class (matching the feature's actual name), and 16 `FastMCP()` constructor kwargs have finally been removed. If you've been ignoring months of deprecation warnings, you'll get a `TypeError` with specific migration instructions.

🔐 **Auth Improvements** — Three changes that together round out FastMCP's auth story for production. `auth=` checks can now be `async`, so you can hit databases or external services during authorization — previously, passing an async function silently passed because the unawaited coroutine was truthy. Static Client Registration lets clients provide a pre-registered `client_id`/`client_secret` directly, bypassing DCR for servers that don't support it. And Azure OBO flows are now declarative via dependency injection:

```python
from fastmcp.server.auth.providers.azure import EntraOBOToken

@mcp.tool()
async def get_emails(
    graph_token: str = EntraOBOToken(["https://graph.microsoft.com/Mail.Read"]),
):
    # OBO exchange already happened — just use the token
    ...
```

⚡ **Concurrent Sampling** — When an LLM returns multiple tool calls in a single response, `context.sample()` can now execute them in parallel. Opt in with `tool_concurrency=0` for unlimited parallelism, or set a bound. Tools that aren't safe to parallelize can declare `sequential=True`.

📡 **Background Task Notifications** — Background tasks now reliably push progress updates and elicit user input through the standard MCP protocol. A distributed Redis queue replaces polling (7,200 round-trips/hour → one blocking call), and `ctx.elicit()` in background tasks automatically relays through the client's standard `elicitation_handler`.

✅ **OpenAPI Output Validation** — When backends don't conform to their own OpenAPI schemas, the MCP SDK rejects the response and the tool fails. `validate_output=False` disables strict schema checking while still passing structured JSON to clients — a necessary escape hatch for imperfect APIs.

## What's Changed
### Enhancements 🔧
* generate-cli: auto-generate SKILL.md agent skill by [@jlowin](https://github.com/jlowin) in [#3115](https://github.com/PrefectHQ/fastmcp/pull/3115)
* Scope Martian triage to bug-labeled issues for jlowin by [@jlowin](https://github.com/jlowin) in [#3124](https://github.com/PrefectHQ/fastmcp/pull/3124)
* Add Azure OBO dependencies, auth token injection, and documentation by [@jlowin](https://github.com/jlowin) in [#2918](https://github.com/PrefectHQ/fastmcp/pull/2918)
* feat: add Static Client Registration (#3085) by [@martimfasantos](https://github.com/martimfasantos) in [#3086](https://github.com/PrefectHQ/fastmcp/pull/3086)
* Add concurrent tool execution with sequential flag by [@strawgate](https://github.com/strawgate) in [#3022](https://github.com/PrefectHQ/fastmcp/pull/3022)
* Add validate_output option for OpenAPI tools by [@jlowin](https://github.com/jlowin) in [#3134](https://github.com/PrefectHQ/fastmcp/pull/3134)
* Relay task elicitation through standard MCP protocol by [@chrisguidry](https://github.com/chrisguidry) in [#3136](https://github.com/PrefectHQ/fastmcp/pull/3136)
* Bump py-key-value-aio to `>=0.4.0,<0.5.0` by [@strawgate](https://github.com/strawgate) in [#3143](https://github.com/PrefectHQ/fastmcp/pull/3143)
* Support async auth checks by [@jlowin](https://github.com/jlowin) in [#3152](https://github.com/PrefectHQ/fastmcp/pull/3152)
* Make $ref dereferencing optional via FastMCP(dereference_refs=...) by [@jlowin](https://github.com/jlowin) in [#3151](https://github.com/PrefectHQ/fastmcp/pull/3151)
* Expose local_provider property, deprecate FastMCP.remove_tool() by [@jlowin](https://github.com/jlowin) in [#3155](https://github.com/PrefectHQ/fastmcp/pull/3155)
* Add helpers for converting FunctionTool and TransformedTool to SamplingTool by [@strawgate](https://github.com/strawgate) in [#3062](https://github.com/PrefectHQ/fastmcp/pull/3062)
* Updates to github actions / workflows for claude by [@strawgate](https://github.com/strawgate) in [#3157](https://github.com/PrefectHQ/fastmcp/pull/3157)
### Fixes 🐞
* Updated deprecation URL for V3 by [@SrzStephen](https://github.com/SrzStephen) in [#3108](https://github.com/PrefectHQ/fastmcp/pull/3108)
* Fix Windows test timeouts in OAuth proxy provider tests by [@strawgate](https://github.com/strawgate) in [#3123](https://github.com/PrefectHQ/fastmcp/pull/3123)
* Fix session visibility marks leaking across sessions by [@jlowin](https://github.com/jlowin) in [#3132](https://github.com/PrefectHQ/fastmcp/pull/3132)
* Fix unhandled exceptions in OpenAPI POST tool calls by [@jlowin](https://github.com/jlowin) in [#3133](https://github.com/PrefectHQ/fastmcp/pull/3133)
* feat: distributed notification queue + BLPOP elicitation for background tasks by [@gfortaine](https://github.com/gfortaine) in [#2906](https://github.com/PrefectHQ/fastmcp/pull/2906)
* fix: snapshot access token for background tasks (#3095) by [@gfortaine](https://github.com/gfortaine) in [#3138](https://github.com/PrefectHQ/fastmcp/pull/3138)
* Stop duplicating path parameter descriptions into tool prose by [@jlowin](https://github.com/jlowin) in [#3149](https://github.com/PrefectHQ/fastmcp/pull/3149)
* fix: guard client pagination loops against misbehaving servers by [@jlowin](https://github.com/jlowin) in [#3167](https://github.com/PrefectHQ/fastmcp/pull/3167)
* Fix stale get_* references in docs and examples by [@jlowin](https://github.com/jlowin) in [#3168](https://github.com/PrefectHQ/fastmcp/pull/3168)
* Support non-serializable values in Context.set_state by [@jlowin](https://github.com/jlowin) in [#3171](https://github.com/PrefectHQ/fastmcp/pull/3171)
* Fix stale request context in StatefulProxyClient handlers by [@jlowin](https://github.com/jlowin) in [#3172](https://github.com/PrefectHQ/fastmcp/pull/3172)
### Breaking Changes 🛫
* Rename ui= to app= and consolidate ToolUI/ResourceUI into AppConfig by [@jlowin](https://github.com/jlowin) in [#3117](https://github.com/PrefectHQ/fastmcp/pull/3117)
* Remove deprecated FastMCP() constructor kwargs by [@jlowin](https://github.com/jlowin) in [#3148](https://github.com/PrefectHQ/fastmcp/pull/3148)
### Docs 📚
* Update docs to reference beta 2 by [@jlowin](https://github.com/jlowin) in [#3112](https://github.com/PrefectHQ/fastmcp/pull/3112)
* docs: add pre-registered OAuth clients to v3-features by [@jlowin](https://github.com/jlowin) in [#3129](https://github.com/PrefectHQ/fastmcp/pull/3129)
### Dependencies 📦
* chore(deps): bump cryptography from 46.0.3 to 46.0.5 in /examples/testing_demo in the uv group across 1 directory by @dependabot in [#3140](https://github.com/PrefectHQ/fastmcp/pull/3140)
### Other Changes 🦾
* docs: add v3.0.0rc1 features to v3-features tracking by [@jlowin](https://github.com/jlowin) in [#3145](https://github.com/PrefectHQ/fastmcp/pull/3145)
* docs: remove nonexistent MSALApp from rc1 notes by [@jlowin](https://github.com/jlowin) in [#3146](https://github.com/PrefectHQ/fastmcp/pull/3146)

## New Contributors
* [@martimfasantos](https://github.com/martimfasantos) made their first contribution in [#3086](https://github.com/PrefectHQ/fastmcp/pull/3086)

**Full Changelog**: https://github.com/PrefectHQ/fastmcp/compare/v3.0.0b2...v3.0.0rc1

</Update>

<Update label="v3.0.0b2" description="2026-02-07">

**[v3.0.0b2: 2 Fast 2 Beta](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0b2)**

FastMCP 3 Beta 2 reflects the huge number of people that kicked the tires on Beta 1. Seven new contributors landed changes in this release, and early migration reports went smoother than expected, including teams on Prefect Horizon upgrading from v2. Most of Beta 2 is refinement: fixing what people found, filling gaps from real usage, hardening edges. But a few new features did land along the way.

🖥️ **Client CLI** — `fastmcp list`, `fastmcp call`, `fastmcp discover`, and `fastmcp generate-cli` turn any MCP server into something you can poke at from a terminal. Discover servers configured in Claude Desktop, Cursor, Goose, or project-level `mcp.json` files and reference them by name. `generate-cli` reads a server's schemas and writes a standalone typed CLI script where every tool is a proper subcommand with flags and help text.

🔐 **CIMD** (Client ID Metadata Documents) adds an alternative to Dynamic Client Registration for OAuth. Clients host a static JSON document at an HTTPS URL; that URL becomes the `client_id`. Server-side support includes SSRF-hardened fetching, cache-aware revalidation, and `private_key_jwt` validation. Enabled by default on `OAuthProxy`.

📱 **MCP Apps** — Spec-level compliance for the MCP Apps extension: `ui://` resource scheme, typed UI metadata on tools and resources, extension negotiation, and `ctx.client_supports_extension()` for runtime detection.

⏳ **Background Task Context** — `Context` now works transparently in Docket workers. `ctx.elicit()` routes through Redis-based coordination so background tasks can pause for user input without any code changes.

🛡️ **ResponseLimitingMiddleware** caps tool response sizes with UTF-8-safe truncation for text and schema-aware error handling for structured outputs.

🪿 **Goose Integration** — `fastmcp install goose` generates deeplink URLs for one-command server installation into Goose.

## What's Changed
### New Features 🎉
* Add MCP Apps Phase 1 — SDK compatibility (SEP-1865) by [@jlowin](https://github.com/jlowin) in [#3009](https://github.com/PrefectHQ/fastmcp/pull/3009)
* Add `fastmcp list` and `fastmcp call` CLI commands by [@jlowin](https://github.com/jlowin) in [#3054](https://github.com/PrefectHQ/fastmcp/pull/3054)
* Add `fastmcp generate-cli` command by [@jlowin](https://github.com/jlowin) in [#3065](https://github.com/PrefectHQ/fastmcp/pull/3065)
* Add CIMD (Client ID Metadata Document) support for OAuth by [@jlowin](https://github.com/jlowin) in [#2871](https://github.com/PrefectHQ/fastmcp/pull/2871)
### Enhancements 🔧
* Make duplicate bot less aggressive by [@jlowin](https://github.com/jlowin) in [#2981](https://github.com/PrefectHQ/fastmcp/pull/2981)
* Remove uv lockfile monitoring from Dependabot by [@jlowin](https://github.com/jlowin) in [#2986](https://github.com/PrefectHQ/fastmcp/pull/2986)
* Run static checks with --upgrade, remove lockfile check by [@jlowin](https://github.com/jlowin) in [#2988](https://github.com/PrefectHQ/fastmcp/pull/2988)
* Adjust workflow triggers for Marvin by [@strawgate](https://github.com/strawgate) in [#3010](https://github.com/PrefectHQ/fastmcp/pull/3010)
* Move tests to a reusable action and enable nightly checks by [@strawgate](https://github.com/strawgate) in [#3017](https://github.com/PrefectHQ/fastmcp/pull/3017)
* feat: option to add upstream claims to the FastMCP proxy JWT by [@JonasKs](https://github.com/JonasKs) in [#2997](https://github.com/PrefectHQ/fastmcp/pull/2997)
* Fix ty 0.0.14 compatibility and upgrade dependencies by [@jlowin](https://github.com/jlowin) in [#3027](https://github.com/PrefectHQ/fastmcp/pull/3027)
* fix: automatically include offline_access as a scope in the Azure provider to enable automatic token refreshing by [@JonasKs](https://github.com/JonasKs) in [#3001](https://github.com/PrefectHQ/fastmcp/pull/3001)
* feat: expand --reload to watch frontend file types by [@jlowin](https://github.com/jlowin) in [#3028](https://github.com/PrefectHQ/fastmcp/pull/3028)
* Add `fastmcp install stdio` command by [@jlowin](https://github.com/jlowin) in [#3032](https://github.com/PrefectHQ/fastmcp/pull/3032)
* Update martian-issue-triage.yml for Workflow editing guidance by [@strawgate](https://github.com/strawgate) in [#3033](https://github.com/PrefectHQ/fastmcp/pull/3033)
* feat: Goose integration + dedicated install command by [@jlowin](https://github.com/jlowin) in [#3040](https://github.com/PrefectHQ/fastmcp/pull/3040)
* Fixing spelling issues in multiple files by [@didier-durand](https://github.com/didier-durand) in [#2996](https://github.com/PrefectHQ/fastmcp/pull/2996)
* Add `fastmcp discover` and name-based server resolution by [@jlowin](https://github.com/jlowin) in [#3055](https://github.com/PrefectHQ/fastmcp/pull/3055)
* feat(context): Add background task support for Context (SEP-1686) by [@gfortaine](https://github.com/gfortaine) in [#2905](https://github.com/PrefectHQ/fastmcp/pull/2905)
* Add server version to banner by [@richardkmichael](https://github.com/richardkmichael) in [#3076](https://github.com/PrefectHQ/fastmcp/pull/3076)
* Add @handle_tool_errors decorator for standardized error handling by [@dgenio](https://github.com/dgenio) in [#2885](https://github.com/PrefectHQ/fastmcp/pull/2885)
* Update Anthropic and OpenAI clients to use Omit instead of NotGiven by [@jlowin](https://github.com/jlowin) in [#3088](https://github.com/PrefectHQ/fastmcp/pull/3088)
* Add ResponseLimitingMiddleware for tool response size control by [@dgenio](https://github.com/dgenio) in [#3072](https://github.com/PrefectHQ/fastmcp/pull/3072)
* Infer MIME types from OpenAPI response definitions by [@jlowin](https://github.com/jlowin) in [#3101](https://github.com/PrefectHQ/fastmcp/pull/3101)
* Remove require_auth in favor of scope-based authorization by [@jlowin](https://github.com/jlowin) in [#3103](https://github.com/PrefectHQ/fastmcp/pull/3103)
### Fixes 🐞
* Fix FastAPI mounting examples in docs by [@jlowin](https://github.com/jlowin) in [#2962](https://github.com/PrefectHQ/fastmcp/pull/2962)
* Remove outdated 'FastMCP 3.0 is coming!' CLI banner by [@jlowin](https://github.com/jlowin) in [#2974](https://github.com/PrefectHQ/fastmcp/pull/2974)
* Pin httpx `< 1.0` and simplify beta install docs by [@jlowin](https://github.com/jlowin) in [#2975](https://github.com/PrefectHQ/fastmcp/pull/2975)
* Add enabled field to ToolTransformConfig by [@jlowin](https://github.com/jlowin) in [#2991](https://github.com/PrefectHQ/fastmcp/pull/2991)
* fix phue2 import in smart_home example by [@zzstoatzz](https://github.com/zzstoatzz) in [#2999](https://github.com/PrefectHQ/fastmcp/pull/2999)
* fix: broaden combine_lifespans type to accept Mapping return types by [@aminsamir45](https://github.com/aminsamir45) in [#3005](https://github.com/PrefectHQ/fastmcp/pull/3005)
* fix: type narrowing for skills resource contents by [@strawgate](https://github.com/strawgate) in [#3023](https://github.com/PrefectHQ/fastmcp/pull/3023)
* fix: correctly send resource when exchanging code for the upstream by [@JonasKs](https://github.com/JonasKs) in [#3013](https://github.com/PrefectHQ/fastmcp/pull/3013)
* MCP Apps: structured CSP/permissions types, resource meta propagation fix, QR example by [@jlowin](https://github.com/jlowin) in [#3031](https://github.com/PrefectHQ/fastmcp/pull/3031)
* chore: upgrade python-multipart to 0.0.22 (CVE-2026-24486) by [@jlowin](https://github.com/jlowin) in [#3042](https://github.com/PrefectHQ/fastmcp/pull/3042)
* chore: upgrade protobuf to 6.33.5 (CVE-2026-0994) by [@jlowin](https://github.com/jlowin) in [#3043](https://github.com/PrefectHQ/fastmcp/pull/3043)
* fix: use MCP spec error code -32002 for resource not found by [@jlowin](https://github.com/jlowin) in [#3041](https://github.com/PrefectHQ/fastmcp/pull/3041)
* Fix tool_choice reset for structured output sampling by [@strawgate](https://github.com/strawgate) in [#3014](https://github.com/PrefectHQ/fastmcp/pull/3014)
* Fix workflow notification URL formatting in upgrade checks by [@strawgate](https://github.com/strawgate) in [#3047](https://github.com/PrefectHQ/fastmcp/pull/3047)
* Fix Field() handling in prompts by [@strawgate](https://github.com/strawgate) in [#3050](https://github.com/PrefectHQ/fastmcp/pull/3050)
* fix: use SkipJsonSchema to exclude callable fields from JSON schema generation by [@strawgate](https://github.com/strawgate) in [#3048](https://github.com/PrefectHQ/fastmcp/pull/3048)
* fix: Preserve metadata in FastMCPProvider component wrappers by [@NeelayS](https://github.com/NeelayS) in [#3057](https://github.com/PrefectHQ/fastmcp/pull/3057)
* Mock network calls in CLI tests and use MemoryStore for OAuth tests by [@strawgate](https://github.com/strawgate) in [#3051](https://github.com/PrefectHQ/fastmcp/pull/3051)
* Remove OpenAPI timeout parameter, make client optional, surface timeout errors by [@jlowin](https://github.com/jlowin) in [#3067](https://github.com/PrefectHQ/fastmcp/pull/3067)
* fix: enforce redirect URI validation when allowed_client_redirect_uris is supplied by [@nathanwelsh8](https://github.com/nathanwelsh8) in [#3066](https://github.com/PrefectHQ/fastmcp/pull/3066)
* Fix --reload port conflict when using explicit port by [@jlowin](https://github.com/jlowin) in [#3070](https://github.com/PrefectHQ/fastmcp/pull/3070)
* Fix compress_schema to preserve additionalProperties: false for MCP compatibility by [@jlowin](https://github.com/jlowin) in [#3102](https://github.com/PrefectHQ/fastmcp/pull/3102)
* Fix CIMD redirect allowlist bypass and cache revalidation by [@jlowin](https://github.com/jlowin) in [#3098](https://github.com/PrefectHQ/fastmcp/pull/3098)
* Exclude content-type from get_http_headers() to prevent HTTP 415 errors by [@jlowin](https://github.com/jlowin) in [#3104](https://github.com/PrefectHQ/fastmcp/pull/3104)
### Docs 📚
* Prepare docs for v3.0 beta release by [@jlowin](https://github.com/jlowin) in [#2954](https://github.com/PrefectHQ/fastmcp/pull/2954)
* Restructure docs: move transforms to dedicated section by [@jlowin](https://github.com/jlowin) in [#2956](https://github.com/PrefectHQ/fastmcp/pull/2956)
* Remove unnecessary pip warning by [@jlowin](https://github.com/jlowin) in [#2958](https://github.com/PrefectHQ/fastmcp/pull/2958)
* Update example MCP version in installation docs by [@jlowin](https://github.com/jlowin) in [#2959](https://github.com/PrefectHQ/fastmcp/pull/2959)
* Update brand images by [@jlowin](https://github.com/jlowin) in [#2960](https://github.com/PrefectHQ/fastmcp/pull/2960)
* Restructure README and welcome page with motivated narrative by [@jlowin](https://github.com/jlowin) in [#2963](https://github.com/PrefectHQ/fastmcp/pull/2963)
* Restructure README and docs with motivated narrative by [@jlowin](https://github.com/jlowin) in [#2964](https://github.com/PrefectHQ/fastmcp/pull/2964)
* Favicon update and Prefect Horizon docs by [@jlowin](https://github.com/jlowin) in [#2978](https://github.com/PrefectHQ/fastmcp/pull/2978)
* Add dependency injection documentation and DI-style dependencies by [@jlowin](https://github.com/jlowin) in [#2980](https://github.com/PrefectHQ/fastmcp/pull/2980)
* docs: document expanded reload behavior and restructure beta sections by [@jlowin](https://github.com/jlowin) in [#3039](https://github.com/PrefectHQ/fastmcp/pull/3039)
* Add output_schema caveat to response limiting docs by [@jlowin](https://github.com/jlowin) in [#3099](https://github.com/PrefectHQ/fastmcp/pull/3099)
* Document token passthrough security in OAuth Proxy docs by [@jlowin](https://github.com/jlowin) in [#3100](https://github.com/PrefectHQ/fastmcp/pull/3100)
### Dependencies 📦
* Bump ty from 0.0.12 to 0.0.13 by @dependabot in [#2984](https://github.com/PrefectHQ/fastmcp/pull/2984)
* Bump prek from 0.2.30 to 0.3.0 by @dependabot in [#2982](https://github.com/PrefectHQ/fastmcp/pull/2982)
### Other Changes 🦾
* Normalize resource URLs before comparison to support RFC 8707 query parameters by [@abhijeethp](https://github.com/abhijeethp) in [#2967](https://github.com/PrefectHQ/fastmcp/pull/2967)
* Bump pydocket to 0.17.2 (memory leak fix) by [@chrisguidry](https://github.com/chrisguidry) in [#2998](https://github.com/PrefectHQ/fastmcp/pull/2998)
* Add AzureJWTVerifier for Managed Identity token verification by [@jlowin](https://github.com/jlowin) in [#3058](https://github.com/PrefectHQ/fastmcp/pull/3058)
* Add release notes for v2.14.4 and v2.14.5 by [@jlowin](https://github.com/jlowin) in [#3064](https://github.com/PrefectHQ/fastmcp/pull/3064)
* Add missing beta2 features to v3 release tracking by [@jlowin](https://github.com/jlowin) in [#3105](https://github.com/PrefectHQ/fastmcp/pull/3105)

## New Contributors
* [@abhijeethp](https://github.com/abhijeethp) made their first contribution in [#2967](https://github.com/PrefectHQ/fastmcp/pull/2967)
* [@aminsamir45](https://github.com/aminsamir45) made their first contribution in [#3005](https://github.com/PrefectHQ/fastmcp/pull/3005)
* [@JonasKs](https://github.com/JonasKs) made their first contribution in [#2997](https://github.com/PrefectHQ/fastmcp/pull/2997)
* [@NeelayS](https://github.com/NeelayS) made their first contribution in [#3057](https://github.com/PrefectHQ/fastmcp/pull/3057)
* [@gfortaine](https://github.com/gfortaine) made their first contribution in [#2905](https://github.com/PrefectHQ/fastmcp/pull/2905)
* [@nathanwelsh8](https://github.com/nathanwelsh8) made their first contribution in [#3066](https://github.com/PrefectHQ/fastmcp/pull/3066)
* [@dgenio](https://github.com/dgenio) made their first contribution in [#2885](https://github.com/PrefectHQ/fastmcp/pull/2885)

**Full Changelog**: https://github.com/PrefectHQ/fastmcp/compare/v3.0.0b1...v3.0.0b2

</Update>

<Update label="v3.0.0b1" description="2026-01-20">

**[v3.0.0b1: This Beta Work](https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0b1)**

FastMCP 3.0 rebuilds the framework around three primitives: components, providers, and transforms. Providers source components dynamically—from decorators, filesystems, OpenAPI specs, remote servers, or anywhere else. Transforms modify components as they flow to clients—renaming, namespacing, filtering, securing. The features that required specialized subsystems in v2 now compose naturally from these building blocks.

🔌 **Provider Architecture** unifies how components are sourced. `FileSystemProvider` discovers decorated functions from directories with optional hot-reload. `SkillsProvider` exposes agent skill files as MCP resources. `OpenAPIProvider` and `ProxyProvider` get cleaner integrations. Providers are composable—share one across servers, or attach many to one server.

🔄 **Transforms** add middleware for components. Namespace mounted servers, rename verbose tools, filter by version, control visibility—all without touching source code. `ResourcesAsTools` and `PromptsAsTools` expose non-tool components to tool-only clients.

📋 **Component Versioning** lets you register `@tool(version="2.0")` alongside older versions. Clients see the highest version by default but can request specific versions. `VersionFilter` serves different API versions from one codebase.

💾 **Session-Scoped State** persists across requests. `await ctx.set_state()` and `await ctx.get_state()` now survive the full session. Per-session visibility via `ctx.enable_components()` lets servers adapt dynamically to each client.

⚡ **DX Improvements** include `--reload` for auto-restart during development, automatic threadpool dispatch for sync functions, tool timeouts, pagination for large component lists, and OpenTelemetry tracing.

🔐 **Component Authorization** via `@tool(auth=require_scopes("admin"))` and `AuthMiddleware` for server-wide policies.

Breaking changes are minimal: for most servers, updating the import statement is all you need. See the [migration guide](https://github.com/PrefectHQ/fastmcp/blob/main/docs/getting-started/upgrading/from-fastmcp-2.mdx) for details.

## What's Changed
### New Features 🎉
* Refactor resource behavior and add meta support by [@jlowin](https://github.com/jlowin) in [#2611](https://github.com/PrefectHQ/fastmcp/pull/2611)
* Refactor prompt behavior and add meta support by [@jlowin](https://github.com/jlowin) in [#2610](https://github.com/PrefectHQ/fastmcp/pull/2610)
* feat: Provider abstraction for dynamic MCP components by [@jlowin](https://github.com/jlowin) in [#2622](https://github.com/PrefectHQ/fastmcp/pull/2622)
* Unify component storage in LocalProvider by [@jlowin](https://github.com/jlowin) in [#2680](https://github.com/PrefectHQ/fastmcp/pull/2680)
* Introduce ResourceResult as canonical resource return type by [@jlowin](https://github.com/jlowin) in [#2734](https://github.com/PrefectHQ/fastmcp/pull/2734)
* Introduce Message and PromptResult as canonical prompt types by [@jlowin](https://github.com/jlowin) in [#2738](https://github.com/PrefectHQ/fastmcp/pull/2738)
* Add --reload flag for auto-restart on file changes by [@jlowin](https://github.com/jlowin) in [#2816](https://github.com/PrefectHQ/fastmcp/pull/2816)
* Add FileSystemProvider for filesystem-based component discovery by [@jlowin](https://github.com/jlowin) in [#2823](https://github.com/PrefectHQ/fastmcp/pull/2823)
* Add standalone decorators and eliminate fastmcp.fs module by [@jlowin](https://github.com/jlowin) in [#2832](https://github.com/PrefectHQ/fastmcp/pull/2832)
* Add authorization checks to components and servers by [@jlowin](https://github.com/jlowin) in [#2855](https://github.com/PrefectHQ/fastmcp/pull/2855)
* Decorators return functions instead of component objects by [@jlowin](https://github.com/jlowin) in [#2856](https://github.com/PrefectHQ/fastmcp/pull/2856)
* Add transform system for modifying components in provider chains by [@jlowin](https://github.com/jlowin) in [#2836](https://github.com/PrefectHQ/fastmcp/pull/2836)
* Add OpenTelemetry tracing support by [@chrisguidry](https://github.com/chrisguidry) in [#2869](https://github.com/PrefectHQ/fastmcp/pull/2869)
* Add component versioning and VersionFilter transform by [@jlowin](https://github.com/jlowin) in [#2894](https://github.com/PrefectHQ/fastmcp/pull/2894)
* Add version discovery and calling a certain version for components by [@jlowin](https://github.com/jlowin) in [#2897](https://github.com/PrefectHQ/fastmcp/pull/2897)
* Refactor visibility to mark-based enabled system by [@jlowin](https://github.com/jlowin) in [#2912](https://github.com/PrefectHQ/fastmcp/pull/2912)
* Add session-specific visibility control via Context by [@jlowin](https://github.com/jlowin) in [#2917](https://github.com/PrefectHQ/fastmcp/pull/2917)
* Add Skills Provider for exposing agent skills as MCP resources by [@jlowin](https://github.com/jlowin) in [#2944](https://github.com/PrefectHQ/fastmcp/pull/2944)
### Enhancements 🔧
* Convert mounted servers to MountedProvider by [@jlowin](https://github.com/jlowin) in [#2635](https://github.com/PrefectHQ/fastmcp/pull/2635)
* Simplify .key as computed property by [@jlowin](https://github.com/jlowin) in [#2648](https://github.com/PrefectHQ/fastmcp/pull/2648)
* Refactor MountedProvider into FastMCPProvider + TransformingProvider by [@jlowin](https://github.com/jlowin) in [#2653](https://github.com/PrefectHQ/fastmcp/pull/2653)
* Enable background task support for custom component subclasses by [@jlowin](https://github.com/jlowin) in [#2657](https://github.com/PrefectHQ/fastmcp/pull/2657)
* Use CreateTaskResult for background task creation by [@jlowin](https://github.com/jlowin) in [#2660](https://github.com/PrefectHQ/fastmcp/pull/2660)
* Refactor provider execution: components own their execution by [@jlowin](https://github.com/jlowin) in [#2663](https://github.com/PrefectHQ/fastmcp/pull/2663)
* Add supports_tasks() method to replace string mode checks by [@jlowin](https://github.com/jlowin) in [#2664](https://github.com/PrefectHQ/fastmcp/pull/2664)
* Replace type: ignore[attr-defined] with isinstance assertions in tests by [@jlowin](https://github.com/jlowin) in [#2665](https://github.com/PrefectHQ/fastmcp/pull/2665)
* Add poll_interval to TaskConfig by [@jlowin](https://github.com/jlowin) in [#2666](https://github.com/PrefectHQ/fastmcp/pull/2666)
* Refactor task module: rename protocol.py to requests.py and reduce redundancy by [@jlowin](https://github.com/jlowin) in [#2667](https://github.com/PrefectHQ/fastmcp/pull/2667)
* Refactor FastMCPProxy into ProxyProvider by [@jlowin](https://github.com/jlowin) in [#2669](https://github.com/PrefectHQ/fastmcp/pull/2669)
* Move OpenAPI to providers/openapi submodule by [@jlowin](https://github.com/jlowin) in [#2672](https://github.com/PrefectHQ/fastmcp/pull/2672)
* Use ergonomic provider initialization pattern by [@jlowin](https://github.com/jlowin) in [#2675](https://github.com/PrefectHQ/fastmcp/pull/2675)
* Fix ty 0.0.5 type errors by [@jlowin](https://github.com/jlowin) in [#2676](https://github.com/PrefectHQ/fastmcp/pull/2676)
* Remove execution methods from Provider base class by [@jlowin](https://github.com/jlowin) in [#2681](https://github.com/PrefectHQ/fastmcp/pull/2681)
* Add type-prefixed keys for globally unique component identification by [@jlowin](https://github.com/jlowin) in [#2704](https://github.com/PrefectHQ/fastmcp/pull/2704)
* Skip parallel MCP config test on Windows by [@jlowin](https://github.com/jlowin) in [#2711](https://github.com/PrefectHQ/fastmcp/pull/2711)
* Consolidate notification system with unified API by [@jlowin](https://github.com/jlowin) in [#2710](https://github.com/PrefectHQ/fastmcp/pull/2710)
* Skip test_multi_client on Windows by [@jlowin](https://github.com/jlowin) in [#2714](https://github.com/PrefectHQ/fastmcp/pull/2714)
* Parallelize provider operations by [@jlowin](https://github.com/jlowin) in [#2716](https://github.com/PrefectHQ/fastmcp/pull/2716)
* Consolidate get_* and _list_* methods into single API by [@jlowin](https://github.com/jlowin) in [#2719](https://github.com/PrefectHQ/fastmcp/pull/2719)
* Consolidate execution method chains into single public API by [@jlowin](https://github.com/jlowin) in [#2728](https://github.com/PrefectHQ/fastmcp/pull/2728)
* Add documentation check to required PR workflow by [@jlowin](https://github.com/jlowin) in [#2730](https://github.com/PrefectHQ/fastmcp/pull/2730)
* Parallelize list_* calls in Provider.get_tasks() by [@jlowin](https://github.com/jlowin) in [#2731](https://github.com/PrefectHQ/fastmcp/pull/2731)
* Consistent decorator-based MCP handler registration by [@jlowin](https://github.com/jlowin) in [#2732](https://github.com/PrefectHQ/fastmcp/pull/2732)
* Make ToolResult a BaseModel for serialization support by [@jlowin](https://github.com/jlowin) in [#2736](https://github.com/PrefectHQ/fastmcp/pull/2736)
* Align prompt handler with resource pattern by [@jlowin](https://github.com/jlowin) in [#2740](https://github.com/PrefectHQ/fastmcp/pull/2740)
* Update classes to inherit from FastMCPBaseModel instead of BaseModel by [@jlowin](https://github.com/jlowin) in [#2739](https://github.com/PrefectHQ/fastmcp/pull/2739)
* Convert provider tests to use direct server calls by [@jlowin](https://github.com/jlowin) in [#2748](https://github.com/PrefectHQ/fastmcp/pull/2748)
* Add explicit task_meta parameter to FastMCP.call_tool() by [@jlowin](https://github.com/jlowin) in [#2749](https://github.com/PrefectHQ/fastmcp/pull/2749)
* Add task_meta parameter to read_resource() for explicit task control by [@jlowin](https://github.com/jlowin) in [#2750](https://github.com/PrefectHQ/fastmcp/pull/2750)
* Add task_meta to prompts and centralize fn_key enrichment by [@jlowin](https://github.com/jlowin) in [#2751](https://github.com/PrefectHQ/fastmcp/pull/2751)
* Remove unused include_tags/exclude_tags settings by [@jlowin](https://github.com/jlowin) in [#2756](https://github.com/PrefectHQ/fastmcp/pull/2756)
* Parallelize provider access when executing components by [@jlowin](https://github.com/jlowin) in [#2744](https://github.com/PrefectHQ/fastmcp/pull/2744)
* Add tests for OAuth generator cleanup and use aclosing by [@jlowin](https://github.com/jlowin) in [#2759](https://github.com/PrefectHQ/fastmcp/pull/2759)
* Deprecate tool_serializer parameter by [@jlowin](https://github.com/jlowin) in [#2753](https://github.com/PrefectHQ/fastmcp/pull/2753)
* Feature/supabase custom auth route by [@EloiZalczer](https://github.com/EloiZalczer) in [#2632](https://github.com/PrefectHQ/fastmcp/pull/2632)
* Add regression tests for caching with mounted server prefixes by [@jlowin](https://github.com/jlowin) in [#2762](https://github.com/PrefectHQ/fastmcp/pull/2762)
* Update CLI banner with FastMCP 3.0 notice by [@jlowin](https://github.com/jlowin) in [#2766](https://github.com/PrefectHQ/fastmcp/pull/2766)
* Make FASTMCP_SHOW_SERVER_BANNER apply to all server startup methods by [@jlowin](https://github.com/jlowin) in [#2771](https://github.com/PrefectHQ/fastmcp/pull/2771)
* Add MCP tool annotations to smart_home example by [@triepod-ai](https://github.com/triepod-ai) in [#2777](https://github.com/PrefectHQ/fastmcp/pull/2777)
* Cherry-pick debug logging for OAuth token expiry to main by [@jlowin](https://github.com/jlowin) in [#2797](https://github.com/PrefectHQ/fastmcp/pull/2797)
* Turn off negative CLI flags by default by [@jlowin](https://github.com/jlowin) in [#2801](https://github.com/PrefectHQ/fastmcp/pull/2801)
* Configure ty to fail on warnings by [@jlowin](https://github.com/jlowin) in [#2804](https://github.com/PrefectHQ/fastmcp/pull/2804)
* Dereference $ref in tool schemas for MCP client compatibility by [@jlowin](https://github.com/jlowin) in [#2814](https://github.com/PrefectHQ/fastmcp/pull/2814)
* Add v3.0 feature tracking document by [@jlowin](https://github.com/jlowin) in [#2822](https://github.com/PrefectHQ/fastmcp/pull/2822)
* Remove deprecated WSTransport by [@jlowin](https://github.com/jlowin) in [#2826](https://github.com/PrefectHQ/fastmcp/pull/2826)
* Add composable lifespans by [@jlowin](https://github.com/jlowin) in [#2828](https://github.com/PrefectHQ/fastmcp/pull/2828)
* Replace FastMCP.as_proxy() with create_proxy() function by [@jlowin](https://github.com/jlowin) in [#2829](https://github.com/PrefectHQ/fastmcp/pull/2829)
* Add docs-broken-links command and fix docstring markdown parsing by [@jlowin](https://github.com/jlowin) in [#2830](https://github.com/PrefectHQ/fastmcp/pull/2830)
* Add PingMiddleware for keepalive connections by [@jlowin](https://github.com/jlowin) in [#2838](https://github.com/PrefectHQ/fastmcp/pull/2838)
* Add CLI update notifications by [@jlowin](https://github.com/jlowin) in [#2840](https://github.com/PrefectHQ/fastmcp/pull/2840)
* Add agent skills for testing and code review by [@jlowin](https://github.com/jlowin) in [#2846](https://github.com/PrefectHQ/fastmcp/pull/2846)
* Add loq pre-commit hook for file size enforcement by [@jlowin](https://github.com/jlowin) in [#2847](https://github.com/PrefectHQ/fastmcp/pull/2847)
* Add transport property to Context by [@jlowin](https://github.com/jlowin) in [#2850](https://github.com/PrefectHQ/fastmcp/pull/2850)
* Add loq file size limits and clean up type ignores by [@jlowin](https://github.com/jlowin) in [#2859](https://github.com/PrefectHQ/fastmcp/pull/2859)
* Run sync tools/resources/prompts in threadpool automatically by [@jlowin](https://github.com/jlowin) in [#2865](https://github.com/PrefectHQ/fastmcp/pull/2865)
* Add timeout parameter for tool foreground execution by [@jlowin](https://github.com/jlowin) in [#2872](https://github.com/PrefectHQ/fastmcp/pull/2872)
* Adopt OpenTelemetry MCP semantic conventions by [@chrisguidry](https://github.com/chrisguidry) in [#2886](https://github.com/PrefectHQ/fastmcp/pull/2886)
* Add client_secret_post authentication to IntrospectionTokenVerifier by [@shulkx](https://github.com/shulkx) in [#2884](https://github.com/PrefectHQ/fastmcp/pull/2884)
* Add enable_rich_logging setting to disable rich formatting by [@strawgate](https://github.com/strawgate) in [#2893](https://github.com/PrefectHQ/fastmcp/pull/2893)
* Rename _fastmcp metadata namespace to fastmcp and make non-optional by [@jlowin](https://github.com/jlowin) in [#2895](https://github.com/PrefectHQ/fastmcp/pull/2895)
* Refactor FastMCP to inherit from Provider by [@jlowin](https://github.com/jlowin) in [#2901](https://github.com/PrefectHQ/fastmcp/pull/2901)
* Swap public/private method naming in Provider by [@jlowin](https://github.com/jlowin) in [#2902](https://github.com/PrefectHQ/fastmcp/pull/2902)
* Add MCP-compliant pagination support by [@jlowin](https://github.com/jlowin) in [#2903](https://github.com/PrefectHQ/fastmcp/pull/2903)
* Support VersionSpec in enable/disable for range-based filtering by [@jlowin](https://github.com/jlowin) in [#2914](https://github.com/PrefectHQ/fastmcp/pull/2914)
* Remove sync notification infrastructure by [@jlowin](https://github.com/jlowin) in [#2915](https://github.com/PrefectHQ/fastmcp/pull/2915)
* Immutable transform wrapping for providers by [@jlowin](https://github.com/jlowin) in [#2913](https://github.com/PrefectHQ/fastmcp/pull/2913)
* Unify discovery API: deduplicate at protocol layer only by [@jlowin](https://github.com/jlowin) in [#2919](https://github.com/PrefectHQ/fastmcp/pull/2919)
* Split transports.py into modular structure by [@jlowin](https://github.com/jlowin) in [#2921](https://github.com/PrefectHQ/fastmcp/pull/2921)
* Move session visibility logic to enabled.py by [@jlowin](https://github.com/jlowin) in [#2924](https://github.com/PrefectHQ/fastmcp/pull/2924)
* Refactor Client class into mixins and add timeout utilities by [@jlowin](https://github.com/jlowin) in [#2933](https://github.com/PrefectHQ/fastmcp/pull/2933)
* Refactor OAuthProxy into focused modules by [@jlowin](https://github.com/jlowin) in [#2935](https://github.com/PrefectHQ/fastmcp/pull/2935)
* Refactor LocalProvider into mixin modules by [@jlowin](https://github.com/jlowin) in [#2936](https://github.com/PrefectHQ/fastmcp/pull/2936)
* Refactor server.py into mixins by [@jlowin](https://github.com/jlowin) in [#2939](https://github.com/PrefectHQ/fastmcp/pull/2939)
* Consolidate test fixtures and refactor large test files by [@jlowin](https://github.com/jlowin) in [#2941](https://github.com/PrefectHQ/fastmcp/pull/2941)
* Refactor transform list methods to pure function pattern by [@jlowin](https://github.com/jlowin) in [#2942](https://github.com/PrefectHQ/fastmcp/pull/2942)
* Add ResourcesAsTools transform by [@jlowin](https://github.com/jlowin) in [#2943](https://github.com/PrefectHQ/fastmcp/pull/2943)
* Add PromptsAsTools transform by [@jlowin](https://github.com/jlowin) in [#2946](https://github.com/PrefectHQ/fastmcp/pull/2946)
* Add client utilities for downloading skills by [@jlowin](https://github.com/jlowin) in [#2948](https://github.com/PrefectHQ/fastmcp/pull/2948)
* Rename Enabled transform to Visibility by [@jlowin](https://github.com/jlowin) in [#2950](https://github.com/PrefectHQ/fastmcp/pull/2950)
### Fixes 🐞
* Let FastMCPError propagate from dependencies by [@chrisguidry](https://github.com/chrisguidry) in [#2646](https://github.com/PrefectHQ/fastmcp/pull/2646)
* Fix task execution for tools with custom names by [@chrisguidry](https://github.com/chrisguidry) in [#2645](https://github.com/PrefectHQ/fastmcp/pull/2645)
* fix: check the cause of the tool error by [@rjolaverria](https://github.com/rjolaverria) in [#2674](https://github.com/PrefectHQ/fastmcp/pull/2674)
* Bump pydocket to 0.16.3 for task cancellation support by [@chrisguidry](https://github.com/chrisguidry) in [#2683](https://github.com/PrefectHQ/fastmcp/pull/2683)
* Fix uvicorn 0.39+ test timeouts and FastMCPError propagation by [@jlowin](https://github.com/jlowin) in [#2699](https://github.com/PrefectHQ/fastmcp/pull/2699)
* Fix Prefect website URL in docs footer by [@mgoldsborough](https://github.com/mgoldsborough) in [#2701](https://github.com/PrefectHQ/fastmcp/pull/2701)
* Fix: resolve root-level $ref in outputSchema for MCP spec compliance by [@majiayu000](https://github.com/majiayu000) in [#2720](https://github.com/PrefectHQ/fastmcp/pull/2720)
* Fix Provider.get_tasks() to include custom component subclasses by [@jlowin](https://github.com/jlowin) in [#2729](https://github.com/PrefectHQ/fastmcp/pull/2729)
* Fix Proxy provider to return all resource contents by [@jlowin](https://github.com/jlowin) in [#2742](https://github.com/PrefectHQ/fastmcp/pull/2742)
* Fix prompt return type documentation by [@jlowin](https://github.com/jlowin) in [#2741](https://github.com/PrefectHQ/fastmcp/pull/2741)
* fix: Client OAuth async_auth_flow() method causing MCP-SDK self.context.lock error. by [@lgndluke](https://github.com/lgndluke) in [#2644](https://github.com/PrefectHQ/fastmcp/pull/2644)
* Fix rate limit detection during teardown phase by [@jlowin](https://github.com/jlowin) in [#2757](https://github.com/PrefectHQ/fastmcp/pull/2757)
* fix: set pytest-asyncio default fixture loop scope to function by [@jlowin](https://github.com/jlowin) in [#2758](https://github.com/PrefectHQ/fastmcp/pull/2758)
* Fix OAuth Proxy resource parameter validation by [@jlowin](https://github.com/jlowin) in [#2764](https://github.com/PrefectHQ/fastmcp/pull/2764)
* [BugFix] Fix `openapi_version` Check So 3.1 Is Included by [@deeleeramone](https://github.com/deeleeramone) in [#2768](https://github.com/PrefectHQ/fastmcp/pull/2768)
* Fix titled enum elicitation schema to comply with MCP spec by [@jlowin](https://github.com/jlowin) in [#2773](https://github.com/PrefectHQ/fastmcp/pull/2773)
* Fix base_url fallback when url is not set by [@bhbs](https://github.com/bhbs) in [#2776](https://github.com/PrefectHQ/fastmcp/pull/2776)
* Lazy import DiskStore to avoid sqlite3 dependency on import by [@jlowin](https://github.com/jlowin) in [#2784](https://github.com/PrefectHQ/fastmcp/pull/2784)
* Fix OAuth token storage TTL calculation by [@jlowin](https://github.com/jlowin) in [#2796](https://github.com/PrefectHQ/fastmcp/pull/2796)
* Use consistent refresh_ttl for JTI mapping store by [@jlowin](https://github.com/jlowin) in [#2799](https://github.com/PrefectHQ/fastmcp/pull/2799)
* Return 401 for invalid_grant token errors per MCP spec by [@jlowin](https://github.com/jlowin) in [#2800](https://github.com/PrefectHQ/fastmcp/pull/2800)
* Fix client hanging on HTTP 4xx/5xx errors by [@jlowin](https://github.com/jlowin) in [#2803](https://github.com/PrefectHQ/fastmcp/pull/2803)
* Fix unawaited coroutine warning and treat as test error by [@jlowin](https://github.com/jlowin) in [#2806](https://github.com/PrefectHQ/fastmcp/pull/2806)
* Fix keep_alive passthrough in StdioMCPServer.to_transport() by [@jlowin](https://github.com/jlowin) in [#2791](https://github.com/PrefectHQ/fastmcp/pull/2791)
* Dereference $ref in tool schemas for MCP client compatibility by [@jlowin](https://github.com/jlowin) in [#2808](https://github.com/PrefectHQ/fastmcp/pull/2808)
* Prefix Redis keys with docket name for ACL isolation by [@chrisguidry](https://github.com/chrisguidry) in [#2811](https://github.com/PrefectHQ/fastmcp/pull/2811)
* fix smart_home example: HueAttributes schema and deprecated prefix by [@zzstoatzz](https://github.com/zzstoatzz) in [#2818](https://github.com/PrefectHQ/fastmcp/pull/2818)
* Fix redirect URI validation docs to match implementation by [@jlowin](https://github.com/jlowin) in [#2824](https://github.com/PrefectHQ/fastmcp/pull/2824)
* Fix timeout not propagating to proxy clients in multi-server MCPConfig by [@jlowin](https://github.com/jlowin) in [#2809](https://github.com/PrefectHQ/fastmcp/pull/2809)
* Fix ContextVar propagation for ASGI-mounted servers with tasks by [@chrisguidry](https://github.com/chrisguidry) in [#2844](https://github.com/PrefectHQ/fastmcp/pull/2844)
* Fix HTTP transport timeout defaulting to 5 seconds by [@jlowin](https://github.com/jlowin) in [#2849](https://github.com/PrefectHQ/fastmcp/pull/2849)
* Fix decorator error messages to link to correct doc pages by [@jlowin](https://github.com/jlowin) in [#2858](https://github.com/PrefectHQ/fastmcp/pull/2858)
* Fix task capabilities location (issue #2870) by [@jlowin](https://github.com/jlowin) in [#2875](https://github.com/PrefectHQ/fastmcp/pull/2875)
* Bump the uv group across 1 directory with 2 updates by [@dependabot](https://github.com/dependabot)\[bot\] in [#2890](https://github.com/PrefectHQ/fastmcp/pull/2890)
### Breaking Changes 🛫
* Add VisibilityFilter for hierarchical enable/disable by [@jlowin](https://github.com/jlowin) in [#2708](https://github.com/PrefectHQ/fastmcp/pull/2708)
* Remove automatic environment variable loading from auth providers by [@jlowin](https://github.com/jlowin) in [#2752](https://github.com/PrefectHQ/fastmcp/pull/2752)
* Make pydocket optional and unify DI systems by [@jlowin](https://github.com/jlowin) in [#2835](https://github.com/PrefectHQ/fastmcp/pull/2835)
* Add session-scoped state persistence by [@jlowin](https://github.com/jlowin) in [#2873](https://github.com/PrefectHQ/fastmcp/pull/2873)
### Docs 📚
* Undocumented `McpError` exceptions by [@ivanbelenky](https://github.com/ivanbelenky) in [#2656](https://github.com/PrefectHQ/fastmcp/pull/2656)
* docs(server): add http to transport options in run() method docstring by [@Ashif4354](https://github.com/Ashif4354) in [#2707](https://github.com/PrefectHQ/fastmcp/pull/2707)
* Add v3 breaking changes notice to README by [@jlowin](https://github.com/jlowin) in [#2712](https://github.com/PrefectHQ/fastmcp/pull/2712)
* Add changelog entries for v2.13.1 through v2.14.1 by [@jlowin](https://github.com/jlowin) in [#2725](https://github.com/PrefectHQ/fastmcp/pull/2725)
* Reorganize docs around provider architecture by [@jlowin](https://github.com/jlowin) in [#2723](https://github.com/PrefectHQ/fastmcp/pull/2723)
* Fix documentation to use 'meta' instead of '_meta' for MCP spec field by [@jlowin](https://github.com/jlowin) in [#2735](https://github.com/PrefectHQ/fastmcp/pull/2735)
* Enhance documentation on tool transformation by [@shea-parkes](https://github.com/shea-parkes) in [#2781](https://github.com/PrefectHQ/fastmcp/pull/2781)
* Add FastMCP 4.0 preview to documentation by [@jlowin](https://github.com/jlowin) in [#2831](https://github.com/PrefectHQ/fastmcp/pull/2831)
* Add release notes for v2.14.2 and v2.14.3 by [@jlowin](https://github.com/jlowin) in [#2852](https://github.com/PrefectHQ/fastmcp/pull/2852)
* Add missing 3.0.0 version badges and document tasks extra by [@jlowin](https://github.com/jlowin) in [#2866](https://github.com/PrefectHQ/fastmcp/pull/2866)
* Fix custom provider docs to show correct interface by [@jlowin](https://github.com/jlowin) in [#2920](https://github.com/PrefectHQ/fastmcp/pull/2920)
* Update v3 features that were missed in PRs by [@jlowin](https://github.com/jlowin) in [#2947](https://github.com/PrefectHQ/fastmcp/pull/2947)
* Restructure documentation for FastMCP 3.0 by [@jlowin](https://github.com/jlowin) in [#2951](https://github.com/PrefectHQ/fastmcp/pull/2951)
* Fix broken documentation links by [@jlowin](https://github.com/jlowin) in [#2952](https://github.com/PrefectHQ/fastmcp/pull/2952)
* Clarify installation for FastMCP 3.0 beta by [@jlowin](https://github.com/jlowin) in [#2953](https://github.com/PrefectHQ/fastmcp/pull/2953)
### Dependencies 📦
* Bump peter-evans/create-pull-request from 7 to 8 by [@dependabot](https://github.com/dependabot)\[bot\] in [#2623](https://github.com/PrefectHQ/fastmcp/pull/2623)
* Bump ty to 0.0.7+ by [@jlowin](https://github.com/jlowin) in [#2737](https://github.com/PrefectHQ/fastmcp/pull/2737)
* Bump the uv group across 1 directory with 4 updates by [@dependabot](https://github.com/dependabot)\[bot\] in [#2891](https://github.com/PrefectHQ/fastmcp/pull/2891)

## New Contributors
* [@ivanbelenky](https://github.com/ivanbelenky) made their first contribution in [#2656](https://github.com/PrefectHQ/fastmcp/pull/2656)
* [@rjolaverria](https://github.com/rjolaverria) made their first contribution in [#2674](https://github.com/PrefectHQ/fastmcp/pull/2674)
* [@mgoldsborough](https://github.com/mgoldsborough) made their first contribution in [#2701](https://github.com/PrefectHQ/fastmcp/pull/2701)
* [@Ashif4354](https://github.com/Ashif4354) made their first contribution in [#2707](https://github.com/PrefectHQ/fastmcp/pull/2707)
* [@majiayu000](https://github.com/majiayu000) made their first contribution in [#2720](https://github.com/PrefectHQ/fastmcp/pull/2720)
* [@lgndluke](https://github.com/lgndluke) made their first contribution in [#2644](https://github.com/PrefectHQ/fastmcp/pull/2644)
* [@EloiZalczer](https://github.com/EloiZalczer) made their first contribution in [#2632](https://github.com/PrefectHQ/fastmcp/pull/2632)
* [@deeleeramone](https://github.com/deeleeramone) made their first contribution in [#2768](https://github.com/PrefectHQ/fastmcp/pull/2768)
* [@shea-parkes](https://github.com/shea-parkes) made their first contribution in [#2781](https://github.com/PrefectHQ/fastmcp/pull/2781)
* [@triepod-ai](https://github.com/triepod-ai) made their first contribution in [#2777](https://github.com/PrefectHQ/fastmcp/pull/2777)
* [@bhbs](https://github.com/bhbs) made their first contribution in [#2776](https://github.com/PrefectHQ/fastmcp/pull/2776)
* [@shulkx](https://github.com/shulkx) made their first contribution in [#2884](https://github.com/PrefectHQ/fastmcp/pull/2884)

**Full Changelog**: [v2.14.1...v3.0.0b1](https://github.com/PrefectHQ/fastmcp/compare/v2.14.1...v3.0.0b1)

</Update>

<Update label="v2.14.7" description="2026-04-13">

**[v2.14.7: Fake It Till You Break It](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.7)**

A 2.x backport of the fakeredis pin: fakeredis 2.35.0 renamed a connection class that pydocket's `memory://` backend depended on, crashing `fastmcp[tasks]` installs at startup. This caps `fakeredis<2.35.0` on the 2.x line.

### Fixes 🐞
* fix(deps): cap fakeredis to `<2.35.0` to prevent startup crash on 2.x by [@vincent067](https://github.com/vincent067) in [#3883](https://github.com/PrefectHQ/fastmcp/pull/3883)

**Full Changelog**: [v2.14.6...v2.14.7](https://github.com/PrefectHQ/fastmcp/compare/v2.14.6...v2.14.7)

</Update>

<Update label="v2.14.6" description="2026-03-27">

**[v2.14.6: $Ref Dead Redemption](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.6)**

v2.14.4 backported `dereference_refs()` but never wired it into the tool schema pipeline — `$ref` and `$defs` were still sent to MCP clients. Now fixed: `compress_schema()` dereferences at both tool schema creation sites, so schemas are fully inlined before reaching clients.

### Fixes 🐞
* Updated deprecation URL for V2 by [@SrzStephen](https://github.com/SrzStephen) in [#3109](https://github.com/PrefectHQ/fastmcp/pull/3109)
* Use MemoryStore for OAuth proxy tests by [@SrzStephen](https://github.com/SrzStephen) in [#3111](https://github.com/PrefectHQ/fastmcp/pull/3111)
* fix: wire up dereference_refs() in tool schema pipeline by [@jlowin](https://github.com/jlowin) in [#3170](https://github.com/PrefectHQ/fastmcp/pull/3170)

**Full Changelog**: [v2.14.5...v2.14.6](https://github.com/PrefectHQ/fastmcp/compare/v2.14.5...v2.14.6)

</Update>

<Update label="v2.14.5" description="2026-02-03">

**[v2.14.5: Sealed Docket](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.5)**

Fixes a memory leak in the memory:// docket broker where cancelled tasks accumulated instead of being cleaned up. Bumps pydocket to ≥0.17.2.

## What's Changed
### Enhancements 🔧
* Bump pydocket to 0.17.2 (memory leak fix) by [@chrisguidry](https://github.com/chrisguidry) in [#2992](https://github.com/PrefectHQ/fastmcp/pull/2992)

**Full Changelog**: [v2.14.4...v2.14.5](https://github.com/PrefectHQ/fastmcp/compare/v2.14.4...v2.14.5)

</Update>

<Update label="v2.14.4" description="2026-01-22">

**[v2.14.4: Package Deal](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.4)**

Fixes a fresh install bug where the packaging library was missing as a direct dependency, plus backports from 3.x for $ref dereferencing in tool schemas and a task capabilities location fix.

## What's Changed
### Enhancements 🔧
* Add release notes for v2.14.2 and v2.14.3 by [@jlowin](https://github.com/jlowin) in [#2851](https://github.com/PrefectHQ/fastmcp/pull/2851)
### Fixes 🐞
* Backport: Dereference $ref in tool schemas for MCP client compatibility by [@jlowin](https://github.com/jlowin) in [#2861](https://github.com/PrefectHQ/fastmcp/pull/2861)
* Fix task capabilities location (issue #2870) by [@jlowin](https://github.com/jlowin) in [#2874](https://github.com/PrefectHQ/fastmcp/pull/2874)
* Add missing packaging dependency by [@jlowin](https://github.com/jlowin) in [#2989](https://github.com/PrefectHQ/fastmcp/pull/2989)

**Full Changelog**: [v2.14.3...v2.14.4](https://github.com/PrefectHQ/fastmcp/compare/v2.14.3...v2.14.4)

</Update>

<Update label="v2.14.3" description="2026-01-12">

**[v2.14.3: Time After Timeout](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.3)**

Sometimes five seconds just isn't enough. This release fixes an HTTP transport bug that was cutting connections short, along with OAuth and Redis fixes, better ASGI support, and CLI update notifications so you never miss a beat.

## What's Changed
### Enhancements 🔧
* Add debug logging for OAuth token expiry diagnostics by [@jlowin](https://github.com/jlowin) in [#2789](https://github.com/PrefectHQ/fastmcp/pull/2789)
* Add CLI update notifications by [@jlowin](https://github.com/jlowin) in [#2839](https://github.com/PrefectHQ/fastmcp/pull/2839)
* Use pip instead of uv pip in upgrade instructions by [@jlowin](https://github.com/jlowin) in [#2841](https://github.com/PrefectHQ/fastmcp/pull/2841)
### Fixes 🐞
* Backport OAuth token storage TTL fix to release/2.x by [@jlowin](https://github.com/jlowin) in [#2798](https://github.com/PrefectHQ/fastmcp/pull/2798)
* Prefix Redis keys with docket name for ACL isolation (2.x backport) by [@chrisguidry](https://github.com/chrisguidry) in [#2812](https://github.com/PrefectHQ/fastmcp/pull/2812)
* Fix ContextVar propagation for ASGI-mounted servers with tasks by [@chrisguidry](https://github.com/chrisguidry) in [#2843](https://github.com/PrefectHQ/fastmcp/pull/2843)
* Fix HTTP transport timeout defaulting to 5 seconds by [@jlowin](https://github.com/jlowin) in [#2848](https://github.com/PrefectHQ/fastmcp/pull/2848)

**Full Changelog**: [v2.14.2...v2.14.3](https://github.com/PrefectHQ/fastmcp/compare/v2.14.2...v2.14.3)

</Update>

<Update label="v2.14.2" description="2025-12-31">

**[v2.14.2: Port Authority](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.2)**

FastMCP 2.14.2 brings a wave of community contributions safely into the 2.x line. A variety of important fixes backported from 3.0 work improve OpenAPI 3.1 compatibility, MCP spec compliance for output schemas and elicitation, and correct a subtle base_url fallback issue. The CLI now gently reminds you that FastMCP 3.0 is on the horizon.

## What's Changed
### Enhancements 🔧
* Pin MCP under 2.x by [@jlowin](https://github.com/jlowin) in [#2709](https://github.com/PrefectHQ/fastmcp/pull/2709)
* Add auth_route parameter to SupabaseProvider by [@EloiZalczer](https://github.com/EloiZalczer) in [#2760](https://github.com/PrefectHQ/fastmcp/pull/2760)
* Update CLI banner with FastMCP 3.0 notice by [@jlowin](https://github.com/jlowin) in [#2765](https://github.com/PrefectHQ/fastmcp/pull/2765)
### Fixes 🐞
* Let FastMCPError propagate unchanged from managers by [@jlowin](https://github.com/jlowin) in [#2697](https://github.com/PrefectHQ/fastmcp/pull/2697)
* Fix test cleanup for uvicorn 0.39+ context isolation by [@jlowin](https://github.com/jlowin) in [#2696](https://github.com/PrefectHQ/fastmcp/pull/2696)
* Bump pydocket to 0.16.3 to fix worker cleanup race condition by [@chrisguidry](https://github.com/chrisguidry) in [#2700](https://github.com/PrefectHQ/fastmcp/pull/2700)
* Fix Prefect website URL in docs footer by [@mgoldsborough](https://github.com/mgoldsborough) in [#2705](https://github.com/PrefectHQ/fastmcp/pull/2705)
* Fix: resolve root-level $ref in outputSchema for MCP spec compliance by [@majiayu000](https://github.com/majiayu000) in [#2727](https://github.com/PrefectHQ/fastmcp/pull/2727)
* Fix OAuth Proxy resource parameter validation by [@jlowin](https://github.com/jlowin) in [#2763](https://github.com/PrefectHQ/fastmcp/pull/2763)
* Fix openapi_version check to include 3.1 by [@deeleeramone](https://github.com/deeleeramone) in [#2769](https://github.com/PrefectHQ/fastmcp/pull/2769)
* Fix titled enum elicitation schema to comply with MCP spec by [@jlowin](https://github.com/jlowin) in [#2774](https://github.com/PrefectHQ/fastmcp/pull/2774)
* Fix base_url fallback when url is not set by [@bhbs](https://github.com/bhbs) in [#2782](https://github.com/PrefectHQ/fastmcp/pull/2782)
* Lazy import DiskStore to avoid sqlite3 dependency on import by [@jlowin](https://github.com/jlowin) in [#2785](https://github.com/PrefectHQ/fastmcp/pull/2785)
### Docs 📚
* Add v3 breaking changes notice to README and docs by [@jlowin](https://github.com/jlowin) in [#2713](https://github.com/PrefectHQ/fastmcp/pull/2713)
* Add changelog entries for v2.13.1 through v2.14.1 by [@jlowin](https://github.com/jlowin) in [#2724](https://github.com/PrefectHQ/fastmcp/pull/2724)
* conference to 2.x branch by [@aaazzam](https://github.com/aaazzam) in [#2787](https://github.com/PrefectHQ/fastmcp/pull/2787)

**Full Changelog**: [v2.14.1...v2.14.2](https://github.com/PrefectHQ/fastmcp/compare/v2.14.1...v2.14.2)

</Update>

<Update label="v2.14.1" description="2025-12-15">

**[v2.14.1: 'Tis a Gift to Be Sample](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.1)**

FastMCP 2.14.1 introduces sampling with tools (SEP-1577), enabling servers to pass tools to `ctx.sample()` for agentic workflows where the LLM can automatically execute tool calls in a loop. The new `ctx.sample_step()` method provides single LLM calls that return `SampleStep` objects for custom control flow, while `result_type` enables structured outputs via validated Pydantic models.

🤖 **AnthropicSamplingHandler** joins the existing OpenAI handler, providing multi-provider sampling support out of the box.

⚡ **OpenAISamplingHandler promoted** from experimental status—sampling handlers are now production-ready with a unified API.

## What's Changed
### New Features 🎉
* Sampling with tools by [@jlowin](https://github.com/jlowin) in [#2538](https://github.com/PrefectHQ/fastmcp/pull/2538)
* Add AnthropicSamplingHandler by [@jlowin](https://github.com/jlowin) in [#2677](https://github.com/PrefectHQ/fastmcp/pull/2677)
### Enhancements 🔧
* Add Python 3.13 to ubuntu CI by [@jlowin](https://github.com/jlowin) in [#2648](https://github.com/PrefectHQ/fastmcp/pull/2648)
* Remove legacy task initialization workaround by [@jlowin](https://github.com/jlowin) in [#2649](https://github.com/PrefectHQ/fastmcp/pull/2649)
* Consolidate session state reset logic by [@jlowin](https://github.com/jlowin) in [#2651](https://github.com/PrefectHQ/fastmcp/pull/2651)
* Unify SamplingHandler; promote OpenAI from experimental by [@jlowin](https://github.com/jlowin) in [#2656](https://github.com/PrefectHQ/fastmcp/pull/2656)
* Add `tool_names` parameter to mount() for name customization by [@jlowin](https://github.com/jlowin) in [#2660](https://github.com/PrefectHQ/fastmcp/pull/2660)
* Use streamable HTTP client API from MCP SDK by [@jlowin](https://github.com/jlowin) in [#2678](https://github.com/PrefectHQ/fastmcp/pull/2678)
* Deprecate `exclude_args` in favor of Depends() by [@jlowin](https://github.com/jlowin) in [#2693](https://github.com/PrefectHQ/fastmcp/pull/2693)
### Fixes 🐞
* Fix prompt tasks to return mcp.types.PromptMessage by [@jlowin](https://github.com/jlowin) in [#2650](https://github.com/PrefectHQ/fastmcp/pull/2650)
* Fix Windows test warnings by [@jlowin](https://github.com/jlowin) in [#2653](https://github.com/PrefectHQ/fastmcp/pull/2653)
* Cleanup cancelled connection startup by [@jlowin](https://github.com/jlowin) in [#2679](https://github.com/PrefectHQ/fastmcp/pull/2679)
* Fix tool choice bug in sampling examples by [@shawnthapa](https://github.com/shawnthapa) in [#2686](https://github.com/PrefectHQ/fastmcp/pull/2686)
### Docs 📚
* Simplify Docket tip wording by [@chrisguidry](https://github.com/chrisguidry) in [#2662](https://github.com/PrefectHQ/fastmcp/pull/2662)
### Other Changes 🦾
* Bump pydocket to ≥0.15.5 by [@jlowin](https://github.com/jlowin) in [#2694](https://github.com/PrefectHQ/fastmcp/pull/2694)

## New Contributors
* [@shawnthapa](https://github.com/shawnthapa) made their first contribution in [#2686](https://github.com/PrefectHQ/fastmcp/pull/2686)

**Full Changelog**: [v2.14.0...v2.14.1](https://github.com/PrefectHQ/fastmcp/compare/v2.14.0...v2.14.1)

</Update>

<Update label="v2.14.0" description="2025-12-11">

**[v2.14.0: Task and You Shall Receive](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.0)**

FastMCP 2.14 begins adopting the MCP 2025-11-25 specification, introducing protocol-native background tasks (SEP-1686) that enable long-running operations to report progress without blocking clients. The experimental OpenAPI parser graduates to standard, the `OpenAISamplingHandler` is promoted from experimental, and deprecated APIs accumulated across the 2.x series are removed.

⏳ **Background Tasks** let you add `task=True` to any async tool decorator to run operations in the background with progress tracking. Powered by [Docket](https://github.com/chrisguidry/docket), an enterprise task scheduler handling millions of concurrent tasks daily—in-memory backends work out-of-the-box, and Redis URLs enable persistence and horizontal scaling.

🔧 **OpenAPI Parser Promoted** from experimental to standard with improved performance through single-pass schema processing and cleaner abstractions.

📋 **MCP 2025-11-25 Specification Support** including SSE polling and event resumability (SEP-1699), multi-select enum elicitation schemas (SEP-1330), default values for elicitation (SEP-1034), and tool name validation at registration time (SEP-986).

## Breaking Changes
- Docket is always enabled; task execution is forbidden through proxies
- Task protocol enabled by default
- Removed deprecated settings, imports, and methods accumulated across 2.x series

## What's Changed
### New Features 🎉
* OpenAPI parser is now the default by [@jlowin](https://github.com/jlowin) in [#2583](https://github.com/PrefectHQ/fastmcp/pull/2583)
* Implement SEP-1686: Background Tasks by [@jlowin](https://github.com/jlowin) in [#2550](https://github.com/PrefectHQ/fastmcp/pull/2550)
### Enhancements 🔧
* Expose InitializeResult in middleware by [@jlowin](https://github.com/jlowin) in [#2562](https://github.com/PrefectHQ/fastmcp/pull/2562)
* Update MCP SDK auth compatibility by [@jlowin](https://github.com/jlowin) in [#2574](https://github.com/PrefectHQ/fastmcp/pull/2574)
* Validate tool names at registration (SEP-986) by [@jlowin](https://github.com/jlowin) in [#2588](https://github.com/PrefectHQ/fastmcp/pull/2588)
* Support SEP-1034 and SEP-1330 for elicitation by [@jlowin](https://github.com/jlowin) in [#2595](https://github.com/PrefectHQ/fastmcp/pull/2595)
* Implement SSE polling (SEP-1699) by [@jlowin](https://github.com/jlowin) in [#2612](https://github.com/PrefectHQ/fastmcp/pull/2612)
* Expose session ID callback by [@jlowin](https://github.com/jlowin) in [#2628](https://github.com/PrefectHQ/fastmcp/pull/2628)
### Fixes 🐞
* Fix OAuth metadata discovery by [@jlowin](https://github.com/jlowin) in [#2565](https://github.com/PrefectHQ/fastmcp/pull/2565)
* Fix fastapi.cli package structure by [@jlowin](https://github.com/jlowin) in [#2570](https://github.com/PrefectHQ/fastmcp/pull/2570)
* Correct OAuth error codes by [@jlowin](https://github.com/jlowin) in [#2578](https://github.com/PrefectHQ/fastmcp/pull/2578)
* Prevent function signature modification by [@jlowin](https://github.com/jlowin) in [#2590](https://github.com/PrefectHQ/fastmcp/pull/2590)
* Fix proxy client kwargs by [@jlowin](https://github.com/jlowin) in [#2605](https://github.com/PrefectHQ/fastmcp/pull/2605)
* Fix nested server routing by [@jlowin](https://github.com/jlowin) in [#2618](https://github.com/PrefectHQ/fastmcp/pull/2618)
* Use access token expiry fallback by [@jlowin](https://github.com/jlowin) in [#2635](https://github.com/PrefectHQ/fastmcp/pull/2635)
* Handle transport cleanup exceptions by [@jlowin](https://github.com/jlowin) in [#2642](https://github.com/PrefectHQ/fastmcp/pull/2642)
### Docs 📚
* Add OCI and Supabase integration docs by [@jlowin](https://github.com/jlowin) in [#2580](https://github.com/PrefectHQ/fastmcp/pull/2580)
* Add v2.14.0 upgrade guide by [@jlowin](https://github.com/jlowin) in [#2598](https://github.com/PrefectHQ/fastmcp/pull/2598)
* Rewrite background tasks documentation by [@jlowin](https://github.com/jlowin) in [#2620](https://github.com/PrefectHQ/fastmcp/pull/2620)
* Document read-only tool patterns by [@jlowin](https://github.com/jlowin) in [#2632](https://github.com/PrefectHQ/fastmcp/pull/2632)

## New Contributors
11 total contributors including 7 first-time participants.

**Full Changelog**: [v2.13.3...v2.14.0](https://github.com/PrefectHQ/fastmcp/compare/v2.13.3...v2.14.0)

</Update>

<Update label="v2.13.3" description="2025-12-03">

**[v2.13.3: Pin-ish Line](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.3)**

FastMCP 2.13.3 pins `mcp<1.23` as a precautionary measure. MCP SDK 1.23 introduced changes related to the November 25, 2025 MCP protocol update that break certain FastMCP patches and workarounds, particularly around OAuth implementation details. FastMCP 2.14 introduces proper support for the updated protocol and requires `mcp>=1.23`.

## What's Changed
### Fixes 🐞
* Pin MCP SDK below 1.23 by [@jlowin](https://github.com/jlowin) in [#2545](https://github.com/PrefectHQ/fastmcp/pull/2545)

**Full Changelog**: [v2.13.2...v2.13.3](https://github.com/PrefectHQ/fastmcp/compare/v2.13.2...v2.13.3)

</Update>

<Update label="v2.13.2" description="2025-12-01">

**[v2.13.2: Refreshing Changes](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.2)**

FastMCP 2.13.2 polishes the authentication stack with improvements to token refresh, scope handling, and multi-instance deployments. Discord was added as a built-in OAuth provider, Azure and Google token handling became more reliable, and proxy classes now properly forward icons and titles.

## What's Changed
### New Features 🎉
* Add Discord OAuth provider by [@jlowin](https://github.com/jlowin) in [#2480](https://github.com/PrefectHQ/fastmcp/pull/2480)
### Enhancements 🔧
* Descope Provider updates for new well-known URLs by [@anvibanga](https://github.com/anvibanga) in [#2465](https://github.com/PrefectHQ/fastmcp/pull/2465)
* Scalekit provider improvements by [@jlowin](https://github.com/jlowin) in [#2472](https://github.com/PrefectHQ/fastmcp/pull/2472)
* Add CSP customization for consent screens by [@jlowin](https://github.com/jlowin) in [#2488](https://github.com/PrefectHQ/fastmcp/pull/2488)
* Add icon support to proxy classes by [@jlowin](https://github.com/jlowin) in [#2495](https://github.com/PrefectHQ/fastmcp/pull/2495)
### Fixes 🐞
* Google Provider now defaults to refresh token support by [@jlowin](https://github.com/jlowin) in [#2468](https://github.com/PrefectHQ/fastmcp/pull/2468)
* Fix Azure OAuth token refresh with unprefixed scopes by [@jlowin](https://github.com/jlowin) in [#2475](https://github.com/PrefectHQ/fastmcp/pull/2475)
* Prevent `$defs` mutation during tool transforms by [@jlowin](https://github.com/jlowin) in [#2482](https://github.com/PrefectHQ/fastmcp/pull/2482)
* Fix OAuth proxy refresh token storage for multi-instance deployments by [@jlowin](https://github.com/jlowin) in [#2490](https://github.com/PrefectHQ/fastmcp/pull/2490)
* Fix stale token issue after OAuth refresh by [@jlowin](https://github.com/jlowin) in [#2498](https://github.com/PrefectHQ/fastmcp/pull/2498)
* Fix Azure provider OIDC scope handling by [@jlowin](https://github.com/jlowin) in [#2505](https://github.com/PrefectHQ/fastmcp/pull/2505)

## New Contributors
7 new contributors made their first FastMCP contributions in this release.

**Full Changelog**: [v2.13.1...v2.13.2](https://github.com/PrefectHQ/fastmcp/compare/v2.13.1...v2.13.2)

</Update>

<Update label="v2.13.1" description="2025-11-15">

**[v2.13.1: Heavy Meta](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.1)**

FastMCP 2.13.1 introduces meta parameter support for `ToolResult`, enabling tools to return supplementary metadata alongside results. This supports emerging use cases like OpenAI's Apps SDK. The release also brings improved OAuth functionality with custom token verifiers including a new DebugTokenVerifier, and adds OCI and Supabase authentication providers.

🏷️ **Meta parameters for ToolResult** enable tools to return supplementary metadata alongside results, supporting patterns like OpenAI's Apps SDK integration.

🔐 **Custom token verifiers** with DebugTokenVerifier for development, plus Azure Government support through a `base_authority` parameter and Supabase authentication algorithm configuration.

🔒 **Security fixes** address CVE-2025-61920 through authlib updates and validate Cursor deeplink URLs using safer Windows APIs.

## What's Changed
### New Features 🎉
* Add meta parameter support for ToolResult by [@jlowin](https://github.com/jlowin) in [#2350](https://github.com/PrefectHQ/fastmcp/pull/2350)
* Add OCI authentication provider by [@jlowin](https://github.com/jlowin) in [#2365](https://github.com/PrefectHQ/fastmcp/pull/2365)
* Add Supabase authentication provider by [@jlowin](https://github.com/jlowin) in [#2378](https://github.com/PrefectHQ/fastmcp/pull/2378)
### Enhancements 🔧
* Add custom token verifier support to OIDCProxy by [@jlowin](https://github.com/jlowin) in [#2355](https://github.com/PrefectHQ/fastmcp/pull/2355)
* Add DebugTokenVerifier for development by [@jlowin](https://github.com/jlowin) in [#2362](https://github.com/PrefectHQ/fastmcp/pull/2362)
* Add Azure Government support via base_authority parameter by [@jlowin](https://github.com/jlowin) in [#2385](https://github.com/PrefectHQ/fastmcp/pull/2385)
* Add Supabase authentication algorithm configuration by [@jlowin](https://github.com/jlowin) in [#2392](https://github.com/PrefectHQ/fastmcp/pull/2392)
### Fixes 🐞
* Security: Update authlib for CVE-2025-61920 by [@jlowin](https://github.com/jlowin) in [#2398](https://github.com/PrefectHQ/fastmcp/pull/2398)
* Validate Cursor deeplink URLs using safer Windows APIs by [@jlowin](https://github.com/jlowin) in [#2405](https://github.com/PrefectHQ/fastmcp/pull/2405)
* Exclude MCP SDK 1.21.1 due to integration test failures by [@jlowin](https://github.com/jlowin) in [#2422](https://github.com/PrefectHQ/fastmcp/pull/2422)

## New Contributors
18 new contributors joined in this release across 70+ pull requests.

**Full Changelog**: [v2.13.0...v2.13.1](https://github.com/PrefectHQ/fastmcp/compare/v2.13.0...v2.13.1)

</Update>

<Update label="v2.13.0" description="2025-10-25">

**[v2.13.0: Cache Me If You Can](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.0)**

FastMCP 2.13 "Cache Me If You Can" represents a fundamental maturation of the framework. After months of community feedback on authentication and state management, this release delivers the infrastructure FastMCP needs to handle production workloads: persistent storage, response caching, and pragmatic OAuth improvements that reflect real-world deployment challenges.

💾 **Pluggable storage backends** bring persistent state to FastMCP servers. Built on [py-key-value-aio](https://github.com/strawgate/py-key-value), a new library from FastMCP maintainer Bill Easton ([@strawgate](https://github.com/strawgate)), the storage layer provides encrypted disk storage by default, platform-aware token management, and a simple key-value interface for application state. We're excited to bring this elegantly designed library into the FastMCP ecosystem - it's both powerful and remarkably easy to use, including wrappers to add encryption, TTLs, caching, and more to backends ranging from Elasticsearch, Redis, DynamoDB, filesystem, in-memory, and more! OAuth providers now automatically persist tokens across restarts, and developers can store arbitrary state without reaching for external databases. This foundation enables long-running sessions, cached credentials, and stateful applications built on MCP.

🔐 **OAuth maturity** brings months of production learnings into the framework. The new consent screen prevents confused deputy and authorization bypass attacks discovered in earlier versions while providing a clean UX with customizable branding. The OAuth proxy now issues its own tokens with automatic key derivation from client secrets, and RFC 7662 token introspection support enables enterprise auth flows. Path prefix mounting enables OAuth-protected servers to integrate into existing web applications under custom paths like `/api`, and MCP 1.17+ compliance with RFC 9728 ensures protocol compatibility. Combined with improved error handling and platform-aware token storage, OAuth is now production-ready and security-hardened for serious applications.

FastMCP now supports out-of-the-box authentication with:
- **[WorkOS](https://gofastmcp.com/integrations/workos)** and **[AuthKit](https://gofastmcp.com/integrations/authkit)**
- **[GitHub](https://gofastmcp.com/integrations/github)**
- **[Google](https://gofastmcp.com/integrations/google)**
- **[Azure](https://gofastmcp.com/integrations/azure)** (Entra ID)
- **[AWS Cognito](https://gofastmcp.com/integrations/aws-cognito)**
- **[Auth0](https://gofastmcp.com/integrations/auth0)**
- **[Descope](https://gofastmcp.com/integrations/descope)**
- **[Scalekit](https://gofastmcp.com/integrations/scalekit)**
- **[JWTs](https://gofastmcp.com/servers/auth/token-verification#jwt-token-verification)**
- **[RFC 7662 token introspection](https://gofastmcp.com/servers/auth/token-verification#token-introspection-protocol)**

⚡ **Response Caching Middleware** dramatically improves performance for expensive operations. Cache tool and resource responses with configurable TTLs, reducing redundant API calls and speeding up repeated queries.

🔄 **Server lifespans** provide proper initialization and cleanup hooks that run once per server instance instead of per client session. This fixes a long-standing source of confusion in the MCP SDK and enables proper resource management for database connections, background tasks, and other server-level state. Note: this is a breaking behavioral change if you were using the `lifespan` parameter.

✨ **Developer experience improvements** include Pydantic input validation for better type safety, icon support for richer UX, RFC 6570 query parameters for resource templates, improved Context API methods (list_resources, list_prompts, get_prompt), and async file/directory resources.

This release includes contributions from **20** new contributors and represents the largest feature set in a while. Thank you to everyone who tested preview builds and filed issues - your feedback shaped these improvements!

**Full Changelog**: [v2.12.5...v2.13.0](https://github.com/PrefectHQ/fastmcp/compare/v2.12.5...v2.13.0)

</Update>

<Update label="v2.12.5" description="2025-10-17">

**[v2.12.5: Safety Pin](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.5)**

FastMCP 2.12.5 is a point release that pins the MCP SDK version below 1.17, which introduced a change affecting FastMCP users with auth providers mounted as part of a larger application. This ensures the `.well-known` payload appears in the expected location when using FastMCP authentication providers with composite applications.

## What's Changed

### Fixes 🐞
* Pin MCP SDK version below 1.17 by [@jlowin](https://github.com/jlowin) in [a1b2c3d](https://github.com/PrefectHQ/fastmcp/commit/dab2b316ddc3883b7896a86da21cacb68da01e5c)

**Full Changelog**: [v2.12.4...v2.12.5](https://github.com/PrefectHQ/fastmcp/compare/v2.12.4...v2.12.5)

</Update>

<Update label="v2.12.4" description="2025-09-26">

**[v2.12.4: OIDC What You Did There](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.4)**

FastMCP 2.12.4 adds comprehensive OIDC support and expands authentication options with AWS Cognito and Descope providers. The release also includes improvements to logging middleware, URL handling for nested resources, persistent OAuth client registration storage, and various fixes to the experimental OpenAPI parser.

## What's Changed
### New Features 🎉
* feat: Add support for OIDC configuration by [@ruhulio](https://github.com/ruhulio) in [#1817](https://github.com/PrefectHQ/fastmcp/pull/1817)
### Enhancements 🔧
* feat: Move the Starlette context middleware to the front by [@akkuman](https://github.com/akkuman) in [#1812](https://github.com/PrefectHQ/fastmcp/pull/1812)
* Refactor Logging and Structured Logging Middleware by [@strawgate](https://github.com/strawgate) in [#1805](https://github.com/PrefectHQ/fastmcp/pull/1805)
* Update pull_request_template.md by [@jlowin](https://github.com/jlowin) in [#1824](https://github.com/PrefectHQ/fastmcp/pull/1824)
* chore: Set redirect_path default in function by [@ruhulio](https://github.com/ruhulio) in [#1833](https://github.com/PrefectHQ/fastmcp/pull/1833)
* feat: Set instructions in code by [@attiks](https://github.com/attiks) in [#1838](https://github.com/PrefectHQ/fastmcp/pull/1838)
* Automatically Create inline Snapshots by [@strawgate](https://github.com/strawgate) in [#1779](https://github.com/PrefectHQ/fastmcp/pull/1779)
* chore: Cleanup Auth0 redirect_path initialization by [@ruhulio](https://github.com/ruhulio) in [#1842](https://github.com/PrefectHQ/fastmcp/pull/1842)
* feat: Add support for Descope Authentication by [@anvibanga](https://github.com/anvibanga) in [#1853](https://github.com/PrefectHQ/fastmcp/pull/1853)
* Update descope version badges by [@jlowin](https://github.com/jlowin) in [#1870](https://github.com/PrefectHQ/fastmcp/pull/1870)
* Update welcome images by [@jlowin](https://github.com/jlowin) in [#1884](https://github.com/PrefectHQ/fastmcp/pull/1884)
* Fix rounded edges of image by [@jlowin](https://github.com/jlowin) in [#1886](https://github.com/PrefectHQ/fastmcp/pull/1886)
* optimize test suite by [@zzstoatzz](https://github.com/zzstoatzz) in [#1893](https://github.com/PrefectHQ/fastmcp/pull/1893)
* Enhancement: client completions support context_arguments by [@isijoe](https://github.com/isijoe) in [#1906](https://github.com/PrefectHQ/fastmcp/pull/1906)
* Update Descope icon by [@anvibanga](https://github.com/anvibanga) in [#1912](https://github.com/PrefectHQ/fastmcp/pull/1912)
* Add AWS Cognito OAuth Provider for Enterprise Authentication by [@stephaneberle9](https://github.com/stephaneberle9) in [#1873](https://github.com/PrefectHQ/fastmcp/pull/1873)
* Fix typos discovered by codespell by [@cclauss](https://github.com/cclauss) in [#1922](https://github.com/PrefectHQ/fastmcp/pull/1922)
* Use lowercase namespace for fastmcp logger by [@jlowin](https://github.com/jlowin) in [#1791](https://github.com/PrefectHQ/fastmcp/pull/1791)
### Fixes 🐞
* Update quickstart.mdx by [@radi-dev](https://github.com/radi-dev) in [#1821](https://github.com/PrefectHQ/fastmcp/pull/1821)
* Remove extraneous union import by [@jlowin](https://github.com/jlowin) in [#1823](https://github.com/PrefectHQ/fastmcp/pull/1823)
* Delay import of Provider classes until FastMCP Server Creation by [@strawgate](https://github.com/strawgate) in [#1820](https://github.com/PrefectHQ/fastmcp/pull/1820)
* fix: correct documentation link in deprecation warning by [@strawgate](https://github.com/strawgate) in [#1828](https://github.com/PrefectHQ/fastmcp/pull/1828)
* fix: Increase default 3s timeout on Pytest by [@dacamposol](https://github.com/dacamposol) in [#1866](https://github.com/PrefectHQ/fastmcp/pull/1866)
* fix: Improve URL handling in OIDCConfiguration by [@ruhulio](https://github.com/ruhulio) in [#1850](https://github.com/PrefectHQ/fastmcp/pull/1850)
* fix: correct typing for on_read_resource middleware method by [@strawgate](https://github.com/strawgate) in [#1858](https://github.com/PrefectHQ/fastmcp/pull/1858)
* feat(experimental/openapi): replace $ref in additionalProperties; add tests by [@jlowin](https://github.com/jlowin) in [#1735](https://github.com/PrefectHQ/fastmcp/pull/1735)
* Honor client supplied scopes during registration by [@dmikusa](https://github.com/dmikusa) in [#1860](https://github.com/PrefectHQ/fastmcp/pull/1860)
* Fix: FastAPI list parameter parsing in experimental OpenAPI parser by [@jlowin](https://github.com/jlowin) in [#1834](https://github.com/PrefectHQ/fastmcp/pull/1834)
* Add log level support for stdio and HTTP transports by [@jlowin](https://github.com/jlowin) in [#1840](https://github.com/PrefectHQ/fastmcp/pull/1840)
* Fix OAuth pre-flight check to accept HTTP 200 responses by [@jlowin](https://github.com/jlowin) in [#1874](https://github.com/PrefectHQ/fastmcp/pull/1874)
* Fix: Preserve OpenAPI parameter descriptions in experimental parser by [@shlomo666](https://github.com/shlomo666) in [#1877](https://github.com/PrefectHQ/fastmcp/pull/1877)
* Add persistent storage for OAuth client registrations by [@jlowin](https://github.com/jlowin) in [#1879](https://github.com/PrefectHQ/fastmcp/pull/1879)
* docs: update release dates based on github releases by [@lodu](https://github.com/lodu) in [#1890](https://github.com/PrefectHQ/fastmcp/pull/1890)
* Small updates to Sampling types by [@strawgate](https://github.com/strawgate) in [#1882](https://github.com/PrefectHQ/fastmcp/pull/1882)
* remove lockfile smart_home example by [@zzstoatzz](https://github.com/zzstoatzz) in [#1892](https://github.com/PrefectHQ/fastmcp/pull/1892)
* Fix: Remove JSON schema title metadata while preserving parameters named 'title' by [@jlowin](https://github.com/jlowin) in [#1872](https://github.com/PrefectHQ/fastmcp/pull/1872)
* Fix: get_resource_url nested URL handling by [@raphael-linx](https://github.com/raphael-linx) in [#1914](https://github.com/PrefectHQ/fastmcp/pull/1914)
* Clean up code for creating the resource url by [@jlowin](https://github.com/jlowin) in [#1916](https://github.com/PrefectHQ/fastmcp/pull/1916)
* Fix route count logging in OpenAPI server by [@zzstoatzz](https://github.com/zzstoatzz) in [#1928](https://github.com/PrefectHQ/fastmcp/pull/1928)
### Docs 📚
* docs: make Gemini CLI integration discoverable by [@jackwotherspoon](https://github.com/jackwotherspoon) in [#1827](https://github.com/PrefectHQ/fastmcp/pull/1827)
* docs: update NEW tags for AI assistant integrations by [@jackwotherspoon](https://github.com/jackwotherspoon) in [#1829](https://github.com/PrefectHQ/fastmcp/pull/1829)
* Update wordmark by [@jlowin](https://github.com/jlowin) in [#1832](https://github.com/PrefectHQ/fastmcp/pull/1832)
* docs: improve OAuth and OIDC Proxy documentation by [@jlowin](https://github.com/jlowin) in [#1880](https://github.com/PrefectHQ/fastmcp/pull/1880)
* Update readme + welcome docs by [@jlowin](https://github.com/jlowin) in [#1883](https://github.com/PrefectHQ/fastmcp/pull/1883)
* Update dark mode image in README by [@jlowin](https://github.com/jlowin) in [#1885](https://github.com/PrefectHQ/fastmcp/pull/1885)

## New Contributors
* [@radi-dev](https://github.com/radi-dev) made their first contribution in [#1821](https://github.com/PrefectHQ/fastmcp/pull/1821)
* [@akkuman](https://github.com/akkuman) made their first contribution in [#1812](https://github.com/PrefectHQ/fastmcp/pull/1812)
* [@ruhulio](https://github.com/ruhulio) made their first contribution in [#1817](https://github.com/PrefectHQ/fastmcp/pull/1817)
* [@attiks](https://github.com/attiks) made their first contribution in [#1838](https://github.com/PrefectHQ/fastmcp/pull/1838)
* [@anvibanga](https://github.com/anvibanga) made their first contribution in [#1853](https://github.com/PrefectHQ/fastmcp/pull/1853)
* [@shlomo666](https://github.com/shlomo666) made their first contribution in [#1877](https://github.com/PrefectHQ/fastmcp/pull/1877)
* [@lodu](https://github.com/lodu) made their first contribution in [#1890](https://github.com/PrefectHQ/fastmcp/pull/1890)
* [@isijoe](https://github.com/isijoe) made their first contribution in [#1906](https://github.com/PrefectHQ/fastmcp/pull/1906)
* [@raphael-linx](https://github.com/raphael-linx) made their first contribution in [#1914](https://github.com/PrefectHQ/fastmcp/pull/1914)
* [@stephaneberle9](https://github.com/stephaneberle9) made their first contribution in [#1873](https://github.com/PrefectHQ/fastmcp/pull/1873)
* [@cclauss](https://github.com/cclauss) made their first contribution in [#1922](https://github.com/PrefectHQ/fastmcp/pull/1922)

**Full Changelog**: [v2.12.3...v2.12.4](https://github.com/PrefectHQ/fastmcp/compare/v2.12.3...v2.12.4)

</Update>

<Update label="v2.12.3" description="2025-09-17">

**[v2.12.3: Double Time](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.3)**

FastMCP 2.12.3 focuses on performance and developer experience improvements based on community feedback. This release includes optimized auth provider imports that reduce server startup time, enhanced OIDC authentication flows with proper token management, and several reliability fixes for OAuth proxy configurations. The addition of automatic inline snapshot creation significantly improves the testing experience for contributors.

## What's Changed
### New Features 🎉
* feat: Support setting MCP log level via transport configuration by [@jlowin](https://github.com/jlowin) in [#1756](https://github.com/PrefectHQ/fastmcp/pull/1756)
### Enhancements 🔧
* Add client-side auth support for mcp install cursor command by [@jlowin](https://github.com/jlowin) in [#1747](https://github.com/PrefectHQ/fastmcp/pull/1747)
* Automatically Create inline Snapshots by [@strawgate](https://github.com/strawgate) in [#1779](https://github.com/PrefectHQ/fastmcp/pull/1779)
* Use lowercase namespace for fastmcp logger by [@jlowin](https://github.com/jlowin) in [#1791](https://github.com/PrefectHQ/fastmcp/pull/1791)
### Fixes 🐞
* fix: correct merge mistake during auth0 refactor by [@strawgate](https://github.com/strawgate) in [#1742](https://github.com/PrefectHQ/fastmcp/pull/1742)
* Remove extraneous union import by [@jlowin](https://github.com/jlowin) in [#1823](https://github.com/PrefectHQ/fastmcp/pull/1823)
* Delay import of Provider classes until FastMCP Server Creation by [@strawgate](https://github.com/strawgate) in [#1820](https://github.com/PrefectHQ/fastmcp/pull/1820)
* fix: refactor OIDC configuration provider for proper token management by [@strawgate](https://github.com/strawgate) in [#1751](https://github.com/PrefectHQ/fastmcp/pull/1751)
* Fix smart_home example imports by [@strawgate](https://github.com/strawgate) in [#1753](https://github.com/PrefectHQ/fastmcp/pull/1753)
* fix: correct oauth proxy initialization of client by [@strawgate](https://github.com/strawgate) in [#1759](https://github.com/PrefectHQ/fastmcp/pull/1759)
* Fix: return empty string when prompts have no arguments by [@jlowin](https://github.com/jlowin) in [#1766](https://github.com/PrefectHQ/fastmcp/pull/1766)
* Fix async server callbacks by [@strawgate](https://github.com/strawgate) in [#1774](https://github.com/PrefectHQ/fastmcp/pull/1774)
* Fix error when retrieving Completion API errors by [@strawgate](https://github.com/strawgate) in [#1785](https://github.com/PrefectHQ/fastmcp/pull/1785)
* fix: correct documentation link in deprecation warning by [@strawgate](https://github.com/strawgate) in [#1828](https://github.com/PrefectHQ/fastmcp/pull/1828)
### Docs 📚
* Add migration docs for 2.12 by [@jlowin](https://github.com/jlowin) in [#1745](https://github.com/PrefectHQ/fastmcp/pull/1745)
* Update docs for default sampling implementation to mention OpenAI API Key by [@strawgate](https://github.com/strawgate) in [#1763](https://github.com/PrefectHQ/fastmcp/pull/1763)
* Add tip about sampling prompts and user_context to sampling documentation by [@jlowin](https://github.com/jlowin) in [#1764](https://github.com/PrefectHQ/fastmcp/pull/1764)
* Update quickstart.mdx by [@radi-dev](https://github.com/radi-dev) in [#1821](https://github.com/PrefectHQ/fastmcp/pull/1821)
### Other Changes 🦾
* Replace Marvin with Claude Code in CI by [@jlowin](https://github.com/jlowin) in [#1800](https://github.com/PrefectHQ/fastmcp/pull/1800)
* Refactor logging and structured logging middleware by [@strawgate](https://github.com/strawgate) in [#1805](https://github.com/PrefectHQ/fastmcp/pull/1805)
* feat: Move the Starlette context middleware to the front by [@akkuman](https://github.com/akkuman) in [#1812](https://github.com/PrefectHQ/fastmcp/pull/1812)
* feat: Add support for OIDC configuration by [@ruhulio](https://github.com/ruhulio) in [#1817](https://github.com/PrefectHQ/fastmcp/pull/1817)

## New Contributors
* [@radi-dev](https://github.com/radi-dev) made their first contribution in [#1821](https://github.com/PrefectHQ/fastmcp/pull/1821)
* [@akkuman](https://github.com/akkuman) made their first contribution in [#1812](https://github.com/PrefectHQ/fastmcp/pull/1812)
* [@ruhulio](https://github.com/ruhulio) made their first contribution in [#1817](https://github.com/PrefectHQ/fastmcp/pull/1817)

**Full Changelog**: [v2.12.2...v2.12.3](https://github.com/PrefectHQ/fastmcp/compare/v2.12.2...v2.12.3)

</Update>

<Update label="v2.12.2" description="2025-09-03">

**[v2.12.2: Perchance to Stream](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.2)**

This is a hotfix for a bug where the `streamable-http` transport was not recognized as a valid option in `fastmcp.json` configuration files, despite being supported by the CLI. This resulted in a parsing error when the CLI arguments were merged against the configuration spec. 

## What's Changed
### Fixes 🐞
* Fix streamable-http transport validation in fastmcp.json config by [@jlowin](https://github.com/jlowin) in [#1739](https://github.com/PrefectHQ/fastmcp/pull/1739)

**Full Changelog**: [v2.12.1...v2.12.2](https://github.com/PrefectHQ/fastmcp/compare/v2.12.1...v2.12.2)

</Update>

<Update label="v2.12.1" description="2025-09-03">

**[v2.12.1: OAuth to Joy](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.1)**

FastMCP 2.12.1 strengthens the OAuth proxy implementation based on extensive community testing and feedback. This release improves client storage reliability, adds PKCE forwarding for enhanced security, introduces configurable token endpoint authentication methods, and expands scope handling—all addressing real-world integration challenges discovered since 2.12.0. The enhanced test suite with mock providers ensures these improvements are robust and maintainable.

## Breaking Changes
- **OAuth Proxy**: Users of built-in IDP integrations should note that `resource_server_url` has been renamed to `base_url` for clarity and consistency

## What's Changed
### Enhancements 🔧
* Make openai dependency optional by [@jlowin](https://github.com/jlowin) in [#1701](https://github.com/PrefectHQ/fastmcp/pull/1701)
* Remove orphaned OAuth proxy code by [@jlowin](https://github.com/jlowin) in [#1722](https://github.com/PrefectHQ/fastmcp/pull/1722)
* Expose valid scopes from OAuthProxy metadata by [@dmikusa](https://github.com/dmikusa) in [#1717](https://github.com/PrefectHQ/fastmcp/pull/1717)
* OAuth proxy PKCE forwarding by [@jlowin](https://github.com/jlowin) in [#1733](https://github.com/PrefectHQ/fastmcp/pull/1733)
* Add token_endpoint_auth_method parameter to OAuthProxy by [@jlowin](https://github.com/jlowin) in [#1736](https://github.com/PrefectHQ/fastmcp/pull/1736)
* Clean up and enhance OAuth proxy tests with mock provider by [@jlowin](https://github.com/jlowin) in [#1738](https://github.com/PrefectHQ/fastmcp/pull/1738)
### Fixes 🐞
* refactor: replace auth provider registry with ImportString by [@jlowin](https://github.com/jlowin) in [#1710](https://github.com/PrefectHQ/fastmcp/pull/1710)
* Fix OAuth resource URL handling and WWW-Authenticate header by [@jlowin](https://github.com/jlowin) in [#1706](https://github.com/PrefectHQ/fastmcp/pull/1706)
* Fix OAuth proxy client storage and add retry logic by [@jlowin](https://github.com/jlowin) in [#1732](https://github.com/PrefectHQ/fastmcp/pull/1732)
### Docs 📚
* Fix documentation: use StreamableHttpTransport for headers in testing by [@jlowin](https://github.com/jlowin) in [#1702](https://github.com/PrefectHQ/fastmcp/pull/1702)
* docs: add performance warnings for mounted servers and proxies by [@strawgate](https://github.com/strawgate) in [#1669](https://github.com/PrefectHQ/fastmcp/pull/1669)
* Update documentation around scopes for google by [@jlowin](https://github.com/jlowin) in [#1703](https://github.com/PrefectHQ/fastmcp/pull/1703)
* Add deployment information to quickstart by [@seanpwlms](https://github.com/seanpwlms) in [#1433](https://github.com/PrefectHQ/fastmcp/pull/1433)
* Update quickstart by [@jlowin](https://github.com/jlowin) in [#1728](https://github.com/PrefectHQ/fastmcp/pull/1728)
* Add development docs for FastMCP by [@jlowin](https://github.com/jlowin) in [#1719](https://github.com/PrefectHQ/fastmcp/pull/1719)
### Other Changes 🦾
* Set generics without bounds to default=Any by [@strawgate](https://github.com/strawgate) in [#1648](https://github.com/PrefectHQ/fastmcp/pull/1648)

## New Contributors
* [@dmikusa](https://github.com/dmikusa) made their first contribution in [#1717](https://github.com/PrefectHQ/fastmcp/pull/1717)
* [@seanpwlms](https://github.com/seanpwlms) made their first contribution in [#1433](https://github.com/PrefectHQ/fastmcp/pull/1433)

**Full Changelog**: [v2.12.0...v2.12.1](https://github.com/PrefectHQ/fastmcp/compare/v2.12.0...v2.12.1)

</Update>

<Update label="v2.12.0" description="2025-08-31">

**[v2.12.0: Auth to the Races](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.0)**

FastMCP 2.12 represents one of our most significant releases to date, both in scope and community involvement. After extensive testing and iteration with the community, we're shipping major improvements to authentication, configuration, and MCP feature adoption.

🔐 **OAuth Proxy for Broader Provider Support** addresses a fundamental challenge: while MCP requires Dynamic Client Registration (DCR), many popular OAuth providers don't support it. The new OAuth proxy bridges this gap, enabling FastMCP servers to authenticate with providers like GitHub, Google, WorkOS, and Azure through minimal configuration. These native integrations ship today, with more providers planned based on community needs.

📋 **Declarative JSON Configuration** introduces a standardized, portable way to describe and deploy MCP servers. The `fastmcp.json` configuration file becomes the single source of truth for dependencies, transport settings, entrypoints, and server metadata. This foundation sets the stage for future capabilities like transformations and remote sources, moving toward a world where MCP servers are as portable and shareable as container images.

🧠 **Sampling API Fallback** tackles the chicken-and-egg problem limiting adoption of advanced MCP features. Sampling—where servers request LLM completions from clients—is powerful but underutilized due to limited client support. FastMCP now lets server authors define fallback handlers that generate sampling completions server-side when clients don't support the feature, encouraging adoption while maintaining compatibility.

This release took longer than usual to ship, and for good reason: the community's aggressive testing and feedback on the authentication system helped us reach a level of stability we're confident in. There's certainly more work ahead, but these foundations position FastMCP to handle increasingly complex use cases while remaining approachable for developers.

Thank you to our new contributors and everyone who tested preview builds. Your feedback directly shaped these features.

## What's Changed
### New Features 🎉
* Add OAuth proxy that allows authentication with social IDPs without DCR support by [@jlowin](https://github.com/jlowin) in [#1434](https://github.com/PrefectHQ/fastmcp/pull/1434)
* feat: introduce declarative JSON configuration system by [@jlowin](https://github.com/jlowin) in [#1517](https://github.com/PrefectHQ/fastmcp/pull/1517)
* ✨ Fallback to a Completions API when Sampling is not available by [@strawgate](https://github.com/strawgate) in [#1145](https://github.com/PrefectHQ/fastmcp/pull/1145)
* Implement typed source system for FastMCP declarative configuration by [@jlowin](https://github.com/jlowin) in [#1607](https://github.com/PrefectHQ/fastmcp/pull/1607)
### Enhancements 🔧
* Support importing custom_route endpoints when mounting servers by [@jlowin](https://github.com/jlowin) in [#1470](https://github.com/PrefectHQ/fastmcp/pull/1470)
* Remove unnecessary asserts by [@jlowin](https://github.com/jlowin) in [#1484](https://github.com/PrefectHQ/fastmcp/pull/1484)
* Add Claude issue triage by [@jlowin](https://github.com/jlowin) in [#1510](https://github.com/PrefectHQ/fastmcp/pull/1510)
* Inline dedupe prompt by [@jlowin](https://github.com/jlowin) in [#1512](https://github.com/PrefectHQ/fastmcp/pull/1512)
* Improve stdio and mcp_config clean-up by [@strawgate](https://github.com/strawgate) in [#1444](https://github.com/PrefectHQ/fastmcp/pull/1444)
* involve kwargs to pass parameters on creating RichHandler for logging customization. by [@itaru2622](https://github.com/itaru2622) in [#1504](https://github.com/PrefectHQ/fastmcp/pull/1504)
* Move SDK docs generation to post-merge workflow by [@jlowin](https://github.com/jlowin) in [#1513](https://github.com/PrefectHQ/fastmcp/pull/1513)
* Improve label triage guidance by [@jlowin](https://github.com/jlowin) in [#1516](https://github.com/PrefectHQ/fastmcp/pull/1516)
* Add code review guidelines for agents by [@jlowin](https://github.com/jlowin) in [#1520](https://github.com/PrefectHQ/fastmcp/pull/1520)
* Remove trailing slash in unit tests by [@jlowin](https://github.com/jlowin) in [#1535](https://github.com/PrefectHQ/fastmcp/pull/1535)
* Update OAuth callback UI branding by [@jlowin](https://github.com/jlowin) in [#1536](https://github.com/PrefectHQ/fastmcp/pull/1536)
* Fix Marvin workflow to support development tools by [@jlowin](https://github.com/jlowin) in [#1537](https://github.com/PrefectHQ/fastmcp/pull/1537)
* Add mounted_components_raise_on_load_error setting for debugging by [@jlowin](https://github.com/jlowin) in [#1534](https://github.com/PrefectHQ/fastmcp/pull/1534)
* feat: Add --workspace flag to fastmcp install cursor by [@jlowin](https://github.com/jlowin) in [#1522](https://github.com/PrefectHQ/fastmcp/pull/1522)
* switch from `pyright` to `ty` by [@zzstoatzz](https://github.com/zzstoatzz) in [#1545](https://github.com/PrefectHQ/fastmcp/pull/1545)
* feat: trigger Marvin workflow on PR body content by [@jlowin](https://github.com/jlowin) in [#1549](https://github.com/PrefectHQ/fastmcp/pull/1549)
* Add WorkOS and Azure OAuth providers by [@jlowin](https://github.com/jlowin) in [#1550](https://github.com/PrefectHQ/fastmcp/pull/1550)
* Adjust timeout for slow MCP Server shutdown test by [@strawgate](https://github.com/strawgate) in [#1561](https://github.com/PrefectHQ/fastmcp/pull/1561)
* Update banner by [@jlowin](https://github.com/jlowin) in [#1567](https://github.com/PrefectHQ/fastmcp/pull/1567)
* Added import of AuthProxy to auth __init__ by [@KaliszS](https://github.com/KaliszS) in [#1568](https://github.com/PrefectHQ/fastmcp/pull/1568)
* Add configurable redirect URI validation for OAuth providers by [@jlowin](https://github.com/jlowin) in [#1582](https://github.com/PrefectHQ/fastmcp/pull/1582)
* Remove invalid-argument-type ignore and fix type errors by [@jlowin](https://github.com/jlowin) in [#1588](https://github.com/PrefectHQ/fastmcp/pull/1588)
* Remove generate-schema from public CLI by [@jlowin](https://github.com/jlowin) in [#1591](https://github.com/PrefectHQ/fastmcp/pull/1591)
* Skip flaky windows test / multi-client garbage collection by [@jlowin](https://github.com/jlowin) in [#1592](https://github.com/PrefectHQ/fastmcp/pull/1592)
* Add setting to disable logging configuration by [@isra17](https://github.com/isra17) in [#1575](https://github.com/PrefectHQ/fastmcp/pull/1575)
* Improve debug logging for nested Servers / Clients by [@strawgate](https://github.com/strawgate) in [#1604](https://github.com/PrefectHQ/fastmcp/pull/1604)
* Add GitHub pull request template by [@strawgate](https://github.com/strawgate) in [#1581](https://github.com/PrefectHQ/fastmcp/pull/1581)
* chore: Automate docs and schema updates via PRs by [@jlowin](https://github.com/jlowin) in [#1611](https://github.com/PrefectHQ/fastmcp/pull/1611)
* Experiment with haiku for limited workflows by [@jlowin](https://github.com/jlowin) in [#1613](https://github.com/PrefectHQ/fastmcp/pull/1613)
* feat: Improve GitHub workflow automation for schema and SDK docs by [@jlowin](https://github.com/jlowin) in [#1615](https://github.com/PrefectHQ/fastmcp/pull/1615)
* Consolidate server loading logic into FileSystemSource by [@jlowin](https://github.com/jlowin) in [#1614](https://github.com/PrefectHQ/fastmcp/pull/1614)
* Prevent Haiku Marvin from commenting when there are no duplicates by [@jlowin](https://github.com/jlowin) in [#1622](https://github.com/PrefectHQ/fastmcp/pull/1622)
* chore: Add clarifying note to automated PR bodies by [@jlowin](https://github.com/jlowin) in [#1623](https://github.com/PrefectHQ/fastmcp/pull/1623)
* feat: introduce inline snapshots by [@strawgate](https://github.com/strawgate) in [#1605](https://github.com/PrefectHQ/fastmcp/pull/1605)
* Improve fastmcp.json environment configuration and project-based deployments by [@jlowin](https://github.com/jlowin) in [#1631](https://github.com/PrefectHQ/fastmcp/pull/1631)
* fix: allow passing query params in OAuthProxy upstream authorization url by [@danb27](https://github.com/danb27) in [#1630](https://github.com/PrefectHQ/fastmcp/pull/1630)
* Support multiple --with-editable flags in CLI commands by [@jlowin](https://github.com/jlowin) in [#1634](https://github.com/PrefectHQ/fastmcp/pull/1634)
* feat: support comma separated oauth scopes by [@jlowin](https://github.com/jlowin) in [#1642](https://github.com/PrefectHQ/fastmcp/pull/1642)
* Add allowed_client_redirect_uris to OAuth provider subclasses by [@jlowin](https://github.com/jlowin) in [#1662](https://github.com/PrefectHQ/fastmcp/pull/1662)
* Consolidate CLI config parsing and prevent infinite loops by [@jlowin](https://github.com/jlowin) in [#1660](https://github.com/PrefectHQ/fastmcp/pull/1660)
* Internal refactor: mcp server config by [@jlowin](https://github.com/jlowin) in [#1672](https://github.com/PrefectHQ/fastmcp/pull/1672)
* Refactor Environment to support multiple runtime types by [@jlowin](https://github.com/jlowin) in [#1673](https://github.com/PrefectHQ/fastmcp/pull/1673)
* Add type field to Environment base class by [@jlowin](https://github.com/jlowin) in [#1676](https://github.com/PrefectHQ/fastmcp/pull/1676)
### Fixes 🐞
* Fix breaking change: restore output_schema=False compatibility by [@jlowin](https://github.com/jlowin) in [#1482](https://github.com/PrefectHQ/fastmcp/pull/1482)
* Fix #1506: Update tool filtering documentation from _meta to meta by [@maybenotconnor](https://github.com/maybenotconnor) in [#1511](https://github.com/PrefectHQ/fastmcp/pull/1511)
* Fix pytest warnings by [@jlowin](https://github.com/jlowin) in [#1559](https://github.com/PrefectHQ/fastmcp/pull/1559)
* nest schemas under assets by [@jlowin](https://github.com/jlowin) in [#1593](https://github.com/PrefectHQ/fastmcp/pull/1593)
* Skip flaky windows test by [@jlowin](https://github.com/jlowin) in [#1596](https://github.com/PrefectHQ/fastmcp/pull/1596)
* ACTUALLY move schemas to fastmcp.json by [@jlowin](https://github.com/jlowin) in [#1597](https://github.com/PrefectHQ/fastmcp/pull/1597)
* Fix and centralize CLI path resolution by [@jlowin](https://github.com/jlowin) in [#1590](https://github.com/PrefectHQ/fastmcp/pull/1590)
* Remove client info modifications by [@jlowin](https://github.com/jlowin) in [#1620](https://github.com/PrefectHQ/fastmcp/pull/1620)
* Fix $defs being discarded in input schema of transformed tool by [@pldesch-chift](https://github.com/pldesch-chift) in [#1578](https://github.com/PrefectHQ/fastmcp/pull/1578)
* Fix enum elicitation to use inline schemas for MCP compatibility by [@jlowin](https://github.com/jlowin) in [#1632](https://github.com/PrefectHQ/fastmcp/pull/1632)
* Reuse session for `StdioTransport` in `Client.new` by [@strawgate](https://github.com/strawgate) in [#1635](https://github.com/PrefectHQ/fastmcp/pull/1635)
* Feat: Configurable LoggingMiddleware payload serialization by [@vl-kp](https://github.com/vl-kp) in [#1636](https://github.com/PrefectHQ/fastmcp/pull/1636)
* Fix OAuth redirect URI validation for DCR compatibility by [@jlowin](https://github.com/jlowin) in [#1661](https://github.com/PrefectHQ/fastmcp/pull/1661)
* Add default scope handling in OAuth proxy by [@romanusyk](https://github.com/romanusyk) in [#1667](https://github.com/PrefectHQ/fastmcp/pull/1667)
* Fix OAuth token expiry handling by [@jlowin](https://github.com/jlowin) in [#1671](https://github.com/PrefectHQ/fastmcp/pull/1671)
* Add resource_server_url parameter to OAuth proxy providers by [@jlowin](https://github.com/jlowin) in [#1682](https://github.com/PrefectHQ/fastmcp/pull/1682)
### Breaking Changes 🛫
* Enhance inspect command with structured output and format options by [@jlowin](https://github.com/jlowin) in [#1481](https://github.com/PrefectHQ/fastmcp/pull/1481)
### Docs 📚
* Update changelog by [@jlowin](https://github.com/jlowin) in [#1453](https://github.com/PrefectHQ/fastmcp/pull/1453)
* Update banner by [@jlowin](https://github.com/jlowin) in [#1472](https://github.com/PrefectHQ/fastmcp/pull/1472)
* Update logo files by [@jlowin](https://github.com/jlowin) in [#1473](https://github.com/PrefectHQ/fastmcp/pull/1473)
* Update deployment docs by [@jlowin](https://github.com/jlowin) in [#1486](https://github.com/PrefectHQ/fastmcp/pull/1486)
* Update FastMCP Cloud screenshot by [@jlowin](https://github.com/jlowin) in [#1487](https://github.com/PrefectHQ/fastmcp/pull/1487)
* Update authentication note in docs by [@jlowin](https://github.com/jlowin) in [#1488](https://github.com/PrefectHQ/fastmcp/pull/1488)
* chore: Update installation.mdx version snippet by [@thomas-te](https://github.com/thomas-te) in [#1496](https://github.com/PrefectHQ/fastmcp/pull/1496)
* Update fastmcp cloud server requirements by [@jlowin](https://github.com/jlowin) in [#1497](https://github.com/PrefectHQ/fastmcp/pull/1497)
* Fix oauth pyright type checking by [@strawgate](https://github.com/strawgate) in [#1498](https://github.com/PrefectHQ/fastmcp/pull/1498)
* docs: Fix type annotation in return value documentation by [@MaikelVeen](https://github.com/MaikelVeen) in [#1499](https://github.com/PrefectHQ/fastmcp/pull/1499)
* Fix PromptMessage usage in docs example by [@jlowin](https://github.com/jlowin) in [#1515](https://github.com/PrefectHQ/fastmcp/pull/1515)
* Create CODE_OF_CONDUCT.md by [@jlowin](https://github.com/jlowin) in [#1523](https://github.com/PrefectHQ/fastmcp/pull/1523)
* Fixed wrong import path in new docs page by [@KaliszS](https://github.com/KaliszS) in [#1538](https://github.com/PrefectHQ/fastmcp/pull/1538)
* Document symmetric key JWT verification support by [@jlowin](https://github.com/jlowin) in [#1586](https://github.com/PrefectHQ/fastmcp/pull/1586)
* Update fastmcp.json schema path by [@jlowin](https://github.com/jlowin) in [#1595](https://github.com/PrefectHQ/fastmcp/pull/1595)
### Dependencies 📦
* Bump actions/create-github-app-token from 1 to 2 by [@dependabot](https://github.com/dependabot)[bot] in [#1436](https://github.com/PrefectHQ/fastmcp/pull/1436)
* Bump astral-sh/setup-uv from 4 to 6 by [@dependabot](https://github.com/dependabot)[bot] in [#1532](https://github.com/PrefectHQ/fastmcp/pull/1532)
* Bump actions/checkout from 4 to 5 by [@dependabot](https://github.com/dependabot)[bot] in [#1533](https://github.com/PrefectHQ/fastmcp/pull/1533)
### Other Changes 🦾
* Add dedupe workflow by [@jlowin](https://github.com/jlowin) in [#1454](https://github.com/PrefectHQ/fastmcp/pull/1454)
* Update AGENTS.md by [@jlowin](https://github.com/jlowin) in [#1471](https://github.com/PrefectHQ/fastmcp/pull/1471)
* Give Marvin the power of the Internet by [@strawgate](https://github.com/strawgate) in [#1475](https://github.com/PrefectHQ/fastmcp/pull/1475)
* Update `just` error message for static checks by [@jlowin](https://github.com/jlowin) in [#1483](https://github.com/PrefectHQ/fastmcp/pull/1483)
* Remove labeler by [@jlowin](https://github.com/jlowin) in [#1509](https://github.com/PrefectHQ/fastmcp/pull/1509)
* update aproto server to handle rich links by [@zzstoatzz](https://github.com/zzstoatzz) in [#1556](https://github.com/PrefectHQ/fastmcp/pull/1556)
* fix: enable triage bot for fork PRs using pull_request_target by [@jlowin](https://github.com/jlowin) in [#1557](https://github.com/PrefectHQ/fastmcp/pull/1557)

## New Contributors
* [@thomas-te](https://github.com/thomas-te) made their first contribution in [#1496](https://github.com/PrefectHQ/fastmcp/pull/1496)
* [@maybenotconnor](https://github.com/maybenotconnor) made their first contribution in [#1511](https://github.com/PrefectHQ/fastmcp/pull/1511)
* [@MaikelVeen](https://github.com/MaikelVeen) made their first contribution in [#1499](https://github.com/PrefectHQ/fastmcp/pull/1499)
* [@KaliszS](https://github.com/KaliszS) made their first contribution in [#1538](https://github.com/PrefectHQ/fastmcp/pull/1538)
* [@isra17](https://github.com/isra17) made their first contribution in [#1575](https://github.com/PrefectHQ/fastmcp/pull/1575)
* [@marvin-context-protocol](https://github.com/marvin-context-protocol)[bot] made their first contribution in [#1616](https://github.com/PrefectHQ/fastmcp/pull/1616)
* [@pldesch-chift](https://github.com/pldesch-chift) made their first contribution in [#1578](https://github.com/PrefectHQ/fastmcp/pull/1578)
* [@vl-kp](https://github.com/vl-kp) made their first contribution in [#1636](https://github.com/PrefectHQ/fastmcp/pull/1636)
* [@romanusyk](https://github.com/romanusyk) made their first contribution in [#1667](https://github.com/PrefectHQ/fastmcp/pull/1667)

**Full Changelog**: [v2.11.3...v2.12.0](https://github.com/PrefectHQ/fastmcp/compare/v2.11.3...v2.12.0)

</Update>

<Update label="v2.11.3" description="2025-08-11">

**[v2.11.3: API-tite for Change](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.11.3)**

This release includes significant enhancements to the experimental OpenAPI parser and fixes a significant bug that led schemas not to be included in input/output schemas if they were transitive dependencies (e.g. A → B → C implies A depends on C). For users naively transforming large OpenAPI specs into MCP servers, this may result in ballooning payload sizes and necessitate curation.

## What's Changed
### Enhancements 🔧
* Improve redirect handling to address 307's by [@jlowin](https://github.com/jlowin) in [#1387](https://github.com/PrefectHQ/fastmcp/pull/1387)
* Ensure resource + template names are properly prefixed when importing/mounting by [@jlowin](https://github.com/jlowin) in [#1423](https://github.com/PrefectHQ/fastmcp/pull/1423)
* fixes #1398: Add JWT claims to AccessToken by [@panargirakis](https://github.com/panargirakis) in [#1399](https://github.com/PrefectHQ/fastmcp/pull/1399)
* Enable Protected Resource Metadata to provide resource_name and resou… by [@yannj-fr](https://github.com/yannj-fr) in [#1371](https://github.com/PrefectHQ/fastmcp/pull/1371)
* Pin mcp SDK under 2.0 to avoid breaking changes by [@jlowin](https://github.com/jlowin) in [#1428](https://github.com/PrefectHQ/fastmcp/pull/1428)
* Clean up complexity from PR #1426 by [@jlowin](https://github.com/jlowin) in [#1435](https://github.com/PrefectHQ/fastmcp/pull/1435)
* Optimize OpenAPI payload size by 46% by [@jlowin](https://github.com/jlowin) in [#1452](https://github.com/PrefectHQ/fastmcp/pull/1452)
* Update static checks by [@jlowin](https://github.com/jlowin) in [#1448](https://github.com/PrefectHQ/fastmcp/pull/1448)
### Fixes 🐞
* Fix client-side logging bug #1394 by [@chi2liu](https://github.com/chi2liu) in [#1397](https://github.com/PrefectHQ/fastmcp/pull/1397)
* fix: Fix httpx_client_factory type annotation to match MCP SDK (#1402) by [@chi2liu](https://github.com/chi2liu) in [#1405](https://github.com/PrefectHQ/fastmcp/pull/1405)
* Fix OpenAPI allOf handling at requestBody top level (#1378) by [@chi2liu](https://github.com/chi2liu) in [#1425](https://github.com/PrefectHQ/fastmcp/pull/1425)
* Fix OpenAPI transitive references and performance (#1372) by [@jlowin](https://github.com/jlowin) in [#1426](https://github.com/PrefectHQ/fastmcp/pull/1426)
* fix(type): lifespan is partially unknown by [@ykun9](https://github.com/ykun9) in [#1389](https://github.com/PrefectHQ/fastmcp/pull/1389)
* Ensure transformed tools generate structured content by [@jlowin](https://github.com/jlowin) in [#1443](https://github.com/PrefectHQ/fastmcp/pull/1443)
### Docs 📚
* docs(client/logging): reflect corrected default log level mapping by [@jlowin](https://github.com/jlowin) in [#1403](https://github.com/PrefectHQ/fastmcp/pull/1403)
* Add documentation for get_access_token() dependency function by [@jlowin](https://github.com/jlowin) in [#1446](https://github.com/PrefectHQ/fastmcp/pull/1446)
### Other Changes 🦾
* Add comprehensive tests for utilities.components module by [@chi2liu](https://github.com/chi2liu) in [#1395](https://github.com/PrefectHQ/fastmcp/pull/1395)
* Consolidate agent instructions into AGENTS.md by [@jlowin](https://github.com/jlowin) in [#1404](https://github.com/PrefectHQ/fastmcp/pull/1404)
* Fix performance test threshold to prevent flaky failures by [@jlowin](https://github.com/jlowin) in [#1406](https://github.com/PrefectHQ/fastmcp/pull/1406)
* Update agents.md; add github instructions by [@jlowin](https://github.com/jlowin) in [#1410](https://github.com/PrefectHQ/fastmcp/pull/1410)
* Add Marvin assistant by [@jlowin](https://github.com/jlowin) in [#1412](https://github.com/PrefectHQ/fastmcp/pull/1412)
* Marvin: fix deprecated variable names by [@jlowin](https://github.com/jlowin) in [#1417](https://github.com/PrefectHQ/fastmcp/pull/1417)
* Simplify action setup and add github tools for Marvin by [@jlowin](https://github.com/jlowin) in [#1419](https://github.com/PrefectHQ/fastmcp/pull/1419)
* Update marvin workflow name by [@jlowin](https://github.com/jlowin) in [#1421](https://github.com/PrefectHQ/fastmcp/pull/1421)
* Improve GitHub templates by [@jlowin](https://github.com/jlowin) in [#1422](https://github.com/PrefectHQ/fastmcp/pull/1422)

## New Contributors
* [@panargirakis](https://github.com/panargirakis) made their first contribution in [#1399](https://github.com/PrefectHQ/fastmcp/pull/1399)
* [@ykun9](https://github.com/ykun9) made their first contribution in [#1389](https://github.com/PrefectHQ/fastmcp/pull/1389)
* [@yannj-fr](https://github.com/yannj-fr) made their first contribution in [#1371](https://github.com/PrefectHQ/fastmcp/pull/1371)

**Full Changelog**: [v2.11.2...v2.11.3](https://github.com/PrefectHQ/fastmcp/compare/v2.11.2...v2.11.3)

</Update>

<Update label="v2.11.2" description="2025-08-06">

## [v2.11.2: Satis-factory](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.11.2)

## What's Changed
### Enhancements 🔧
* Support factory functions in fastmcp run by [@jlowin](https://github.com/jlowin) in [#1384](https://github.com/PrefectHQ/fastmcp/pull/1384)
* Add async support to client_factory in FastMCPProxy  (#1286) by [@bianning](https://github.com/bianning) in [#1375](https://github.com/PrefectHQ/fastmcp/pull/1375)
### Fixes 🐞
* Fix server_version field in inspect manifest by [@jlowin](https://github.com/jlowin) in [#1383](https://github.com/PrefectHQ/fastmcp/pull/1383)
* Fix Settings field with both default and default_factory by [@jlowin](https://github.com/jlowin) in [#1380](https://github.com/PrefectHQ/fastmcp/pull/1380)
### Other Changes 🦾
* Remove unused arg by [@jlowin](https://github.com/jlowin) in [#1382](https://github.com/PrefectHQ/fastmcp/pull/1382)
* Add remote auth provider tests by [@jlowin](https://github.com/jlowin) in [#1351](https://github.com/PrefectHQ/fastmcp/pull/1351)

## New Contributors
* [@bianning](https://github.com/bianning) made their first contribution in [#1375](https://github.com/PrefectHQ/fastmcp/pull/1375)

**Full Changelog**: [v2.11.1...v2.11.2](https://github.com/PrefectHQ/fastmcp/compare/v2.11.1...v2.11.2)

</Update>

<Update label="v2.11.1" description="2025-08-04">

## [v2.11.1: You're Better Auth Now](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.11.1)

## What's Changed
### New Features 🎉
* Introduce `RemoteAuthProvider` for cleaner external identity provider integration, update docs by [@jlowin](https://github.com/jlowin) in [#1346](https://github.com/PrefectHQ/fastmcp/pull/1346)
### Enhancements 🔧
* perf: optimize string operations in OpenAPI parameter processing by [@chi2liu](https://github.com/chi2liu) in [#1342](https://github.com/PrefectHQ/fastmcp/pull/1342)
### Fixes 🐞
* Fix method-bound FunctionTool schemas by [@strawgate](https://github.com/strawgate) in [#1360](https://github.com/PrefectHQ/fastmcp/pull/1360)
* Manually set `_key` after `model_copy()` to enable prefixing Transformed Tools by [@strawgate](https://github.com/strawgate) in [#1357](https://github.com/PrefectHQ/fastmcp/pull/1357)
### Docs 📚
* Docs updates by [@jlowin](https://github.com/jlowin) in [#1336](https://github.com/PrefectHQ/fastmcp/pull/1336)
* Add 2.11 to changelog by [@jlowin](https://github.com/jlowin) in [#1337](https://github.com/PrefectHQ/fastmcp/pull/1337)
* Update AuthKit vocab by [@jlowin](https://github.com/jlowin) in [#1338](https://github.com/PrefectHQ/fastmcp/pull/1338)
* Fix typo in decorating-methods.mdx by [@Ozzuke](https://github.com/Ozzuke) in [#1344](https://github.com/PrefectHQ/fastmcp/pull/1344)

## New Contributors
* [@Ozzuke](https://github.com/Ozzuke) made their first contribution in [#1344](https://github.com/PrefectHQ/fastmcp/pull/1344)

**Full Changelog**: [v2.11.0...v2.11.1](https://github.com/PrefectHQ/fastmcp/compare/v2.11.0...v2.11.1)

</Update>

<Update label="v2.11.0" description="2025-08-01">

## [v2.11.0: Auth to a Good Start](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.11.0)

FastMCP 2.11 doubles down on what developers need most: speed and simplicity. This massive release delivers significant performance improvements and a dramatically better developer experience.

🔐 **Enterprise-Ready Authentication** brings comprehensive OAuth 2.1 support with WorkOS's AuthKit integration. The new AuthProvider interface leverages MCP's support for separate resource and authorization servers, handling API keys and remote authentication with Dynamic Client Registration. AuthKit integration means you can plug into existing enterprise identity systems without rebuilding your auth stack, setting the stage for plug-and-play auth that doesn't require users to become security experts overnight.

⚡ The **Experimental OpenAPI Parser** delivers dramatic performance improvements through single-pass schema processing and optimized memory usage. OpenAPI integrations are now significantly faster, with cleaner, more maintainable code. _(Note: the experimental parser is disabled by default, set `FASTMCPEXPERIMENTALENABLENEWOPENAPIPARSER=1` to enable it. A message will be shown to all users on the legacy parser encouraging them to try the new one before it becomes the default.)_

🧠 **Context State Management** finally gives you persistent state across tool calls with a simple dict interface, while enhanced meta support lets you expose rich component metadata to clients. Combined with improved type annotations, string-based argument descriptions, and UV transport support, this release makes FastMCP feel more intuitive than ever.

This release represents a TON of community contributions and sets the foundation for even more ambitious features ahead.

## What's Changed
### New Features 🎉
* Introduce experimental OpenAPI parser with improved performance and maintainability by [@jlowin](https://github.com/jlowin) in [#1209](https://github.com/PrefectHQ/fastmcp/pull/1209)
* Add state dict to Context (#1118) by [@mukulmurthy](https://github.com/mukulmurthy) in [#1160](https://github.com/PrefectHQ/fastmcp/pull/1160)
* Expose FastMCP tags to clients via component `meta` dict by [@jlowin](https://github.com/jlowin) in [#1281](https://github.com/PrefectHQ/fastmcp/pull/1281)
* Add _fastmcp meta namespace by [@jlowin](https://github.com/jlowin) in [#1290](https://github.com/PrefectHQ/fastmcp/pull/1290)
* Add TokenVerifier protocol support alongside existing OAuthProvider authentication by [@jlowin](https://github.com/jlowin) in [#1297](https://github.com/PrefectHQ/fastmcp/pull/1297)
* Add comprehensive OAuth 2.1 authentication system with WorkOS integration by [@jlowin](https://github.com/jlowin) in [#1327](https://github.com/PrefectHQ/fastmcp/pull/1327)
### Enhancements 🔧
* [🐶] Transform MCP Server Tools by [@strawgate](https://github.com/strawgate) in [#1132](https://github.com/PrefectHQ/fastmcp/pull/1132)
* Add --python, --project, and --with-requirements options to CLI commands by [@jlowin](https://github.com/jlowin) in [#1190](https://github.com/PrefectHQ/fastmcp/pull/1190)
* Support `fastmcp run mcp.json` by [@strawgate](https://github.com/strawgate) in [#1138](https://github.com/PrefectHQ/fastmcp/pull/1138)
* Support from __future__ import annotations by [@jlowin](https://github.com/jlowin) in [#1199](https://github.com/PrefectHQ/fastmcp/pull/1199)
* Optimize OpenAPI parser performance with single-pass schema processing by [@jlowin](https://github.com/jlowin) in [#1214](https://github.com/PrefectHQ/fastmcp/pull/1214)
* Log tool name on transform validation error by [@strawgate](https://github.com/strawgate) in [#1238](https://github.com/PrefectHQ/fastmcp/pull/1238)
* Refactor `get_http_request` and `context.session_id` by [@hopeful0](https://github.com/hopeful0) in [#1242](https://github.com/PrefectHQ/fastmcp/pull/1242)
* Support creating tool argument descriptions from string annotations by [@jlowin](https://github.com/jlowin) in [#1255](https://github.com/PrefectHQ/fastmcp/pull/1255)
* feat: Add Annotations support for resources and resource templates by [@chughtapan](https://github.com/chughtapan) in [#1260](https://github.com/PrefectHQ/fastmcp/pull/1260)
* Add UV Transport by [@strawgate](https://github.com/strawgate) in [#1270](https://github.com/PrefectHQ/fastmcp/pull/1270)
* Improve OpenAPI-to-JSONSchema conversion utilities by [@jlowin](https://github.com/jlowin) in [#1283](https://github.com/PrefectHQ/fastmcp/pull/1283)
* Ensure proxy components forward meta dicts by [@jlowin](https://github.com/jlowin) in [#1282](https://github.com/PrefectHQ/fastmcp/pull/1282)
* fix: server argument passing in CLI run command by [@chughtapan](https://github.com/chughtapan) in [#1293](https://github.com/PrefectHQ/fastmcp/pull/1293)
* Add meta support to tool transformation utilities by [@jlowin](https://github.com/jlowin) in [#1295](https://github.com/PrefectHQ/fastmcp/pull/1295)
* feat: Allow Resource Metadata URL as field in OAuthProvider by [@dacamposol](https://github.com/dacamposol) in [#1287](https://github.com/PrefectHQ/fastmcp/pull/1287)
* Use a simple overwrite instead of a merge for meta by [@jlowin](https://github.com/jlowin) in [#1296](https://github.com/PrefectHQ/fastmcp/pull/1296)
* Remove unused TimedCache by [@strawgate](https://github.com/strawgate) in [#1303](https://github.com/PrefectHQ/fastmcp/pull/1303)
* refactor: standardize logging usage across OpenAPI utilities by [@chi2liu](https://github.com/chi2liu) in [#1322](https://github.com/PrefectHQ/fastmcp/pull/1322)
* perf: optimize OpenAPI parsing by reducing dict copy operations by [@chi2liu](https://github.com/chi2liu) in [#1321](https://github.com/PrefectHQ/fastmcp/pull/1321)
* Structured client-side logging by [@cjermain](https://github.com/cjermain) in [#1326](https://github.com/PrefectHQ/fastmcp/pull/1326)
### Fixes 🐞
* fix: preserve def reference when referenced in allOf / oneOf / anyOf by [@algirdasci](https://github.com/algirdasci) in [#1208](https://github.com/PrefectHQ/fastmcp/pull/1208)
* fix: add type hint to custom_route decorator by [@zzstoatzz](https://github.com/zzstoatzz) in [#1210](https://github.com/PrefectHQ/fastmcp/pull/1210)
* chore: typo by [@richardkmichael](https://github.com/richardkmichael) in [#1216](https://github.com/PrefectHQ/fastmcp/pull/1216)
* fix: handle non-string $ref values in experimental OpenAPI parser by [@jlowin](https://github.com/jlowin) in [#1217](https://github.com/PrefectHQ/fastmcp/pull/1217)
* Skip repeated type conversion and validation in proxy client elicitation handler by [@chughtapan](https://github.com/chughtapan) in [#1222](https://github.com/PrefectHQ/fastmcp/pull/1222)
* Ensure default fields are not marked nullable by [@jlowin](https://github.com/jlowin) in [#1224](https://github.com/PrefectHQ/fastmcp/pull/1224)
* Fix stateful proxy client mixing in multi-proxies sessions by [@hopeful0](https://github.com/hopeful0) in [#1245](https://github.com/PrefectHQ/fastmcp/pull/1245)
* Fix invalid async context manager usage in proxy documentation by [@zzstoatzz](https://github.com/zzstoatzz) in [#1246](https://github.com/PrefectHQ/fastmcp/pull/1246)
* fix: experimental FastMCPOpenAPI server lost headers in request when __init__(client with headers) by [@itaru2622](https://github.com/itaru2622) in [#1254](https://github.com/PrefectHQ/fastmcp/pull/1254)
* Fix typing, add tests for tool call middleware by [@jlowin](https://github.com/jlowin) in [#1269](https://github.com/PrefectHQ/fastmcp/pull/1269)
* Fix: prune hidden parameter defs by [@muhammadkhalid-03](https://github.com/muhammadkhalid-03) in [#1257](https://github.com/PrefectHQ/fastmcp/pull/1257)
* Fix nullable field handling in OpenAPI to JSON Schema conversion by [@jlowin](https://github.com/jlowin) in [#1279](https://github.com/PrefectHQ/fastmcp/pull/1279)
* Ensure fastmcp run supports v1 servers by [@jlowin](https://github.com/jlowin) in [#1332](https://github.com/PrefectHQ/fastmcp/pull/1332)
### Breaking Changes 🛫
* Change server flag to --name by [@jlowin](https://github.com/jlowin) in [#1248](https://github.com/PrefectHQ/fastmcp/pull/1248)
### Docs 📚
* Remove unused import from FastAPI integration documentation by [@mariotaddeucci](https://github.com/mariotaddeucci) in [#1194](https://github.com/PrefectHQ/fastmcp/pull/1194)
* Update fastapi docs by [@jlowin](https://github.com/jlowin) in [#1198](https://github.com/PrefectHQ/fastmcp/pull/1198)
* Add docs for context state management by [@jlowin](https://github.com/jlowin) in [#1227](https://github.com/PrefectHQ/fastmcp/pull/1227)
* Permit.io integration docs by [@orweis](https://github.com/orweis) in [#1226](https://github.com/PrefectHQ/fastmcp/pull/1226)
* Update docs to reflect sync tools by [@jlowin](https://github.com/jlowin) in [#1234](https://github.com/PrefectHQ/fastmcp/pull/1234)
* Update changelog.mdx by [@jlowin](https://github.com/jlowin) in [#1235](https://github.com/PrefectHQ/fastmcp/pull/1235)
* Update SDK docs by [@jlowin](https://github.com/jlowin) in [#1236](https://github.com/PrefectHQ/fastmcp/pull/1236)
* Update --name flag documentation for Cursor/Claude by [@adam-conway](https://github.com/adam-conway) in [#1239](https://github.com/PrefectHQ/fastmcp/pull/1239)
* Add annotations docs by [@jlowin](https://github.com/jlowin) in [#1268](https://github.com/PrefectHQ/fastmcp/pull/1268)
* Update openapi/fastapi URLs README.md by [@jbn](https://github.com/jbn) in [#1278](https://github.com/PrefectHQ/fastmcp/pull/1278)
* Add 2.11 version badge for state management by [@jlowin](https://github.com/jlowin) in [#1289](https://github.com/PrefectHQ/fastmcp/pull/1289)
* Add meta parameter support to tools, resources, templates, and prompts decorators by [@jlowin](https://github.com/jlowin) in [#1294](https://github.com/PrefectHQ/fastmcp/pull/1294)
* docs: update get_state and set_state references by [@Maxi91f](https://github.com/Maxi91f) in [#1306](https://github.com/PrefectHQ/fastmcp/pull/1306)
* Add unit tests and docs for denying tool calls with middleware by [@jlowin](https://github.com/jlowin) in [#1333](https://github.com/PrefectHQ/fastmcp/pull/1333)
* Remove reference to stacked decorators by [@jlowin](https://github.com/jlowin) in [#1334](https://github.com/PrefectHQ/fastmcp/pull/1334)
* Eunomia authorization server can run embedded within the MCP server by [@tommitt](https://github.com/tommitt) in [#1317](https://github.com/PrefectHQ/fastmcp/pull/1317)
### Other Changes 🦾
* Update README.md by [@jlowin](https://github.com/jlowin) in [#1230](https://github.com/PrefectHQ/fastmcp/pull/1230)
* Logcapture addition to test_server file by [@Sourav-Tripathy](https://github.com/Sourav-Tripathy) in [#1229](https://github.com/PrefectHQ/fastmcp/pull/1229)
* Add tests for headers with both legacy and experimental openapi parser by [@jlowin](https://github.com/jlowin) in [#1259](https://github.com/PrefectHQ/fastmcp/pull/1259)
* Small clean-up from MCP Tool Transform PR by [@strawgate](https://github.com/strawgate) in [#1267](https://github.com/PrefectHQ/fastmcp/pull/1267)
* Add test for proxy tags visibility by [@jlowin](https://github.com/jlowin) in [#1302](https://github.com/PrefectHQ/fastmcp/pull/1302)
* Add unit test for sampling with image messages by [@jlowin](https://github.com/jlowin) in [#1329](https://github.com/PrefectHQ/fastmcp/pull/1329)
* Remove redundant resource_metadata_url assignment by [@jlowin](https://github.com/jlowin) in [#1328](https://github.com/PrefectHQ/fastmcp/pull/1328)
* Update bug.yml by [@jlowin](https://github.com/jlowin) in [#1331](https://github.com/PrefectHQ/fastmcp/pull/1331)
* Ensure validation errors are raised when masked by [@jlowin](https://github.com/jlowin) in [#1330](https://github.com/PrefectHQ/fastmcp/pull/1330)

## New Contributors
* [@mariotaddeucci](https://github.com/mariotaddeucci) made their first contribution in [#1194](https://github.com/PrefectHQ/fastmcp/pull/1194)
* [@algirdasci](https://github.com/algirdasci) made their first contribution in [#1208](https://github.com/PrefectHQ/fastmcp/pull/1208)
* [@chughtapan](https://github.com/chughtapan) made their first contribution in [#1222](https://github.com/PrefectHQ/fastmcp/pull/1222)
* [@mukulmurthy](https://github.com/mukulmurthy) made their first contribution in [#1160](https://github.com/PrefectHQ/fastmcp/pull/1160)
* [@orweis](https://github.com/orweis) made their first contribution in [#1226](https://github.com/PrefectHQ/fastmcp/pull/1226)
* [@Sourav-Tripathy](https://github.com/Sourav-Tripathy) made their first contribution in [#1229](https://github.com/PrefectHQ/fastmcp/pull/1229)
* [@adam-conway](https://github.com/adam-conway) made their first contribution in [#1239](https://github.com/PrefectHQ/fastmcp/pull/1239)
* [@muhammadkhalid-03](https://github.com/muhammadkhalid-03) made their first contribution in [#1257](https://github.com/PrefectHQ/fastmcp/pull/1257)
* [@jbn](https://github.com/jbn) made their first contribution in [#1278](https://github.com/PrefectHQ/fastmcp/pull/1278)
* [@dacamposol](https://github.com/dacamposol) made their first contribution in [#1287](https://github.com/PrefectHQ/fastmcp/pull/1287)
* [@chi2liu](https://github.com/chi2liu) made their first contribution in [#1322](https://github.com/PrefectHQ/fastmcp/pull/1322)
* [@cjermain](https://github.com/cjermain) made their first contribution in [#1326](https://github.com/PrefectHQ/fastmcp/pull/1326)

**Full Changelog**: [v2.10.6...v2.11.0](https://github.com/PrefectHQ/fastmcp/compare/v2.10.6...v2.11.0)

</Update>

<Update label="v2.10.6" description="2025-07-19">

## [v2.10.6: Hymn for the Weekend](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.6)

A special Saturday release with many fixes.

## What's Changed
### Enhancements 🔧
* Resolve #1139 -- Implement include_context argument in Context.sample by [@codingjoe](https://github.com/codingjoe) in [#1141](https://github.com/PrefectHQ/fastmcp/pull/1141)
* feat(settings): add log level normalization by [@ka2048](https://github.com/ka2048) in [#1171](https://github.com/PrefectHQ/fastmcp/pull/1171)
* add server name to mounted server warnings by [@artificial-aidan](https://github.com/artificial-aidan) in [#1147](https://github.com/PrefectHQ/fastmcp/pull/1147)
* Add StatefulProxyClient by [@hopeful0](https://github.com/hopeful0) in [#1109](https://github.com/PrefectHQ/fastmcp/pull/1109)
### Fixes 🐞
* Fix OpenAPI empty parameters by [@FabrizioSandri](https://github.com/FabrizioSandri) in [#1128](https://github.com/PrefectHQ/fastmcp/pull/1128)
* Fix title field preservation in tool transformations by [@jlowin](https://github.com/jlowin) in [#1131](https://github.com/PrefectHQ/fastmcp/pull/1131)
* Fix optional parameter validation in OpenAPI integration by [@jlowin](https://github.com/jlowin) in [#1135](https://github.com/PrefectHQ/fastmcp/pull/1135)
* Do not silently exclude the "context" key from JSON body by [@melkamar](https://github.com/melkamar) in [#1153](https://github.com/PrefectHQ/fastmcp/pull/1153)
* Fix tool output schema generation to respect Pydantic serialization aliases by [@zzstoatzz](https://github.com/zzstoatzz) in [#1148](https://github.com/PrefectHQ/fastmcp/pull/1148)
* fix: _replace_ref_with_defs; ensure ref_path is string by [@itaru2622](https://github.com/itaru2622) in [#1164](https://github.com/PrefectHQ/fastmcp/pull/1164)
* Fix nesting when making OpenAPI arrays and objects optional by [@melkamar](https://github.com/melkamar) in [#1178](https://github.com/PrefectHQ/fastmcp/pull/1178)
* Fix `mcp-json` output format to include server name by [@jlowin](https://github.com/jlowin) in [#1185](https://github.com/PrefectHQ/fastmcp/pull/1185)
* Only configure logging one time by [@jlowin](https://github.com/jlowin) in [#1187](https://github.com/PrefectHQ/fastmcp/pull/1187)
### Docs 📚
* Update changelog.mdx by [@jlowin](https://github.com/jlowin) in [#1127](https://github.com/PrefectHQ/fastmcp/pull/1127)
* Eunomia Authorization with native FastMCP's Middleware by [@tommitt](https://github.com/tommitt) in [#1144](https://github.com/PrefectHQ/fastmcp/pull/1144)
* update api ref for new `mdxify` version by [@zzstoatzz](https://github.com/zzstoatzz) in [#1182](https://github.com/PrefectHQ/fastmcp/pull/1182)
### Other Changes 🦾
* Expand empty parameter filtering and add comprehensive tests by [@jlowin](https://github.com/jlowin) in [#1129](https://github.com/PrefectHQ/fastmcp/pull/1129)
* Add no-commit-to-branch hook by [@zzstoatzz](https://github.com/zzstoatzz) in [#1149](https://github.com/PrefectHQ/fastmcp/pull/1149)
* Update README.md by [@jlowin](https://github.com/jlowin) in [#1165](https://github.com/PrefectHQ/fastmcp/pull/1165)
* skip on rate limit by [@zzstoatzz](https://github.com/zzstoatzz) in [#1183](https://github.com/PrefectHQ/fastmcp/pull/1183)
* Remove deprecated proxy creation by [@jlowin](https://github.com/jlowin) in [#1186](https://github.com/PrefectHQ/fastmcp/pull/1186)
* Separate integration tests from unit tests in CI by [@jlowin](https://github.com/jlowin) in [#1188](https://github.com/PrefectHQ/fastmcp/pull/1188)

## New Contributors
* [@FabrizioSandri](https://github.com/FabrizioSandri) made their first contribution in [#1128](https://github.com/PrefectHQ/fastmcp/pull/1128)
* [@melkamar](https://github.com/melkamar) made their first contribution in [#1153](https://github.com/PrefectHQ/fastmcp/pull/1153)
* [@codingjoe](https://github.com/codingjoe) made their first contribution in [#1141](https://github.com/PrefectHQ/fastmcp/pull/1141)
* [@itaru2622](https://github.com/itaru2622) made their first contribution in [#1164](https://github.com/PrefectHQ/fastmcp/pull/1164)
* [@ka2048](https://github.com/ka2048) made their first contribution in [#1171](https://github.com/PrefectHQ/fastmcp/pull/1171)
* [@artificial-aidan](https://github.com/artificial-aidan) made their first contribution in [#1147](https://github.com/PrefectHQ/fastmcp/pull/1147)

**Full Changelog**: [v2.10.5...v2.10.6](https://github.com/PrefectHQ/fastmcp/compare/v2.10.5...v2.10.6)

</Update>

<Update label="v2.10.5" description="2025-07-11">

## [v2.10.5: Middle Management](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.5)

A maintenance release focused on OpenAPI refinements and middleware fixes, plus console improvements.

## What's Changed
### Enhancements 🔧
* Fix Claude Code CLI detection for npm global installations by [@jlowin](https://github.com/jlowin) in [#1106](https://github.com/PrefectHQ/fastmcp/pull/1106)
* Fix OpenAPI parameter name collisions with location suffixing by [@jlowin](https://github.com/jlowin) in [#1107](https://github.com/PrefectHQ/fastmcp/pull/1107)
* Add mirrored component support for proxy servers by [@jlowin](https://github.com/jlowin) in [#1105](https://github.com/PrefectHQ/fastmcp/pull/1105)
### Fixes 🐞
* Fix OpenAPI deepObject style parameter encoding by [@jlowin](https://github.com/jlowin) in [#1122](https://github.com/PrefectHQ/fastmcp/pull/1122)
* xfail when github token is not set ('' or None) by [@jlowin](https://github.com/jlowin) in [#1123](https://github.com/PrefectHQ/fastmcp/pull/1123)
* fix: replace oneOf with anyOf in OpenAPI output schemas by [@MagnusS0](https://github.com/MagnusS0) in [#1119](https://github.com/PrefectHQ/fastmcp/pull/1119)
* Fix middleware list result types by [@jlowin](https://github.com/jlowin) in [#1125](https://github.com/PrefectHQ/fastmcp/pull/1125)
* Improve console width for logo by [@jlowin](https://github.com/jlowin) in [#1126](https://github.com/PrefectHQ/fastmcp/pull/1126)
### Docs 📚
* Improve transport + integration docs by [@jlowin](https://github.com/jlowin) in [#1103](https://github.com/PrefectHQ/fastmcp/pull/1103)
* Update proxy.mdx by [@coldfire-x](https://github.com/coldfire-x) in [#1108](https://github.com/PrefectHQ/fastmcp/pull/1108)
### Other Changes 🦾
* Update github remote server tests with secret by [@jlowin](https://github.com/jlowin) in [#1112](https://github.com/PrefectHQ/fastmcp/pull/1112)

## New Contributors
* [@coldfire-x](https://github.com/coldfire-x) made their first contribution in [#1108](https://github.com/PrefectHQ/fastmcp/pull/1108)
* [@MagnusS0](https://github.com/MagnusS0) made their first contribution in [#1119](https://github.com/PrefectHQ/fastmcp/pull/1119)

**Full Changelog**: [v2.10.4...v2.10.5](https://github.com/PrefectHQ/fastmcp/compare/v2.10.4...v2.10.5)

</Update>

<Update label="v2.10.4" description="2025-07-09">

## [v2.10.4: Transport-ation](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.4)

A quick fix to ensure the CLI accepts "streamable-http" as a valid transport option.

## What's Changed
### Fixes 🐞
* Ensure the CLI accepts "streamable-http" as a valid transport by [@jlowin](https://github.com/jlowin) in [#1099](https://github.com/PrefectHQ/fastmcp/pull/1099)

**Full Changelog**: [v2.10.3...v2.10.4](https://github.com/PrefectHQ/fastmcp/compare/v2.10.3...v2.10.4)

</Update>

<Update label="v2.10.3" description="2025-07-09">

## [v2.10.3: CLI Me a River](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.3)

A major CLI overhaul featuring a complete refactor from typer to cyclopts, new IDE integrations, and comprehensive OpenAPI improvements.

## What's Changed
### New Features 🎉
* Refactor CLI from typer to cyclopts and add comprehensive tests by [@jlowin](https://github.com/jlowin) in [#1062](https://github.com/PrefectHQ/fastmcp/pull/1062)
* Add output schema support for OpenAPI tools by [@jlowin](https://github.com/jlowin) in [#1073](https://github.com/PrefectHQ/fastmcp/pull/1073)
### Enhancements 🔧
* Add Cursor support via CLI integration by [@jlowin](https://github.com/jlowin) in [#1052](https://github.com/PrefectHQ/fastmcp/pull/1052)
* Add Claude Code install integration by [@jlowin](https://github.com/jlowin) in [#1053](https://github.com/PrefectHQ/fastmcp/pull/1053)
* Generate MCP JSON config output from CLI as new `fastmcp install` command by [@jlowin](https://github.com/jlowin) in [#1056](https://github.com/PrefectHQ/fastmcp/pull/1056)
* Use isawaitable instead of iscoroutine by [@jlowin](https://github.com/jlowin) in [#1059](https://github.com/PrefectHQ/fastmcp/pull/1059)
* feat: Add `--path` Option to CLI for HTTP/SSE Route by [@davidbk-legit](https://github.com/davidbk-legit) in [#1087](https://github.com/PrefectHQ/fastmcp/pull/1087)
* Fix concurrent proxy client operations with session isolation by [@jlowin](https://github.com/jlowin) in [#1083](https://github.com/PrefectHQ/fastmcp/pull/1083)
### Fixes 🐞
* Refactor Client context management to avoid concurrency issue by [@hopeful0](https://github.com/hopeful0) in [#1054](https://github.com/PrefectHQ/fastmcp/pull/1054)
* Keep json schema $defs on transform by [@strawgate](https://github.com/strawgate) in [#1066](https://github.com/PrefectHQ/fastmcp/pull/1066)
* Ensure fastmcp version copy is plaintext by [@jlowin](https://github.com/jlowin) in [#1071](https://github.com/PrefectHQ/fastmcp/pull/1071)
* Fix single-element list unwrapping in tool content by [@jlowin](https://github.com/jlowin) in [#1074](https://github.com/PrefectHQ/fastmcp/pull/1074)
* Fix max recursion error when pruning OpenAPI definitions by [@dimitribarbot](https://github.com/dimitribarbot) in [#1092](https://github.com/PrefectHQ/fastmcp/pull/1092)
* Fix OpenAPI tool name registration when modified by mcp_component_fn by [@jlowin](https://github.com/jlowin) in [#1096](https://github.com/PrefectHQ/fastmcp/pull/1096)
### Docs 📚
* Docs: add example of more concise way to use bearer auth by [@neilconway](https://github.com/neilconway) in [#1055](https://github.com/PrefectHQ/fastmcp/pull/1055)
* Update favicon by [@jlowin](https://github.com/jlowin) in [#1058](https://github.com/PrefectHQ/fastmcp/pull/1058)
* Update environment note by [@jlowin](https://github.com/jlowin) in [#1075](https://github.com/PrefectHQ/fastmcp/pull/1075)
* Add fastmcp version --copy documentation by [@jlowin](https://github.com/jlowin) in [#1076](https://github.com/PrefectHQ/fastmcp/pull/1076)
### Other Changes 🦾
* Remove asserts and add documentation following #1054 by [@jlowin](https://github.com/jlowin) in [#1057](https://github.com/PrefectHQ/fastmcp/pull/1057)
* Add --copy flag for fastmcp version by [@jlowin](https://github.com/jlowin) in [#1063](https://github.com/PrefectHQ/fastmcp/pull/1063)
* Fix docstring format for fastmcp.client.Client by [@neilconway](https://github.com/neilconway) in [#1094](https://github.com/PrefectHQ/fastmcp/pull/1094)

## New Contributors
* [@neilconway](https://github.com/neilconway) made their first contribution in [#1055](https://github.com/PrefectHQ/fastmcp/pull/1055)
* [@davidbk-legit](https://github.com/davidbk-legit) made their first contribution in [#1087](https://github.com/PrefectHQ/fastmcp/pull/1087)
* [@dimitribarbot](https://github.com/dimitribarbot) made their first contribution in [#1092](https://github.com/PrefectHQ/fastmcp/pull/1092)

**Full Changelog**: [v2.10.2...v2.10.3](https://github.com/PrefectHQ/fastmcp/compare/v2.10.2...v2.10.3)

</Update>

<Update label="v2.10.2" description="2025-07-05">

## [v2.10.2: Forward March](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.2)

The headline feature of this release is the ability to "forward" advanced MCP interactions like logging, progress, and elicitation through proxy servers. If the remote server requests an elicitation, the proxy client will pass that request to the new, "ultimate" client.

## What's Changed
### New Features 🎉
* Proxy support advanced MCP features by [@hopeful0](https://github.com/hopeful0) in [#1022](https://github.com/PrefectHQ/fastmcp/pull/1022)
### Enhancements 🔧
* Re-add splash screen by [@jlowin](https://github.com/jlowin) in [#1027](https://github.com/PrefectHQ/fastmcp/pull/1027)
* Reduce banner padding by [@jlowin](https://github.com/jlowin) in [#1030](https://github.com/PrefectHQ/fastmcp/pull/1030)
* Allow per-server timeouts in MCPConfig by [@cegersdoerfer](https://github.com/cegersdoerfer) in [#1031](https://github.com/PrefectHQ/fastmcp/pull/1031)
* Support 'scp' claim for OAuth scopes in BearerAuthProvider by [@jlowin](https://github.com/jlowin) in [#1033](https://github.com/PrefectHQ/fastmcp/pull/1033)
* Add path expansion to image/audio/file by [@jlowin](https://github.com/jlowin) in [#1038](https://github.com/PrefectHQ/fastmcp/pull/1038)
* Ensure multi-client configurations use new ProxyClient by [@jlowin](https://github.com/jlowin) in [#1045](https://github.com/PrefectHQ/fastmcp/pull/1045)
### Fixes 🐞
* Expose stateless_http kwarg for mcp.run() by [@jlowin](https://github.com/jlowin) in [#1018](https://github.com/PrefectHQ/fastmcp/pull/1018)
* Avoid propagating logs by [@jlowin](https://github.com/jlowin) in [#1042](https://github.com/PrefectHQ/fastmcp/pull/1042)
### Docs 📚
* Clean up docs by [@jlowin](https://github.com/jlowin) in [#1028](https://github.com/PrefectHQ/fastmcp/pull/1028)
* Docs: clarify server URL paths for ChatGPT integration by [@thap2331](https://github.com/thap2331) in [#1017](https://github.com/PrefectHQ/fastmcp/pull/1017)
### Other Changes 🦾
* Split giant openapi test file into smaller files by [@jlowin](https://github.com/jlowin) in [#1034](https://github.com/PrefectHQ/fastmcp/pull/1034)
* Add comprehensive OpenAPI 3.0 vs 3.1 compatibility tests by [@jlowin](https://github.com/jlowin) in [#1035](https://github.com/PrefectHQ/fastmcp/pull/1035)
* Update banner and use console.log by [@jlowin](https://github.com/jlowin) in [#1041](https://github.com/PrefectHQ/fastmcp/pull/1041)

## New Contributors
* [@cegersdoerfer](https://github.com/cegersdoerfer) made their first contribution in [#1031](https://github.com/PrefectHQ/fastmcp/pull/1031)
* [@hopeful0](https://github.com/hopeful0) made their first contribution in [#1022](https://github.com/PrefectHQ/fastmcp/pull/1022)
* [@thap2331](https://github.com/thap2331) made their first contribution in [#1017](https://github.com/PrefectHQ/fastmcp/pull/1017)

**Full Changelog**: [v2.10.1...v2.10.2](https://github.com/PrefectHQ/fastmcp/compare/v2.10.1...v2.10.2)

</Update>

<Update label="v2.10.1" description="2025-07-02">

## [v2.10.1: Revert to Sender](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.1)

A quick patch to revert the CLI banner that was added in v2.10.0.

## What's Changed
### Docs 📚
* Update changelog.mdx by [@jlowin](https://github.com/jlowin) in [#1009](https://github.com/PrefectHQ/fastmcp/pull/1009)
* Revert "Add CLI banner" by [@jlowin](https://github.com/jlowin) in [#1011](https://github.com/PrefectHQ/fastmcp/pull/1011)

**Full Changelog**: [v2.10.0...v2.10.1](https://github.com/PrefectHQ/fastmcp/compare/v2.10.0...v2.10.1)

</Update>

<Update label="v2.10.0" description="2024-07-01">

## [v2.10.0: Great Spec-tations](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.0)

FastMCP 2.10 brings full compliance with the 6/18/2025 MCP spec update, introducing elicitation support for dynamic server-client communication and output schemas for structured tool responses. Please note that due to these changes, this release also includes a breaking change to the return signature of `client.call_tool()`.

### Elicitation Support
Elicitation allows MCP servers to request additional information from clients during tool execution, enabling more interactive and dynamic server behavior. This opens up new possibilities for tools that need user input or confirmation during execution.

### Output Schemas
Tools can now define structured output schemas, ensuring that responses conform to expected formats and making tool integration more predictable and type-safe.

## What's Changed
### New Features 🎉
* MCP 6/18/25: Add output schema to tools by [@jlowin](https://github.com/jlowin) in [#901](https://github.com/PrefectHQ/fastmcp/pull/901)
* MCP 6/18/25: Elicitation support by [@jlowin](https://github.com/jlowin) in [#889](https://github.com/PrefectHQ/fastmcp/pull/889)
### Enhancements 🔧
* Update types + tests for SDK changes by [@jlowin](https://github.com/jlowin) in [#888](https://github.com/PrefectHQ/fastmcp/pull/888)
* MCP 6/18/25: Update auth primitives by [@jlowin](https://github.com/jlowin) in [#966](https://github.com/PrefectHQ/fastmcp/pull/966)
* Add OpenAPI extensions support to HTTPRoute by [@maddymanu](https://github.com/maddymanu) in [#977](https://github.com/PrefectHQ/fastmcp/pull/977)
* Add title field support to FastMCP components by [@jlowin](https://github.com/jlowin) in [#982](https://github.com/PrefectHQ/fastmcp/pull/982)
* Support implicit Elicitation acceptance by [@jlowin](https://github.com/jlowin) in [#983](https://github.com/PrefectHQ/fastmcp/pull/983)
* Support 'no response' elicitation requests by [@jlowin](https://github.com/jlowin) in [#992](https://github.com/PrefectHQ/fastmcp/pull/992)
* Add Support for Configurable Algorithms by [@sstene1](https://github.com/sstene1) in [#997](https://github.com/PrefectHQ/fastmcp/pull/997)
### Fixes 🐞
* Improve stdio error handling to raise connection failures immediately by [@jlowin](https://github.com/jlowin) in [#984](https://github.com/PrefectHQ/fastmcp/pull/984)
* Fix type hints for FunctionResource:fn by [@CfirTsabari](https://github.com/CfirTsabari) in [#986](https://github.com/PrefectHQ/fastmcp/pull/986)
* Update link to OpenAI MCP example by [@mossbanay](https://github.com/mossbanay) in [#985](https://github.com/PrefectHQ/fastmcp/pull/985)
* Fix output schema generation edge case by [@jlowin](https://github.com/jlowin) in [#995](https://github.com/PrefectHQ/fastmcp/pull/995)
* Refactor array parameter formatting to reduce code duplication by [@jlowin](https://github.com/jlowin) in [#1007](https://github.com/PrefectHQ/fastmcp/pull/1007)
* Fix OpenAPI array parameter explode handling by [@jlowin](https://github.com/jlowin) in [#1008](https://github.com/PrefectHQ/fastmcp/pull/1008)
### Breaking Changes 🛫
* MCP 6/18/25: Upgrade to mcp 1.10 by [@jlowin](https://github.com/jlowin) in [#887](https://github.com/PrefectHQ/fastmcp/pull/887)
### Docs 📚
* Update middleware imports and documentation by [@jlowin](https://github.com/jlowin) in [#999](https://github.com/PrefectHQ/fastmcp/pull/999)
* Update OpenAI docs by [@jlowin](https://github.com/jlowin) in [#1001](https://github.com/PrefectHQ/fastmcp/pull/1001)
* Add CLI banner by [@jlowin](https://github.com/jlowin) in [#1005](https://github.com/PrefectHQ/fastmcp/pull/1005)
### Examples & Contrib 💡
* Component Manager by [@gorocode](https://github.com/gorocode) in [#976](https://github.com/PrefectHQ/fastmcp/pull/976)
### Other Changes 🦾
* Minor auth improvements by [@jlowin](https://github.com/jlowin) in [#967](https://github.com/PrefectHQ/fastmcp/pull/967)
* Add .ccignore for copychat by [@jlowin](https://github.com/jlowin) in [#1000](https://github.com/PrefectHQ/fastmcp/pull/1000)

## New Contributors
* [@maddymanu](https://github.com/maddymanu) made their first contribution in [#977](https://github.com/PrefectHQ/fastmcp/pull/977)
* [@github0hello](https://github.com/github0hello) made their first contribution in [#979](https://github.com/PrefectHQ/fastmcp/pull/979)
* [@tommitt](https://github.com/tommitt) made their first contribution in [#975](https://github.com/PrefectHQ/fastmcp/pull/975)
* [@CfirTsabari](https://github.com/CfirTsabari) made their first contribution in [#986](https://github.com/PrefectHQ/fastmcp/pull/986)
* [@mossbanay](https://github.com/mossbanay) made their first contribution in [#985](https://github.com/PrefectHQ/fastmcp/pull/985)
* [@sstene1](https://github.com/sstene1) made their first contribution in [#997](https://github.com/PrefectHQ/fastmcp/pull/997)

**Full Changelog**: [v2.9.2...v2.10.0](https://github.com/PrefectHQ/fastmcp/compare/v2.9.2...v2.10.0)

</Update>

<Update label="v2.9.2" description="2024-06-26">

## [v2.9.2: Safety Pin](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.9.2)

This is a patch release to pin `mcp` below 1.10, which includes changes related to the 6/18/2025 MCP spec update and could potentially break functionality for some FastMCP users.

## What's Changed
### Docs 📚
* Fix version badge for messages by [@jlowin](https://github.com/jlowin) in [#960](https://github.com/PrefectHQ/fastmcp/pull/960)
### Dependencies 📦
* Pin mcp dependency by [@jlowin](https://github.com/jlowin) in [#962](https://github.com/PrefectHQ/fastmcp/pull/962)

**Full Changelog**: [v2.9.1...v2.9.2](https://github.com/PrefectHQ/fastmcp/compare/v2.9.1...v2.9.2)

</Update>

<Update label="v2.9.1" description="2024-06-26">

## [v2.9.1: Call Me Maybe](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.9.1)

FastMCP 2.9.1 introduces automatic MCP list change notifications, allowing servers to notify clients when tools, resources, or prompts are dynamically updated. This enables more responsive and adaptive MCP integrations.

## What's Changed
### New Features 🎉
* Add automatic MCP list change notifications and client message handling by [@jlowin](https://github.com/jlowin) in [#939](https://github.com/PrefectHQ/fastmcp/pull/939)
### Enhancements 🔧
* Add debug logging to bearer token authentication by [@jlowin](https://github.com/jlowin) in [#952](https://github.com/PrefectHQ/fastmcp/pull/952)
### Fixes 🐞
* Fix duplicate error logging in exception handlers by [@jlowin](https://github.com/jlowin) in [#938](https://github.com/PrefectHQ/fastmcp/pull/938)
* Fix parameter location enum handling in OpenAPI parser by [@jlowin](https://github.com/jlowin) in [#953](https://github.com/PrefectHQ/fastmcp/pull/953)
* Fix external schema reference handling in OpenAPI parser by [@jlowin](https://github.com/jlowin) in [#954](https://github.com/PrefectHQ/fastmcp/pull/954)
### Docs 📚
* Update changelog for 2.9 release by [@jlowin](https://github.com/jlowin) in [#929](https://github.com/PrefectHQ/fastmcp/pull/929)
* Regenerate API references by [@zzstoatzz](https://github.com/zzstoatzz) in [#935](https://github.com/PrefectHQ/fastmcp/pull/935)
* Regenerate API references by [@zzstoatzz](https://github.com/zzstoatzz) in [#947](https://github.com/PrefectHQ/fastmcp/pull/947)
* Regenerate API references by [@zzstoatzz](https://github.com/zzstoatzz) in [#949](https://github.com/PrefectHQ/fastmcp/pull/949)
### Examples & Contrib 💡
* Add `create_thread` tool to bsky MCP server by [@zzstoatzz](https://github.com/zzstoatzz) in [#927](https://github.com/PrefectHQ/fastmcp/pull/927)
* Update `mount_example.py` to work with current fastmcp API by [@rajephon](https://github.com/rajephon) in [#957](https://github.com/PrefectHQ/fastmcp/pull/957)

## New Contributors
* [@rajephon](https://github.com/rajephon) made their first contribution in [#957](https://github.com/PrefectHQ/fastmcp/pull/957)

**Full Changelog**: [v2.9.0...v2.9.1](https://github.com/PrefectHQ/fastmcp/compare/v2.9.0...v2.9.1)

</Update>

<Update label="v2.9.0" description="2024-06-23">

## [v2.9.0: Stuck in the Middleware With You](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.9.0)

FastMCP 2.9 introduces two important features that push beyond the basic MCP protocol: MCP Middleware and server-side type conversion.

### MCP Middleware
MCP middleware lets you intercept and modify requests and responses at the protocol level, giving you powerful capabilities for logging, authentication, validation, and more. This is particularly useful for building production-ready MCP servers that need sophisticated request handling.

### Server-side Type Conversion
This release also introduces server-side type conversion for prompt arguments, ensuring that data is properly formatted before being passed to your functions. This reduces the burden on individual tools and prompts to handle type validation and conversion.

## What's Changed
### New Features 🎉
* Add File utility for binary data by [@gorocode](https://github.com/gorocode) in [#843](https://github.com/PrefectHQ/fastmcp/pull/843)
* Consolidate prefix logic into FastMCP methods by [@jlowin](https://github.com/jlowin) in [#861](https://github.com/PrefectHQ/fastmcp/pull/861)
* Add MCP Middleware by [@jlowin](https://github.com/jlowin) in [#870](https://github.com/PrefectHQ/fastmcp/pull/870)
* Implement server-side type conversion for prompt arguments by [@jlowin](https://github.com/jlowin) in [#908](https://github.com/PrefectHQ/fastmcp/pull/908)
### Enhancements 🔧
* Fix tool description indentation issue by [@zfflxx](https://github.com/zfflxx) in [#845](https://github.com/PrefectHQ/fastmcp/pull/845)
* Add version parameter to FastMCP constructor by [@mkyutani](https://github.com/mkyutani) in [#842](https://github.com/PrefectHQ/fastmcp/pull/842)
* Update version to not be positional by [@jlowin](https://github.com/jlowin) in [#848](https://github.com/PrefectHQ/fastmcp/pull/848)
* Add key to component by [@jlowin](https://github.com/jlowin) in [#869](https://github.com/PrefectHQ/fastmcp/pull/869)
* Add session_id property to Context for data sharing by [@jlowin](https://github.com/jlowin) in [#881](https://github.com/PrefectHQ/fastmcp/pull/881)
* Fix CORS documentation example by [@jlowin](https://github.com/jlowin) in [#895](https://github.com/PrefectHQ/fastmcp/pull/895)
### Fixes 🐞
* "report_progress missing passing related_request_id causes notifications not working" by [@alexsee](https://github.com/alexsee) in [#838](https://github.com/PrefectHQ/fastmcp/pull/838)
* Fix JWT issuer validation to support string values per RFC 7519 by [@jlowin](https://github.com/jlowin) in [#892](https://github.com/PrefectHQ/fastmcp/pull/892)
* Fix BearerAuthProvider audience type annotations by [@jlowin](https://github.com/jlowin) in [#894](https://github.com/PrefectHQ/fastmcp/pull/894)
### Docs 📚
* Add CLAUDE.md development guidelines by [@jlowin](https://github.com/jlowin) in [#880](https://github.com/PrefectHQ/fastmcp/pull/880)
* Update context docs for session_id property by [@jlowin](https://github.com/jlowin) in [#882](https://github.com/PrefectHQ/fastmcp/pull/882)
* Add API reference by [@zzstoatzz](https://github.com/zzstoatzz) in [#893](https://github.com/PrefectHQ/fastmcp/pull/893)
* Fix API ref rendering by [@zzstoatzz](https://github.com/zzstoatzz) in [#900](https://github.com/PrefectHQ/fastmcp/pull/900)
* Simplify docs nav by [@jlowin](https://github.com/jlowin) in [#902](https://github.com/PrefectHQ/fastmcp/pull/902)
* Add fastmcp inspect command by [@jlowin](https://github.com/jlowin) in [#904](https://github.com/PrefectHQ/fastmcp/pull/904)
* Update client docs by [@jlowin](https://github.com/jlowin) in [#912](https://github.com/PrefectHQ/fastmcp/pull/912)
* Update docs nav by [@jlowin](https://github.com/jlowin) in [#913](https://github.com/PrefectHQ/fastmcp/pull/913)
* Update integration documentation for Claude Desktop, ChatGPT, and Claude Code by [@jlowin](https://github.com/jlowin) in [#915](https://github.com/PrefectHQ/fastmcp/pull/915)
* Add http as an alias for streamable http by [@jlowin](https://github.com/jlowin) in [#917](https://github.com/PrefectHQ/fastmcp/pull/917)
* Clean up parameter documentation by [@jlowin](https://github.com/jlowin) in [#918](https://github.com/PrefectHQ/fastmcp/pull/918)
* Add middleware examples for timing, logging, rate limiting, and error handling by [@jlowin](https://github.com/jlowin) in [#919](https://github.com/PrefectHQ/fastmcp/pull/919)
* ControlFlow → FastMCP rename by [@jlowin](https://github.com/jlowin) in [#922](https://github.com/PrefectHQ/fastmcp/pull/922)
### Examples & Contrib 💡
* Add contrib.mcp_mixin support for annotations by [@rsp2k](https://github.com/rsp2k) in [#860](https://github.com/PrefectHQ/fastmcp/pull/860)
* Add ATProto (Bluesky) MCP Server Example by [@zzstoatzz](https://github.com/zzstoatzz) in [#916](https://github.com/PrefectHQ/fastmcp/pull/916)
* Fix path in atproto example pyproject by [@zzstoatzz](https://github.com/zzstoatzz) in [#920](https://github.com/PrefectHQ/fastmcp/pull/920)
* Remove uv source in example by [@zzstoatzz](https://github.com/zzstoatzz) in [#921](https://github.com/PrefectHQ/fastmcp/pull/921)

## New Contributors
* [@alexsee](https://github.com/alexsee) made their first contribution in [#838](https://github.com/PrefectHQ/fastmcp/pull/838)
* [@zfflxx](https://github.com/zfflxx) made their first contribution in [#845](https://github.com/PrefectHQ/fastmcp/pull/845)
* [@mkyutani](https://github.com/mkyutani) made their first contribution in [#842](https://github.com/PrefectHQ/fastmcp/pull/842)
* [@gorocode](https://github.com/gorocode) made their first contribution in [#843](https://github.com/PrefectHQ/fastmcp/pull/843)
* [@rsp2k](https://github.com/rsp2k) made their first contribution in [#860](https://github.com/PrefectHQ/fastmcp/pull/860)
* [@owtaylor](https://github.com/owtaylor) made their first contribution in [#897](https://github.com/PrefectHQ/fastmcp/pull/897)
* [@Jason-CKY](https://github.com/Jason-CKY) made their first contribution in [#906](https://github.com/PrefectHQ/fastmcp/pull/906)

**Full Changelog**: [v2.8.1...v2.9.0](https://github.com/PrefectHQ/fastmcp/compare/v2.8.1...v2.9.0)

</Update>

<Update label="v2.8.1" description="2024-06-15">

## [v2.8.1: Sound Judgement](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.8.1)

2.8.1 introduces audio support, as well as minor fixes and updates for deprecated features.

### Audio Support
This release adds support for audio content in MCP tools and resources, expanding FastMCP's multimedia capabilities beyond text and images.

## What's Changed
### New Features 🎉
* Add audio support by [@jlowin](https://github.com/jlowin) in [#833](https://github.com/PrefectHQ/fastmcp/pull/833)
### Enhancements 🔧
* Add flag for disabling deprecation warnings by [@jlowin](https://github.com/jlowin) in [#802](https://github.com/PrefectHQ/fastmcp/pull/802)
* Add examples to Tool Arg Param transformation by [@strawgate](https://github.com/strawgate) in [#806](https://github.com/PrefectHQ/fastmcp/pull/806)
### Fixes 🐞
* Restore .settings access as deprecated by [@jlowin](https://github.com/jlowin) in [#800](https://github.com/PrefectHQ/fastmcp/pull/800)
* Ensure handling of false http kwargs correctly; removed unused kwarg by [@jlowin](https://github.com/jlowin) in [#804](https://github.com/PrefectHQ/fastmcp/pull/804)
* Bump mcp 1.9.4 by [@jlowin](https://github.com/jlowin) in [#835](https://github.com/PrefectHQ/fastmcp/pull/835)
### Docs 📚
* Update changelog for 2.8.0 by [@jlowin](https://github.com/jlowin) in [#794](https://github.com/PrefectHQ/fastmcp/pull/794)
* Update welcome docs by [@jlowin](https://github.com/jlowin) in [#808](https://github.com/PrefectHQ/fastmcp/pull/808)
* Update headers in docs by [@jlowin](https://github.com/jlowin) in [#809](https://github.com/PrefectHQ/fastmcp/pull/809)
* Add MCP group to tutorials by [@jlowin](https://github.com/jlowin) in [#810](https://github.com/PrefectHQ/fastmcp/pull/810)
* Add Community section to documentation by [@zzstoatzz](https://github.com/zzstoatzz) in [#819](https://github.com/PrefectHQ/fastmcp/pull/819)
* Add 2.8 update by [@jlowin](https://github.com/jlowin) in [#821](https://github.com/PrefectHQ/fastmcp/pull/821)
* Embed YouTube videos in community showcase by [@zzstoatzz](https://github.com/zzstoatzz) in [#820](https://github.com/PrefectHQ/fastmcp/pull/820)
### Other Changes 🦾
* Ensure http args are passed through by [@jlowin](https://github.com/jlowin) in [#803](https://github.com/PrefectHQ/fastmcp/pull/803)
* Fix install link in readme by [@jlowin](https://github.com/jlowin) in [#836](https://github.com/PrefectHQ/fastmcp/pull/836)

**Full Changelog**: [v2.8.0...v2.8.1](https://github.com/PrefectHQ/fastmcp/compare/v2.8.0...v2.8.1)

</Update>

<Update label="v2.8.0" description="2024-06-10">

## [v2.8.0: Transform and Roll Out](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.8.0)

FastMCP 2.8.0 introduces powerful new ways to customize and control your MCP servers! 

### Tool Transformation

The highlight of this release is first-class [**Tool Transformation**](/servers/transforms/tool-transformation), a new feature that lets you create enhanced variations of existing tools. You can now easily rename arguments, hide parameters, modify descriptions, and even wrap tools with custom validation or post-processing logic—all without rewriting the original code. This makes it easier than ever to adapt generic tools for specific LLM use cases or to simplify complex APIs. Huge thanks to [@strawgate](https://github.com/strawgate) for partnering on this, starting with [#591](https://github.com/PrefectHQ/fastmcp/discussions/591) and [#599](https://github.com/PrefectHQ/fastmcp/pull/599) and continuing offline.

### Component Control
This release also gives you more granular control over which components are exposed to clients. With new [**tag-based filtering**](/servers/server#tag-based-filtering), you can selectively enable or disable tools, resources, and prompts based on tags, perfect for managing different environments or user permissions. Complementing this, every component now supports being [programmatically enabled or disabled](/servers/tools#disabling-tools), offering dynamic control over your server's capabilities.

### Tools-by-Default
Finally, to improve compatibility with a wider range of LLM clients, this release changes the default behavior for OpenAPI integration: all API endpoints are now converted to `Tools` by default. This is a **breaking change** but pragmatically necessitated by the fact that the majority of MCP clients available today are, sadly, only compatible with MCP tools. Therefore, this change significantly simplifies the out-of-the-box experience and ensures your entire API is immediately accessible to any tool-using agent.

## What's Changed
### New Features 🎉
* First-class tool transformation by [@jlowin](https://github.com/jlowin) in [#745](https://github.com/PrefectHQ/fastmcp/pull/745)
* Support enable/disable for all FastMCP components (tools, prompts, resources, templates) by [@jlowin](https://github.com/jlowin) in [#781](https://github.com/PrefectHQ/fastmcp/pull/781)
* Add support for tag-based component filtering by [@jlowin](https://github.com/jlowin) in [#748](https://github.com/PrefectHQ/fastmcp/pull/748)
* Allow tag assignments for OpenAPI by [@jlowin](https://github.com/jlowin) in [#791](https://github.com/PrefectHQ/fastmcp/pull/791)
### Enhancements 🔧
* Create common base class for components by [@jlowin](https://github.com/jlowin) in [#776](https://github.com/PrefectHQ/fastmcp/pull/776)
* Move components to own file; add resource by [@jlowin](https://github.com/jlowin) in [#777](https://github.com/PrefectHQ/fastmcp/pull/777)
* Update FastMCP component with __eq__ and __repr__ by [@jlowin](https://github.com/jlowin) in [#779](https://github.com/PrefectHQ/fastmcp/pull/779)
* Remove open-ended and server-specific settings by [@jlowin](https://github.com/jlowin) in [#750](https://github.com/PrefectHQ/fastmcp/pull/750)
### Fixes 🐞
* Ensure client is only initialized once by [@jlowin](https://github.com/jlowin) in [#758](https://github.com/PrefectHQ/fastmcp/pull/758)
* Fix field validator for resource by [@jlowin](https://github.com/jlowin) in [#778](https://github.com/PrefectHQ/fastmcp/pull/778)
* Ensure proxies can overwrite remote tools without falling back to the remote by [@jlowin](https://github.com/jlowin) in [#782](https://github.com/PrefectHQ/fastmcp/pull/782)
### Breaking Changes 🛫
* Treat all openapi routes as tools by [@jlowin](https://github.com/jlowin) in [#788](https://github.com/PrefectHQ/fastmcp/pull/788)
* Fix issue with global OpenAPI tags by [@jlowin](https://github.com/jlowin) in [#792](https://github.com/PrefectHQ/fastmcp/pull/792)
### Docs 📚
* Minor docs updates by [@jlowin](https://github.com/jlowin) in [#755](https://github.com/PrefectHQ/fastmcp/pull/755)
* Add 2.7 update by [@jlowin](https://github.com/jlowin) in [#756](https://github.com/PrefectHQ/fastmcp/pull/756)
* Reduce 2.7 image size by [@jlowin](https://github.com/jlowin) in [#757](https://github.com/PrefectHQ/fastmcp/pull/757)
* Update updates.mdx by [@jlowin](https://github.com/jlowin) in [#765](https://github.com/PrefectHQ/fastmcp/pull/765)
* Hide docs sidebar scrollbar by default by [@jlowin](https://github.com/jlowin) in [#766](https://github.com/PrefectHQ/fastmcp/pull/766)
* Add "stop vibe testing" to tutorials by [@jlowin](https://github.com/jlowin) in [#767](https://github.com/PrefectHQ/fastmcp/pull/767)
* Add docs links by [@jlowin](https://github.com/jlowin) in [#768](https://github.com/PrefectHQ/fastmcp/pull/768)
* Fix: updated variable name under Gemini remote client by [@yrangana](https://github.com/yrangana) in [#769](https://github.com/PrefectHQ/fastmcp/pull/769)
* Revert "Hide docs sidebar scrollbar by default" by [@jlowin](https://github.com/jlowin) in [#770](https://github.com/PrefectHQ/fastmcp/pull/770)
* Add updates by [@jlowin](https://github.com/jlowin) in [#773](https://github.com/PrefectHQ/fastmcp/pull/773)
* Add tutorials by [@jlowin](https://github.com/jlowin) in [#783](https://github.com/PrefectHQ/fastmcp/pull/783)
* Update LLM-friendly docs by [@jlowin](https://github.com/jlowin) in [#784](https://github.com/PrefectHQ/fastmcp/pull/784)
* Update oauth.mdx by [@JeremyCraigMartinez](https://github.com/JeremyCraigMartinez) in [#787](https://github.com/PrefectHQ/fastmcp/pull/787)
* Add changelog by [@jlowin](https://github.com/jlowin) in [#789](https://github.com/PrefectHQ/fastmcp/pull/789)
* Add tutorials by [@jlowin](https://github.com/jlowin) in [#790](https://github.com/PrefectHQ/fastmcp/pull/790)
* Add docs for tag-based filtering by [@jlowin](https://github.com/jlowin) in [#793](https://github.com/PrefectHQ/fastmcp/pull/793)
### Other Changes 🦾
* Create dependabot.yml by [@jlowin](https://github.com/jlowin) in [#759](https://github.com/PrefectHQ/fastmcp/pull/759)
* Bump astral-sh/setup-uv from 3 to 6 by [@dependabot](https://github.com/dependabot) in [#760](https://github.com/PrefectHQ/fastmcp/pull/760)
* Add dependencies section to release by [@jlowin](https://github.com/jlowin) in [#761](https://github.com/PrefectHQ/fastmcp/pull/761)
* Remove extra imports for MCPConfig by [@Maanas-Verma](https://github.com/Maanas-Verma) in [#763](https://github.com/PrefectHQ/fastmcp/pull/763)
* Split out enhancements in release notes by [@jlowin](https://github.com/jlowin) in [#764](https://github.com/PrefectHQ/fastmcp/pull/764)

## New Contributors
* [@dependabot](https://github.com/dependabot) made their first contribution in [#760](https://github.com/PrefectHQ/fastmcp/pull/760)
* [@Maanas-Verma](https://github.com/Maanas-Verma) made their first contribution in [#763](https://github.com/PrefectHQ/fastmcp/pull/763)
* [@JeremyCraigMartinez](https://github.com/JeremyCraigMartinez) made their first contribution in [#787](https://github.com/PrefectHQ/fastmcp/pull/787)

**Full Changelog**: [v2.7.1...v2.8.0](https://github.com/PrefectHQ/fastmcp/compare/v2.7.1...v2.8.0)

</Update>

<Update label="v2.7.1" description="2024-06-08">

## [v2.7.1: The Bearer Necessities](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.7.1)

This release primarily contains a fix for parsing string tokens that are provided to FastMCP clients.

### New Features 🎉

* Respect cache setting, set default to 1 second by [@jlowin](https://github.com/jlowin) in [#747](https://github.com/PrefectHQ/fastmcp/pull/747)

### Fixes 🐞

* Ensure event store is properly typed by [@jlowin](https://github.com/jlowin) in [#753](https://github.com/PrefectHQ/fastmcp/pull/753)
* Fix passing token string to client auth & add auth to MCPConfig clients by [@jlowin](https://github.com/jlowin) in [#754](https://github.com/PrefectHQ/fastmcp/pull/754)

### Docs 📚

* Docs : fix client to mcp\_client in Gemini example by [@yrangana](https://github.com/yrangana) in [#734](https://github.com/PrefectHQ/fastmcp/pull/734)
* update add tool docstring by [@strawgate](https://github.com/strawgate) in [#739](https://github.com/PrefectHQ/fastmcp/pull/739)
* Fix contrib link by [@richardkmichael](https://github.com/richardkmichael) in [#749](https://github.com/PrefectHQ/fastmcp/pull/749)

### Other Changes 🦾

* Switch Pydantic defaults to kwargs by [@strawgate](https://github.com/strawgate) in [#731](https://github.com/PrefectHQ/fastmcp/pull/731)
* Fix Typo in CLI module by [@wfclark5](https://github.com/wfclark5) in [#737](https://github.com/PrefectHQ/fastmcp/pull/737)
* chore: fix prompt docstring by [@danb27](https://github.com/danb27) in [#752](https://github.com/PrefectHQ/fastmcp/pull/752)
* Add accept to excluded headers by [@jlowin](https://github.com/jlowin) in [#751](https://github.com/PrefectHQ/fastmcp/pull/751)

### New Contributors

* [@wfclark5](https://github.com/wfclark5) made their first contribution in [#737](https://github.com/PrefectHQ/fastmcp/pull/737)
* [@richardkmichael](https://github.com/richardkmichael) made their first contribution in [#749](https://github.com/PrefectHQ/fastmcp/pull/749)
* [@danb27](https://github.com/danb27) made their first contribution in [#752](https://github.com/PrefectHQ/fastmcp/pull/752)

**Full Changelog**: [v2.7.0...v2.7.1](https://github.com/PrefectHQ/fastmcp/compare/v2.7.0...v2.7.1)
</Update>

<Update label="v2.7.0" description="2024-06-05">

## [v2.7.0: Pare Programming](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.7.0)

This is primarily a housekeeping release to remove or deprecate cruft that's accumulated since v1. Primarily, this release refactors FastMCP's internals in preparation for features planned in the next few major releases. However please note that as a result, this release has some minor breaking changes (which is why it's 2.7, not 2.6.2, in accordance with repo guidelines) though not to the core user-facing APIs.

### Breaking Changes 🛫

* decorators return the objects they create, not the decorated function
* websockets is an optional dependency
* methods on the server for automatically converting functions into tools/resources/prompts have been deprecated in favor of using the decorators directly

### New Features 🎉

* allow passing flags to servers by [@zzstoatzz](https://github.com/zzstoatzz) in [#690](https://github.com/PrefectHQ/fastmcp/pull/690)
* replace $ref pointing to `#/components/schemas/` with `#/$defs/` by [@phateffect](https://github.com/phateffect) in [#697](https://github.com/PrefectHQ/fastmcp/pull/697)
* Split Tool into Tool and FunctionTool by [@jlowin](https://github.com/jlowin) in [#700](https://github.com/PrefectHQ/fastmcp/pull/700)
* Use strict basemodel for Prompt; relax from\_function deprecation by [@jlowin](https://github.com/jlowin) in [#701](https://github.com/PrefectHQ/fastmcp/pull/701)
* Formalize resource/functionresource replationship by [@jlowin](https://github.com/jlowin) in [#702](https://github.com/PrefectHQ/fastmcp/pull/702)
* Formalize template/functiontemplate split by [@jlowin](https://github.com/jlowin) in [#703](https://github.com/PrefectHQ/fastmcp/pull/703)
* Support flexible @tool decorator call patterns by [@jlowin](https://github.com/jlowin) in [#706](https://github.com/PrefectHQ/fastmcp/pull/706)
* Ensure deprecation warnings have stacklevel=2 by [@jlowin](https://github.com/jlowin) in [#710](https://github.com/PrefectHQ/fastmcp/pull/710)
* Allow naked prompt decorator by [@jlowin](https://github.com/jlowin) in [#711](https://github.com/PrefectHQ/fastmcp/pull/711)

### Fixes 🐞

* Updates / Fixes for Tool Content Conversion by [@strawgate](https://github.com/strawgate) in [#642](https://github.com/PrefectHQ/fastmcp/pull/642)
* Fix pr labeler permissions by [@jlowin](https://github.com/jlowin) in [#708](https://github.com/PrefectHQ/fastmcp/pull/708)
* remove -n auto by [@jlowin](https://github.com/jlowin) in [#709](https://github.com/PrefectHQ/fastmcp/pull/709)
* Fix links in README.md by [@alainivars](https://github.com/alainivars) in [#723](https://github.com/PrefectHQ/fastmcp/pull/723)

Happily, this release DOES permit the use of "naked" decorators to align with Pythonic practice:

```python
@mcp.tool
def my_tool():
    ...
```

**Full Changelog**: [v2.6.2...v2.7.0](https://github.com/PrefectHQ/fastmcp/compare/v2.6.2...v2.7.0)
</Update>

<Update label="v2.6.1" description="2024-06-03">

## [v2.6.1: Blast Auth (second ignition)](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.6.1)

This is a patch release to restore py.typed in #686.

### Docs 📚

* Update readme by [@jlowin](https://github.com/jlowin) in [#679](https://github.com/PrefectHQ/fastmcp/pull/679)
* Add gemini tutorial by [@jlowin](https://github.com/jlowin) in [#680](https://github.com/PrefectHQ/fastmcp/pull/680)
* Fix : fix path error to CLI Documentation by [@yrangana](https://github.com/yrangana) in [#684](https://github.com/PrefectHQ/fastmcp/pull/684)
* Update auth docs by [@jlowin](https://github.com/jlowin) in [#687](https://github.com/PrefectHQ/fastmcp/pull/687)

### Other Changes 🦾

* Remove deprecation notice by [@jlowin](https://github.com/jlowin) in [#677](https://github.com/PrefectHQ/fastmcp/pull/677)
* Delete server.py by [@jlowin](https://github.com/jlowin) in [#681](https://github.com/PrefectHQ/fastmcp/pull/681)
* Restore py.typed by [@jlowin](https://github.com/jlowin) in [#686](https://github.com/PrefectHQ/fastmcp/pull/686)

### New Contributors

* [@yrangana](https://github.com/yrangana) made their first contribution in [#684](https://github.com/PrefectHQ/fastmcp/pull/684)

**Full Changelog**: [v2.6.0...v2.6.1](https://github.com/PrefectHQ/fastmcp/compare/v2.6.0...v2.6.1)
</Update>

<Update label="v2.6.0" description="2024-06-02">

## [v2.6.0: Blast Auth](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.6.0)

### New Features 🎉

* Introduce MCP client oauth flow by [@jlowin](https://github.com/jlowin) in [#478](https://github.com/PrefectHQ/fastmcp/pull/478)
* Support providing tools at init by [@jlowin](https://github.com/jlowin) in [#647](https://github.com/PrefectHQ/fastmcp/pull/647)
* Simplify code for running servers in processes during tests by [@jlowin](https://github.com/jlowin) in [#649](https://github.com/PrefectHQ/fastmcp/pull/649)
* Add basic bearer auth for server and client by [@jlowin](https://github.com/jlowin) in [#650](https://github.com/PrefectHQ/fastmcp/pull/650)
* Support configuring bearer auth from env vars by [@jlowin](https://github.com/jlowin) in [#652](https://github.com/PrefectHQ/fastmcp/pull/652)
* feat(tool): add support for excluding arguments from tool definition by [@deepak-stratforge](https://github.com/deepak-stratforge) in [#626](https://github.com/PrefectHQ/fastmcp/pull/626)
* Add docs for server + client auth by [@jlowin](https://github.com/jlowin) in [#655](https://github.com/PrefectHQ/fastmcp/pull/655)

### Fixes 🐞

* fix: Support concurrency in FastMcpProxy (and Client) by [@Sillocan](https://github.com/Sillocan) in [#635](https://github.com/PrefectHQ/fastmcp/pull/635)
* Ensure Client.close() cleans up client context appropriately by [@jlowin](https://github.com/jlowin) in [#643](https://github.com/PrefectHQ/fastmcp/pull/643)
* Update client.mdx: ClientError namespace by [@mjkaye](https://github.com/mjkaye) in [#657](https://github.com/PrefectHQ/fastmcp/pull/657)

### Docs 📚

* Make FastMCPTransport support simulated Streamable HTTP Transport (didn't work) by [@jlowin](https://github.com/jlowin) in [#645](https://github.com/PrefectHQ/fastmcp/pull/645)
* Document exclude\_args by [@jlowin](https://github.com/jlowin) in [#653](https://github.com/PrefectHQ/fastmcp/pull/653)
* Update welcome by [@jlowin](https://github.com/jlowin) in [#673](https://github.com/PrefectHQ/fastmcp/pull/673)
* Add Anthropic + Claude desktop integration guides by [@jlowin](https://github.com/jlowin) in [#674](https://github.com/PrefectHQ/fastmcp/pull/674)
* Minor docs design updates by [@jlowin](https://github.com/jlowin) in [#676](https://github.com/PrefectHQ/fastmcp/pull/676)

### Other Changes 🦾

* Update test typing by [@jlowin](https://github.com/jlowin) in [#646](https://github.com/PrefectHQ/fastmcp/pull/646)
* Add OpenAI integration docs by [@jlowin](https://github.com/jlowin) in [#660](https://github.com/PrefectHQ/fastmcp/pull/660)

### New Contributors

* [@Sillocan](https://github.com/Sillocan) made their first contribution in [#635](https://github.com/PrefectHQ/fastmcp/pull/635)
* [@deepak-stratforge](https://github.com/deepak-stratforge) made their first contribution in [#626](https://github.com/PrefectHQ/fastmcp/pull/626)
* [@mjkaye](https://github.com/mjkaye) made their first contribution in [#657](https://github.com/PrefectHQ/fastmcp/pull/657)

**Full Changelog**: [v2.5.2...v2.6.0](https://github.com/PrefectHQ/fastmcp/compare/v2.5.2...v2.6.0)
</Update>

<Update label="v2.5.2" description="2024-05-29">

## [v2.5.2: Stayin' Alive](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.5.2)

### New Features 🎉

* Add graceful error handling for unreachable mounted servers by [@davenpi](https://github.com/davenpi) in [#605](https://github.com/PrefectHQ/fastmcp/pull/605)
* Improve type inference from client transport by [@jlowin](https://github.com/jlowin) in [#623](https://github.com/PrefectHQ/fastmcp/pull/623)
* Add keep\_alive param to reuse subprocess by [@jlowin](https://github.com/jlowin) in [#624](https://github.com/PrefectHQ/fastmcp/pull/624)

### Fixes 🐞

* Fix handling tools without descriptions by [@jlowin](https://github.com/jlowin) in [#610](https://github.com/PrefectHQ/fastmcp/pull/610)
* Don't print env vars to console when format is wrong by [@jlowin](https://github.com/jlowin) in [#615](https://github.com/PrefectHQ/fastmcp/pull/615)
* Ensure behavior-affecting headers are excluded when forwarding proxies/openapi by [@jlowin](https://github.com/jlowin) in [#620](https://github.com/PrefectHQ/fastmcp/pull/620)

### Docs 📚

* Add notes about uv and claude desktop by [@jlowin](https://github.com/jlowin) in [#597](https://github.com/PrefectHQ/fastmcp/pull/597)

### Other Changes 🦾

* add init\_timeout for mcp client by [@jfouret](https://github.com/jfouret) in [#607](https://github.com/PrefectHQ/fastmcp/pull/607)
* Add init\_timeout for mcp client (incl settings) by [@jlowin](https://github.com/jlowin) in [#609](https://github.com/PrefectHQ/fastmcp/pull/609)
* Support for uppercase letters at the log level by [@ksawaray](https://github.com/ksawaray) in [#625](https://github.com/PrefectHQ/fastmcp/pull/625)

### New Contributors

* [@jfouret](https://github.com/jfouret) made their first contribution in [#607](https://github.com/PrefectHQ/fastmcp/pull/607)
* [@ksawaray](https://github.com/ksawaray) made their first contribution in [#625](https://github.com/PrefectHQ/fastmcp/pull/625)

**Full Changelog**: [v2.5.1...v2.5.2](https://github.com/PrefectHQ/fastmcp/compare/v2.5.1...v2.5.2)
</Update>

<Update label="v2.5.1" description="2024-05-24">

## [v2.5.1: Route Awakening (Part 2)](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.5.1)

### Fixes 🐞

* Ensure content-length is always stripped from client headers by [@jlowin](https://github.com/jlowin) in [#589](https://github.com/PrefectHQ/fastmcp/pull/589)

### Docs 📚

* Fix redundant section of docs by [@jlowin](https://github.com/jlowin) in [#583](https://github.com/PrefectHQ/fastmcp/pull/583)

**Full Changelog**: [v2.5.0...v2.5.1](https://github.com/PrefectHQ/fastmcp/compare/v2.5.0...v2.5.1)
</Update>

<Update label="v2.5.0" description="2024-05-24">

## [v2.5.0: Route Awakening](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.5.0)

This release introduces completely new tools for generating and customizing MCP servers from OpenAPI specs and FastAPI apps, including popular requests like mechanisms for determining what routes map to what MCP components; renaming routes; and customizing the generated MCP components.

### New Features 🎉

* Add FastMCP 1.0 server support for in-memory Client / Testing by [@jlowin](https://github.com/jlowin) in [#539](https://github.com/PrefectHQ/fastmcp/pull/539)
* Minor addition: add transport to stdio server in mcpconfig, with default by [@jlowin](https://github.com/jlowin) in [#555](https://github.com/PrefectHQ/fastmcp/pull/555)
* Raise an error if a Client is created with no servers in config by [@jlowin](https://github.com/jlowin) in [#554](https://github.com/PrefectHQ/fastmcp/pull/554)
* Expose model preferences in `Context.sample` for flexible model selection. by [@davenpi](https://github.com/davenpi) in [#542](https://github.com/PrefectHQ/fastmcp/pull/542)
* Ensure custom routes are respected by [@jlowin](https://github.com/jlowin) in [#558](https://github.com/PrefectHQ/fastmcp/pull/558)
* Add client method to send cancellation notifications by [@davenpi](https://github.com/davenpi) in [#563](https://github.com/PrefectHQ/fastmcp/pull/563)
* Enhance route map logic for include/exclude OpenAPI routes by [@jlowin](https://github.com/jlowin) in [#564](https://github.com/PrefectHQ/fastmcp/pull/564)
* Add tag-based route maps by [@jlowin](https://github.com/jlowin) in [#565](https://github.com/PrefectHQ/fastmcp/pull/565)
* Add advanced control of openAPI route creation by [@jlowin](https://github.com/jlowin) in [#566](https://github.com/PrefectHQ/fastmcp/pull/566)
* Make error masking configurable by [@jlowin](https://github.com/jlowin) in [#550](https://github.com/PrefectHQ/fastmcp/pull/550)
* Ensure client headers are passed through to remote servers by [@jlowin](https://github.com/jlowin) in [#575](https://github.com/PrefectHQ/fastmcp/pull/575)
* Use lowercase name for headers when comparing by [@jlowin](https://github.com/jlowin) in [#576](https://github.com/PrefectHQ/fastmcp/pull/576)
* Permit more flexible name generation for OpenAPI servers by [@jlowin](https://github.com/jlowin) in [#578](https://github.com/PrefectHQ/fastmcp/pull/578)
* Ensure that tools/templates/prompts are compatible with callable objects by [@jlowin](https://github.com/jlowin) in [#579](https://github.com/PrefectHQ/fastmcp/pull/579)

### Docs 📚

* Add version badge for prefix formats by [@jlowin](https://github.com/jlowin) in [#537](https://github.com/PrefectHQ/fastmcp/pull/537)
* Add versioning note to docs by [@jlowin](https://github.com/jlowin) in [#551](https://github.com/PrefectHQ/fastmcp/pull/551)
* Bump 2.3.6 references to 2.4.0 by [@jlowin](https://github.com/jlowin) in [#567](https://github.com/PrefectHQ/fastmcp/pull/567)

**Full Changelog**: [v2.4.0...v2.5.0](https://github.com/PrefectHQ/fastmcp/compare/v2.4.0...v2.5.0)
</Update>

<Update label="v2.4.0" description="2024-05-21">

## [v2.4.0: Config and Conquer](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.4.0)

**Note**: this release includes a backwards-incompatible change to how resources are prefixed when mounted in composed servers. However, it is only backwards-incompatible if users were running tests or manually loading resources by prefixed key; LLMs should not have any issue discovering the new route.

### New Features 🎉

* Allow \* Methods and all routes as tools shortcuts by [@jlowin](https://github.com/jlowin) in [#520](https://github.com/PrefectHQ/fastmcp/pull/520)
* Improved support for config dicts by [@jlowin](https://github.com/jlowin) in [#522](https://github.com/PrefectHQ/fastmcp/pull/522)
* Support creating clients from MCP config dicts, including multi-server clients by [@jlowin](https://github.com/jlowin) in [#527](https://github.com/PrefectHQ/fastmcp/pull/527)
* Make resource prefix format configurable by [@jlowin](https://github.com/jlowin) in [#534](https://github.com/PrefectHQ/fastmcp/pull/534)

### Fixes 🐞

* Avoid hanging on initializing server session by [@jlowin](https://github.com/jlowin) in [#523](https://github.com/PrefectHQ/fastmcp/pull/523)

### Breaking Changes 🛫

* Remove customizable separators; improve resource separator by [@jlowin](https://github.com/jlowin) in [#526](https://github.com/PrefectHQ/fastmcp/pull/526)

### Docs 📚

* Improve client documentation by [@jlowin](https://github.com/jlowin) in [#517](https://github.com/PrefectHQ/fastmcp/pull/517)

### Other Changes 🦾

* Ensure openapi path params are handled properly by [@jlowin](https://github.com/jlowin) in [#519](https://github.com/PrefectHQ/fastmcp/pull/519)
* better error when missing lifespan by [@zzstoatzz](https://github.com/zzstoatzz) in [#521](https://github.com/PrefectHQ/fastmcp/pull/521)

**Full Changelog**: [v2.3.5...v2.4.0](https://github.com/PrefectHQ/fastmcp/compare/v2.3.5...v2.4.0)
</Update>

<Update label="v2.3.5" description="2024-05-20">

## [v2.3.5: Making Progress](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.3.5)

### New Features 🎉

* support messages in progress notifications by [@rickygenhealth](https://github.com/rickygenhealth) in [#471](https://github.com/PrefectHQ/fastmcp/pull/471)
* feat: Add middleware option in server.run by [@Maxi91f](https://github.com/Maxi91f) in [#475](https://github.com/PrefectHQ/fastmcp/pull/475)
* Add lifespan property to app by [@jlowin](https://github.com/jlowin) in [#483](https://github.com/PrefectHQ/fastmcp/pull/483)
* Update `fastmcp run` to work with remote servers by [@jlowin](https://github.com/jlowin) in [#491](https://github.com/PrefectHQ/fastmcp/pull/491)
* Add FastMCP.as\_proxy() by [@jlowin](https://github.com/jlowin) in [#490](https://github.com/PrefectHQ/fastmcp/pull/490)
* Infer sse transport from urls containing /sse by [@jlowin](https://github.com/jlowin) in [#512](https://github.com/PrefectHQ/fastmcp/pull/512)
* Add progress handler to client by [@jlowin](https://github.com/jlowin) in [#513](https://github.com/PrefectHQ/fastmcp/pull/513)
* Store the initialize result on the client by [@jlowin](https://github.com/jlowin) in [#509](https://github.com/PrefectHQ/fastmcp/pull/509)

### Fixes 🐞

* Remove patch and use upstream SSEServerTransport by [@jlowin](https://github.com/jlowin) in [#425](https://github.com/PrefectHQ/fastmcp/pull/425)

### Docs 📚

* Update transport docs by [@jlowin](https://github.com/jlowin) in [#458](https://github.com/PrefectHQ/fastmcp/pull/458)
* update proxy docs + example by [@zzstoatzz](https://github.com/zzstoatzz) in [#460](https://github.com/PrefectHQ/fastmcp/pull/460)
* doc(asgi): Change custom route example to PlainTextResponse by [@mcw0933](https://github.com/mcw0933) in [#477](https://github.com/PrefectHQ/fastmcp/pull/477)
* Store FastMCP instance on app.state.fastmcp\_server by [@jlowin](https://github.com/jlowin) in [#489](https://github.com/PrefectHQ/fastmcp/pull/489)
* Improve AGENTS.md overview by [@jlowin](https://github.com/jlowin) in [#492](https://github.com/PrefectHQ/fastmcp/pull/492)
* Update release numbers for anticipated version by [@jlowin](https://github.com/jlowin) in [#516](https://github.com/PrefectHQ/fastmcp/pull/516)

### Other Changes 🦾

* run tests on all PRs by [@jlowin](https://github.com/jlowin) in [#468](https://github.com/PrefectHQ/fastmcp/pull/468)
* add null check by [@zzstoatzz](https://github.com/zzstoatzz) in [#473](https://github.com/PrefectHQ/fastmcp/pull/473)
* strict typing for `server.py` by [@zzstoatzz](https://github.com/zzstoatzz) in [#476](https://github.com/PrefectHQ/fastmcp/pull/476)
* Doc(quickstart): Fix import statements by [@mai-nakagawa](https://github.com/mai-nakagawa) in [#479](https://github.com/PrefectHQ/fastmcp/pull/479)
* Add labeler by [@jlowin](https://github.com/jlowin) in [#484](https://github.com/PrefectHQ/fastmcp/pull/484)
* Fix flaky timeout test by increasing timeout (#474) by [@davenpi](https://github.com/davenpi) in [#486](https://github.com/PrefectHQ/fastmcp/pull/486)
* Skipping `test_permission_error` if runner is root. by [@ZiadAmerr](https://github.com/ZiadAmerr) in [#502](https://github.com/PrefectHQ/fastmcp/pull/502)
* allow passing full uvicorn config by [@zzstoatzz](https://github.com/zzstoatzz) in [#504](https://github.com/PrefectHQ/fastmcp/pull/504)
* Skip timeout tests on windows by [@jlowin](https://github.com/jlowin) in [#514](https://github.com/PrefectHQ/fastmcp/pull/514)

### New Contributors

* [@rickygenhealth](https://github.com/rickygenhealth) made their first contribution in [#471](https://github.com/PrefectHQ/fastmcp/pull/471)
* [@Maxi91f](https://github.com/Maxi91f) made their first contribution in [#475](https://github.com/PrefectHQ/fastmcp/pull/475)
* [@mcw0933](https://github.com/mcw0933) made their first contribution in [#477](https://github.com/PrefectHQ/fastmcp/pull/477)
* [@mai-nakagawa](https://github.com/mai-nakagawa) made their first contribution in [#479](https://github.com/PrefectHQ/fastmcp/pull/479)
* [@ZiadAmerr](https://github.com/ZiadAmerr) made their first contribution in [#502](https://github.com/PrefectHQ/fastmcp/pull/502)

**Full Changelog**: [v2.3.4...v2.3.5](https://github.com/PrefectHQ/fastmcp/compare/v2.3.4...v2.3.5)
</Update>

<Update label="v2.3.4" description="2024-05-15">

## [v2.3.4: Error Today, Gone Tomorrow](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.3.4)

### New Features 🎉

* logging stack trace for easier debugging by [@jbkoh](https://github.com/jbkoh) in [#413](https://github.com/PrefectHQ/fastmcp/pull/413)
* add missing StreamableHttpTransport in client exports by [@yihuang](https://github.com/yihuang) in [#408](https://github.com/PrefectHQ/fastmcp/pull/408)
* Improve error handling for tools and resources by [@jlowin](https://github.com/jlowin) in [#434](https://github.com/PrefectHQ/fastmcp/pull/434)
* feat: add support for removing tools from server by [@davenpi](https://github.com/davenpi) in [#437](https://github.com/PrefectHQ/fastmcp/pull/437)
* Prune titles from JSONSchemas by [@jlowin](https://github.com/jlowin) in [#449](https://github.com/PrefectHQ/fastmcp/pull/449)
* Declare toolsChanged capability for stdio server. by [@davenpi](https://github.com/davenpi) in [#450](https://github.com/PrefectHQ/fastmcp/pull/450)
* Improve handling of exceptiongroups when raised in clients by [@jlowin](https://github.com/jlowin) in [#452](https://github.com/PrefectHQ/fastmcp/pull/452)
* Add timeout support to client by [@jlowin](https://github.com/jlowin) in [#455](https://github.com/PrefectHQ/fastmcp/pull/455)

### Fixes 🐞

* Pin to mcp 1.8.1 to resolve callback deadlocks with SHTTP by [@jlowin](https://github.com/jlowin) in [#427](https://github.com/PrefectHQ/fastmcp/pull/427)
* Add reprs for OpenAPI objects by [@jlowin](https://github.com/jlowin) in [#447](https://github.com/PrefectHQ/fastmcp/pull/447)
* Ensure openapi defs for structured objects are loaded properly by [@jlowin](https://github.com/jlowin) in [#448](https://github.com/PrefectHQ/fastmcp/pull/448)
* Ensure tests run against correct python version by [@jlowin](https://github.com/jlowin) in [#454](https://github.com/PrefectHQ/fastmcp/pull/454)
* Ensure result is only returned if a new key was found by [@jlowin](https://github.com/jlowin) in [#456](https://github.com/PrefectHQ/fastmcp/pull/456)

### Docs 📚

* Add documentation for tool removal by [@jlowin](https://github.com/jlowin) in [#440](https://github.com/PrefectHQ/fastmcp/pull/440)

### Other Changes 🦾

* Deprecate passing settings to the FastMCP instance by [@jlowin](https://github.com/jlowin) in [#424](https://github.com/PrefectHQ/fastmcp/pull/424)
* Add path prefix to test by [@jlowin](https://github.com/jlowin) in [#432](https://github.com/PrefectHQ/fastmcp/pull/432)

### New Contributors

* [@jbkoh](https://github.com/jbkoh) made their first contribution in [#413](https://github.com/PrefectHQ/fastmcp/pull/413)
* [@davenpi](https://github.com/davenpi) made their first contribution in [#437](https://github.com/PrefectHQ/fastmcp/pull/437)

**Full Changelog**: [v2.3.3...v2.3.4](https://github.com/PrefectHQ/fastmcp/compare/v2.3.3...v2.3.4)
</Update>

<Update label="v2.3.3" description="2024-05-10">

## [v2.3.3: SSE you later](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.3.3)

This is a hotfix for a bug introduced in 2.3.2 that broke SSE servers

### Fixes 🐞

* Fix bug that sets message path and sse path to same value by [@jlowin](https://github.com/jlowin) in [#405](https://github.com/PrefectHQ/fastmcp/pull/405)

### Docs 📚

* Update composition docs by [@jlowin](https://github.com/jlowin) in [#403](https://github.com/PrefectHQ/fastmcp/pull/403)

### Other Changes 🦾

* Add test for no prefix when importing by [@jlowin](https://github.com/jlowin) in [#404](https://github.com/PrefectHQ/fastmcp/pull/404)

**Full Changelog**: [v2.3.2...v2.3.3](https://github.com/PrefectHQ/fastmcp/compare/v2.3.2...v2.3.3)
</Update>

<Update label="v2.3.2" description="2024-05-10">

## [v2.3.2: Stuck in the Middleware With You](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.3.2)

### New Features 🎉

* Allow users to pass middleware to starlette app constructors by [@jlowin](https://github.com/jlowin) in [#398](https://github.com/PrefectHQ/fastmcp/pull/398)
* Deprecate transport-specific methods on FastMCP server by [@jlowin](https://github.com/jlowin) in [#401](https://github.com/PrefectHQ/fastmcp/pull/401)

### Docs 📚

* Update CLI docs by [@jlowin](https://github.com/jlowin) in [#402](https://github.com/PrefectHQ/fastmcp/pull/402)

### Other Changes 🦾

* Adding 23 tests for CLI by [@didier-durand](https://github.com/didier-durand) in [#394](https://github.com/PrefectHQ/fastmcp/pull/394)

**Full Changelog**: [v2.3.1...v2.3.2](https://github.com/PrefectHQ/fastmcp/compare/v2.3.1...v2.3.2)
</Update>

<Update label="v2.3.1" description="2024-05-09">

## [v2.3.1: For Good-nests Sake](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.3.1)

This release primarily patches a long-standing bug with nested ASGI SSE servers.

### Fixes 🐞

* Fix tool result serialization when the tool returns a list by [@strawgate](https://github.com/strawgate) in [#379](https://github.com/PrefectHQ/fastmcp/pull/379)
* Ensure FastMCP handles nested SSE and SHTTP apps properly in ASGI frameworks by [@jlowin](https://github.com/jlowin) in [#390](https://github.com/PrefectHQ/fastmcp/pull/390)

### Docs 📚

* Update transport docs by [@jlowin](https://github.com/jlowin) in [#377](https://github.com/PrefectHQ/fastmcp/pull/377)
* Add llms.txt to docs by [@jlowin](https://github.com/jlowin) in [#384](https://github.com/PrefectHQ/fastmcp/pull/384)
* Fixing various text typos by [@didier-durand](https://github.com/didier-durand) in [#385](https://github.com/PrefectHQ/fastmcp/pull/385)

### Other Changes 🦾

* Adding a few tests to Image type by [@didier-durand](https://github.com/didier-durand) in [#387](https://github.com/PrefectHQ/fastmcp/pull/387)
* Adding tests for TimedCache by [@didier-durand](https://github.com/didier-durand) in [#388](https://github.com/PrefectHQ/fastmcp/pull/388)

### New Contributors

* [@didier-durand](https://github.com/didier-durand) made their first contribution in [#385](https://github.com/PrefectHQ/fastmcp/pull/385)

**Full Changelog**: [v2.3.0...v2.3.1](https://github.com/PrefectHQ/fastmcp/compare/v2.3.0...v2.3.1)
</Update>

<Update label="v2.3.0" description="2024-05-08">

## [v2.3.0: Stream Me Up, Scotty](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.3.0)

### New Features 🎉

* Add streaming support for HTTP transport by [@jlowin](https://github.com/jlowin) in [#365](https://github.com/PrefectHQ/fastmcp/pull/365)
* Support streaming HTTP transport in clients by [@jlowin](https://github.com/jlowin) in [#366](https://github.com/PrefectHQ/fastmcp/pull/366)
* Add streaming support to CLI by [@jlowin](https://github.com/jlowin) in [#367](https://github.com/PrefectHQ/fastmcp/pull/367)

### Fixes 🐞

* Fix streaming transport initialization by [@jlowin](https://github.com/jlowin) in [#368](https://github.com/PrefectHQ/fastmcp/pull/368)

### Docs 📚

* Update transport documentation for streaming support by [@jlowin](https://github.com/jlowin) in [#369](https://github.com/PrefectHQ/fastmcp/pull/369)

**Full Changelog**: [v2.2.10...v2.3.0](https://github.com/PrefectHQ/fastmcp/compare/v2.2.10...v2.3.0)
</Update>

<Update label="v2.2.10" description="2024-05-06">

## [v2.2.10: That's JSON Bourne](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.10)

### Fixes 🐞

* Disable automatic JSON parsing of tool args by [@jlowin](https://github.com/jlowin) in [#341](https://github.com/PrefectHQ/fastmcp/pull/341)
* Fix prompt test by [@jlowin](https://github.com/jlowin) in [#342](https://github.com/PrefectHQ/fastmcp/pull/342)

### Other Changes 🦾

* Update docs.json by [@jlowin](https://github.com/jlowin) in [#338](https://github.com/PrefectHQ/fastmcp/pull/338)
* Add test coverage + tests on 4 examples by [@alainivars](https://github.com/alainivars) in [#306](https://github.com/PrefectHQ/fastmcp/pull/306)

### New Contributors

* [@alainivars](https://github.com/alainivars) made their first contribution in [#306](https://github.com/PrefectHQ/fastmcp/pull/306)

**Full Changelog**: [v2.2.9...v2.2.10](https://github.com/PrefectHQ/fastmcp/compare/v2.2.9...v2.2.10)
</Update>

<Update label="v2.2.9" description="2024-05-06">

## [v2.2.9: Str-ing the Pot (Hotfix)](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.9)

This release is a hotfix for the issue detailed in #330

### Fixes 🐞

* Prevent invalid resource URIs by [@jlowin](https://github.com/jlowin) in [#336](https://github.com/PrefectHQ/fastmcp/pull/336)
* Coerce numbers to str by [@jlowin](https://github.com/jlowin) in [#337](https://github.com/PrefectHQ/fastmcp/pull/337)

### Docs 📚

* Add client badge by [@jlowin](https://github.com/jlowin) in [#327](https://github.com/PrefectHQ/fastmcp/pull/327)
* Update bug.yml by [@jlowin](https://github.com/jlowin) in [#328](https://github.com/PrefectHQ/fastmcp/pull/328)

### Other Changes 🦾

* Update quickstart.mdx example to include import by [@discdiver](https://github.com/discdiver) in [#329](https://github.com/PrefectHQ/fastmcp/pull/329)

### New Contributors

* [@discdiver](https://github.com/discdiver) made their first contribution in [#329](https://github.com/PrefectHQ/fastmcp/pull/329)

**Full Changelog**: [v2.2.8...v2.2.9](https://github.com/PrefectHQ/fastmcp/compare/v2.2.8...v2.2.9)
</Update>

<Update label="v2.2.8" description="2024-05-05">

## [v2.2.8: Parse and Recreation](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.8)

### New Features 🎉

* Replace custom parsing with TypeAdapter by [@jlowin](https://github.com/jlowin) in [#314](https://github.com/PrefectHQ/fastmcp/pull/314)
* Handle \*args/\*\*kwargs appropriately for various components by [@jlowin](https://github.com/jlowin) in [#317](https://github.com/PrefectHQ/fastmcp/pull/317)
* Add timeout-graceful-shutdown as a default config for SSE app by [@jlowin](https://github.com/jlowin) in [#323](https://github.com/PrefectHQ/fastmcp/pull/323)
* Ensure prompts return descriptions by [@jlowin](https://github.com/jlowin) in [#325](https://github.com/PrefectHQ/fastmcp/pull/325)

### Fixes 🐞

* Ensure that tool serialization has a graceful fallback by [@jlowin](https://github.com/jlowin) in [#310](https://github.com/PrefectHQ/fastmcp/pull/310)

### Docs 📚

* Update docs for clarity by [@jlowin](https://github.com/jlowin) in [#312](https://github.com/PrefectHQ/fastmcp/pull/312)

### Other Changes 🦾

* Remove is\_async attribute by [@jlowin](https://github.com/jlowin) in [#315](https://github.com/PrefectHQ/fastmcp/pull/315)
* Dry out retrieving context kwarg by [@jlowin](https://github.com/jlowin) in [#316](https://github.com/PrefectHQ/fastmcp/pull/316)

**Full Changelog**: [v2.2.7...v2.2.8](https://github.com/PrefectHQ/fastmcp/compare/v2.2.7...v2.2.8)
</Update>

<Update label="v2.2.7" description="2024-05-03">

## [v2.2.7: You Auth to Know Better](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.7)

### New Features 🎉

* use pydantic\_core.to\_json by [@jlowin](https://github.com/jlowin) in [#290](https://github.com/PrefectHQ/fastmcp/pull/290)
* Ensure openapi descriptions are included in tool details by [@jlowin](https://github.com/jlowin) in [#293](https://github.com/PrefectHQ/fastmcp/pull/293)
* Bump mcp to 1.7.1 by [@jlowin](https://github.com/jlowin) in [#298](https://github.com/PrefectHQ/fastmcp/pull/298)
* Add support for tool annotations by [@jlowin](https://github.com/jlowin) in [#299](https://github.com/PrefectHQ/fastmcp/pull/299)
* Add auth support by [@jlowin](https://github.com/jlowin) in [#300](https://github.com/PrefectHQ/fastmcp/pull/300)
* Add low-level methods to client by [@jlowin](https://github.com/jlowin) in [#301](https://github.com/PrefectHQ/fastmcp/pull/301)
* Add method for retrieving current starlette request to FastMCP context by [@jlowin](https://github.com/jlowin) in [#302](https://github.com/PrefectHQ/fastmcp/pull/302)
* get\_starlette\_request → get\_http\_request by [@jlowin](https://github.com/jlowin) in [#303](https://github.com/PrefectHQ/fastmcp/pull/303)
* Support custom Serializer for Tools by [@strawgate](https://github.com/strawgate) in [#308](https://github.com/PrefectHQ/fastmcp/pull/308)
* Support proxy mount by [@jlowin](https://github.com/jlowin) in [#309](https://github.com/PrefectHQ/fastmcp/pull/309)

### Other Changes 🦾

* Improve context injection type checks by [@jlowin](https://github.com/jlowin) in [#291](https://github.com/PrefectHQ/fastmcp/pull/291)
* add readme to smarthome example by [@zzstoatzz](https://github.com/zzstoatzz) in [#294](https://github.com/PrefectHQ/fastmcp/pull/294)

**Full Changelog**: [v2.2.6...v2.2.7](https://github.com/PrefectHQ/fastmcp/compare/v2.2.6...v2.2.7)
</Update>

<Update label="v2.2.6" description="2024-04-30">

## [v2.2.6: The REST is History](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.6)

### New Features 🎉

* Added feature : Load MCP server using config by [@sandipan1](https://github.com/sandipan1) in [#260](https://github.com/PrefectHQ/fastmcp/pull/260)
* small typing fixes by [@zzstoatzz](https://github.com/zzstoatzz) in [#237](https://github.com/PrefectHQ/fastmcp/pull/237)
* Expose configurable timeout for OpenAPI by [@jlowin](https://github.com/jlowin) in [#279](https://github.com/PrefectHQ/fastmcp/pull/279)
* Lower websockets pin for compatibility by [@jlowin](https://github.com/jlowin) in [#286](https://github.com/PrefectHQ/fastmcp/pull/286)
* Improve OpenAPI param handling by [@jlowin](https://github.com/jlowin) in [#287](https://github.com/PrefectHQ/fastmcp/pull/287)

### Fixes 🐞

* Ensure openapi tool responses are properly converted by [@jlowin](https://github.com/jlowin) in [#283](https://github.com/PrefectHQ/fastmcp/pull/283)
* Fix OpenAPI examples by [@jlowin](https://github.com/jlowin) in [#285](https://github.com/PrefectHQ/fastmcp/pull/285)
* Fix client docs for advanced features, add tests for logging by [@jlowin](https://github.com/jlowin) in [#284](https://github.com/PrefectHQ/fastmcp/pull/284)

### Other Changes 🦾

* add testing doc by [@jlowin](https://github.com/jlowin) in [#264](https://github.com/PrefectHQ/fastmcp/pull/264)
* #267 Fix openapi template resource to support multiple path parameters by [@jeger-at](https://github.com/jeger-at) in [#278](https://github.com/PrefectHQ/fastmcp/pull/278)

### New Contributors

* [@sandipan1](https://github.com/sandipan1) made their first contribution in [#260](https://github.com/PrefectHQ/fastmcp/pull/260)
* [@jeger-at](https://github.com/jeger-at) made their first contribution in [#278](https://github.com/PrefectHQ/fastmcp/pull/278)

**Full Changelog**: [v2.2.5...v2.2.6](https://github.com/PrefectHQ/fastmcp/compare/v2.2.5...v2.2.6)
</Update>

<Update label="v2.2.5" description="2024-04-26">

## [v2.2.5: Context Switching](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.5)

### New Features 🎉

* Add tests for tool return types; improve serialization behavior by [@jlowin](https://github.com/jlowin) in [#262](https://github.com/PrefectHQ/fastmcp/pull/262)
* Support context injection in resources, templates, and prompts (like tools) by [@jlowin](https://github.com/jlowin) in [#263](https://github.com/PrefectHQ/fastmcp/pull/263)

### Docs 📚

* Update wildcards to 2.2.4 by [@jlowin](https://github.com/jlowin) in [#257](https://github.com/PrefectHQ/fastmcp/pull/257)
* Update note in templates docs by [@jlowin](https://github.com/jlowin) in [#258](https://github.com/PrefectHQ/fastmcp/pull/258)
* Significant documentation and test expansion for tool input types by [@jlowin](https://github.com/jlowin) in [#261](https://github.com/PrefectHQ/fastmcp/pull/261)

**Full Changelog**: [v2.2.4...v2.2.5](https://github.com/PrefectHQ/fastmcp/compare/v2.2.4...v2.2.5)
</Update>

<Update label="v2.2.4" description="2024-04-25">

## [v2.2.4: The Wild Side, Actually](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.4)

The wildcard URI templates exposed in v2.2.3 were blocked by a server-level check which is removed in this release.

### New Features 🎉

* Allow customization of inspector proxy port, ui port, and version by [@jlowin](https://github.com/jlowin) in [#253](https://github.com/PrefectHQ/fastmcp/pull/253)

### Fixes 🐞

* fix: unintended type convert by [@cutekibry](https://github.com/cutekibry) in [#252](https://github.com/PrefectHQ/fastmcp/pull/252)
* Ensure openapi resources return valid responses by [@jlowin](https://github.com/jlowin) in [#254](https://github.com/PrefectHQ/fastmcp/pull/254)
* Ensure servers expose template wildcards by [@jlowin](https://github.com/jlowin) in [#256](https://github.com/PrefectHQ/fastmcp/pull/256)

### Docs 📚

* Update README.md Grammar error by [@TechWithTy](https://github.com/TechWithTy) in [#249](https://github.com/PrefectHQ/fastmcp/pull/249)

### Other Changes 🦾

* Add resource template tests by [@jlowin](https://github.com/jlowin) in [#255](https://github.com/PrefectHQ/fastmcp/pull/255)

### New Contributors

* [@TechWithTy](https://github.com/TechWithTy) made their first contribution in [#249](https://github.com/PrefectHQ/fastmcp/pull/249)
* [@cutekibry](https://github.com/cutekibry) made their first contribution in [#252](https://github.com/PrefectHQ/fastmcp/pull/252)

**Full Changelog**: [v2.2.3...v2.2.4](https://github.com/PrefectHQ/fastmcp/compare/v2.2.3...v2.2.4)
</Update>

<Update label="v2.2.3" description="2024-04-25">

## [v2.2.3: The Wild Side](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.3)

### New Features 🎉

* Add wildcard params for resource templates by [@jlowin](https://github.com/jlowin) in [#246](https://github.com/PrefectHQ/fastmcp/pull/246)

### Docs 📚

* Indicate that Image class is for returns by [@jlowin](https://github.com/jlowin) in [#242](https://github.com/PrefectHQ/fastmcp/pull/242)
* Update mermaid diagram by [@jlowin](https://github.com/jlowin) in [#243](https://github.com/PrefectHQ/fastmcp/pull/243)

### Other Changes 🦾

* update version badges by [@jlowin](https://github.com/jlowin) in [#248](https://github.com/PrefectHQ/fastmcp/pull/248)

**Full Changelog**: [v2.2.2...v2.2.3](https://github.com/PrefectHQ/fastmcp/compare/v2.2.2...v2.2.3)
</Update>

<Update label="v2.2.2" description="2024-04-24">

## [v2.2.2: Prompt and Circumstance](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.2)

### New Features 🎉

* Add prompt support by [@jlowin](https://github.com/jlowin) in [#235](https://github.com/PrefectHQ/fastmcp/pull/235)

### Fixes 🐞

* Ensure that resource templates are properly exposed by [@jlowin](https://github.com/jlowin) in [#238](https://github.com/PrefectHQ/fastmcp/pull/238)

### Docs 📚

* Update docs for prompts by [@jlowin](https://github.com/jlowin) in [#236](https://github.com/PrefectHQ/fastmcp/pull/236)

### Other Changes 🦾

* Add prompt tests by [@jlowin](https://github.com/jlowin) in [#239](https://github.com/PrefectHQ/fastmcp/pull/239)

**Full Changelog**: [v2.2.1...v2.2.2](https://github.com/PrefectHQ/fastmcp/compare/v2.2.1...v2.2.2)
</Update>

<Update label="v2.2.1" description="2024-04-23">

## [v2.2.1: Template for Success](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.1)

### New Features 🎉

* Add resource templates by [@jlowin](https://github.com/jlowin) in [#230](https://github.com/PrefectHQ/fastmcp/pull/230)

### Fixes 🐞

* Ensure that resource templates are properly exposed by [@jlowin](https://github.com/jlowin) in [#231](https://github.com/PrefectHQ/fastmcp/pull/231)

### Docs 📚

* Update docs for resource templates by [@jlowin](https://github.com/jlowin) in [#232](https://github.com/PrefectHQ/fastmcp/pull/232)

### Other Changes 🦾

* Add resource template tests by [@jlowin](https://github.com/jlowin) in [#233](https://github.com/PrefectHQ/fastmcp/pull/233)

**Full Changelog**: [v2.2.0...v2.2.1](https://github.com/PrefectHQ/fastmcp/compare/v2.2.0...v2.2.1)
</Update>

<Update label="v2.2.0" description="2024-04-22">

## [v2.2.0: Compose Yourself](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.2.0)

### New Features 🎉

* Add support for mounting FastMCP servers by [@jlowin](https://github.com/jlowin) in [#175](https://github.com/PrefectHQ/fastmcp/pull/175)
* Add support for duplicate behavior == ignore by [@jlowin](https://github.com/jlowin) in [#169](https://github.com/PrefectHQ/fastmcp/pull/169)

### Breaking Changes 🛫

* Refactor MCP composition by [@jlowin](https://github.com/jlowin) in [#176](https://github.com/PrefectHQ/fastmcp/pull/176)

### Docs 📚

* Improve integration documentation by [@jlowin](https://github.com/jlowin) in [#184](https://github.com/PrefectHQ/fastmcp/pull/184)
* Improve documentation by [@jlowin](https://github.com/jlowin) in [#185](https://github.com/PrefectHQ/fastmcp/pull/185)

### Other Changes 🦾

* Add transport kwargs for mcp.run() and fastmcp run by [@jlowin](https://github.com/jlowin) in [#161](https://github.com/PrefectHQ/fastmcp/pull/161)
* Allow resource templates to have optional / excluded arguments by [@jlowin](https://github.com/jlowin) in [#164](https://github.com/PrefectHQ/fastmcp/pull/164)
* Update resources.mdx by [@jlowin](https://github.com/jlowin) in [#165](https://github.com/PrefectHQ/fastmcp/pull/165)

### New Contributors

* [@kongqi404](https://github.com/kongqi404) made their first contribution in [#181](https://github.com/PrefectHQ/fastmcp/pull/181)

**Full Changelog**: [v2.1.2...v2.2.0](https://github.com/PrefectHQ/fastmcp/compare/v2.1.2...v2.2.0)
</Update>

<Update label="v2.1.2" description="2024-04-14">

## [v2.1.2: Copy That, Good Buddy](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.1.2)

The main improvement in this release is a fix that allows FastAPI / OpenAPI-generated servers to be mounted as sub-servers.

### Fixes 🐞

* Ensure objects are copied properly and test mounting fastapi by [@jlowin](https://github.com/jlowin) in [#153](https://github.com/PrefectHQ/fastmcp/pull/153)

### Docs 📚

* Fix broken links in docs by [@jlowin](https://github.com/jlowin) in [#154](https://github.com/PrefectHQ/fastmcp/pull/154)

### Other Changes 🦾

* Update README.md by [@jlowin](https://github.com/jlowin) in [#149](https://github.com/PrefectHQ/fastmcp/pull/149)
* Only apply log config to FastMCP loggers by [@jlowin](https://github.com/jlowin) in [#155](https://github.com/PrefectHQ/fastmcp/pull/155)
* Update pyproject.toml by [@jlowin](https://github.com/jlowin) in [#156](https://github.com/PrefectHQ/fastmcp/pull/156)

**Full Changelog**: [v2.1.1...v2.1.2](https://github.com/PrefectHQ/fastmcp/compare/v2.1.1...v2.1.2)
</Update>

<Update label="v2.1.1" description="2024-04-14">

## [v2.1.1: Doc Holiday](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.1.1)

FastMCP's docs are now available at gofastmcp.com.

### Docs 📚

* Add docs by [@jlowin](https://github.com/jlowin) in [#136](https://github.com/PrefectHQ/fastmcp/pull/136)
* Add docs link to readme by [@jlowin](https://github.com/jlowin) in [#137](https://github.com/PrefectHQ/fastmcp/pull/137)
* Minor docs updates by [@jlowin](https://github.com/jlowin) in [#138](https://github.com/PrefectHQ/fastmcp/pull/138)

### Fixes 🐞

* fix branch name in example by [@zzstoatzz](https://github.com/zzstoatzz) in [#140](https://github.com/PrefectHQ/fastmcp/pull/140)

### Other Changes 🦾

* smart home example by [@zzstoatzz](https://github.com/zzstoatzz) in [#115](https://github.com/PrefectHQ/fastmcp/pull/115)
* Remove mac os tests by [@jlowin](https://github.com/jlowin) in [#142](https://github.com/PrefectHQ/fastmcp/pull/142)
* Expand support for various method interactions by [@jlowin](https://github.com/jlowin) in [#143](https://github.com/PrefectHQ/fastmcp/pull/143)
* Update docs and add\_resource\_fn by [@jlowin](https://github.com/jlowin) in [#144](https://github.com/PrefectHQ/fastmcp/pull/144)
* Update description by [@jlowin](https://github.com/jlowin) in [#145](https://github.com/PrefectHQ/fastmcp/pull/145)
* Support openapi 3.0 and 3.1 by [@jlowin](https://github.com/jlowin) in [#147](https://github.com/PrefectHQ/fastmcp/pull/147)

**Full Changelog**: [v2.1.0...v2.1.1](https://github.com/PrefectHQ/fastmcp/compare/v2.1.0...v2.1.1)
</Update>

<Update label="v2.1.0" description="2024-04-13">

## [v2.1.0: Tag, You're It](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.1.0)

The primary motivation for this release is the fix in #128 for Claude desktop compatibility, but the primary new feature of this release is per-object tags. Currently these are for bookkeeping only but will become useful in future releases.

### New Features 🎉

* Add tags for all core MCP objects by [@jlowin](https://github.com/jlowin) in [#121](https://github.com/PrefectHQ/fastmcp/pull/121)
* Ensure that openapi tags are transferred to MCP objects by [@jlowin](https://github.com/jlowin) in [#124](https://github.com/PrefectHQ/fastmcp/pull/124)

### Fixes 🐞

* Change default mounted tool separator from / to \_ by [@jlowin](https://github.com/jlowin) in [#128](https://github.com/PrefectHQ/fastmcp/pull/128)
* Enter mounted app lifespans by [@jlowin](https://github.com/jlowin) in [#129](https://github.com/PrefectHQ/fastmcp/pull/129)
* Fix CLI that called mcp instead of fastmcp by [@jlowin](https://github.com/jlowin) in [#128](https://github.com/PrefectHQ/fastmcp/pull/128)

### Breaking Changes 🛫

* Changed configuration for duplicate resources/tools/prompts by [@jlowin](https://github.com/jlowin) in [#121](https://github.com/PrefectHQ/fastmcp/pull/121)
* Improve client return types by [@jlowin](https://github.com/jlowin) in [#123](https://github.com/PrefectHQ/fastmcp/pull/123)

### Other Changes 🦾

* Add tests for tags in server decorators by [@jlowin](https://github.com/jlowin) in [#122](https://github.com/PrefectHQ/fastmcp/pull/122)
* Clean up server tests by [@jlowin](https://github.com/jlowin) in [#125](https://github.com/PrefectHQ/fastmcp/pull/125)

**Full Changelog**: [v2.0.0...v2.1.0](https://github.com/PrefectHQ/fastmcp/compare/v2.0.0...v2.1.0)
</Update>

<Update label="v2.0.0" description="2024-04-11">

## [v2.0.0: Second to None](https://github.com/PrefectHQ/fastmcp/releases/tag/v2.0.0)

### New Features 🎉

* Support mounting FastMCP instances as sub-MCPs by [@jlowin](https://github.com/jlowin) in [#99](https://github.com/PrefectHQ/fastmcp/pull/99)
* Add in-memory client for calling FastMCP servers (and tests) by [@jlowin](https://github.com/jlowin) in [#100](https://github.com/PrefectHQ/fastmcp/pull/100)
* Add MCP proxy server by [@jlowin](https://github.com/jlowin) in [#105](https://github.com/PrefectHQ/fastmcp/pull/105)
* Update FastMCP for upstream changes by [@jlowin](https://github.com/jlowin) in [#107](https://github.com/PrefectHQ/fastmcp/pull/107)
* Generate FastMCP servers from OpenAPI specs and FastAPI by [@jlowin](https://github.com/jlowin) in [#110](https://github.com/PrefectHQ/fastmcp/pull/110)
* Reorganize all client / transports by [@jlowin](https://github.com/jlowin) in [#111](https://github.com/PrefectHQ/fastmcp/pull/111)
* Add sampling and roots by [@jlowin](https://github.com/jlowin) in [#117](https://github.com/PrefectHQ/fastmcp/pull/117)

### Fixes 🐞

* Fix bug with tools that return lists by [@jlowin](https://github.com/jlowin) in [#116](https://github.com/PrefectHQ/fastmcp/pull/116)

### Other Changes 🦾

* Add back FastMCP CLI by [@jlowin](https://github.com/jlowin) in [#108](https://github.com/PrefectHQ/fastmcp/pull/108)
* Update Readme for v2 by [@jlowin](https://github.com/jlowin) in [#112](https://github.com/PrefectHQ/fastmcp/pull/112)
* fix deprecation warnings by [@zzstoatzz](https://github.com/zzstoatzz) in [#113](https://github.com/PrefectHQ/fastmcp/pull/113)
* Readme by [@jlowin](https://github.com/jlowin) in [#118](https://github.com/PrefectHQ/fastmcp/pull/118)
* FastMCP 2.0 by [@jlowin](https://github.com/jlowin) in [#119](https://github.com/PrefectHQ/fastmcp/pull/119)

**Full Changelog**: [v1.0...v2.0.0](https://github.com/PrefectHQ/fastmcp/compare/v1.0...v2.0.0)
</Update>

<Update label="v1.0" description="2024-04-11">

## [v1.0: It's Official](https://github.com/PrefectHQ/fastmcp/releases/tag/v1.0)

This release commemorates FastMCP 1.0, which is included in the official Model Context Protocol SDK:

```python
from mcp.server.fastmcp import FastMCP
```

To the best of my knowledge, v1 is identical to the upstream version included with `mcp`.

### Docs 📚

* Update readme to redirect to the official SDK by [@jlowin](https://github.com/jlowin) in [#79](https://github.com/PrefectHQ/fastmcp/pull/79)

### Other Changes 🦾

* fix: use Mount instead of Route for SSE message handling by [@samihamine](https://github.com/samihamine) in [#77](https://github.com/PrefectHQ/fastmcp/pull/77)

### New Contributors

* [@samihamine](https://github.com/samihamine) made their first contribution in [#77](https://github.com/PrefectHQ/fastmcp/pull/77)

**Full Changelog**: [v0.4.1...v1.0](https://github.com/PrefectHQ/fastmcp/compare/v0.4.1...v1.0)
</Update>

<Update label="v0.4.1" description="2024-12-09">

## [v0.4.1: String Theory](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.4.1)

### Fixes 🐞

* fix: handle strings containing numbers correctly by [@sd2k](https://github.com/sd2k) in [#63](https://github.com/PrefectHQ/fastmcp/pull/63)

### Docs 📚

* patch: Update pyproject.toml license by [@leonkozlowski](https://github.com/leonkozlowski) in [#67](https://github.com/PrefectHQ/fastmcp/pull/67)

### Other Changes 🦾

* Avoid new try\_eval\_type unavailable with older pydantic by [@jurasofish](https://github.com/jurasofish) in [#57](https://github.com/PrefectHQ/fastmcp/pull/57)
* Decorator typing by [@jurasofish](https://github.com/jurasofish) in [#56](https://github.com/PrefectHQ/fastmcp/pull/56)

### New Contributors

* [@leonkozlowski](https://github.com/leonkozlowski) made their first contribution in [#67](https://github.com/PrefectHQ/fastmcp/pull/67)

**Full Changelog**: [v0.4.0...v0.4.1](https://github.com/PrefectHQ/fastmcp/compare/v0.4.0...v0.4.1)
</Update>

<Update label="v0.4.0" description="2024-12-05">

## [v0.4.0: Nice to MIT You](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.4.0)

This is a relatively small release in terms of features, but the version is bumped to 0.4 to reflect that the code is being relicensed from Apache 2.0 to MIT. This is to facilitate FastMCP's inclusion in the official MCP SDK.

### New Features 🎉

* Add pyright + tests by [@jlowin](https://github.com/jlowin) in [#52](https://github.com/PrefectHQ/fastmcp/pull/52)
* add pgvector memory example by [@zzstoatzz](https://github.com/zzstoatzz) in [#49](https://github.com/PrefectHQ/fastmcp/pull/49)

### Fixes 🐞

* fix: use stderr for logging by [@sd2k](https://github.com/sd2k) in [#51](https://github.com/PrefectHQ/fastmcp/pull/51)

### Docs 📚

* Update ai-labeler.yml by [@jlowin](https://github.com/jlowin) in [#48](https://github.com/PrefectHQ/fastmcp/pull/48)
* Relicense from Apache 2.0 to MIT by [@jlowin](https://github.com/jlowin) in [#54](https://github.com/PrefectHQ/fastmcp/pull/54)

### Other Changes 🦾

* fix warning and flake by [@zzstoatzz](https://github.com/zzstoatzz) in [#47](https://github.com/PrefectHQ/fastmcp/pull/47)

### New Contributors

* [@sd2k](https://github.com/sd2k) made their first contribution in [#51](https://github.com/PrefectHQ/fastmcp/pull/51)

**Full Changelog**: [v0.3.5...v0.4.0](https://github.com/PrefectHQ/fastmcp/compare/v0.3.5...v0.4.0)
</Update>

<Update label="v0.3.5" description="2024-12-03">

## [v0.3.5: Windows of Opportunity](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.3.5)

This release is highlighted by the ability to handle complex JSON objects as MCP inputs and improved Windows compatibility.

### New Features 🎉

* Set up multiple os tests by [@jlowin](https://github.com/jlowin) in [#44](https://github.com/PrefectHQ/fastmcp/pull/44)
* Changes to accommodate windows users. by [@justjoehere](https://github.com/justjoehere) in [#42](https://github.com/PrefectHQ/fastmcp/pull/42)
* Handle complex inputs by [@jurasofish](https://github.com/jurasofish) in [#31](https://github.com/PrefectHQ/fastmcp/pull/31)

### Docs 📚

* Make AI labeler more conservative by [@jlowin](https://github.com/jlowin) in [#46](https://github.com/PrefectHQ/fastmcp/pull/46)

### Other Changes 🦾

* Additional Windows Fixes for Dev running and for importing modules in a server by [@justjoehere](https://github.com/justjoehere) in [#43](https://github.com/PrefectHQ/fastmcp/pull/43)

### New Contributors

* [@justjoehere](https://github.com/justjoehere) made their first contribution in [#42](https://github.com/PrefectHQ/fastmcp/pull/42)
* [@jurasofish](https://github.com/jurasofish) made their first contribution in [#31](https://github.com/PrefectHQ/fastmcp/pull/31)

**Full Changelog**: [v0.3.4...v0.3.5](https://github.com/PrefectHQ/fastmcp/compare/v0.3.4...v0.3.5)
</Update>

<Update label="v0.3.4" description="2024-12-02">

## [v0.3.4: URL's Well That Ends Well](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.3.4)

### Fixes 🐞

* Handle missing config file when installing by [@jlowin](https://github.com/jlowin) in [#37](https://github.com/PrefectHQ/fastmcp/pull/37)
* Remove BaseURL reference and use AnyURL by [@jlowin](https://github.com/jlowin) in [#40](https://github.com/PrefectHQ/fastmcp/pull/40)

**Full Changelog**: [v0.3.3...v0.3.4](https://github.com/PrefectHQ/fastmcp/compare/v0.3.3...v0.3.4)
</Update>

<Update label="v0.3.3" description="2024-12-02">

## [v0.3.3: Dependence Day](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.3.3)

### New Features 🎉

* Surge example by [@zzstoatzz](https://github.com/zzstoatzz) in [#29](https://github.com/PrefectHQ/fastmcp/pull/29)
* Support Python dependencies in Server by [@jlowin](https://github.com/jlowin) in [#34](https://github.com/PrefectHQ/fastmcp/pull/34)

### Docs 📚

* add `Contributing` section to README by [@zzstoatzz](https://github.com/zzstoatzz) in [#32](https://github.com/PrefectHQ/fastmcp/pull/32)

**Full Changelog**: [v0.3.2...v0.3.3](https://github.com/PrefectHQ/fastmcp/compare/v0.3.2...v0.3.3)
</Update>

<Update label="v0.3.2" date="2024-12-01" description="Green with ENVy">

## [v0.3.2: Green with ENVy](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.3.2)

### New Features 🎉

* Support env vars when installing by [@jlowin](https://github.com/jlowin) in [#27](https://github.com/PrefectHQ/fastmcp/pull/27)

### Docs 📚

* Remove top level env var by [@jlowin](https://github.com/jlowin) in [#28](https://github.com/PrefectHQ/fastmcp/pull/28)

**Full Changelog**: [v0.3.1...v0.3.2](https://github.com/PrefectHQ/fastmcp/compare/v0.3.1...v0.3.2)
</Update>

<Update label="v0.3.1" description="2024-12-01">

## [v0.3.1](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.3.1)

### New Features 🎉

* Update README.md by [@jlowin](https://github.com/jlowin) in [#23](https://github.com/PrefectHQ/fastmcp/pull/23)
* add rich handler and dotenv loading for settings by [@zzstoatzz](https://github.com/zzstoatzz) in [#22](https://github.com/PrefectHQ/fastmcp/pull/22)
* print exception when server can't start by [@jlowin](https://github.com/jlowin) in [#25](https://github.com/PrefectHQ/fastmcp/pull/25)

### Docs 📚

* Update README.md by [@jlowin](https://github.com/jlowin) in [#24](https://github.com/PrefectHQ/fastmcp/pull/24)

### Other Changes 🦾

* Remove log by [@jlowin](https://github.com/jlowin) in [#26](https://github.com/PrefectHQ/fastmcp/pull/26)

**Full Changelog**: [v0.3.0...v0.3.1](https://github.com/PrefectHQ/fastmcp/compare/v0.3.0...v0.3.1)
</Update>

<Update label="v0.3.0" description="2024-12-01">

## [v0.3.0: Prompt and Circumstance](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.3.0)

### New Features 🎉

* Update README by [@jlowin](https://github.com/jlowin) in [#3](https://github.com/PrefectHQ/fastmcp/pull/3)
* Make log levels strings by [@jlowin](https://github.com/jlowin) in [#4](https://github.com/PrefectHQ/fastmcp/pull/4)
* Make content method a function by [@jlowin](https://github.com/jlowin) in [#5](https://github.com/PrefectHQ/fastmcp/pull/5)
* Add template support by [@jlowin](https://github.com/jlowin) in [#6](https://github.com/PrefectHQ/fastmcp/pull/6)
* Refactor resources module by [@jlowin](https://github.com/jlowin) in [#7](https://github.com/PrefectHQ/fastmcp/pull/7)
* Clean up cli imports by [@jlowin](https://github.com/jlowin) in [#8](https://github.com/PrefectHQ/fastmcp/pull/8)
* Prepare to list templates by [@jlowin](https://github.com/jlowin) in [#11](https://github.com/PrefectHQ/fastmcp/pull/11)
* Move image to separate module by [@jlowin](https://github.com/jlowin) in [#9](https://github.com/PrefectHQ/fastmcp/pull/9)
* Add support for request context, progress, logging, etc. by [@jlowin](https://github.com/jlowin) in [#12](https://github.com/PrefectHQ/fastmcp/pull/12)
* Add context tests and better runtime loads by [@jlowin](https://github.com/jlowin) in [#13](https://github.com/PrefectHQ/fastmcp/pull/13)
* Refactor tools + resourcemanager by [@jlowin](https://github.com/jlowin) in [#14](https://github.com/PrefectHQ/fastmcp/pull/14)
* func → fn everywhere by [@jlowin](https://github.com/jlowin) in [#15](https://github.com/PrefectHQ/fastmcp/pull/15)
* Add support for prompts by [@jlowin](https://github.com/jlowin) in [#16](https://github.com/PrefectHQ/fastmcp/pull/16)
* Create LICENSE by [@jlowin](https://github.com/jlowin) in [#18](https://github.com/PrefectHQ/fastmcp/pull/18)
* Update cli file spec by [@jlowin](https://github.com/jlowin) in [#19](https://github.com/PrefectHQ/fastmcp/pull/19)
* Update readmeUpdate README by [@jlowin](https://github.com/jlowin) in [#20](https://github.com/PrefectHQ/fastmcp/pull/20)
* Use hatchling for version by [@jlowin](https://github.com/jlowin) in [#21](https://github.com/PrefectHQ/fastmcp/pull/21)

### Other Changes 🦾

* Add echo server by [@jlowin](https://github.com/jlowin) in [#1](https://github.com/PrefectHQ/fastmcp/pull/1)
* Add github workflows by [@jlowin](https://github.com/jlowin) in [#2](https://github.com/PrefectHQ/fastmcp/pull/2)
* typing updates by [@zzstoatzz](https://github.com/zzstoatzz) in [#17](https://github.com/PrefectHQ/fastmcp/pull/17)

### New Contributors

* [@jlowin](https://github.com/jlowin) made their first contribution in [#1](https://github.com/PrefectHQ/fastmcp/pull/1)
* [@zzstoatzz](https://github.com/zzstoatzz) made their first contribution in [#17](https://github.com/PrefectHQ/fastmcp/pull/17)

**Full Changelog**: [v0.2.0...v0.3.0](https://github.com/PrefectHQ/fastmcp/compare/v0.2.0...v0.3.0)
</Update>

<Update label="v0.2.0" description="2024-11-30">

## [v0.2.0](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.2.0)

**Full Changelog**: [v0.1.0...v0.2.0](https://github.com/PrefectHQ/fastmcp/compare/v0.1.0...v0.2.0)
</Update>

<Update label="v0.1.0" description="2024-11-30">

## [v0.1.0](https://github.com/PrefectHQ/fastmcp/releases/tag/v0.1.0)

The very first release of FastMCP! 🎉

**Full Changelog**: [Initial commits](https://github.com/PrefectHQ/fastmcp/commits/v0.1.0)
</Update>

---

### Updates (`docs/updates.mdx`)

---
title: "FastMCP Updates"
sidebarTitle: "Updates"
description: "Summaries of each FastMCP release, with links to the full release notes on GitHub."
icon: "sparkles"
tag: NEW
---

<Update label="FastMCP 4.2.0" description="November 13, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.2.0: Mad Skills"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0"
cta="Read the release notes"
>
FastMCP 4.2 makes skills something a server can serve. A `Skill` is now a plain value — a name, a description, instructions and files, validated once when you build it — and you can load one from a directory or a package, or build it in code. Put skills on a server with `SkillCatalogProvider` or `SkillsDirectoryProvider` and they're served as ordinary resources; clients that speak the experimental [Skills extension](https://modelcontextprotocol.io/seps/2640-skills-extension) also get `skills/list` with a hashed manifest per skill. Client support is still uneven, so FastMCP's own client covers the gap: `Client.read_skill()` verifies every file's size and digest, and `to_directory()` installs a skill into any agent's skills folder. Skills follow the rest of FastMCP's composition: they namespace under mounts, pass through proxies with `skills=True`, list across a `ClientGroup`, and respect `AuthMiddleware`.

Thanks to our 129 contributors, including 55 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.2.0a5" description="November 12, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.2.0a5: Skillium Fancyson"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a5"
cta="Read the release notes"
>
FastMCP 4.2.0a5 adds `SkillManifestProvider`, which serves skills from their manifests (frontmatter plus each file's digest and size) and reads a file only when a client reads it, so skills kept in a bucket or database don't have to be loaded to answer `skills/list`. `SkillCatalogProvider` now builds on it and no longer re-hashes every file on each request. Since a4, a dependency can own the tool argument it reads through `CallArgument`, completion no longer suggests values for prompts or templates a caller can't see, `ctx.info()` and the other logging helpers work inside background tasks, and a final polish pass covered docs, examples and docstrings. This is the last prerelease before 4.2.0. Thanks to our 128 contributors, including 54 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.1.8" description="November 10, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.8: Backporch Light"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.8"
cta="Read the release notes"
>
FastMCP 4.1.8 backports 28 fixes from the 4.2 line, led by OAuth proxy token revocation, which now works for the client that owns the token. It also fixes recursive and untyped schema hydration, GitHub sessions across transient verification failures, proxied sampling and prompt arguments, and a set of OpenAPI, client timeout, task and CLI edge cases. Thanks to our 21 contributors, including 9 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.2.0a4" description="November 9, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.2.0a4: Skills to Pay the Bills"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a4"
cta="Read the release notes"
>
FastMCP 4.2.0a4 requires Python 3.11 or newer and adds `Annotated` dependencies. `Depends(...)` and built-ins such as `CurrentContext()` can now be declared as `Annotated` metadata, so a type alias like `Config = Annotated[dict, Depends(get_config)]` works across tools, resources, and prompts. Skill discovery over plain resources no longer lists a nested supporting `SKILL.md` as its own skill, and `download_skill` URIs now encode manifest paths. Since a3, the redirect URI helpers normalize raw strings the way browsers read them, the joserfc and Authlib floors pick up security fixes, and fixes land for OpenAPI request bodies, CIMD redirect URIs, multi-select elicitation schemas, search indexing, and docstring parsing. Skills support remains experimental; this prerelease is intended for integration testing. Thanks to our 68 contributors, including 40 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.1.7" description="November 9, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.7: Dumpster Dive"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.7"
cta="Read the release notes"
>
FastMCP 4.1.7 backports 42 fixes from the 4.2 line, covering OpenAPI schema and parameter handling, OAuth redirect and consent edge cases, proxy and response caching, and lost-connection errors in the client. It also requires patched joserfc and Authlib releases and closes a redirect URI validation gap for callers that pass raw strings. Thanks to our 41 contributors, including 28 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.2.0a3" description="November 3, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.2.0a3: A Particular Set of Skills"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a3"
cta="Read the release notes"
>
FastMCP 4.2.0a3 consolidates skills around `Skill`, `SkillCatalogProvider`, and the new strict `SkillsDirectoryProvider` in `fastmcp.skills.provider`. Directory loading validates each skill before publication, and skills with structured metadata or YAML `allowed-tools` lists are accepted without changing their values. This alpha also fixes stale proxy discovery caches, preserves OpenAPI schema references and explicit null values, and improves client connection recovery. Skills support remains experimental; this prerelease is intended for integration testing. If you import the 4.1 skills providers directly, they keep their behavior in 4.2 and now warn ahead of removal in 4.3. Move directory loading to `from fastmcp.skills.provider import SkillsDirectoryProvider`; its startup errors and the legacy providers' warnings identify folders that need fixing. For a single skill, use `Skill.from_directory(...)` with `SkillCatalogProvider` from `fastmcp.skills.provider`. `Client.list_skill_resources()` remains available for servers without the Skills extension. The old `experimental_skills=True` path redirects to the new provider for the base class and rejects subclasses to preserve access controls. Legacy `Skill` wire-model construction still works with a warning, wire entries retain `isinstance(entry, Skill)` behavior, and existing Pydantic `Skill` fields still validate wire payloads. Use `MCPSkill` for wire entries, annotations, and checks, and `Skill` for authoring. For manifest metadata on resource-only servers, read `skill://<name>/_manifest` with `client.read_resource()` and parse its JSON; `client.get_skill()` requires the Skills extension, while `client.read_skill()` downloads and validates the whole skill. Since a2, `ClientGroup` retains known tool routes after its context exits, OpenAPI tool inputs omit `readOnly` properties, and header and path parameters follow their declared simple serialization style. OAuth consent bindings survive concurrent approvals, exception middleware matches subclasses, and empty logging method filters mean “log nothing.” Thanks to our 46 contributors, including 29 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.2.0a2" description="November 1, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.2.0a2: Skill Waters Run Deep"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a2"
cta="Read the release notes"
>
The second 4.2 alpha carries every fix from 4.1.5 plus the ones that only land on 4.2: Skills discovery through proxies pages its backends with a bound, pre-4.2 Prefab backend addresses rebind through 4.2 proxies, large tool catalogs expand their schemas faster, and kept-alive stdio transports respect each client's timeout. Before tagging, this build ran against pydantic-ai, langchain, agno, Microsoft Agent Framework, and the OpenAI Agents SDK. Skills support remains experimental; this prerelease is intended for integration testing. Behavior changes since a1: JSON Schema `const` and `enum` compare by JSON equality, so `true` no longer passes for `1`; `prompts/get` with a missing argument returns invalid params (`-32602`); OpenAPI upstream errors are cut to 1 KB with HTML bodies dropped, and strict input validation rejects undeclared OpenAPI arguments; a later client with a different timeout restarts an idle kept-alive stdio subprocess, while one nested inside a live client shares its session's timeout and logs a warning. Thanks to our 22 contributors, including 13 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.1.5" description="November 1, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.5: Back to the Fourture"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.5"
cta="Read the release notes"
>
Twelve fixes backported from main onto the new `release/4.1` line: mounted resource templates keep their list-style query parameters, `FastMCPStdioTransport` forwards script arguments, OpenAPI tools report timeouts and concise upstream errors (and reject undeclared arguments under strict validation), a missing prompt argument returns invalid params, and JSON Schema `const`/`enum` compare by JSON equality, so `true` no longer passes for `1`. Thanks to our 12 contributors, including 7 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.2.0a1" description="October 27, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.2.0a1: Skill Issue"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.2.0a1"
cta="Read the release notes"
>
FastMCP 4.2's first alpha brings code-defined skills, discovery through mounted and proxied servers, and verified downloads into one workflow. Build a `Skill` in Python or load one from a folder or package, publish it through `SkillCatalogProvider`, and let clients discover its metadata or download and export its files. Proxy discovery is opt-in with `skills=True`. Skills support remains experimental; this prerelease is intended for integration testing. It also includes lazy, shared Prefab renderer resources and backend-addressing fixes. Migration: `Skill` now represents file contents; the wire metadata model is named `MCPSkill`. Whole-skill downloads require a standard `SKILL.md` with a `name` matching its URI and a `description`. Exports with `overwrite=True` replace the installed folder, including locally added files. Ordinary resource providers still support their existing document formats. Thanks to our 8 contributors, including 3 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.1.4" description="October 26, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.4: Token Gesture"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.4"
cta="Read the release notes"
>
Generated CLIs now preserve remote transports, empty arrays, and parameters whose names collide with their own helpers; mounted servers honor session visibility and `mounted_components_raise_on_load_error`, a stale client context no longer closes a newer session, and OAuth provider wrappers accept identity assertions. Tasks accept a redis-py credential provider that returns current credentials for each new connection (streaming providers such as redis-entraid's are rejected until Docket can refresh them safely), Redis 8.1.0 is excluded, and custom `KeyringStore` users must now install `py-key-value-aio[keyring]` explicitly. Thanks to our 16 contributors, including 9 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.1.3" description="October 20, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.3: Root Awakening"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.3"
cta="Read the release notes"
>
This release updates certifi-backed dependencies following the eMudhra CA compromise and fixes public-client OAuth authentication, empty visibility selections, generator transforms, and per-server timeouts for ordinary requests. FastMCP 4 uses system trust by default: follow the [security notice](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026) to update operating-system, container, custom, and installer trust stores; upgrading FastMCP alone is insufficient. Thanks to our 11 contributors, including 6 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.1.2" description="October 20, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.2: License to Deny"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.2"
cta="Read the release notes"
>
Component authorization now applies after transforms, denied resources cannot fall through matching templates, and OAuth client credentials providers support issuer binding across fresh and cached-token flows. Existing configurations remain compatible, but users of `ClientCredentialsOAuthProvider` or `PrivateKeyJWTOAuthProvider` must set `issuer` to enable this protection; upgrading alone is insufficient. Thanks to our 18 contributors, including 9 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 3.4.11" description="October 20, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.11: Trust Issues"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.11"
cta="Read the release notes"
>
This release requires certifi 2026.10.19 or later for FastMCP's HTTP stack and certifi-backed integrations following the eMudhra CA compromise. Follow the [security notice](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026) to update custom, system, and installer trust stores too; upgrading FastMCP alone is insufficient. Thanks to our 1 contributor, with no first-time contributors in this release.
</Card>
</Update>

<Update label="FastMCP 3.4.10" description="October 20, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.10: Back in Check"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.10"
cta="Read the release notes"
>
This release backports component authorization checks after transforms and prevents denied concrete resources from being served by matching templates. All 3.x users are encouraged to upgrade. Thanks to our 2 contributors, including 1 first-time contributor.
</Card>
</Update>

<Update label="FastMCP 4.1.1" description="October 17, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.1: Regex Marks the Spot"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.1"
cta="Read the release notes"
>
Regex tool search now rejects patterns over 1,000 characters and stops after about a second, and `SkillsDirectoryProvider` discovers skill folders that are links again, including links to folders outside the skills root; a skill's own files must still resolve inside the folder it links to. All 4.x users are encouraged to upgrade. Thanks to our 4 contributors, including 1 first-time contributor.
</Card>
</Update>

<Update label="FastMCP 3.4.9" description="October 16, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.9: Contain Yourself"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.9"
cta="Read the release notes"
>
This release backports security fixes from 4.1: OpenAPI path parameters reject `.` and `..` segments, a skill's `SKILL.md` must stay inside its skill folder, regex tool search is bounded in time and pattern length, and JWT verifiers share JWKS refreshes instead of fetching on every unknown key ID. All 3.x users are encouraged to upgrade. Thanks to our 6 contributors, including 3 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 4.1.0" description="October 8, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.1.0: Fourth and One"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.0"
cta="Read the release notes"
>
FastMCP 4.1.0 is a maintenance release at heart: a broad sweep of fixes across OpenAPI, proxies, auth, tasks, and the CLI, plus full Python 3.15 support. It doesn't change how most servers behave. A few security fixes do tighten inputs that FastMCP previously accepted, though, and our versioning policy keeps breaking changes out of patch releases, so this ships as a point-one release.

Thanks to our 48 contributors, including 21 first-time contributors!
</Card>
</Update>

<Update label="FastMCP 4.0.11" description="October 4, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.11: Fort Knocks"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.11"
cta="Read the release notes"
>
This release contains important security and bug fixes. All users are encouraged to upgrade. Thanks to our 10 contributors, including 6 first-time contributors.
</Card>
</Update>

<Update label="FastMCP 3.4.8" description="October 4, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.8: Long Arm of the Patch"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.8"
cta="Read the release notes"
>
This release contains important security and bug fixes. All users are encouraged to upgrade. Thanks to our 2 contributors.
</Card>
</Update>

<Update label="FastMCP 4.0.10" description="September 25, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.10: Inside Job"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.10"
cta="Read the release notes"
>
Task-enabled tools now work behind search transforms and CodeMode: they're registered with the task backend even when hidden, and a tool, resource, or prompt that calls one through `ctx.fastmcp.call_tool()` (including the search `call_tool` proxy and CodeMode's `execute`) now gets its result instead of an empty task receipt.
</Card>
</Update>

<Update label="FastMCP 4.0.9" description="September 24, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.9: Cache and Release"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.9"
cta="Read the release notes"
>
`ResourceTemplate` now keeps its compiled URI pattern for its own lifetime while the shared cache is bounded again, preventing dynamic proxies from growing process memory without restoring the 4,096-template performance cliff.
</Card>
</Update>

<Update label="FastMCP 4.0.8" description="September 23, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.8: Take Three"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.8"
cta="Read the release notes"
>
Completion goes back to its 4.0.5 behavior. The visibility check added in 4.0.6 and reworked in 4.0.7 simulated list requests through middleware, and in 4.0.7 that could let a response cache serve hidden prompts to other clients. New tests pin both problems, and withholding suggestions for hidden references will return with a proper design. Resource template patterns are now cached without a size limit, so servers with thousands of templates read fast again, and OAuthProxy revokes the upstream refresh token instead of sending its own token upstream.
</Card>
</Update>

<Update label="FastMCP 4.0.7" description="September 23, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.7: Double Take"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.7"
cta="Read the release notes"
>
Fixes two regressions from 4.0.6. The completion visibility check runs only the list-specific middleware hooks, so rate limits, logging, and metrics see a single request per completion again. Resource template patterns are cached, which makes template reads faster than in 4.0.5.
</Card>
</Update>

<Update label="FastMCP 4.0.6" description="September 23, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.6: Comma Chameleon"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.6"
cta="Read the release notes"
>
Resource templates now match what clients actually send: literals raw or percent-encoded, and list query parameters exploded or comma-joined. A `Client` whose exit is cancelled releases its session instead of leaking it, completion no longer answers for prompts and templates the caller can't see, and JSON schemas with float or oversized length limits load instead of failing. The auth fixes cache OIDC discovery and keep Google tokens out of request URLs.
</Card>
</Update>

<Update label="FastMCP 4.0.5" description="September 17, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.5: No Country for Loose Ints"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.5"
cta="Read the release notes"
>
Tool parameters declared strict with `Field(strict=True)`, `StrictInt`, or a strict model config are honored again, on both direct calls and task submission. Since the SDK v2 migration the server's lax default overrode them and silently coerced values.
</Card>
</Update>

<Update label="FastMCP 4.0.4" description="September 15, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.4: Here Be No Dragons"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.4"
cta="Read the release notes"
>
OpenAPI request bodies get most of the attention in this patch: multipart string arrays are sent as repeated fields, whole-body arguments no longer clobber same-named HTTP parameters, dictionary bodies and raw content types survive intact, and JSON scalar bodies are encoded. On the auth side, OAuthProxy rejects ID-JAG tokens unless identity assertion is configured and refuses non-positive upstream token expiries. Clients now follow empty pagination cursors and servers reject malformed ones.
</Card>
</Update>

<Update label="FastMCP 4.0.3" description="September 4, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.3: Once Is Enough"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.3"
cta="Read the release notes"
>
Multi-server clients with legacy-only backends now avoid unnecessary startup retries, and tools returning unconstrained sequences no longer send images twice. This patch also fixes task timing values rejected by strict clients and cleans up unfinished Monty callbacks when execution ends.
</Card>
</Update>

<Update label="FastMCP 4.0.2" description="September 2, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.2: Root Access"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.2"
cta="Read the release notes"
>
`ClientGroup` is now importable from the package root, `from fastmcp import ClientGroup`, with the same lazy export and install hint as `Client`, so integrations no longer couple to FastMCP's internal module layout.
</Card>
</Update>

<Update label="FastMCP 4.0.1" description="September 1, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.1: Come Back Any Time"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.1"
cta="Read the release notes"
>
`ClientGroup` is now reentrant like `Client`: nested or concurrent entries reuse the group's connections, and only the last exit closes them.
</Card>
</Update>

<Update label="FastMCP 4.0.0" description="August 31, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.0: Four Real"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0"
cta="Read the release notes"
>
FastMCP 4 is stable: the FastMCP release for the new MCP protocol and the rewritten Python SDK v2, with old-protocol clients supported through per-connection negotiation. Read the announcement: [FastMCP 4 is GA](https://blog.gofastmcp.com/3mufbh2vcv22o).

🌐 **Every protocol era** — one deployment serves `2026-07-28` and legacy clients; `Client(url)` negotiates from the other side.

🔁 **Interactive tools** — tools request follow-up input across complete request-response rounds.

⚙️ **Background tasks** — `@mcp.tool(task=True)` via the `io.modelcontextprotocol/tasks` extension in the optional `fastmcp-tasks` package.

🧩 **Extensions** — `add_extension()` registers capability-negotiated protocol extensions with their own methods and lifespan.

💉 **Dependency injection** — `Depends` + `CallArgument` bind dependencies to call arguments while keeping them out of tool schemas.

🤝 **Client groups** — `ClientGroup` manages one client per server with collision-checked namespacing.
</Card>
</Update>

<Update label="FastMCP 4.0.0b5" description="August 28, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.0b5: Group Effourt"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b5"
cta="Read the release notes"
>
FastMCP 4 beta 5 introduces client groups: coordinate several independent MCP server connections through one tool catalog, without a proxy in the middle.

🤝 **Client groups** — `ClientGroup` manages one client per server, each negotiating its own protocol era, with collision-checked `{server}_{tool}` namespacing, call routing, and per-tool provenance for adapters.

📏 **Consistent limits** — middleware response limits now align with declared output schemas.
</Card>
</Update>

<Update label="FastMCP 4.0.0b4" description="August 26, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.0b4: Calm Befour the Storm"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b4"
cta="Read the release notes"
>
FastMCP 4 beta 4 is the final hardening pass before the stable release, improving modern multi-server clients, operational tooling, and security boundaries.

🌐 **Modern multi-server clients** — proxy-backed client configurations now preserve modern protocol support instead of forcing the legacy handshake.

☁️ **Horizon accounts** — new commands manage Prefect Horizon account authentication from the FastMCP CLI.

🔐 **Safer boundaries** — HTTP proxies no longer forward cookies, MCP transport headers reach their backends correctly, and CIMD caches stay bounded.

🔎 **Sharper tools** — BM25 search handles Unicode tokens and MCP inspect reports server instructions correctly.
</Card>
</Update>

<Update label="FastMCP 4.0.0b3" description="August 14, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.0b3: Fast Fourward"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b3"
cta="Read the release notes"
>
FastMCP 4 beta 3 moves the v4 line toward general availability with new authentication and dependency-injection capabilities, plus compatibility hardening across OAuth, proxies, OpenAPI, and Python 3.14.

🔐 **Authentication foundations** — Prefect Horizon gains a native authentication client and local state, Google token verification can pin audiences, and Scalekit issuer updates preserve backward compatibility.

🧰 **Tool dependencies** — `CallArgument` and `Depends` bindings from `uncalled-for` 0.4 work in regular tools and background tasks.

🔄 **Runtime reliability** — stateful proxy clients reconnect after session failures, consent transactions keep valid earlier CSRF tokens, and partial parameter hints work on Python 3.14.

🧾 **OpenAPI fidelity** — parameter-level `example` and `examples` values now flow into generated tool schemas.
</Card>
</Update>

<Update label="FastMCP 3.4.7" description="August 10, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.7: Know Your Audience"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.7"
cta="Read the release notes"
>
FastMCP 3.4.7 restores CIMD `private_key_jwt` authentication for bare-origin OAuth proxy deployments by validating client assertions against the exact token endpoint advertised to clients.
</Card>
</Update>

<Update label="FastMCP 3.4.6" description="August 5, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.6: Trust, but Proxy"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.6"
cta="Read the release notes"
>
FastMCP 3.4.6 adds trusted-proxy support for SSRF-protected OAuth metadata and JWKS fetches on the 3.x line. Deployments can route these requests through a mandated corporate proxy while preserving custom CA certificates, and FastMCP refuses the fetch when no proxy is configured instead of risking an unprotected direct request.
</Card>
</Update>

<Update label="FastMCP 4.0.0b1" description="July 28, 2026" tags={["Releases"]}>
<Card
title="FastMCP v4.0.0b1: Fourgone Conclusion"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v4.0.0b1"
cta="Read the release notes"
>
FastMCP 4 makes stateful MCP applications work on the sessionless protocol while one deployment continues serving handshake-era clients. The engine underneath changed completely, but FastMCP absorbs nearly all of it — most FastMCP 3 servers upgrade untouched.

🌐 **Every protocol era** — one server answers both the sessionless `2026-07-28` protocol and the older session-based handshake, negotiated per connection.

💬 **Interactive tools** — tools ask follow-up questions across complete request-response rounds, with shared request-state keys for load balancing and worker restarts.

💾 **State without a session** — `UserSession` and `SessionId` give tools explicit server-side state on a protocol that deliberately has none, keyed per user when the request is authenticated.

⏳ **Background tasks** — the `io.modelcontextprotocol/tasks` extension in the new `fastmcp-tasks` package, on the same Docket engine FastMCP 3 used.

🧩 **Server extensions** — `add_extension()` turns capability-negotiated protocol features into a supported plugin surface.

🔐 **Enterprise auth** — server-side identity assertion (SEP-990), `require_roles`, scope step-up challenges, and DCR `application_type`.

⚠️ **Breaking** — server-initiated sampling and roots are removed from the server API, and the 3.x-era compatibility shims are gone. See the [upgrade guide](/getting-started/upgrading/from-fastmcp-3).
</Card>
</Update>

<Update label="FastMCP 3.4.5" description="July 27, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.5: Key Change"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.5"
cta="Read the release notes"
>
A maintenance release for the 3.x line. A single unrecognized JWKS key — Ed25519, which Rauthy and Ory Hydra publish by default — no longer poisons the entire key cache, alongside fixes for Azure scope fallback, OpenAPI `deepObject` query serialization, schema compression, and transformed tool `required` ordering.
</Card>
</Update>

<Update label="FastMCP 3.4.4" description="July 8, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.4: Host in Translation"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.4"
cta="Read the release notes"
>
A compatibility patch for HTTP deployments affected by the 3.4.3 Host/Origin guard defaults. FastMCP 3.x now keeps strict Host and Origin validation available for explicit opt-in deployments without rejecting existing ASGI, serverless, and reverse-proxy traffic by default.

🌐 **HTTP compatibility restored** — existing hosted deployments keep accepting their public Host headers unless strict host/origin protection is configured.

🔐 **Guard remains available** — deployments that know their public host and browser origins can still enable strict validation with `host_origin_protection=True`, `allowed_hosts`, and `allowed_origins`.

🤗 **Hugging Face auth** — new OAuth provider support covers public and private Hugging Face apps, with docs and examples for PKCE, Dynamic Client Registration, and CIMD.
</Card>
</Update>

<Update label="FastMCP 3.4.3" description="July 5, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.3: The Fast and the Secure-ious"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.3"
cta="Read the release notes"
>
A month of SSRF and OAuth hardening lands in one patch. NAT64, 6to4, Teredo, and ISATAP transition addresses can no longer smuggle private IPv4 targets past the SSRF allow-list, Streamable HTTP validates Host and Origin before session handling to block DNS rebinding, and OAuth redirect validation rejects unsafe schemes and unregistered DCR redirect URIs.

🛡️ **SSRF allow-list hardening** — every IPv6 transition form (NAT64, 6to4, Teredo, ISATAP) now unwraps to its embedded IPv4 target and gets checked against the same policy.

🌐 **DNS rebinding protection** — Streamable HTTP validates `Host` and browser `Origin` before session handling, closing a path to localhost-bound unauthenticated servers.

🔐 **Stricter OAuth redirects** — unsafe redirect schemes are rejected before registration, and DCR clients are bound to the redirect URIs they registered.

🧵 **Reliability fixes** — proxy session teardown races, discriminator-tag handling in JSON schema conversion, and several smaller fixes across middleware and resource templates.
</Card>
</Update>

<Update label="FastMCP 3.4.2" description="June 6, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.2: Heads Up"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.2"
cta="Read the release notes"
>
A compatibility patch. `JWTVerifier` now accepts JWTs carrying private, non-critical JWS header parameters (like Clerk's `cat`) instead of rejecting them before signature and claim validation, while unsupported critical headers are still rejected.
</Card>
</Update>

<Update label="FastMCP 3.4.1" description="June 5, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.1: Floor It"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.1"
cta="Read the release notes"
>
A security patch. FastMCP now floors Starlette at `>=1.0.1`, so installs can no longer resolve to a version affected by CVE-2026-48710 — previously the dependency was only constrained transitively through `mcp`. OAuthProxy also logs refresh-token cache misses instead of failing silently.
</Card>
</Update>

<Update label="FastMCP 3.4.0" description="June 2, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.4.0: Remote Control"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.4.0"
cta="Read the release notes"
>
The remote release. `fastmcp-remote` is a standalone bridge that connects stdio-only MCP hosts to servers hosted over HTTP, with OAuth enabled automatically for HTTPS. The proxy layer underneath it is hardened so bridges fail loudly on a missing or misconfigured upstream, and FastMCP-issued tokens can now outlive short-lived upstream tokens to survive long idle periods.

🌉 **fastmcp-remote** — `uvx fastmcp-remote https://example.com/mcp` bridges a remote server back to a stdio-only host.

🔌 **Bridges fail loudly** — proxies forward `initialize` upstream, so a missing backend or wrong URL fails the handshake instead of returning an empty-but-connected proxy.

🔐 **Longer-lived tokens** — `fastmcp_access_token_expiry_seconds` decouples the client-facing token lifetime from a short upstream `expires_in`.

⚠️ **Returnable tool errors** — `ToolResult(..., is_error=True)` hands back rich errors the model can act on instead of only raising.
</Card>
</Update>

<Update label="FastMCP 3.3.1" description="May 15, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.3.1: Loop There It Is"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.3.1"
cta="Read the release notes"
>
Hotfix for the 3.3 packaging split: standalone component imports like `from fastmcp.tools import tool` no longer pull in the server stack or trip a circular import. Component-level auth and task primitives moved to lightweight utility modules, with the old import paths preserved as compatibility re-exports.
</Card>
</Update>

<Update label="FastMCP 3.3.0" description="May 15, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.3.0: Slim Reaper"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.3.0"
cta="Read the release notes"
>
The `fastmcp-slim` release. A dependency-light distribution that ships FastMCP's client and transport layer without Starlette, Uvicorn, or the server stack — the import namespace is unchanged. It also closes out a backlog of OAuth proxy hardening, MCP-compliant OTEL instrumentation, and auth additions.

🪶 **fastmcp-slim** — install the client without the server footprint for CI, agents, and library dependencies.

🔐 **OAuth proxy hardening** — silent-consent AS-in-the-middle guard, dot-segment redirect rejection, and per-token response cache partitioning.

🔑 **Auth additions** — `AzureB2CProvider` user flows and a public `update_scopes()` API on `OAuthProxy`.

🧵 **Thread affinity** — `@mcp.tool(run_in_thread=False)` for tools bound to a specific thread.
</Card>
</Update>

<Update label="FastMCP 3.2.4" description="April 14, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.2.4: Patch Me If You Can"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.4"
cta="Read the release notes"
>
A grab bag of fixes and hardening. Background tasks are now scoped to the authorization context instead of the MCP session — a breaking change for anyone relying on session-scoped semantics — and parameter descriptions are extracted from docstrings automatically.

🔐 **Security** — `FileUpload` validates decoded base64 size, the proxy stops forwarding inbound headers to unrelated servers, and AuthKit binds token audience per RFC 8707.

🔑 **Keycloak** — new OAuth provider for enterprise auth and local dev.
</Card>
</Update>

<Update label="FastMCP 3.2.3" description="April 9, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.2.3: Redis or Not"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.3"
cta="Read the release notes"
>
Pins `fakeredis<2.35.0` in the `tasks` extra: a 2.35.0 rename broke pydocket's `memory://` backend and made `fastmcp[tasks]` installs fail at startup with an `ImportError`.
</Card>
</Update>

<Update label="FastMCP 3.2.2" description="April 9, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.2.2: Audience Appreciation"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.2"
cta="Read the release notes"
>
Fixes the Azure audience regression from 3.2.1 — both the bare client ID GUID and a custom `identifier_uri` are now accepted as the token audience.
</Card>
</Update>

<Update label="FastMCP 3.2.1" description="April 8, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.2.1: Audience Participation"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.1"
cta="Read the release notes"
>
A patch focused on auth-provider audience validation: Cognito validates on `client_id`, Azure honors `identifier_uri`, and consent cookies are LRU-capped to avoid header overflow. Also fixes OpenAPI 3.0 `nullable` fields leaking into tool input schemas and server-variable substitution in base URLs.
</Card>
</Update>

<Update label="FastMCP 3.2.0" description="March 30, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.2.0: Show Don't Tool"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.0"
cta="Read the release notes"
>
The Apps release. Your tools can return interactive UIs — charts, dashboards, forms, maps — rendered right inside the conversation.

🎨 **FastMCPApp** — separate the tools the LLM sees (`@app.ui()`) from the backend tools the UI calls (`@app.tool()`), built on Prefab.

🧩 **Built-in providers** — FileUpload, Approval, Choice, FormInput, and GenerativeUI.

🖥️ **Dev server** — `fastmcp dev apps` previews app tools in the browser with an MCP message inspector.

🔒 **Security pass** — SSRF/path-traversal prevention, JWT algorithm restrictions, OAuth scope enforcement, and CSRF fixes.
</Card>
</Update>

<Update label="FastMCP 3.1.1" description="March 14, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.1.1: 'Tis But a Patch"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.1.1"
cta="Read the release notes"
>
Pins `pydantic-monty<0.0.8` to fix a breaking change in Monty that affects code mode.
</Card>
</Update>

<Update label="FastMCP 3.1.0" description="March 3, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.1.0: Code to Joy"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.1.0"
cta="Read the release notes"
>
The Code Mode release. Instead of loading the entire tool catalog into context, `CodeMode` gives LLMs meta-tools: search for relevant tools on demand, inspect their schemas, then write Python that chains `call_tool()` calls in a sandbox. Also ships search transforms, early Prefab Apps integration, `MultiAuth` for composing multiple token verification sources, and PropelAuth support.
</Card>
</Update>

<Update label="FastMCP 3.0.2" description="February 22, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.0.2: Threecovery Mode II"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.2"
cta="Read the release notes"
>
Two community-contributed fixes: auth headers from MCP transport no longer leak through to downstream OpenAPI APIs, and background task workers now correctly receive the originating request ID. Plus a new docs example for context-aware tool factories.
</Card>
</Update>

<Update label="FastMCP 3.0.1" description="February 20, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.0.1: Three-covery Mode"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.1"
cta="Read the release notes"
>
First patch after 3.0 — mostly smoothing out rough edges discovered in the wild. The big ones: middleware state that wasn't surviving the trip to tool handlers now does, `Tool.from_tool()` accepts callables again, OpenAPI schemas with circular references no longer crash discovery, and decorator overloads now return the correct types in function mode.

🔐 **OIDC `verify_id_token`** — New option for providers that issue opaque access tokens but standard JWT id_tokens. Verifies identity via the id_token while using the access_token for upstream API calls.

🐞 **11 bug fixes** — State serialization, future annotations with `Context`/`Depends`, OpenAI handler deprecation warnings, type checker compatibility, and more.
</Card>
</Update>

<Update label="FastMCP 3.0.0" description="February 18, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.0.0: Three at Last"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0"
cta="Read the release notes"
>
FastMCP 3.0 is stable. Two betas, two release candidates, 21 new contributors, and more than 100,000 pre-release installs later — the architecture held up, the upgrade path was smooth, and we're shipping it.

The surface API is largely unchanged — `@mcp.tool()` still works exactly as before. What changed is everything underneath: a provider/transform architecture that makes FastMCP extensible, observable, and composable in ways v2 couldn't support.

🔌 **Build servers from anything** — `FileSystemProvider`, `OpenAPIProvider`, `ProxyProvider`, `SkillsProvider`, and composable transforms that rename, namespace, filter, version, and secure components as they flow to clients.

🔐 **Ship to production** — Component versioning, granular authorization with async auth checks, CIMD, Static Client Registration, Azure OBO, OpenTelemetry tracing, and background tasks with distributed Redis notification.

💾 **Adapt per session** — Session state persists across requests, and `ctx.enable_components()` / `ctx.disable_components()` let servers adapt dynamically per client.

⚡ **Develop faster** — `--reload`, standalone decorators, automatic threadpool dispatch, tool timeouts, pagination, and concurrent tool execution.

🖥️ **CLI** — `fastmcp list`, `fastmcp call`, `fastmcp discover`, `fastmcp generate-cli`, and `fastmcp install` for Claude Desktop, Cursor, and Goose.
</Card>
</Update>

<Update label="FastMCP 3.0.0rc1" description="February 12, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.0.0rc1: RC-ing is Believing"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0rc1"
cta="Read the release notes"
>
FastMCP 3 RC1 means we believe the API is stable. Beta 2 drew a wave of real-world adoption — production deployments, migration reports, integration testing — and the feedback overwhelmingly confirmed that the architecture works. This release closes gaps that surfaced under load: auth flows that needed to be async, background tasks that needed reliable notification delivery, and APIs still carrying beta-era naming. If nothing unexpected surfaces, this is what 3.0.0 looks like.

🚨 **Breaking Changes** — The `ui=` parameter is now `app=` with a unified `AppConfig` class, and 16 `FastMCP()` constructor kwargs have been removed after months of deprecation warnings.

🔐 **Auth Improvements** — Async `auth=` checks, Static Client Registration for servers without DCR, and declarative Azure OBO flows via dependency injection.

⚡ **Concurrent Sampling** — `context.sample()` can now execute multiple tool calls in parallel with `tool_concurrency=0`.

📡 **Background Task Notifications** — A distributed Redis queue replaces polling for progress updates and elicitation relay.

✅ **OpenAPI Output Validation** — `validate_output=False` disables strict schema checking for imperfect backend APIs.
</Card>
</Update>

<Update label="FastMCP 3.0.0b2" description="February 7, 2026" tags={["Releases"]}>
<Card
title="FastMCP v3.0.0b2: 2 Fast 2 Beta"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0b2"
cta="Read the release notes"
>
Beta 2 reflects the huge number of people that kicked the tires on Beta 1. Seven new contributors landed changes, and early migration reports went smoother than expected. Most of Beta 2 is refinement — fixing what people found, filling gaps from real usage, hardening edges — but a few new features landed along the way.

🖥️ **Client CLI** — `fastmcp list`, `fastmcp call`, `fastmcp discover`, and `fastmcp generate-cli` turn any MCP server into something you can poke at from a terminal.

🔐 **CIMD** (Client ID Metadata Documents) adds an alternative to Dynamic Client Registration for OAuth.

📱 **MCP Apps** — Spec-level compliance for the MCP Apps extension with `ui://` resource scheme and typed UI metadata.

⏳ **Background Task Context** — `Context` now works transparently in Docket workers with Redis-based coordination.

🛡️ **ResponseLimitingMiddleware** caps tool response sizes with UTF-8-safe truncation.

🪿 **Goose Integration** — `fastmcp install goose` for one-command server installation into Goose.
</Card>
</Update>

<Update label="FastMCP 3.0.0b1" description="January 20, 2026" tags={["Releases"]}>
<Card
title="FastMCP 3.0.0b1: This Beta Work"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v3.0.0b1"
cta="Read the release notes"
>
FastMCP 3.0 rebuilds the framework around three primitives: components, providers, and transforms. Providers source components dynamically—from decorators, filesystems, OpenAPI specs, remote servers, or anywhere else. Transforms modify components as they flow to clients. The features that required specialized subsystems in v2 now compose naturally from these building blocks.

🔌 **Provider Architecture** unifies how components are sourced with `FileSystemProvider`, `SkillsProvider`, `OpenAPIProvider`, and `ProxyProvider`.

🔄 **Transforms** add middleware for components—namespace, rename, filter by version, control visibility.

📋 **Component Versioning** lets you register multiple versions of the same tool with automatic highest-version selection.

💾 **Session-Scoped State** persists across requests, with per-session visibility control.

⚡ **DX Improvements** include `--reload` for development, automatic threadpool dispatch, tool timeouts, pagination, and OpenTelemetry tracing.
</Card>
</Update>

<Update label="FastMCP 2.14.7" description="April 13, 2026" tags={["Releases"]}>
<Card
title="FastMCP 2.14.7: Fake It Till You Break It"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.7"
cta="Read the release notes"
>
A 2.x backport of the fakeredis pin: fakeredis 2.35.0 renamed a connection class that pydocket's `memory://` backend relied on, crashing `fastmcp[tasks]` installs at startup. Caps `fakeredis<2.35.0` on the 2.x line.
</Card>
</Update>

<Update label="FastMCP 2.14.6" description="March 27, 2026" tags={["Releases"]}>
<Card
title="FastMCP 2.14.6: $Ref Dead Redemption"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.6"
cta="Read the release notes"
>
v2.14.4 backported `dereference_refs()` but never wired it into the tool schema pipeline — `$ref` and `$defs` were still sent to MCP clients. Now fixed: schemas are fully inlined before reaching clients.
</Card>
</Update>

<Update label="FastMCP 2.14.5" description="February 3, 2026" tags={["Releases"]}>
<Card
title="FastMCP 2.14.5: Sealed Docket"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.5"
cta="Read the release notes"
>
Fixes a memory leak in the memory:// docket broker where cancelled tasks accumulated instead of being cleaned up. Bumps pydocket to ≥0.17.2.
</Card>
</Update>

<Update label="FastMCP 2.14.4" description="January 22, 2026" tags={["Releases"]}>
<Card
title="FastMCP 2.14.4: Package Deal"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.4"
cta="Read the release notes"
>
Fixes a fresh install bug where the packaging library was missing as a direct dependency, plus backports $ref dereferencing in tool schemas and a task capabilities location fix.
</Card>
</Update>

<Update label="FastMCP 2.14.3" description="January 12, 2026" tags={["Releases"]}>
<Card
title="FastMCP 2.14.3: Time After Timeout"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.3"
cta="Read the release notes"
>
Sometimes five seconds just isn't enough. This release fixes an HTTP transport bug that was cutting connections short, along with OAuth and Redis fixes, better ASGI support, and CLI update notifications so you never miss a beat.

⏱️ **HTTP transport timeout fix** restores MCP's 30-second default connect timeout, which was incorrectly defaulting to 5 seconds.

🔧 **Infrastructure fixes** including OAuth token storage TTL, Redis key prefixing for ACL isolation, and ContextVar propagation for ASGI-mounted servers with background tasks.
</Card>
</Update>

<Update label="FastMCP 2.14.2" description="December 31, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.14.2: Port Authority"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.2"
cta="Read the release notes"
>
A wave of community contributions arrives safely in the 2.x line. Important backports from 3.0 improve OpenAPI 3.1 compatibility, MCP spec compliance for output schemas and elicitation, and correct a subtle base_url fallback issue.

🔧 **OpenAPI 3.1 support** fixes version detection to properly handle 3.1 specs alongside 3.0.

📋 **MCP spec compliance** for root-level `$ref` resolution in output schemas and titled enum elicitation schemas.
</Card>
</Update>

<Update label="FastMCP 2.14.1" description="December 15, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.14.1: 'Tis a Gift to Be Sample"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.1"
cta="Read the release notes"
>
FastMCP 2.14.1 introduces sampling with tools (SEP-1577), enabling servers to pass tools to `ctx.sample()` for agentic workflows where the LLM can automatically execute tool calls in a loop.

🤖 **Sampling with tools** lets servers leverage client LLM capabilities for multi-step agentic workflows. The new `ctx.sample_step()` method provides single LLM calls with tool inspection, while `result_type` enables structured outputs via validated Pydantic models.

🔧 **AnthropicSamplingHandler** joins the existing OpenAI handler, and both are now promoted from experimental to production-ready status with a unified API.
</Card>
</Update>

<Update label="FastMCP 2.14.0" description="December 11, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.14.0: Task and You Shall Receive"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.14.0"
cta="Read the release notes"
>
FastMCP 2.14 begins adopting the MCP 2025-11-25 specification, introducing protocol-native background tasks that enable long-running operations to report progress without blocking clients.

⏳ **Background Tasks (SEP-1686)** let you add `task=True` to any async tool decorator. Powered by [Docket](https://github.com/chrisguidry/docket) for enterprise task scheduling—in-memory backends work out-of-the-box, Redis enables persistence and horizontal scaling.

🔧 **OpenAPI Parser Promoted** from experimental to standard with improved performance through single-pass schema processing.

📋 **MCP Spec Updates** including SSE polling (SEP-1699), multi-select elicitation (SEP-1330), and tool name validation (SEP-986). Also removes deprecated APIs accumulated across 2.x.
</Card>
</Update>

<Update label="FastMCP 2.13.3" description="December 3, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.13.3: Pin-ish Line"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.3"
cta="Read the release notes"
>
Pins `mcp<1.23` as a precaution due to MCP SDK changes related to the 11/25/25 protocol update that break certain FastMCP patches and workarounds. FastMCP 2.14 introduces proper support for the updated protocol.
</Card>
</Update>

<Update label="FastMCP 2.13.2" description="December 1, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.13.2: Refreshing Changes"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.2"
cta="Read the release notes"
>
Polishes the authentication stack with improvements to token refresh, scope handling, and multi-instance deployments.

🎮 **Discord OAuth provider** added as a built-in authentication option.

🔄 **Token refresh fixes** for Azure and Google providers, plus OAuth proxy improvements for multi-instance deployments.

🎨 **Icon support** added to proxy classes for richer UX.
</Card>
</Update>

<Update label="FastMCP 2.13.1" description="November 15, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.13.1: Heavy Meta"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.1"
cta="Read the release notes"
>
Introduces meta parameter support for `ToolResult`, enabling tools to return supplementary metadata alongside results for patterns like OpenAI's Apps SDK.

🏷️ **Meta parameters** let tools return supplementary metadata alongside results.

🔐 **New auth providers** for OCI and Supabase, plus custom token verifiers with DebugTokenVerifier for development.

🔒 **Security fixes** for CVE-2025-61920 and safer Cursor deeplink URL validation on Windows.
</Card>
</Update>

<Update label="FastMCP 2.13.0" description="October 25, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.13.0: Cache Me If You Can"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.13.0"
cta="Read the release notes"
>
FastMCP 2.13 "Cache Me If You Can" represents a fundamental maturation of the framework. After months of community feedback on authentication and state management, this release delivers the infrastructure FastMCP needs to handle production workloads: persistent storage, response caching, and pragmatic OAuth improvements that reflect real-world deployment challenges.

💾 **Pluggable storage backends** bring persistent state to FastMCP servers. Built on [py-key-value-aio](https://github.com/strawgate/py-key-value), a new library from FastMCP maintainer Bill Easton ([@strawgate](https://github.com/strawgate)), the storage layer provides encrypted disk storage by default, platform-aware token management, and a simple key-value interface for application state. We're excited to bring this elegantly designed library into the FastMCP ecosystem - it's both powerful and remarkably easy to use, including wrappers to add encryption, TTLs, caching, and more to backends ranging from Elasticsearch, Redis, DynamoDB, filesystem, in-memory, and more!

🔐 **OAuth maturity** brings months of production learnings into the framework. The new consent screen prevents confused deputy and authorization bypass attacks discovered in earlier versions, while the OAuth proxy now issues its own tokens with automatic key derivation. RFC 7662 token introspection support enables enterprise auth flows, and path prefix mounting enables OAuth-protected servers to integrate into existing web applications. FastMCP now supports out-of-the-box authentication with [WorkOS](https://gofastmcp.com/integrations/workos) and [AuthKit](https://gofastmcp.com/integrations/authkit), [GitHub](https://gofastmcp.com/integrations/github), [Google](https://gofastmcp.com/integrations/google), [Azure](https://gofastmcp.com/integrations/azure) (Entra ID), [AWS Cognito](https://gofastmcp.com/integrations/aws-cognito), [Auth0](https://gofastmcp.com/integrations/auth0), [Descope](https://gofastmcp.com/integrations/descope), [Scalekit](https://gofastmcp.com/integrations/scalekit), [JWTs](https://gofastmcp.com/servers/auth/token-verification#jwt-token-verification), and [RFC 7662 token introspection](https://gofastmcp.com/servers/auth/token-verification#token-introspection-protocol).

⚡ **Response Caching Middleware** dramatically improves performance for expensive operations, while **Server lifespans** provide proper initialization and cleanup hooks that run once per server instance instead of per client session.

✨ **Developer experience improvements** include Pydantic input validation, icon support, RFC 6570 query parameters for resource templates, improved Context API methods, and async file/directory resources.
</Card>
</Update>

<Update label="FastMCP 2.12.5" description="October 17, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.12.5: Safety Pin"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.5"
cta="Read the release notes"
>
Pins MCP SDK version below 1.17 to ensure the `.well-known` payload appears in the expected location when using FastMCP auth providers with composite applications.
</Card>
</Update>

<Update label="FastMCP 2.12.4" description="September 26, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.12.4: OIDC What You Did There"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.4"
cta="Read the release notes"
>
FastMCP 2.12.4 adds comprehensive OIDC support and expands authentication options with AWS Cognito and Descope providers. The release also includes improvements to logging middleware, URL handling for nested resources, persistent OAuth client registration storage, and various fixes to the experimental OpenAPI parser.

🔐 **OIDC Configuration** brings native support for OpenID Connect, enabling seamless integration with enterprise identity providers.

🏢 **Enterprise Authentication** expands with AWS Cognito and Descope providers, broadening the authentication ecosystem.

🛠️ **Improved Reliability** through enhanced URL handling, persistent OAuth storage, and numerous parser fixes based on community feedback.
</Card>
</Update>

<Update label="FastMCP 2.12.3" description="September 17, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.12.3: Double Time"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.3"
cta="Read the release notes"
>
FastMCP 2.12.3 focuses on performance and developer experience improvements. This release includes optimized auth provider imports that reduce server startup time, enhanced OIDC authentication flows, and automatic inline snapshot creation for testing.
</Card>
</Update>

<Update label="FastMCP 2.12.2" description="September 3, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.12.2: Perchance to Stream"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.2"
cta="Read the release notes"
>
Hotfix for streamable-http transport validation in fastmcp.json configuration files, resolving a parsing error when CLI arguments were merged against the configuration spec.
</Card>
</Update>

<Update label="FastMCP 2.12.1" description="September 3, 2025" tags={["Releases"]}>
<Card
title="FastMCP 2.12.1: OAuth to Joy"
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.1"
cta="Read the release notes"
>
FastMCP 2.12.1 strengthens OAuth proxy implementation with improved client storage reliability, PKCE forwarding, configurable token endpoint authentication methods, and expanded scope handling based on extensive community testing.
</Card>
</Update>

<Update label="FastMCP 2.12" description="August 31, 2025" tags={["Releases"]}>
<Card 
title="FastMCP 2.12: Auth to the Races" 
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.12.0" 
cta="Read the release notes"  
>
FastMCP 2.12 represents one of our most significant releases to date. After extensive testing and iteration with the community, we're shipping major improvements to authentication, configuration, and MCP feature adoption.

🔐 **OAuth Proxy** bridges the gap for providers that don't support Dynamic Client Registration, enabling authentication with GitHub, Google, WorkOS, and Azure through minimal configuration.

📋 **Declarative JSON Configuration** introduces `fastmcp.json` as the single source of truth for server settings, making MCP servers as portable and shareable as container images.

🧠 **Sampling API Fallback** tackles adoption challenges by letting servers generate completions server-side when clients don't support the feature, encouraging innovation while maintaining compatibility.
</Card>
</Update>

<Update label="FastMCP 2.11" description="August 1, 2025" tags={["Releases"]}>
<Card 
title="FastMCP 2.11: Auth to a Good Start" 
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.11.0" 
cta="Read the release notes"  
>
FastMCP 2.11 brings enterprise-ready authentication and dramatic performance improvements.

🔒 **Comprehensive OAuth 2.1 Support** with WorkOS AuthKit integration, Dynamic Client Registration, and support for separate resource and authorization servers.

⚡ **Experimental OpenAPI Parser** delivers dramatic performance gains through single-pass schema processing and optimized memory usage (enable with environment variable).

💾 **Enhanced State Management** provides persistent state across tool calls with a simple dictionary interface, improving context handling and type annotations.

This release emphasizes speed and simplicity while setting the foundation for future enterprise features.
</Card>
</Update>

<Update label="FastMCP 2.10" description="July 2, 2025" tags={["Releases"]}>
<Card 
title="FastMCP 2.10: Great Spec-tations" 
href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.10.0" 
cta="Read the release notes"  
>
FastMCP 2.10 achieves full compliance with the 6/18/2025 MCP specification update, introducing powerful new communication patterns.

💬 **Elicitation Support** enables dynamic server-client communication and "human-in-the-loop" workflows, allowing servers to request additional information during execution.

📊 **Output Schemas** provide structured outputs for tools, making results more predictable and easier to parse programmatically.

🛠️ **Enhanced HTTP Routing** with OpenAPI extensions support and configurable algorithms for more flexible API integration.

This release includes a breaking change to `client.call_tool()` return signatures but significantly expands the interaction capabilities of MCP servers.
</Card>
</Update>

<Update label="FastMCP 2.9" description="June 23, 2025" tags={["Releases", "Blog Posts"]}>
<Card 
title="FastMCP 2.9: MCP-Native Middleware" href="https://www.jlowin.dev/blog/fastmcp-2-9-middleware" 
img="https://jlowin.dev/_image?href=%2F_astro%2Fhero.BkVTdeBk.jpg&w=1200&h=630&f=png" 
cta="Read more"  
>
FastMCP 2.9 is a major release that, among other things, introduces two important features that push beyond the basic MCP protocol. 

🤝 *MCP Middleware* brings a flexible middleware system for intercepting and controlling server operations - think authentication, logging, rate limiting, and custom business logic without touching core protocol code. 

✨ *Server-side type conversion* for prompts solves a major developer pain point: while MCP requires string arguments, your functions can now work with native Python types like lists and dictionaries, with automatic conversion handling the complexity.

These features transform FastMCP from a simple protocol implementation into a powerful framework for building sophisticated MCP applications. Combined with the new `File` utility for binary data and improvements to authentication and serialization, this release makes FastMCP significantly more flexible and developer-friendly while maintaining full protocol compliance.
</Card>
</Update>

<Update label="FastMCP 2.8" description="June 11, 2025" tags={["Releases", "Blog Posts"]}>
<Card 
title="FastMCP 2.8: Transform and Roll Out" href="https://www.jlowin.dev/blog/fastmcp-2-8-tool-transformation" 
img="https://www.jlowin.dev/_image?href=%2F_astro%2Fhero.su3kspkP.png&w=1000&h=500&f=webp" 
cta="Read more"  
>
FastMCP 2.8 is here, and it's all about taking control of your tools.

This release is packed with new features for curating the perfect LLM experience:

🛠️ Tool Transformation

The headline feature lets you wrap any tool—from your own code, a third-party library, or an OpenAPI spec—to create an enhanced, LLM-friendly version. You can rename arguments, rewrite descriptions, and hide parameters without touching the original code.

This feature was developed in close partnership with Bill Easton. As Bill brilliantly [put it](https://www.linkedin.com/posts/williamseaston_huge-thanks-to-william-easton-for-providing-activity-7338011349525983232-Mw6T?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAAd6d0B3uL9zpCsq9eYWKi3HIvb8eN_r_Q), "Tool transformation flips Prompt Engineering on its head: stop writing tool-friendly LLM prompts and start providing LLM-friendly tools."

🏷️ Component Control

Now that you're transforming tools, you need a way to hide the old ones! In FastMCP 2.8 you can programmatically enable/disable any component, and for everyone who's been asking what FastMCP's tags are for—they finally have a purpose! You can now use tags to declaratively filter which components are exposed to your clients.

🚀 Pragmatic by Default

Lastly, to ensure maximum compatibility with the ecosystem, we've made the pragmatic decision to default all OpenAPI routes to Tools, making your entire API immediately accessible to any tool-using agent. When the industry catches up and supports resources, we'll restore the old default -- but no reason you should do extra work before OpenAI, Anthropic, or Google!

</Card>
</Update>

<Update label="FastMCP 2.7" description="June 6, 2025" tags={["Releases"]}>
<Card 
title="FastMCP 2.7: Pare Programming" href="https://github.com/PrefectHQ/fastmcp/releases/tag/v2.7.0" 
img="assets/updates/release-2-7.png" 
cta="Read the release notes"  
>
FastMCP 2.7 has been released!

Most notably, it introduces the highly requested (and Pythonic) "naked" decorator usage:

```python {3}
mcp = FastMCP()

@mcp.tool
def add(a: int, b: int) -> int:
    return a + b
```

In addition, decorators now return the objects they create, instead of the decorated function. This is an important usability enhancement.

The bulk of the update is focused on improving the FastMCP internals, including a few breaking internal changes to private APIs. A number of functions that have clung on since 1.0 are now deprecated.
</Card>
</Update>



<Update label="FastMCP 2.6" description="June 2, 2025" tags={["Releases", "Blog Posts"]}>
<Card 
title="FastMCP 2.6: Blast Auth" href="https://www.jlowin.dev/blog/fastmcp-2-6" 
img="https://www.jlowin.dev/_image?href=%2F_astro%2Fhero.Bsu8afiw.png&w=1000&h=500&f=webp" 
cta="Read more"  
>
FastMCP 2.6 is here!

This release introduces first-class authentication for MCP servers and clients, including pragmatic Bearer token support and seamless OAuth 2.1 integration. This release aligns with how major AI platforms are adopting MCP today, making it easier than ever to securely connect your tools to real-world AI models. Dive into the update and secure your stack with minimal friction.
</Card>
</Update>

<Update description="May 21, 2025" label="Vibe-Testing" tags={["Blog Posts", "Tutorials"]}>
<Card
title="Stop Vibe-Testing Your MCP Server"
href="https://www.jlowin.dev/blog/stop-vibe-testing-mcp-servers"
img="https://www.jlowin.dev/_image?href=%2F_astro%2Fhero.BUPy9I9c.png&w=1000&h=500&f=webp"
cta="Read more"
>

Your tests are bad and you should feel bad.

Stop vibe-testing your MCP server through LLM guesswork. FastMCP 2.0 introduces in-memory testing for fast, deterministic, and fully Pythonic validation of your MCP logic—no network, no subprocesses, no vibes.

</Card>
</Update>


<Update description="May 8, 2025" label="10,000 Stars" tags={["Blog Posts"]}>
<Card
title="Reflecting on FastMCP at 10k stars 🌟"
href="https://www.jlowin.dev/blog/fastmcp-2-10k-stars"
img="https://www.jlowin.dev/_image?href=%2F_astro%2Fhero.Cnvci9Q_.png&w=1000&h=500&f=webp"
cta="Read more"
>

In just six weeks since its relaunch, FastMCP has surpassed 10,000 GitHub stars—becoming the fastest-growing OSS project in our orbit. What started as a personal itch has become the backbone of Python-based MCP servers, powering a rapidly expanding ecosystem. While the protocol itself evolves, FastMCP continues to lead with clarity, developer experience, and opinionated tooling. Here’s to what’s next.

</Card>
</Update>

<Update description="May 8, 2025" label="FastMCP 2.3" tags={["Blog Posts", "Releases"]}>
<Card
title="Now Streaming: FastMCP 2.3"
href="https://www.jlowin.dev/blog/fastmcp-2-3-streamable-http"
img="https://www.jlowin.dev/_image?href=%2F_astro%2Fhero.M_hv6gEB.png&w=1000&h=500&f=webp"
cta="Read more"
>

FastMCP 2.3 introduces full support for Streamable HTTP, a modern alternative to SSE that simplifies MCP deployments over the web. It’s efficient, reliable, and now the default HTTP transport. Just run your server with transport="http" and connect clients via a standard URL—FastMCP handles the rest. No special setup required. This release makes deploying MCP servers easier and more portable than ever.

</Card>
</Update>

<Update description="April 23, 2025" label="Proxy Servers" tags={["Blog Posts", "Tutorials"]}>
<Card
title="MCP Proxy Servers with FastMCP 2.0"
href="https://www.jlowin.dev/blog/fastmcp-proxy"
img="https://www.jlowin.dev/_image?href=%2F_astro%2Frobot-hero.DpmAqgui.png&w=1000&h=500&f=webp"
cta="Read more"
>

Even AI needs a good travel adapter 🔌


FastMCP now supports proxying arbitrary MCP servers, letting you run a local FastMCP instance that transparently forwards requests to any remote or third-party server—regardless of transport. This enables transport bridging (e.g., stdio ⇄ SSE), simplified client configuration, and powerful gateway patterns. Proxies are fully composable with other FastMCP servers, letting you mount or import them just like local servers. Use `FastMCP.from_client()` to wrap any backend in a clean, Pythonic proxy.
</Card>
</Update>

<Update label="FastMCP 2.0" description="April 16, 2025" tags={["Releases", "Blog Posts"]}>
<Card
title="Introducing FastMCP 2.0 🚀"
href="https://www.jlowin.dev/blog/fastmcp-2"
img="https://www.jlowin.dev/_image?href=%2F_astro%2Fhero.DpbmGNrr.png&w=1000&h=500&f=webp"
cta="Read more"
>

This major release reimagines FastMCP as a full ecosystem platform, with powerful new features for composition, integration, and client interaction. You can now compose local and remote servers, proxy arbitrary MCP servers (with transport translation), and generate MCP servers from OpenAPI or FastAPI apps. A new client infrastructure supports advanced workflows like LLM sampling. 

FastMCP 2.0 builds on the success of v1 with a cleaner, more flexible foundation—try it out today!
</Card>
</Update>



<Update label="Official SDK" description="December 3, 2024" tags={["Announcements"]}>
<Card
title="FastMCP is joining the official MCP Python SDK!"
href="https://bsky.app/profile/jlowin.dev/post/3lch4xk5cf22c"
icon="sparkles"
cta="Read the announcement"
>
FastMCP 1.0 will become part of the official MCP Python SDK!
</Card>
</Update>



<Update label="FastMCP 1.0" description="December 1, 2024" tags={["Releases", "Blog Posts"]}>
<Card
title="Introducing FastMCP 🚀"
href="https://www.jlowin.dev/blog/introducing-fastmcp"
img="https://www.jlowin.dev/_image?href=%2F_astro%2Ffastmcp.Bep7YlTw.png&w=1000&h=500&f=webp"
cta="Read more"
>
Because life's too short for boilerplate.

This is where it all started. FastMCP’s launch post introduced a clean, Pythonic way to build MCP servers without the protocol overhead. Just write functions; FastMCP handles the rest. What began as a weekend project quickly became the foundation of a growing ecosystem.
</Card>
</Update>

---

### Apps Architecture (`docs/apps/architecture.mdx`)

---
title: Architecture
sidebarTitle: Architecture
description: How FastMCP apps work under the hood — from Python to pixels.
icon: sitemap
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.2.0" />

You don't need this page to build apps. It's for when something isn't rendering the way you expect, when UI tool calls aren't reaching your server, or when you're writing [custom HTML apps](/apps/low-level) and need to understand the protocol directly.

## The pipeline

An MCP app moves through five stages from Python to pixels:

```text
Python components  →  JSON tree  →  structuredContent  →  Renderer iframe  →  Host UI
```

You write Prefab components. FastMCP serializes them to a JSON component tree and delivers it as `structuredContent` on the tool result. The host loads the Prefab renderer in a sandboxed iframe, pushes the JSON in, and the renderer paints the UI. If the UI calls server tools, it talks back through the same `postMessage` channel.

The sections below walk each stage.

## Tool registration

When you mark a tool with `app=True` or `@app.ui()`, FastMCP wires up the metadata and renderer resource that the protocol requires.

### The `app=True` flag

`app` on `@mcp.tool` accepts `True`, an `AppConfig`, or a dict. When you pass `True`, FastMCP explicitly marks the tool as a Prefab UI tool and stamps placeholder UI metadata so the provider can synthesize the correct renderer resource later. When you omit `app`, FastMCP only applies this automatically if the tool's return type is a Prefab type (`PrefabApp`, `Component`, or unions containing them).

The tool and renderer are linked through a `resourceUri` field in the metadata. Internally, registration uses the placeholder URI `ui://prefab/renderer.html`; when tools and resources are listed or read, FastMCP rewrites that placeholder to a shared URI like `ui://prefab/renderer/<hash>/renderer.html` and synthesizes the matching renderer resource on demand.

### FastMCPApp registration

`FastMCPApp` uses the same mechanism but adds two things. First, it tags every tool — both `@app.ui()` entry points and `@app.tool()` backends — with `meta["fastmcp"]["app"]` set to the app's name. That tag lets the server identify which app a tool belongs to when routing UI calls.

Second, it sets `meta["ui"]["visibility"]` to control who can see each tool. Entry points default to `["model"]` (LLM-visible). Backend tools default to `["app"]` (UI-only). Hosts use this to filter the tool list.

This metadata is not a security boundary: FastMCP accepts direct MCP calls to app tools regardless of the declared audience, subject to authentication and authorization. The MCP connection does not identify whether a call originated from the model or the UI. See [Tool visibility](/apps/low-level#tool-visibility).

## Serialization

When a Prefab tool runs, its return value — a `PrefabApp` or a bare `Component` — becomes a JSON blob the renderer can interpret.

### `PrefabApp.to_json()`

The entry point is `PrefabApp.to_json()`. It walks the component tree and produces a JSON object with a `$prefab` protocol version, `view` (the component tree), and, when set, `state` (initial state values), `defs`, and theme keys. FastMCP then adds routing metadata under `_meta`, described below.

FastMCP passes a `tool_resolver` callback to `to_json()`. The resolver runs on every `CallTool` action in the tree and returns a `ResolvedTool` carrying the tool's name: a function reference resolves to the function's registered name, and a string passes through. For tools that belong to a `FastMCPApp`, that name is then wrapped in the deterministic hashed format described below.

### Hashed backend tool references

Backend routing does not depend on sending the app name through each tool call. When a `FastMCPApp` tree contains `CallTool(save_contact)`, the resolver turns it into a deterministic hashed name such as `__<hash>_save_contact`, where the hash is the first 12 hex characters of a SHA-256 digest of the app name and backend tool name.

The `__<12 lowercase hex>_<name>` pattern is reserved for these generated addresses. `FastMCPApp` rejects registered backend and UI tool names matching it, so the resolver can distinguish registered names from addresses. This reservation concerns the name sent in tool calls; a component key such as `tool:save@` is a separate lookup identifier. Other double-underscore names, such as `__save`, remain valid.

FastMCP records each hashed reference in `structuredContent` under `_meta.fastmcp.toolNames`. On the way out, each server rewrites the reference to the name it lists that tool under, as described in [Late-bound tool names](#late-bound-tool-names). A reference no server could rewrite reaches the renderer in hashed form, and the server routes a `tools/call` with that name through the [hashed lookup fallback](#the-hashed-lookup-fallback).

### ToolResult assembly

The final tool result has two parts: `content` (a list of `TextContent` blocks for the LLM) and `structuredContent` (the JSON tree for the renderer). By default, Prefab tools send `"[Rendered Prefab UI]"` as the text content — just enough for the LLM to know something was rendered. If you return a `ToolResult` explicitly, you control both halves.

## Tool call routing

A tool has two things that behave very differently. Its **name** is unstable by design — namespace transforms rename it, so `save_contact` becomes `contacts_save_contact` in one composition and something else in another. Its **identity** is a hash of the app name and the registered tool name, written once at registration and never changed.

A UI is serialized during the entry tool's call, deep inside whatever composition the server happens to have, so it cannot know what its backend tools will be called by the time the payload reaches a host.

### Late-bound tool names

The payload leaves the app addressed by identity, and every FastMCP server rewrites those references on the way out to whatever it lists that tool as. Servers unwind innermost-first, so the outermost server rewrites last — and its names are the only ones a client can actually invoke.

Rewriting a name in place would destroy the identity for the next layer up, so the payload carries a name-to-identity map under `_meta.fastmcp.toolNames`. Each layer resolves through the map and updates it. The action objects keep the exact shape `prefab_ui` defines: only the value of `tool` changes, and only ever to another valid tool name.

The result is that a renderer receives names that exist in the listing the host is looking at. Under three layers of namespacing the button calls `c_b_a_save`; behind a gateway it calls whatever the gateway lists. No intermediary has to understand a FastMCP-specific convention.

A reference this server cannot resolve is left alone rather than corrupted. This is what keeps apps working behind [tool search](/servers/transforms/tool-search) and code mode, which replace `tools/list` with a handful of synthetic tools: there is no better name to bind to, so the reference stays identity-addressed and the fallback below carries it.

### One copy of an app per server

**An app name must be unique within a server.** Composing the same app twice breaks its UI, and no namespace or mount arrangement makes it work.

The reason is structural. Identity is derived from the app name and the tool's registered name, and deliberately nothing else — that is what makes it survive renaming. Two copies of one app therefore produce two tools claiming a single identity, and no fact anywhere in the listing says which copy a given button belongs to. The information needed to choose was never recorded.

FastMCP declines to bind rather than picking a copy, so buttons stop working instead of quietly invoking the wrong tenant's tool. Expect a message naming the cause:

```text
Ambiguous app tool 'save': 2 components share the identity '10c0803009ff'.
The same app is composed more than once, so this call cannot be routed to a
single tool.
```

Give each copy its own app name. Two tenants running the same product want `FastMCPApp("contacts-acme")` and `FastMCPApp("contacts-globex")` — not two instances of `FastMCPApp("contacts")` under different namespaces, since namespaces rename tools and identity is immune to renaming by design.

### The hashed lookup fallback

Upgrading a server updates both address generation and lookup automatically. If you deploy an app backend and a proxy gateway separately, upgrade both to use the `__` address format; gateways cannot rewrite identity addresses emitted in the earlier `<hash>_<local_name>` format.

The identity-addressed form `__<hash>_<local_name>` remains callable. FastMCP first tries normal tool resolution; if no tool matches and the name has that shape, it calls `get_tool_by_hash(hash, local_name)`, which resolves the tool through the same lookup as its listed name. Only tools whose `meta["ui"]["visibility"]` includes `"app"` answer to a hashed name. Transforms, enabled state, and authorization apply to a hashed name exactly as they do to a name call.

When one identity is claimed by more than one tool — which happens when the same app is composed into two branches — the call is refused rather than resolved, since picking either one would silently route into the wrong branch.

Hashed tool names provide stable routing identities, not secrets or access controls. Knowing a hashed name grants no additional authorization, and hiding it from a model's tool list does not restrict access.

### Provider delegation

`get_tool_by_hash` is defined on the `Provider` base class. Providers override `_get_tool_by_hash` to find a tool by its identity, and the base class resolves the result through the provider's public `get_tool`. Aggregate providers fan out the lookup across child providers in parallel. Wrapped providers (like `FastMCPProvider`, which wraps a nested `FastMCP` server) delegate to the inner server's hashed lookup. Backend tools are reachable through any depth of composition.

## The renderer

The Prefab renderer is a self-contained JavaScript application that interprets the JSON component tree and renders it as a React UI.

### Renderer resources

Tools with matching renderer configurations share one resource at `ui://prefab/renderer/<hash>/renderer.html`, with MIME type `text/html;profile=mcp-app`. The identity includes the installed Prefab version, delivery mode, and effective resource metadata. Different CSP, permissions, domains, or border preferences produce separate resources. Explicit resource URI overrides are left unchanged, and previously advertised per-tool URIs remain readable.

Listing tools and resources does not load the renderer HTML. FastMCP generates the page when a host reads the resource. The default delivery mode returns a small HTML page that loads version-pinned assets from a CDN; `PREFAB_BUNDLED_RENDERER=1` serves a self-contained page instead. Shared URIs let hosts recognize equivalent resources, whether or not they choose to cache them.

The resource also carries CSP metadata (via `get_renderer_csp()`) declaring the CDN domains the renderer needs. Hosts use this to configure the iframe's Content Security Policy.

### `postMessage` communication

The renderer lives in a sandboxed iframe and communicates with the host using `postMessage`. The protocol follows the [MCP Apps extension](https://modelcontextprotocol.io/docs/extensions/apps) spec:

The host pushes the tool result (with `structuredContent`) into the iframe. The renderer parses the component tree, initializes state, and renders the UI. When the user interacts — submitting a form, clicking a button — and the interaction triggers a `CallTool` action, the renderer sends a `tools/call` request to the host via `postMessage`. The host forwards it as a regular MCP `tools/call` request to the server, using the tool name in the action.

The response flows back the same way: server → host → iframe via `postMessage`, and the renderer updates state with the result.

### AppBridge

The `@modelcontextprotocol/ext-apps` JavaScript SDK provides both ends of the `postMessage` handshake: the `App` class runs inside the iframe, and the `AppBridge` class runs in the host. Together they handle connection negotiation, tool result delivery, server tool calls, and host context (safe area insets, theme preferences). The Prefab renderer uses `App` internally; you only touch it directly when building [custom HTML apps](/apps/low-level).

## The dev server

`fastmcp dev apps` simulates the host-side behavior locally without a real MCP client.

### Proxy architecture

Two HTTP servers. Your MCP server runs on port 8000 with the Streamable HTTP transport. The dev UI runs on port 8080 and serves a picker page that lists your app tools.

A reverse proxy at `/mcp` on the dev server forwards requests to your MCP server. This matters because the dev UI and your MCP server listen on different ports: the host page's MCP client sends every request, including the renderer's tool calls relayed over `postMessage`, to `/mcp` on its own origin, and the proxy passes them on. Without the proxy, those requests would be cross-origin and the browser would block them.

### The launch flow

When you select a tool and click launch, the dev UI stores the tool name and arguments and opens a new tab. That tab connects to your server through the proxy, creates an AppBridge, and loads the tool's renderer resource. Once the renderer initializes, the tab calls the tool and pushes the result into the renderer. From here on it matches what a real host provides: the renderer displays the UI, and any `CallTool` actions route back through the proxy to your server.

Auto-reload is on by default, so changes to your server code restart the MCP server automatically. The dev UI keeps running — relaunch the tool to see changes.

---

### Apps Development (`docs/apps/development.mdx`)

---
title: Development
sidebarTitle: Development
description: Preview and test your app tools locally without a full MCP host.
icon: flask
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.2.0" />

<Frame>
  <img src="/apps/images/dev-app.png" alt="The dev UI showing a rendered Prefab app with the MCP inspector panel" />
</Frame>

`fastmcp dev apps` gives you a browser preview for your app tools without needing an MCP host client. It starts your server and a local dev UI side by side: you pick a tool, fill in its arguments, and the rendered result opens in a new tab.

Works with both [Interactive Tools](/apps/prefab) and [custom HTML apps](/apps/low-level).

## Quick start

```bash
fastmcp dev apps server.py
```

The dev UI opens in your browser on port 8080 through a startup URL that the terminal prints. Each run prints a new URL; open it to use the dev UI in another browser or after closing the tab. Your MCP server runs on port 8000 with auto-reload enabled by default — save a file and the server restarts automatically.

## How it works

The dev server does three things:

The **picker page** connects to your MCP server, finds all tools with UI metadata, and renders a form for each one. The forms are auto-generated from the tool's input schema — text fields, dropdowns, checkboxes, all wired up.

When you submit a form, the dev UI opens a new tab that **calls your tool** via the MCP protocol and renders the result. Each result page comes from a picker launch and stays available, including on reload, until the dev server stops. The result page loads the tool's UI resource (the Prefab renderer or your custom HTML) inside an AppBridge — the same protocol that real MCP hosts use. The resource runs in a sandboxed iframe, so it can't use `localStorage`, open popups, or show `alert` and `confirm` dialogs.

A **reverse proxy** on `/mcp` forwards requests from the browser to your MCP server, so the dev UI's MCP client stays same-origin instead of making cross-origin requests to a different port.

## MCP inspector

The dev UI includes an inspector panel on the left side that captures MCP traffic in real time. It shows JSON-RPC messages flowing between the browser and your server — requests, responses, and AppBridge `postMessage` traffic.

Each entry shows direction, method, timing, and a smart summary. Click any entry to expand the full JSON-RPC body. The panel auto-scrolls to new messages unless you've scrolled up to inspect older ones.

The inspector is useful for debugging: you can see exactly what arguments your tool received, what it returned, and how the AppBridge communicated with the renderer.

## Options

```bash
fastmcp dev apps server.py:mcp --mcp-port 9000 --dev-port 9090 --no-reload
```

| Option | Flag | Default | Description |
| ------ | ---- | ------- | ----------- |
| MCP Port | `--mcp-port` | `8000` | Port for your MCP server |
| Dev Port | `--dev-port` | `8080` | Port for the dev UI |
| Auto-Reload | `--reload` / `--no-reload` | On | Watch files and restart the server on changes |
| Host | `--host` | `127.0.0.1` | Interface for both local servers to bind |
| Log Panel | `--log-panel` / `--no-log-panel` | On | Show or hide the log panel in the dev UI |

With `--host 0.0.0.0`, open the dev UI through `localhost` or an IP address. To reach it by hostname, pass that hostname to `--host`.

### npm registry

<VersionBadge version="4.2.0" />

On first run, the dev server downloads the `@modelcontextprotocol/ext-apps` package from the public npm registry and caches it. If your network only allows an internal npm mirror, set `npm_config_registry` (or `NPM_CONFIG_REGISTRY`) to the mirror's URL, the same variable npm reads. When neither is set, or the value is empty, the dev server uses `https://registry.npmjs.org`. The mirror must serve the standard npm tarball layout.

```bash
npm_config_registry=https://npm.internal.example.com fastmcp dev apps server.py
```

This setting covers only the npm download. The dev UI also loads modules from `esm.sh`, and that host is not configurable.

## Multiple tools

If your server has multiple app tools, the picker shows a dropdown. Each tool gets its own form and launch button. The tool's `title` is displayed when available, falling back to the tool name.

```bash
# Server with multiple app tools
fastmcp dev apps examples/apps/contacts/contacts_server.py
```

---

### Apps Examples (`docs/apps/examples.mdx`)

---
title: Examples
sidebarTitle: Examples
description: Example apps you can run right now.
icon: images
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.2.0" />

Each tile below is a working FastMCP server you can run with `fastmcp dev apps` or connect to from any MCP host. Source lives in `examples/apps/` in the repository.

<Columns cols={2}>
  <Tile href="#sales-dashboard" title="Sales Dashboard" description="Metrics, charts, and deal pipeline">
    <div style={{overflow: "hidden", width: "100%"}}>
      <img src="/apps/images/app-example-sales-dashboard.png" alt="Sales dashboard with KPI cards, a monthly revenue chart, and a revenue-by-segment donut chart" />
    </div>
  </Tile>
  <Tile href="#system-monitor" title="System Monitor" description="Live CPU, memory, disk with auto-refresh">
    <img src="/apps/images/app-example-system-dashboard.png" alt="System monitor with CPU, memory, disk, and uptime stats above a CPU and memory chart" />
  </Tile>
  <Tile href="#quiz" title="Quiz" description="LLM-generated trivia with scoring">
    <img src="/apps/images/app-example-quiz.png" alt="Quiz question with multiple-choice answer buttons" />
  </Tile>
  <Tile href="#interactive-map" title="Interactive Map" description="Geocoded addresses on Leaflet">
    <img src="/apps/images/app-example-map.png" alt="Leaflet map of Washington DC with a location marker" />
  </Tile>
  <Tile href="/apps/providers/file-upload" title="File Upload" description="Drag-and-drop upload provider">
    <img src="/apps/images/app-file-upload.png" alt="File upload drop zone" />
  </Tile>
  <Tile href="/apps/providers/approval" title="Approval" description="Human-in-the-loop confirmation">
    <img src="/apps/images/app-approval.png" alt="Confirm Payment card with Cancel and approve buttons" />
  </Tile>
  <Tile href="/apps/providers/choice" title="Choice" description="Clickable option selection">
    <img src="/apps/images/app-choice.png" alt="Lunch question with four clickable options" />
  </Tile>
  <Tile href="/apps/providers/form" title="Form Input" description="Pydantic model forms">
    <img src="/apps/images/app-form.png" alt="Form generated from a Pydantic model" />
  </Tile>
  <Tile href="/apps/generative" title="Generative UI" description="LLM writes the UI at runtime">
    <img src="/apps/images/app-showcase.png" alt="Component showcase with forms, charts, toggles, and a data table" />
  </Tile>
</Columns>

## Running the examples

Preview any example in your browser with the dev server:

```bash
pip install "fastmcp[apps]"
fastmcp dev apps examples/apps/sales_dashboard/sales_dashboard_server.py
```

The dev UI lets you pick a tool and fill in arguments. In a real deployment the LLM provides those arguments from conversation context — the quiz example especially shines when connected to a host like Goose or Claude Desktop, where the LLM generates the questions itself.

## Standalone apps

### Sales dashboard

A full dashboard with KPI metrics, revenue trends, segment breakdown, and a deal pipeline table. Shows what you can build with a single `app=True` tool and Prefab's chart and data components.

```bash
fastmcp dev apps examples/apps/sales_dashboard/sales_dashboard_server.py
```

### System monitor

Reads live CPU, memory, and disk stats from your machine using `psutil`. Auto-refreshes via `SetInterval` calling a backend tool, with a dropdown to control the refresh rate. The chart accumulates up to 100 data points over time.

```bash
pip install psutil
fastmcp dev apps examples/apps/system_monitor/system_monitor_server.py
```

### Quiz

The LLM generates trivia questions and passes them to the tool. The user answers via buttons, sees correct/incorrect feedback, and tracks score across questions. Demonstrates multi-turn client-side state with FastMCPApp.

```bash
fastmcp dev apps examples/apps/quiz/quiz_server.py
```

### Media picker

The model finds videos with its own search and passes their YouTube links; the server verifies each link through oEmbed before showing it. `Play` and `Save` call app-only tools directly, `Play` can drive a TV through another MCP server, and `More like this` sends a follow-up request to the conversation.

```bash
fastmcp dev apps examples/apps/media_picker/media_picker_server.py
```

### Interactive map

Accepts addresses or place names, geocodes them via OpenStreetMap Nominatim (free, no API key), and renders an interactive Leaflet map using Prefab's `Embed` component with inline HTML. A reminder that Prefab apps can break out of built-in components when they need to.

```bash
fastmcp dev apps examples/apps/map/map_server.py
```

For ready-made building blocks like approvals, choice pickers, file uploads, and Pydantic forms, see the [Providers](/apps/providers/approval) group.

---

### Apps Fastmcp App (`docs/apps/fastmcp-app.mdx`)

---
title: FastMCPApp
sidebarTitle: FastMCPApp
description: Wire an interactive UI to backend tools with managed visibility and composition safety.
icon: puzzle-piece
---

import { VersionBadge } from '/snippets/version-badge.mdx'
import PrefabPinWarning from '/snippets/prefab-pin-warning.mdx'
import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx'

<VersionBadge version="3.2.0" />

<PrefabPinWarning />

<PrefabDemoFrame demo="contacts" height="650px" title="Contacts app demo" />

Search a list, fill out a form, click save, the list updates. That pattern — UI that reads and writes data on the server — needs two things: backend tools that actually do the work, and a way to call them from the UI. `FastMCPApp` handles the wiring.

You'll build up to the contacts app above by the end of this page. Let's start with something smaller.

## A minimal interactive app

The smallest interactive app: a form that saves a note, and a list that updates when the user submits.

```
/* Detailed source-code truncated for AI context efficiency. */
```

With a host that honors app visibility, the model sees one tool: `notes_app`. Calling it opens the UI. When the user submits the form, `CallTool("add_note")` fires, the server saves the note, returns the updated list, and `SetState("notes", RESULT)` writes that list back into state. `ForEach("notes")` re-renders. `add_note` is omitted from the model's tool list.

## Why not just `@mcp.tool(app=True)`?

A fair question. Any [Interactive Tool](/apps/prefab) can call a server tool — there's nothing stopping you from putting `CallTool("add_note")` inside a regular `@mcp.tool(app=True)`. It works for one or two tools. Things get harder once the app grows:

- Which tools should the model see, and which are UI-only?
- What happens to `CallTool("add_note")` when you mount this server under a namespace and the tool becomes `notes_add_note`?
- How do you keep it all wired correctly as you compose servers?

`FastMCPApp` owns these concerns. Entry points register as model-visible, backend tools register as UI-only, and hosts act on those declarations to decide what the model sees.

App tool visibility is not a security boundary. Backend tools remain callable through direct MCP requests by clients that know their names, subject to the server's authentication and authorization checks. Use [authorization](/servers/authorization) and server-side validation to enforce access and approval requirements; [visibility metadata](/apps/low-level#tool-visibility) only declares the intended audience.

Composition is handled at serialization. Inside a `FastMCPApp`, FastMCP resolves every `CallTool` reference, by name or by function, to whatever that tool is actually called when the UI reaches the host. Mount the server under a namespace and the button calls `notes_add_note`; put a gateway in front and it calls whatever the gateway lists. Renaming cannot break it. [The architecture page](/apps/architecture) covers how that resolution works.

The one rule that comes with this: **an app name must be unique within a server.** Composing the same app twice breaks its UI — two copies of `FastMCPApp("notes")` are indistinguishable no matter what namespaces you mount them under, so FastMCP declines to bind rather than picking one. Name apps for what they serve: `FastMCPApp("notes-acme")` and `FastMCPApp("notes-globex")`. [The architecture page](/apps/architecture) explains why identity works this way.

The rest of this page covers each piece in turn.

## `@app.ui()` — entry points

Entry points are what the model sees. They return a `PrefabApp` and default to `visibility=["model"]`, asking hosts to include them in the LLM tool list and reject calls to them from the UI.

```python
@app.ui()
def dashboard() -> PrefabApp:
    """The model calls this to open the dashboard."""
    with Column(gap=4, css_class="p-6") as view:
        Heading("Dashboard")
        ...
    return PrefabApp(view=view)
```

`@app.ui()` accepts `name`, `description`, `title`, `tags`, `icons`, `annotations`, `auth`, and `timeout`.

## `@app.tool()` — backend tools

Backend tools do the work. By default they declare `visibility=["app"]`, asking hosts to expose them to the UI and omit them from the model's tool list.

```python
@app.tool()
def save_contact(name: str, email: str) -> list[dict]:
    """Save a contact and return the updated list."""
    db.append({"name": name, "email": email})
    return list(db)
```

If you want a tool callable by both the model and the UI, pass `model=True`:

```python
@app.tool(model=True)
def list_contacts() -> list[dict]:
    """Both the model and the UI can call this."""
    return list(db)
```

Backend tools support `name`, `description`, `auth`, and `timeout`.

App tool names matching `__<12 lowercase hex>_<name>` (for example, `__abcdef012345_save`) are reserved for generated tool addresses. `@app.tool()`, `@app.ui()`, and `app.add_tool()` reject that pattern with a `ValueError` at registration. Other names containing double underscores, such as `__save` or `save__contact`, are allowed.

## `CallTool` — UI → backend

`CallTool` is how the UI invokes a backend tool. Pass the tool's name or the function itself; inside a `FastMCPApp`, both resolve to the tool's current address when the UI is serialized:

```python
from prefab_ui.actions.mcp import CallTool

CallTool("save_contact", arguments={"name": "Alice", "email": "alice@example.com"})

# Or pass the function itself
CallTool(save_contact, arguments={...})
```

Arguments can reference state with `Rx`:

```python
from prefab_ui.rx import STATE

CallTool("search", arguments={"query": STATE.search_term})
```

### Handling results

Server calls are async. Use `on_success` and `on_error` callbacks:

```python
from prefab_ui.actions import SetState, ShowToast
from prefab_ui.rx import RESULT

CallTool(
    "save_contact",
    on_success=[
        SetState("contacts", RESULT),
        ShowToast("Saved!", variant="success"),
    ],
    on_error=ShowToast("Something went wrong", variant="error"),
)
```

`RESULT` is a reactive reference to the tool's return value, available inside `on_success`. `ERROR` (from `prefab_ui.rx`) is the counterpart inside `on_error`. Callbacks can be a single action or a list; they execute in order and short-circuit on error.

### `result_key` shorthand

When a tool's return value should replace a state key, use `result_key`:

```python
CallTool("list_contacts", result_key="contacts")

# same as:
CallTool("list_contacts", on_success=SetState("contacts", RESULT))
```

## Actions

`CallTool` is one of several actions. Actions attach to handlers like `on_click`, `on_submit`, and `on_change`.

Client-side actions run instantly in the browser, no server round-trip:

```python
from prefab_ui.actions import SetState, ToggleState, AppendState, PopState, ShowToast

SetState("count", 42)
ToggleState("expanded")
AppendState("items", {"name": "New Item"})
PopState("items", 0)
ShowToast("Done!", variant="success")
```

Pass a list to chain actions:

```python
Button(
    "Reset",
    on_click=[
        SetState("query", ""),
        SetState("results", []),
        ShowToast("Cleared"),
    ],
)
```

### Loading states

A common pattern: disable a button and show a spinner while a call is in flight.

```python
from prefab_ui.rx import Rx

saving = Rx("saving")

Button(
    saving.then("Saving...", "Save"),
    disabled=saving,
    on_click=[
        SetState("saving", True),
        CallTool(
            "save_data",
            on_success=[
                SetState("saving", False),
                SetState("result", RESULT),
                ShowToast("Saved!", variant="success"),
            ],
            on_error=[
                SetState("saving", False),
                ShowToast("Failed", variant="error"),
            ],
        ),
    ],
)

# PrefabApp(view=view, state={"saving": False, ...})
```

## Forms

Forms collect input and submit it to a tool. When submitted, named input values become the tool's arguments.

### Manual forms

```python
from prefab_ui.components import Form, Input, Select, SelectOption, Textarea, Button

with Form(
    on_submit=CallTool(
        "create_ticket",
        on_success=ShowToast("Ticket created!", variant="success"),
    )
):
    Input(name="title", label="Title", required=True)
    with Select(name="priority", label="Priority"):
        SelectOption("Low", value="low")
        SelectOption("Medium", value="medium")
        SelectOption("High", value="high")
    Textarea(name="description", label="Description")
    Button("Create Ticket")
```

On submit, `CallTool` receives `{"title": ..., "priority": ..., "description": ...}`.

### Forms from Pydantic models

For structured input, `Form.from_model()` generates the whole form — inputs, labels, validation:

```python
from typing import Literal
from pydantic import BaseModel, Field

class BugReport(BaseModel):
    title: str = Field(title="Bug Title")
    severity: Literal["low", "medium", "high", "critical"] = Field(
        title="Severity", default="medium"
    )
    description: str = Field(title="Description")


@app.ui()
def report_bug() -> PrefabApp:
    with Column(gap=4, css_class="p-6") as view:
        Heading("Report a Bug")
        Form.from_model(
            BugReport,
            on_submit=CallTool(
                "create_bug",
                on_success=ShowToast("Bug filed!", variant="success"),
            ),
        )
    return PrefabApp(view=view)


@app.tool()
def create_bug(data: BugReport) -> str:
    return f"Created: {data.title}"
```

`str` becomes a text input, `Literal` becomes a select, `bool` becomes a checkbox. Field titles and defaults are respected.

## Composition and namespacing

The reason `FastMCPApp` exists — and why you'd pick it over a plain `@mcp.tool(app=True)` that calls other tools — is composition safety.

When you mount a server under a namespace, tool names get prefixed:

```python
platform = FastMCP("Platform")
platform.mount(contacts_server, namespace="contacts")

# "save_contact" becomes "contacts_save_contact"
```

In a plain `@mcp.tool(app=True)`, `CallTool("save_contact")` would now point at a tool that no longer exists. Inside a `FastMCPApp`, the same call is addressed by the app's identity and rewritten to `contacts_save_contact` on the way out, so the app works the same whether standalone or mounted.

### Mounting

`FastMCPApp` is a Provider. Add it to a server with `providers=` or `add_provider`:

```python
mcp = FastMCP("Platform", providers=[app])

# or
mcp = FastMCP("Platform")
mcp.add_provider(app)
```

Multiple apps can coexist; each gets its own global keys, so there's no collision even if two apps have a tool named `save`.

```python
mcp = FastMCP("Platform", providers=[contacts_app, inventory_app, billing_app])
```

### Running standalone

For development, `FastMCPApp` has a `run()` shortcut that wraps itself in a temporary `FastMCP` server:

```python
app = FastMCPApp("Contacts")
# ... register tools ...

if __name__ == "__main__":
    app.run()
```

## A full example: contact manager

This brings everything together — entry point, backend tools, Pydantic form, manual form, state, actions, and multi-visibility.

```
/* Detailed source-code truncated for AI context efficiency. */
```

Also available as a runnable server at `examples/apps/contacts/contacts_server.py`.

## Next steps

- **[Interactive Tools](/apps/prefab)** — the building blocks: charts, tables, dashboards, reactive state
- **[Examples](/apps/examples)** — complete working servers
- **[Development](/apps/development)** — preview and test app tools locally
- **[Prefab UI docs](https://prefab.prefect.io)** — full component reference

---

### Apps Generative (`docs/apps/generative.mdx`)

---
title: Generative UI
sidebarTitle: Generative UI
description: Let the LLM build custom Prefab UIs on the fly.
icon: wand-magic-sparkles
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.2.0" />

<video src="/apps/images/generative-ui.mp4" autoPlay loop muted playsInline style={{width:"100%", borderRadius:"8px", marginBottom:"1rem"}} />

With Generative UI, the LLM writes the UI code at runtime. Instead of calling a pre-built tool with a fixed shape, the model writes Prefab Python tailored to the current data and request. The user watches the UI stream in as the model generates it.

```python
from fastmcp import FastMCP
from fastmcp.apps.generative import GenerativeUI

mcp = FastMCP("Prefab Studio")
mcp.add_provider(GenerativeUI())
```

One provider registers three things:

- **`generate_prefab_ui`** — a tool that accepts Python code, executes it in a Pyodide sandbox, and renders the result as a Prefab app
- **`search_prefab_components`** — a tool the LLM uses to discover what components are available
- **The streaming renderer** — a `ui://` resource with browser-side Pyodide that progressively renders partial code as the LLM generates it

## How it works

When the LLM calls `generate_prefab_ui`, it writes Prefab Python code into the `code` argument. The MCP Apps protocol creates the renderer iframe in parallel with the tool call, so the app is already running by the time partial arguments start flowing.

As the LLM generates each token:

1. The host forwards partial arguments to the app via `ontoolinputpartial`
2. The renderer extracts the growing `code` string
3. Browser-side Pyodide executes whatever compiles successfully
4. The user sees components appear as they're written

When the LLM finishes, the server runs the complete code in a server-side Pyodide sandbox for validation, and the renderer swaps the streaming preview for the final server-validated result.

## What the LLM writes

The tool description includes examples that teach the model the Prefab patterns. A typical generation looks like:

```python
from prefab_ui.components import Column, Row, Heading, Text, Badge, Card, CardContent
from prefab_ui.components.charts import BarChart, ChartSeries
from prefab_ui.app import PrefabApp

with PrefabApp() as app:
    with Column(gap=6, css_class="p-6"):
        Heading("Q3 Revenue Report")

        BarChart(
            data=[
                {"month": "Jul", "revenue": 42000},
                {"month": "Aug", "revenue": 51000},
                {"month": "Sep", "revenue": 63000},
            ],
            series=[ChartSeries(data_key="revenue", label="Revenue")],
            x_axis="month",
        )

        with Row(gap=4):
            with Card():
                with CardContent():
                    Text("Total", css_class="text-sm text-muted-foreground")
                    Heading("$156,000")
            with Card():
                with CardContent():
                    Text("Growth", css_class="text-sm text-muted-foreground")
                    Badge("+18%", variant="success")
```

The model writes real Python — loops, f-strings, computation, helper functions. Prefab gives it charts, tables, forms, cards, badges, and layout primitives to compose.

## The component search tool

Before writing code, the LLM can call `search_prefab_components` to discover what's available:

```text
search_prefab_components("Chart")
→ 9 components matching 'Chart':

  ## Charts
  Import: `from prefab_ui.components.charts import <name>`
  AreaChart — Area chart with one or more series.
  BarChart — Bar chart with one or more series.
  ...
```

Space-separated terms match independently, so `"Card Badge Metric"` returns all three. A query that matches five or fewer components returns full docstrings and arguments; a broader one returns this compact listing. Pass `detail=True` or `detail=False` to override. The search tool introspects Prefab classes at runtime, so it matches the installed version.

## Passing data

The `generate_prefab_ui` tool accepts a `data` parameter. Values become global variables in the sandbox:

```python
# The LLM can reference 'sales_data' directly in its code
result = await generate_prefab_ui(
    code="...",
    data={"sales_data": [{"month": "Jan", "revenue": 42000}, ...]}
)
```

This lets the model use data from earlier in the conversation to build visualizations.

## Configuration

`GenerativeUI` takes options for customizing tool names:

```python
GenerativeUI(
    tool_name="generate_prefab_ui",           # default
    components_tool_name="search_prefab_components",  # default
    include_components_tool=True,              # default
)
```

## Requirements

Generative UI needs `fastmcp[apps]`, which pulls in `prefab-ui`. The server-side Pyodide sandbox (for final validation) requires [Deno](https://deno.land) on your `PATH`; FastMCP does not install it, and `generate_prefab_ui` calls fail until it is present. Pyodide itself downloads on first use.

The streaming renderer loads Pyodide from CDN in the browser. The CSP is configured automatically by the provider — no manual setup.

## Sandbox limitations

The Pyodide sandbox includes the Python standard library and Prefab. External packages (NumPy, pandas, requests, etc.) are **not available** — the LLM's code must work with only built-in Python and Prefab. If the LLM imports something unavailable, the sandbox raises `ImportError`.

## Next steps

- **[Interactive Tools](/apps/prefab)** — the component building blocks the LLM will use
- **[Prefab component reference](https://prefab.prefect.io/docs/components)** — full component library
- **[Development](/apps/development)** — preview generative tools locally with `fastmcp dev apps`

---

### Apps Prefab (`docs/apps/prefab.mdx`)

---
title: Interactive Tools
sidebarTitle: Interactive Tools
description: Turn your tools into interactive UIs with charts, tables, and dashboards.
icon: palette
---

import { VersionBadge } from '/snippets/version-badge.mdx'
import PrefabPinWarning from '/snippets/prefab-pin-warning.mdx'
import { PrefabDemoFrame } from '/snippets/prefab-demo-frame.mdx'

<VersionBadge version="3.1.0" />

<PrefabPinWarning />

<PrefabDemoFrame demo="dashboard" height="680px" title="Sales dashboard demo" />

Believe it or not, that dashboard is a FastMCP tool. The chart has tooltips. The table is sortable. The badges are styled by deal stage. The whole thing is about 40 lines of Python, and the user sees it right inside their conversation instead of a wall of JSON.

The pattern behind every example on this page is the same: add `app=True` to your tool, build a UI with [Prefab](https://prefab.prefect.io) components, and return it as a `PrefabApp`. Prefab has [100+ components](https://prefab.prefect.io/docs/components), from data tables and charts to forms and progress bars. You compose them in Python; the host renders them as a live, interactive application.

## Start with a table

Most tools return data the user wants to explore. A `DataTable` is often the smallest useful upgrade — your data goes from a JSON blob to a searchable, sortable table:

<PrefabDemoFrame demo="data-table" height="530px" title="Data table demo" />

```python
from prefab_ui.components import DataTable, DataTableColumn
from fastmcp import FastMCP

mcp = FastMCP("Directory")


@mcp.tool(app=True)
def team_directory() -> DataTable:
    """Browse the team directory."""
    employees = [
        {"name": "Alice Chen", "role": "Staff Engineer", "dept": "Platform"},
        {"name": "Bob Martinez", "role": "Lead Designer", "dept": "Design"},
        {"name": "Carol Johnson", "role": "Senior Engineer", "dept": "Platform"},
        {"name": "David Kim", "role": "Product Manager", "dept": "Product"},
        {"name": "Eva Mueller", "role": "Engineer", "dept": "Platform"},
        {"name": "Frank Lee", "role": "Data Scientist", "dept": "ML"},
        {"name": "Grace Park", "role": "Eng Manager", "dept": "Platform"},
    ]

    return DataTable(
        columns=[
            DataTableColumn(key="name", header="Name", sortable=True),
            DataTableColumn(key="role", header="Role", sortable=True),
            DataTableColumn(key="dept", header="Dept", sortable=True),
        ],
        rows=employees,
        search=True,
    )
```

That's it. Add `app=True`, return a Prefab component instead of raw dicts. FastMCP handles the rendering, sandboxing, and security. No wrapper class needed for simple cases like this.

## Add charts

When numbers tell a better story as a visual, swap in a chart. The API is the same: pass your data as a list of dicts, tell the chart which keys to plot.

<PrefabDemoFrame demo="bar-chart" height="430px" title="Bar chart demo" />

```python
from prefab_ui.components.charts import BarChart, ChartSeries


@mcp.tool(app=True)
def quarterly_revenue(year: int) -> BarChart:
    """Show quarterly revenue as a bar chart."""
    data = [
        {"quarter": "Q1", "revenue": 42000, "costs": 28000},
        {"quarter": "Q2", "revenue": 51000, "costs": 31000},
        {"quarter": "Q3", "revenue": 47000, "costs": 29000},
        {"quarter": "Q4", "revenue": 63000, "costs": 35000},
    ]

    return BarChart(
        data=data,
        series=[
            ChartSeries(data_key="revenue", label="Revenue"),
            ChartSeries(data_key="costs", label="Costs"),
        ],
        x_axis="quarter",
        show_legend=True,
    )
```

Each `ChartSeries` plots a different key from the data. `BarChart`, `LineChart`, `AreaChart`, `PieChart`, `RadarChart`, and `RadialChart` all follow the same pattern. Hover over the bars to see tooltips.

<PrefabDemoFrame demo="pie-chart" height="410px" title="Pie chart demo" />

```python
from prefab_ui.components.charts import PieChart


@mcp.tool(app=True)
def ticket_breakdown() -> PieChart:
    """Show open tickets by category."""
    data = [
        {"category": "Bug", "count": 42},
        {"category": "Feature", "count": 28},
        {"category": "Docs", "count": 15},
        {"category": "Infra", "count": 10},
    ]

    return PieChart(
        data=data,
        data_key="count",
        name_key="category",
        inner_radius=50,
        show_legend=True,
    )
```

See the [Prefab chart docs](https://prefab.prefect.io/docs/components) for stacking, curves, custom colors, and more.

## Compose a dashboard

Tables and charts are useful on their own, but the real power comes from composing them. `Column` stacks children vertically, `Row` lays them out side by side, and `with` blocks establish nesting — the indentation is the layout.

<PrefabDemoFrame demo="dashboard" height="680px" title="Sales dashboard demo" />

```
/* Detailed source-code truncated for AI context efficiency. */
```

Notice how `Badge` components can be placed inside table cells — any Prefab component works as a cell value, so you can put progress bars, icons, or buttons in your tables too.

## Make it reactive

Everything above renders once from the data your Python provides. But interactive tools can also respond to user input in real time, without any server round-trips. Prefab's state system lets components read and write client-side values, so the UI updates instantly as the user interacts with it.

<PrefabDemoFrame demo="reactive" height="500px" title="Reactive sales demo" />

Try switching regions in the dropdown, and toggling the switch on and off.

```
/* Detailed source-code truncated for AI context efficiency. */
```

The `state` dict on `PrefabApp` declares initial values. The `Select` writes to the `region` key on every change. A `let` binding picks the matching dataset, and the chart re-renders. The `Switch` toggles a `Metric` on and off through `If(Rx("show_target"))`. All of this happens in the browser — no calls back to your server.

`Rx` is a reactive reference: `Rx("region")` compiles to an expression the renderer evaluates live. It supports arithmetic, comparisons, formatting pipes (`.currency()`, `.percent()`), and ternary conditionals (`.then()`). For the full state system, see the [Prefab state docs](https://prefab.prefect.io/docs/concepts/state) and [expression docs](https://prefab.prefect.io/docs/concepts/expressions).

## Content Security Policy

Interactive tools render in a sandboxed iframe with a strict CSP. If your tool loads external resources — embedding iframes, fetching from APIs, loading scripts — add the required domains:

```python
from prefab_ui.app import PrefabApp
from fastmcp.apps import PrefabAppConfig, ResourceCSP


@mcp.tool(app=PrefabAppConfig(
    csp=ResourceCSP(frame_domains=["https://example.com"]),
))
def dashboard_with_embed() -> PrefabApp:
    ...
```

`PrefabAppConfig()` with no arguments is equivalent to `app=True`.

## Giving the LLM context

By default, the LLM sees `"[Rendered Prefab UI]"` as the tool result. If the model needs to reason about the data, return a `ToolResult` with a text summary alongside the UI:

```python
from prefab_ui.components import Column
from prefab_ui.components.charts import BarChart, ChartSeries
from fastmcp.tools import ToolResult


@mcp.tool(app=True)
def sales_overview(year: int) -> ToolResult:
    """Show sales visually, summarize for the model."""
    data = get_sales_data(year)
    total = sum(row["revenue"] for row in data)

    with Column(gap=4, css_class="p-6") as view:
        BarChart(data=data, series=[ChartSeries(data_key="revenue")])

    return ToolResult(
        content=f"Total revenue for {year}: ${total:,} across {len(data)} quarters",
        structured_content=view,
    )
```

The user sees the chart. The model sees the summary.

## Next steps

- **[FastMCPApp](/apps/fastmcp-app)** — when your UI needs to call backend tools (forms, search, CRUD)
- **[Generative UI](/apps/generative)** — let the LLM design the UI at runtime
- **[Custom HTML](/apps/low-level)** — when Prefab isn't enough (maps, 3D, your own framework)
- **[Examples](/apps/examples)** — complete working servers you can run today
- **[Development](/apps/development)** — preview your tools locally with `fastmcp dev apps`
- **[Prefab UI](https://prefab.prefect.io)** — full component reference with 100+ components, theming, and advanced patterns

---

### Cli Auth (`docs/cli/auth.mdx`)

---
title: Auth Utilities
sidebarTitle: Auth
description: Create and validate CIMD documents for OAuth
icon: key
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.0.0" />

The `fastmcp auth` commands help with CIMD (Client ID Metadata Document) management — part of MCP's OAuth authentication flow. A CIMD is a JSON document you host at an HTTPS URL to identify your client application to MCP servers.

## Creating a CIMD

`fastmcp auth cimd create` generates a CIMD document:

```bash
fastmcp auth cimd create \
  --name "My App" \
  --redirect-uri "http://localhost:*/callback"
```

```json
{
  "client_id": "https://YOUR-DOMAIN.com/path/to/client.json",
  "client_name": "My App",
  "redirect_uris": ["http://localhost:*/callback"],
  "token_endpoint_auth_method": "none",
  "grant_types": ["authorization_code"],
  "response_types": ["code"]
}
```

By default, the generated document includes a placeholder `client_id`. Update it to match the URL where you'll host the document before deploying, or pass `--client-id` when generating the file.

### Options

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Name | `--name` | **Required.** Human-readable client name |
| Redirect URI | `--redirect-uri`, `-r` | **Required.** Allowed redirect URIs (repeatable) |
| Client ID | `--client-id` | URL where this document will be hosted; defaults to a placeholder |
| Client URI | `--client-uri` | Client's home page URL |
| Logo URI | `--logo-uri` | Client's logo URL |
| Scope | `--scope` | Space-separated list of scopes |
| Output | `--output`, `-o` | Save to file (default: stdout) |
| Pretty | `--pretty` | Pretty-print JSON (default: true; pass `--pretty=false` for compact output) |

### Example

```bash
fastmcp auth cimd create \
  --name "My Production App" \
  --redirect-uri "http://localhost:*/callback" \
  --redirect-uri "https://myapp.example.com/callback" \
  --client-id "https://myapp.example.com/oauth/client.json" \
  --client-uri "https://myapp.example.com" \
  --scope "read write" \
  --output client.json
```

## Validating a CIMD

`fastmcp auth cimd validate` fetches a hosted CIMD and verifies it conforms to the spec:

```bash
fastmcp auth cimd validate https://myapp.example.com/oauth/client.json
```

The validator checks that the URL is valid (HTTPS, non-root path), the document is valid JSON, the `client_id` matches the URL, and no shared-secret auth methods are used.

On success:

```text
→ Fetching https://myapp.example.com/oauth/client.json...
✓ Valid CIMD document

Document details:
  client_id: https://myapp.example.com/oauth/client.json
  client_name: My App
  token_endpoint_auth_method: none
  redirect_uris:
    • http://localhost:*/callback
```

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Timeout | `--timeout`, `-t` | HTTP request timeout in seconds (default: 10) |

---

### Cli Client (`docs/cli/client.mdx`)

---
title: Client Commands
sidebarTitle: Client
description: List tools, call them, and discover configured servers
icon: satellite-dish
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.0.0" />

The CLI can act as an MCP client — connecting to any server (local or remote) to list what it exposes and call its tools directly. This is useful for development, debugging, scripting, and giving shell-capable LLM agents access to MCP servers.

## Listing Tools

`fastmcp list` connects to a server and prints its tools as function signatures, showing parameter names, types, and descriptions at a glance:

```bash
fastmcp list http://localhost:8000/mcp
fastmcp list server.py
fastmcp list weather  # name-based resolution
```

When you need the full JSON Schema for a tool's inputs or outputs — for understanding nested objects, enum constraints, or complex types — opt in with `--input-schema` or `--output-schema`:

```bash
fastmcp list server.py --input-schema
```

### Resources and Prompts

By default, only tools are shown. Add `--resources` or `--prompts` to include those:

```bash
fastmcp list server.py --resources --prompts
```

<VersionBadge version="4.2.0" />

`--skills` lists the server's [Skills extension](/servers/skills) entries with each skill's files. A server that doesn't advertise the extension shows no skills and says why.

```bash
fastmcp list server.py --skills
```

### Machine-Readable Output

The `--json` flag switches to structured JSON with full schemas included. This is the format to use when feeding tool definitions to an LLM or building automation:

```bash
fastmcp list server.py --json
```

### Options

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Command | `--command` | Connect via stdio (e.g., `'npx -y @mcp/server'`) |
| Transport | `--transport`, `-t` | Force `http` or `sse` for URL targets |
| Resources | `--resources` | Include resources in output |
| Prompts | `--prompts` | Include prompts in output |
| Skills | `--skills` | Include Skills extension entries in output |
| Input Schema | `--input-schema` | Show full input schemas |
| Output Schema | `--output-schema` | Show full output schemas |
| JSON | `--json` | Structured JSON output |
| Timeout | `--timeout` | Connection timeout in seconds |
| Auth | `--auth` | `oauth` (default for HTTP), a bearer token, or `none` |

## Calling Tools

`fastmcp call` invokes a single tool on a server. Pass arguments as `key=value` pairs — the CLI fetches the tool's schema and coerces your string values to the right types automatically:

```bash
fastmcp call server.py greet name=World
fastmcp call http://localhost:8000/mcp search query=hello limit=5
```

Type coercion is schema-driven: `"5"` becomes the integer `5` when the schema expects an integer. Booleans accept `true`/`false`, `yes`/`no`, and `1`/`0`. Arrays and objects are parsed as JSON.

### Complex Arguments

For tools with nested or structured parameters, `key=value` syntax gets awkward. Pass a single JSON object instead:

```bash
fastmcp call server.py create_item '{"name": "Widget", "tags": ["sale"], "metadata": {"color": "blue"}}'
```

Or use `--input-json` to provide a base dictionary, then override individual keys with `key=value` pairs:

```bash
fastmcp call server.py search --input-json '{"query": "hello", "limit": 5}' limit=10
```

### Error Handling

If you misspell a tool name, the CLI suggests corrections via fuzzy matching. Missing required arguments produce a clear message with the tool's signature as a reminder. Tool execution errors are printed with a non-zero exit code, making the CLI straightforward to use in scripts.

### Structured Output

`--json` emits the raw result including content blocks, error status, and structured content:

```bash
fastmcp call server.py get_weather city=London --json
```

### Interactive Elicitation

Some tools request additional input during execution through MCP's elicitation mechanism. When this happens, the CLI prompts you in the terminal — showing each field's name, type, and whether it's required. You can type `decline` to skip a question or `cancel` to abort the call entirely.

### Options

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Command | `--command` | Connect via stdio |
| Transport | `--transport`, `-t` | Force `http` or `sse` |
| Prompt | `--prompt` | Treat the target as a prompt name instead of a tool/resource |
| Input JSON | `--input-json` | Base arguments as JSON (merged with `key=value`) |
| JSON | `--json` | Raw JSON output |
| Timeout | `--timeout` | Connection timeout in seconds |
| Auth | `--auth` | `oauth`, a bearer token, or `none` |

## Reading Resources and Getting Prompts

`fastmcp call` can also read resources and render prompts. If the target contains `://`, the CLI treats it as a resource URI and calls `read_resource`:

```bash
fastmcp call server.py resource://docs/readme
fastmcp call server.py file:///tmp/example.txt --json
```

To get a prompt, pass `--prompt`; prompt arguments use the same `key=value` and `--input-json` forms as tool calls:

```bash
fastmcp call server.py summarize --prompt topic=weather
fastmcp call server.py summarize --prompt --input-json '{"topic": "weather"}'
```

## Discovering Configured Servers

`fastmcp discover` scans your machine for MCP servers configured in editors and tools. It checks these sources, listed with the source name you use in `--source` and `source:name`:

- **Claude Desktop** (`claude-desktop`) — `claude_desktop_config.json`
- **Claude Code** (`claude-code`) — `~/.claude.json`
- **Cursor** (`cursor`) — `.cursor/mcp.json` (walks up from current directory)
- **Gemini CLI** (`gemini`) — `~/.gemini/settings.json` and `.gemini/settings.json` in the current directory
- **Goose** (`goose`) — `~/.config/goose/config.yaml`
- **Project** (`project`) — `./mcp.json` in the current directory

Goose discovery includes enabled `stdio` and `streamable_http` extensions, as well as legacy `sse` entries. Streamable HTTP extensions retain their configured `headers` when resolved by name.

```bash
fastmcp discover
```

The output groups servers by source, showing each server's name and transport. Filter by source or get machine-readable output:

```bash
fastmcp discover --source claude-code
fastmcp discover --source cursor --source gemini --json
```

Any server that appears here can be used by name with `list`, `call`, and other commands — so you can go from "I have a server in Claude Code" to querying it without copying URLs or paths.

## LLM Agent Integration

For LLM agents that can execute shell commands but don't have native MCP support, the CLI provides a clean bridge. The agent calls `fastmcp list --json` to discover available tools with full schemas, then `fastmcp call --json` to invoke them with structured results.

Because the CLI handles connection management, transport selection, and type coercion internally, the agent doesn't need to understand MCP protocol details — it just reads JSON and constructs shell commands.

## Remote Stdio Bridges

For MCP hosts that expect a local stdio command but need to connect to a remote HTTP server, use [`fastmcp-remote`](/clients/fastmcp-remote). It provides a small standalone bridge for host configuration, while `fastmcp list` and `fastmcp call` remain focused on direct inspection and invocation from the terminal.

---

### Cli Generate Cli (`docs/cli/generate-cli.mdx`)

---
title: Generate CLI
sidebarTitle: Generate CLI
description: Scaffold a standalone typed CLI from any MCP server
icon: wand-magic-sparkles
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.0.0" />

`fastmcp list` and `fastmcp call` are general-purpose — you always specify the server, the tool name, and the arguments from scratch. `fastmcp generate-cli` goes further: it connects to a server, reads its tool schemas, and writes a standalone Python script where every tool is a proper subcommand with typed flags and help text. The result is a CLI that feels hand-written for that specific server.

MCP tool schemas already contain everything a CLI framework needs — parameter names, types, descriptions, required/optional status, and defaults. `generate-cli` maps that into [cyclopts](https://cyclopts.readthedocs.io/) commands, so JSON Schema types become Python type annotations, descriptions become `--help` text, and required parameters become mandatory flags.

## Generating a Script

Point the command at any [server target](/cli/overview#server-targets) and it writes a CLI script:

```bash
fastmcp generate-cli weather
fastmcp generate-cli http://localhost:8000/mcp
fastmcp generate-cli server.py my_weather_cli.py
```

The second positional argument sets the output path (defaults to `cli.py`). If the file already exists, pass `-f` to overwrite:

```bash
fastmcp generate-cli weather -f
```

## What You Get

The generated script is a regular Python file — executable, editable, and yours:

```text
$ python cli.py call-tool --help
Usage: weather call-tool COMMAND

Call a tool on the server

╭─ Commands ──────────────────────────────────────────────────╮
│ get_forecast  Get the weather forecast for a city.          │
│ search_city   Search for a city by name.                    │
╰─────────────────────────────────────────────────────────────╯
```

Each tool has typed parameters with help text pulled directly from the server's schema:

```text
$ python cli.py call-tool get_forecast --help
Usage: weather call-tool get_forecast --city STR [OPTIONS]

Get the weather forecast for a city.

╭─ Parameters ────────────────────────────────────────────────╮
│ *  --city  City name [required]                             │
│    --days  Number of forecast days [default: 3]             │
╰─────────────────────────────────────────────────────────────╯
```

Beyond tool commands, the script includes generic MCP operations — `list-tools`, `list-resources`, `read-resource`, `list-prompts`, and `get-prompt` — that always reflect the server's current state, even if tools have changed since generation.

## Parameter Handling

Parameters are mapped based on their JSON Schema type:

**Simple types** (`string`, `integer`, `number`, `boolean`) become typed flags:

```bash
python cli.py call-tool get_forecast --city London --days 3
```

**Arrays of simple types** become repeatable flags:

```bash
python cli.py call-tool tag_items --tags python --tags fastapi --tags mcp
```

**Complex types** (objects, nested arrays, unions) accept JSON strings. The `--help` output shows the full schema so you know what structure to pass:

```bash
python cli.py call-tool create_user \
  --name John \
  --metadata '{"role": "admin", "dept": "engineering"}'
```

For JSON-encoded parameters whose schema permits `null`, pass `--parameter null` to send an explicit null value. Omitting an optional flag remains distinct and allows its default to apply.

## Agent Skill

Alongside the CLI script, `generate-cli` writes a `SKILL.md` file — a [Claude Code agent skill](https://code.claude.com/docs/en/skills) that documents every tool's exact invocation syntax, parameter flags, types, and descriptions. An agent can pick up the CLI immediately without running `--help` or experimenting with flag names.

To skip skill generation:

```bash
fastmcp generate-cli weather --no-skill
```

## How It Works

The generated script is a *client*, not a server — it connects to the server on every invocation rather than bundling it. A `CLIENT_SPEC` variable at the top holds the resolved transport (a URL string or `StdioTransport` with baked-in command and arguments).

The most common edit is changing `CLIENT_SPEC` — for example, pointing a script generated from a dev server at production. Beyond that, the helper functions (`_call_tool`, `_print_tool_result`) are thin wrappers around `fastmcp.Client` that are easy to adapt.

The script requires `fastmcp` as a dependency. If it lives outside a project that already has FastMCP installed:

```bash
uv run --with fastmcp python cli.py call-tool get_forecast --city London
```

---

### Cli Inspecting (`docs/cli/inspecting.mdx`)

---
title: Inspecting Servers
sidebarTitle: Inspecting
description: View a server's components and metadata
icon: magnifying-glass
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.9.0" />

`fastmcp inspect` loads a server and reports what it contains — its tools, resources, prompts, version, and metadata. The default output is a human-readable summary:

```bash
fastmcp inspect server.py
```

```text
Server
  Name:         MyServer
  Version:      1.0.0
  Generation:   2
  Instructions: A helpful MCP server

Components
  Tools:        5
  Prompts:      2
  Resources:    3
  Templates:    1

Environment
  FastMCP:      4.2.0
  MCP:          2.3.0

Use --format [fastmcp|mcp] for complete JSON output
```

## JSON Output

For programmatic use, two JSON formats are available:

**FastMCP format** (`--format fastmcp`) includes everything FastMCP knows about the server — component keys, tags, output schemas, annotations, custom metadata, and the server's capabilities. Field names use `snake_case`. This is the format for debugging and introspecting FastMCP servers.

**MCP protocol format** (`--format mcp`) shows exactly what MCP clients see through the protocol — only standard MCP fields, `camelCase` names, no FastMCP-specific extensions. This is the format for verifying client compatibility and debugging what clients actually receive.

```bash
# Full FastMCP metadata to stdout
fastmcp inspect server.py --format fastmcp

# MCP protocol view saved to file
fastmcp inspect server.py --format mcp -o manifest.json
```

## Options

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Format | `--format`, `-f` | `fastmcp` or `mcp` (required when using `-o`) |
| Output File | `--output`, `-o` | Save to file instead of stdout |
| Python | `--python` | Python version to use when running via `uv` |
| Extra Packages | `--with` | Additional packages to install (repeatable) |
| Project | `--project` | Run within a specific uv project directory |
| Requirements | `--with-requirements` | Install from a requirements file |
| Skip Env | `--skip-env` | Do not set up a uv environment |

## Entrypoints

The `inspect` command supports the same local entrypoints as [`fastmcp run`](/cli/running): inferred instances, explicit entrypoints, factory functions, and `fastmcp.json` configs.

```bash
fastmcp inspect server.py                  # inferred instance
fastmcp inspect server.py:my_server        # explicit entrypoint
fastmcp inspect server.py:create_server    # factory function
fastmcp inspect fastmcp.json               # config file
```

<Warning>
`inspect` only works with local files and `fastmcp.json` — it doesn't connect to remote URLs or standard MCP config files.
</Warning>

---

### Cli Install Mcp (`docs/cli/install-mcp.mdx`)

---
title: Install MCP Servers
sidebarTitle: Install MCPs
description: Install MCP servers into Claude, Cursor, Gemini, and other clients
icon: download
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.10.3" />

`fastmcp install` registers a server with an MCP client application so the client can launch it automatically. Each MCP client runs servers in its own isolated environment, which means dependencies need to be explicitly declared — you can't rely on whatever happens to be installed locally.

```bash
fastmcp install claude-desktop server.py
fastmcp install claude-code server.py --with pandas --with matplotlib
fastmcp install cursor server.py --with-editable .
```

<Warning>
`uv` must be installed and available in your system PATH. Both Claude Desktop and Cursor run servers in isolated environments managed by `uv`. On macOS, install it globally with Homebrew for Claude Desktop compatibility: `brew install uv`.
</Warning>

## Supported Clients

| Client | Install method |
| ------ | -------------- |
| `claude-code` | Claude Code's built-in MCP management |
| `claude-desktop` | Direct config file modification |
| `cursor` | Deeplink that opens Cursor for confirmation |
| `gemini-cli` | Gemini CLI's built-in MCP management |
| `goose` | Deeplink that opens Goose for confirmation (uses `uvx`) |
| `mcp-json` | Generates standard MCP JSON config for manual use |
| `stdio` | Outputs the shell command to run via stdio |

## Declaring Dependencies

Because MCP clients run servers in isolation, you need to tell the install command what your server needs. There are two approaches:

**Command-line flags** let you specify dependencies directly:

```bash
fastmcp install claude-desktop server.py --with pandas --with "sqlalchemy>=2.0"
fastmcp install cursor server.py --with-editable . --with-requirements requirements.txt
```

**`fastmcp.json`** configuration files declare dependencies alongside the server definition. When you install from a config file explicitly, dependencies are picked up automatically:

```bash
fastmcp install claude-desktop fastmcp.json
```

See [Server Configuration](/deployment/server-configuration) for the full config format.

## Options

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Server Name | `--name`, `-n` | Custom name for the server |
| Editable Package | `--with-editable` | Install a directory in editable mode |
| Extra Packages | `--with` | Additional packages (repeatable) |
| Environment Variables | `--env` | `KEY=VALUE` pairs (repeatable; not `stdio`) |
| Environment File | `--env-file` | Load env vars from a `.env` file (not `stdio`) |
| Python | `--python` | Python version (e.g., `3.11`) |
| Project | `--project` | Run within a uv project directory |
| Requirements | `--with-requirements` | Install from a requirements file |
| Config Path | `--config-path` | Custom path to Claude Desktop config directory (`claude-desktop` only) |
| Workspace | `--workspace` | Write `.cursor/mcp.json` in this workspace directory instead of opening a deeplink (`cursor` only) |
| Copy | `--copy` | Copy the generated output to the clipboard (`mcp-json` and `stdio` only) |

`goose` installs through a deeplink that runs your server with `uvx`, so it accepts only `--name`, `--with`, and `--python`. Options that depend on a local uv project — `--with-editable`, `--project`, and `--with-requirements` — are unavailable there. Deeplinks also cannot carry environment variables: passing `--env` or `--env-file` exits with an error directing you to `fastmcp install mcp-json`, which generates a config you can add to Goose by hand with the variables included.

## Examples

```bash
# Basic install with auto-detected server instance
fastmcp install claude-desktop server.py

# Install from fastmcp.json
fastmcp install claude-desktop fastmcp.json

# Explicit entrypoint with dependencies
fastmcp install claude-desktop server.py:my_server \
  --name "My Analysis Server" \
  --with pandas

# With environment variables
fastmcp install claude-code server.py \
  --env API_KEY=secret \
  --env DEBUG=true

# With env file
fastmcp install cursor server.py --env-file .env

# Specific Python version and requirements file
fastmcp install claude-desktop server.py \
  --python 3.11 \
  --with-requirements requirements.txt

# With custom config path (claude-desktop only)
fastmcp install claude-desktop server.py \
  --config-path "C:\Users\username\AppData\Local\Packages\Claude_xyz\LocalCache\Roaming\Claude"
```

## Generating MCP JSON

The `mcp-json` target generates standard MCP configuration JSON instead of installing into a specific client. This is useful for clients that FastMCP doesn't directly support, for CI/CD environments, or for sharing server configs:

```bash
fastmcp install mcp-json server.py
```

The output follows the standard format used by Claude Desktop, Cursor, and other MCP clients:

```json
{
  "server-name": {
    "command": "uv",
    "args": ["run", "--with", "fastmcp", "fastmcp", "run", "/path/to/server.py"],
    "env": {
      "API_KEY": "value"
    }
  }
}
```

Use `--copy` to send it to your clipboard instead of stdout.

## Generating Stdio Commands

The `stdio` target outputs the shell command an MCP host would use to start your server over stdio:

```bash
fastmcp install stdio server.py
# Output: uv run --with fastmcp fastmcp run /absolute/path/to/server.py
```

When installing from a `fastmcp.json`, dependencies from the config are included automatically:

```bash
fastmcp install stdio fastmcp.json
# Output: uv run --with fastmcp --with pillow --with 'qrcode[pil]>=8.0' fastmcp run /path/to/server.py
```

Use `--copy` to copy to clipboard.

<Tip>
`fastmcp install` is designed for local server files with stdio transport. For remote servers running over HTTP, use your client's native configuration — FastMCP's value here is simplifying the complex local setup with `uv`, dependencies, and environment variables.
</Tip>

---

### Cli Running (`docs/cli/running.mdx`)

---
title: Running Servers
sidebarTitle: Running
description: Start, develop, and configure servers from the command line
icon: play
---

import { VersionBadge } from '/snippets/version-badge.mdx'

## Starting a Server

`fastmcp run` starts a server. Point it at a Python file, a factory function, a remote URL, or a config file:

```bash
fastmcp run server.py
fastmcp run server.py:create_server
fastmcp run https://example.com/mcp
fastmcp run fastmcp.json
```

By default, the server runs over **stdio** — the transport that MCP clients like Claude Desktop expect. To serve over HTTP instead, specify the transport:

```bash
fastmcp run server.py --transport http
fastmcp run server.py --transport http --host 0.0.0.0 --port 9000
```

### Entrypoints

FastMCP supports several ways to locate and start your server:

**Inferred instance** — FastMCP imports the file and looks for a variable named `mcp`, `server`, or `app`:

```bash
fastmcp run server.py
```

**Explicit instance** — point at a specific variable:

```bash
fastmcp run server.py:my_server
```

**Factory function** — FastMCP calls the function and uses the returned server. Useful when your server needs async setup or configuration that runs before startup:

```bash
fastmcp run server.py:create_server
```

**Remote URL** — starts a local proxy that bridges to a remote server. Handy for local development against a deployed server, or for bridging a remote HTTP server to stdio:

```bash
fastmcp run https://example.com/mcp
```

**FastMCP config** — uses a `fastmcp.json` file that declaratively specifies the server, its dependencies, and deployment settings. When you run `fastmcp run` with no arguments, it auto-detects `fastmcp.json` in the current directory:

```bash
fastmcp run
fastmcp run my-config.fastmcp.json
```

See [Server Configuration](/deployment/server-configuration) for the full `fastmcp.json` format.

**MCP config** — runs servers defined in a standard MCP configuration file (any `.json` with an `mcpServers` key):

```bash
fastmcp run mcp.json
```

<Warning>
`fastmcp run` completely ignores the `if __name__ == "__main__"` block. Any setup code in that block won't execute. If you need initialization logic to run, use a [factory function](#entrypoints).
</Warning>

### Options

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Transport | `--transport`, `-t` | `stdio` (default), `http` / `streamable-http`, or `sse` |
| Host | `--host` | Bind address for HTTP (default: `127.0.0.1`) |
| Port | `--port`, `-p` | Bind port for HTTP (default: `8000`) |
| Path | `--path` | URL path for HTTP (default: `/mcp` for `http`, `/sse` for `sse`) |
| Log Level | `--log-level`, `-l` | `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` |
| No Banner | `--no-banner` | Suppress the startup banner |
| Stateless | `--stateless` | Run without sessions, for serverless and multi-worker deployments |
| Module Mode | `--module`, `-m` | Run a Python module via `python -m` instead of a file path |
| Skip Source | `--skip-source` | Skip source preparation (use when the source is already prepared) |
| Auto-Reload | `--reload` / `--no-reload` | Watch for file changes and restart automatically |
| Reload Dirs | `--reload-dir` | Directories to watch (repeatable) |
| Skip Env | `--skip-env` | Don't set up a uv environment (use when already in one) |
| Python | `--python` | Python version to use (e.g., `3.11`) |
| Extra Packages | `--with` | Additional packages to install (repeatable) |
| Project | `--project` | Run within a specific uv project directory |
| Requirements | `--with-requirements` | Install from a requirements file |

### Dependency Management

By default, `fastmcp run` uses your current Python environment directly. When you pass `--python`, `--with`, `--project`, or `--with-requirements`, it switches to running via `uv run` in a subprocess, which handles dependency isolation automatically.

The `--skip-env` flag is useful when you're already inside an activated venv, a Docker container with pre-installed dependencies, or a uv-managed project — it prevents uv from trying to set up another environment layer.

## Previewing Apps

<VersionBadge version="3.2.0" />

`fastmcp dev apps` launches a browser-based preview UI for servers with [Prefab App tools](/apps/prefab). It starts your MCP server on one port and a local dev UI on another — giving you a live, interactive picker where you can call app tools and see their rendered output without needing a full MCP host client.

```bash
fastmcp dev apps server.py
fastmcp dev apps server.py:mcp --mcp-port 9000 --dev-port 9090
```

The picker auto-generates a form from each tool's input schema. Submit the form and the result opens in a new tab as a rendered Prefab UI.

Auto-reload is on by default — save a file and the MCP server restarts automatically.

<Tip>
`fastmcp dev apps` requires `fastmcp[apps]` — install with `pip install "fastmcp[apps]"`.
</Tip>

| Option | Flag | Description |
| ------ | ---- | ----------- |
| MCP Port | `--mcp-port` | Port for the MCP server (default: `8000`) |
| Dev Port | `--dev-port` | Port for the dev UI (default: `8080`) |
| Host | `--host` | Bind address for both servers (default: `127.0.0.1`) |
| Auto-Reload | `--reload` / `--no-reload` | Watch for file changes (default: on) |
| Log Panel | `--log-panel` / `--no-log-panel` | Show a panel that logs MCP traffic in the dev UI (default: on) |

## Development with the Inspector

`fastmcp dev inspector` launches your server inside the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), a browser-based tool for interactively testing MCP servers. Auto-reload is on by default, so your server restarts when you save changes.

```bash
fastmcp dev inspector server.py
fastmcp dev inspector server.py:create_server
fastmcp dev inspector server.py --with-editable . --with pandas
```

<Warning>
When you pass a Python file, `fastmcp dev inspector` imports it without executing the `if __name__ == "__main__"` block. Setup in that block won't run, so tools registered there won't appear in the Inspector. Use a [factory function](#entrypoints) to run initialization before the server starts.
</Warning>

<Tip>
The Inspector starts your server with `fastmcp run` in a subprocess. When you specify dependencies with `--with`, `--with-editable`, `--with-requirements`, `--python`, `--project`, or a `fastmcp.json` environment, that subprocess runs through `uv run`; otherwise it uses your current environment.
</Tip>

<Warning>
The Inspector connects over **stdio only**. When it launches, you may need to select "STDIO" from the transport dropdown and click connect. To test a server over HTTP, start it separately with `fastmcp run server.py --transport http` and point the Inspector at the URL.
</Warning>

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Editable Package | `--with-editable` | Install a directory in editable mode |
| Extra Packages | `--with` | Additional packages (repeatable) |
| Inspector Version | `--inspector-version` | MCP Inspector version to use |
| UI Port | `--ui-port` | Port for the Inspector UI |
| Server Port | `--server-port` | Port for the Inspector proxy |
| Auto-Reload | `--reload` / `--no-reload` | File watching (default: on) |
| Reload Dirs | `--reload-dir` | Directories to watch (repeatable) |
| Python | `--python` | Python version |
| Project | `--project` | Run within a uv project directory |
| Requirements | `--with-requirements` | Install from a requirements file |
| Module Mode | `--module`, `-m` | Run a Python module via `python -m` instead of a file path |

## Pre-Building Environments

`fastmcp project prepare` creates a persistent uv project from a `fastmcp.json` file, pre-installing all dependencies. This separates environment setup from server execution — install once, run many times.

```bash
# Step 1: Build the environment (slow, does dependency resolution)
fastmcp project prepare fastmcp.json --output-dir ./env

# Step 2: Run using the prepared environment (fast, no install step)
fastmcp run fastmcp.json --project ./env
```

The prepared directory contains a `pyproject.toml`, a `.venv` with all packages installed, and a `uv.lock` for reproducibility. This is particularly useful in deployment scenarios where you want deterministic, pre-built environments.

---

### Clients Client Groups (`docs/clients/client-groups.mdx`)

---
title: Client Groups
sidebarTitle: Client Groups
description: "Use ClientGroup to coordinate several FastMCP clients, each on its own connection, and route namespaced tool calls back to the server that owns them."
icon: layer-group
tag: NEW
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="4.0.0" />

A `ClientGroup` coordinates several independent FastMCP clients without combining them behind a proxy server. Each client keeps its own connection, negotiated protocol version, capabilities, and handlers. The group adds namespaced tool discovery and routes each call back to the client that advertised the tool.

This differs from passing a multi-server configuration directly to `Client`. `Client(config)` presents one aggregate MCP endpoint and therefore selects one protocol era shared by its proxy chain. A `ClientGroup` retains one MCP connection per configured server, so legacy and modern servers can operate in their native eras at the same time.

## Create a group from clients

Construct the clients explicitly when each server needs its own handlers, authentication, or connection settings:

```python
from pathlib import Path
import asyncio

from fastmcp import Client, ClientGroup

legacy_client = Client(Path("legacy_server.py"), mode="legacy")
modern_client = Client("https://modern.example.com/mcp", mode="auto")

group = ClientGroup(
    {
        "legacy": legacy_client,
        "modern": modern_client,
    }
)


async def main() -> None:
    async with group:
        tools = await group.list_tools()
        print([tool.name for tool in tools])

        result = await group.call_tool(
            "modern_get_weather",
            {"city": "Chicago"},
        )
        print(result)


asyncio.run(main())
```

Tool names are prefixed with the configured client name. For example, a `get_weather` tool exposed by the `modern` client becomes `modern_get_weather`.

A group with a single client is a supported way to get namespacing alone: the one server's tools are presented under its configured name, with no other behavior change.

The first routed call loads the tool catalog lazily. After a successful load, unknown tool names fail locally rather than repeating discovery against every server. Call `list_tools()` explicitly to refresh the routes when servers add or remove tools dynamically — the explicit call refreshes past any client-side response cache, so the catalog reflects what every server advertises now.

## Bind tools to their owning client

Tool adapters — code that turns MCP tools into callables for an agent framework — often need more than routed calls: session-driven input loops, handler context, and interceptors must run on the connection that owns the tool. `resolve_tool()` returns that route, so an adapter can discover through the group and still bind each generated tool to its real client:

```python
async with group:
    for tool in await group.list_tools():
        route = await group.resolve_tool(tool.name)
        # route.client is the connected FastMCP client for this tool;
        # route.upstream_name is the name the server itself advertises
        register_agent_tool(tool, client=route.client, name=route.upstream_name)
```

The group aggregates names and detects collisions; it never stands between the adapter and the client, so everything a single `Client` supports keeps working per tool.

Discovered routes outlive the group's context. After the last exit, `resolve_tool()` and `call_tool()` for a known tool need only that tool's own client to be connected, so an adapter that bound its tools inside the group can keep calling them under the owning client's context. The next unknown name after the last exit reloads the catalog, which requires every client. Call `list_tools()` to drop routes for tools a server has since removed.

## List skills across servers

<VersionBadge version="4.2.0" />

`list_skills()` collects [Skills extension](/servers/skills) entries from every client that opted into it, keyed by server name, since two servers can publish the same skill URI. Clients created without `SkillsClientExtension()`, including those from `from_config`, and servers that don't advertise the extension are left out.

```python
from fastmcp import Client, ClientGroup
from fastmcp.skills import SkillsClientExtension

docs = Client("https://docs.example.com/mcp", extensions=[SkillsClientExtension()])
ops = Client("https://ops.example.com/mcp", extensions=[SkillsClientExtension()])
group = ClientGroup({"docs": docs, "ops": ops})

async with group:
    for server_name, entries in (await group.list_skills()).items():
        for entry in entries:
            print(server_name, entry.uri)
    deploy = await group.get_skill("ops", "skill://deploy/SKILL.md")
```

## Create a group from configuration

`ClientGroup.from_config` creates one client per server rather than passing the entire configuration through a proxy. Each entry’s `timeout` applies to that client in milliseconds; `0` disables the request timeout. A FastMCP-specific `mode` field can select the protocol behavior for each server:

```python
from fastmcp import ClientGroup

config = {
    "mcpServers": {
        "legacy": {
            "command": "python",
            "args": ["legacy_server.py"],
            "mode": "legacy",
        },
        "modern": {
            "url": "https://modern.example.com/mcp",
            "mode": "auto",
        },
    }
}

group = ClientGroup.from_config(config)
```

Entries without a `mode` use the `default_mode` argument to `from_config`, which is `"auto"`.

## Manage connections explicitly

Using the group as a context manager is optional. Applications can own each client connection and use the group only for discovery and routing:

```python
async with legacy_client, modern_client:
    tools = await group.list_tools()
```

It is also safe to enter the group inside a client context. FastMCP client contexts are reference counted, so leaving the group does not close a connection still owned by an outer context.

The group's own context is reentrant in the same way (FastMCP 4.0.1 and later). Entering a group that is already connected, whether from a nested block or a concurrent task, reuses the existing connections. The first entry connects every client and the last exit disconnects them, so code that already relies on `Client` being safe to enter more than once can hold a `ClientGroup` the same way:

```python
async with group:
    async with group:  # reuses the connections opened above
        await group.call_tool("modern_get_weather", {"city": "Chicago"})
    assert modern_client.is_connected()
```

The group adds no session handling of its own. Each client owns its transport and session exactly as it does standalone, so a legacy stateful session (for example over SSE or stdio) is held open by its client for as long as that client's context is active, whether the group or the caller entered it.

## Related: SDK session groups

The MCP Python SDK has its own aggregation primitive, [`ClientSessionGroup`](https://py.sdk.modelcontextprotocol.io/client/session-groups/), which pools raw `ClientSession` connections. `ClientGroup` exists because FastMCP clients carry more than a session: authentication, handlers, caching, result parsing, and protocol negotiation all live on the `Client`, and routing calls through the client that advertised each tool keeps every one of those intact. Reach for the SDK's group when working with raw sessions directly; reach for `ClientGroup` when the servers are already configured as FastMCP clients.

---

### Clients Client Only Package (`docs/clients/client-only-package.mdx`)

---
title: Client-Only Package
description: Use FastMCP's client without installing the full server framework.
icon: box
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="3.3.0" />

FastMCP's full `fastmcp` package includes everything needed to build and run MCP servers, apps, proxies, and clients. If you are only embedding an MCP client in another framework, building your own LLM host, or testing MCP servers, you can install the smaller client-only package instead.

```bash
pip install "fastmcp-slim[client]"
```

The client-only package uses the `fastmcp` import namespace:

```python
from fastmcp import Client

client = Client("https://example.com/mcp")
```

Use `fastmcp-slim[client]` when your code connects to MCP servers but does not define or run FastMCP servers itself. For example, framework authors can depend on `fastmcp-slim[client]` to provide MCP connectivity without requiring users to install the full FastMCP server stack.

## Supported Usage

Client-only installs support remote and subprocess transports:

```python
from pathlib import Path
from fastmcp import Client

# Remote MCP server
http_client = Client("https://example.com/mcp")

# Local MCP server over stdio
stdio_client = Client(Path("my_server.py"))
```

Single-server MCP configuration works as well:

```python
from fastmcp import Client

config = {
    "mcpServers": {
        "weather": {
            "url": "https://weather.example.com/mcp"
        }
    }
}

client = Client(config)
```

Optional sampling handlers are available through the same extras as the full package:

```bash
pip install "fastmcp-slim[client,openai]"
pip install "fastmcp-slim[client,anthropic]"
pip install "fastmcp-slim[client,gemini]"
```

## When to Use the Full Package

Install `fastmcp` when you need server-side FastMCP features:

```bash
pip install fastmcp
```

The full package remains the default for most users and continues to support the existing import style:

```python
from fastmcp import Client, FastMCP

server = FastMCP("Example")
client = Client(server)
```

Use the full package for:

- defining or running FastMCP servers
- in-memory clients connected directly to `FastMCP` server objects
- multi-server MCP configurations, and configurations that use tool transformations or tag filters
- FastMCP apps, proxies, server auth, middleware, and other server-side features

The `fastmcp-slim` package is intentionally narrower: it is for client-only consumers who want FastMCP's MCP client behavior without depending on the full framework.

---

### Clients Client (`docs/clients/client.mdx`)

---
title: The FastMCP Client
sidebarTitle: Overview
description: Programmatic client for interacting with MCP servers through a well-typed, Pythonic interface.
icon: user-robot
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.0.0" />

The `fastmcp.Client` class provides a programmatic interface for interacting with any MCP server. It handles protocol details and connection management automatically, letting you focus on the operations you want to perform.

Use it to add MCP tools to a Python script, web application, or AI agent. Your application chooses which operations to call; the client discovers and executes them on the server.

## Creating a Client

You provide a server source and the client automatically infers the appropriate transport mechanism. This example calls an inventory tool from ordinary Python code and uses its result in the application:

```python
import asyncio

from fastmcp import Client, FastMCP

server = FastMCP("Inventory")


@server.tool
def stock_count(sku: str) -> int:
    """Return the available stock for a product."""
    return {"WIDGET": 12}.get(sku, 0)


async def main():
    async with Client(server) as client:
        result = await client.call_tool("stock_count", {"sku": "WIDGET"})
        print(f"Available stock: {result.data}")  # Available stock: 12


asyncio.run(main())
```

All client operations require using the `async with` context manager for proper connection lifecycle management.

## Use Cases

### Applications and Scripts

Call a known tool with `call_tool()` when your application already knows what work to do, such as checking inventory before preparing an order. Use `result.data` for Python values, or `result.content` when you need the MCP content blocks, including text, images, and other media. The same client API works with an in-memory server, a local subprocess, or a remote HTTP server; choose the connection in [Transports](/clients/transports).

### AI Agents and Chat Applications

Use `list_tools()` to discover each tool's name, description, and `input_schema`, then adapt those definitions to your model SDK's tool format. When the model requests a tool call, pass its name and parsed arguments to `call_tool()` and return the result to the model in the SDK's expected format. Your application owns the conversation loop and decides which tools it permits the model to call.

See [Calling Tools](/clients/tools) for discovery, result formats, and error handling. [Client Groups](/clients/client-groups) let an agent use tools from several independently configured servers through one catalog.

### Testing Servers

Pass your server instance to `Client(server)` in a test to exercise tool discovery and execution without starting a network listener. Assert the returned values just as your application would. The [server testing guide](/servers/testing) shows how to share a client through pytest fixtures.

### Discovering and Downloading Skills

An agent can also use the client to retrieve a server's skills. With `SkillsClientExtension` (see [Skills extension](#skills-extension)), `list_skills()` discovers them; for servers that publish skills only as resources, use `list_skill_resources()`. `read_skill()` fetches and verifies every file of one, and `skill.to_directory()` [installs it into a local agent](/servers/skills#install-skills-into-a-local-agent).

## Choosing a Transport

The client automatically selects a transport based on what you pass to it, but different transports have different characteristics that matter for your use case.

**In-memory transport** connects directly to a FastMCP server instance within the same Python process. Use this for testing and development where you want to eliminate subprocess and network complexity. The server shares your process's environment and memory space.

```python
from fastmcp import Client, FastMCP

server = FastMCP("TestServer")
client = Client(server)  # In-memory, no network or subprocess
```

**STDIO transport** launches a server as a subprocess and communicates through stdin/stdout pipes. This is the standard mechanism used by desktop clients like Claude Desktop. By default, the subprocess receives the MCP SDK's default environment; pass an explicit transport when you need to add environment variables, set a working directory, or control process reuse.

```python
from pathlib import Path
from fastmcp import Client
from fastmcp.client.transports import PythonStdioTransport

# Simple inference from file path
client = Client(Path("my_server.py"))

# With explicit environment configuration
transport = PythonStdioTransport(
    "my_server.py",
    env={"API_KEY": "secret"},
)
client = Client(transport)
```

**HTTP transport** connects to servers running as web services. Use this for production deployments where the server runs independently and manages its own lifecycle.

```python
from fastmcp import Client

client = Client("https://api.example.com/mcp")
```

See [Transports](/clients/transports) for detailed configuration options including authentication headers, session persistence, and multi-server configurations.

## Configuration-Based Clients

<VersionBadge version="2.4.0" />

Create clients from MCP configuration dictionaries, which can include multiple servers. While there is no official standard for MCP configuration format, FastMCP follows established conventions used by tools like Claude Desktop.

```python
from fastmcp import Client

config = {
    "mcpServers": {
        "weather": {
            "url": "https://weather-api.example.com/mcp"
        },
        "assistant": {
            "command": "python",
            "args": ["./assistant_server.py"]
        }
    }
}

client = Client(config)

async with client:
    # Tools are prefixed with server names
    weather_data = await client.call_tool("weather_get_forecast", {"city": "London"})
    response = await client.call_tool("assistant_answer_question", {"question": "What's the capital of France?"})

    # Resources use prefixed URIs
    icons = await client.read_resource("weather://weather/icons/sunny")
```

<Note>
A multi-server configuration presents one aggregate MCP endpoint. Each entry still configures its own transport, headers, and auth, but every backend shares the outer client's negotiated protocol era, handlers, and client-level policy. To hold several fully independent connections — each with its own protocol `mode` and handlers — see [Client Groups](/clients/client-groups).
</Note>

## Connection Lifecycle

The client uses context managers for connection management. When you enter the context, the client establishes a connection and negotiates the protocol era with the server. Metadata returned by either legacy initialization or modern discovery is exposed through the same client properties.

```python
from fastmcp import Client, FastMCP

mcp = FastMCP(name="MyServer", instructions="Use the greet tool to say hello!")

@mcp.tool
def greet(name: str) -> str:
    """Greet a user by name."""
    return f"Hello, {name}!"

async with Client(mcp) as client:
    # Protocol negotiation already happened automatically
    assert client.server_info is not None
    assert client.server_capabilities is not None
    print(f"Server: {client.server_info.name}")
    print(f"Instructions: {client.instructions}")
    print(f"Capabilities: {client.server_capabilities.tools}")
```

For advanced scenarios where you need precise control over when initialization happens, disable automatic initialization and call `initialize()` manually. `initialize()` is a handshake-era operation, so pin the connection with `mode="legacy"`: the modern protocol has no `initialize` round trip, and calling it on a modern connection raises.

```python
from pathlib import Path
from fastmcp import Client

client = Client(Path("my_mcp_server.py"), auto_initialize=False, mode="legacy")

async with client:
    # Connection established, but not initialized yet
    print(f"Connected: {client.is_connected()}")
    print(f"Initialized: {client.initialize_result is not None}")  # False

    # Initialize manually with custom timeout
    result = await client.initialize(timeout=10.0)
    print(f"Server: {result.server_info.name}")

    # Now ready for operations
    tools = await client.list_tools()
```

Every connection also tells the server who is calling. By default a FastMCP client identifies itself as `fastmcp` at the installed FastMCP version. Servers see this in their logs and middleware, so an application that wants to be recognized on its own should pass `client_info`:

```python
from mcp.types import Implementation
from fastmcp import Client

client_info = Implementation(name="my-agent", version="1.0.0")
client = Client("https://example.com/mcp", client_info=client_info)
```

## Protocol negotiation

<VersionBadge version="4.0.0" />

MCP has two protocol eras: the original *legacy* era, which begins every connection with an `initialize` handshake, and the *modern* era (protocol version `2026-07-28` and later), which a client discovers by probing the server's `server/discover` endpoint. The `mode` parameter controls which era the client negotiates when it connects.

By default, `mode="auto"`. The client probes `server/discover` and adopts the modern protocol when the server responds; for any server that is not positive evidence of modern support, it falls back to the legacy handshake. This makes the default safe against a mixed fleet of legacy and modern servers.

```python
from fastmcp import Client

# Negotiate the newest era the server supports (the default)
client = Client("https://example.com/mcp", mode="auto")
```

Set `mode="legacy"` to force the initialize handshake. This behaves identically to earlier FastMCP versions and is the opt-out if a server misbehaves under discovery or you need the legacy `initialize` result object.

```python
from fastmcp import Client

client = Client("https://example.com/mcp", mode="legacy")
```

Legacy mode is also what carries the *pushed* form of a server's requests. The handshake opens a persistent back-channel down which a server can send a sampling, roots, or elicitation request mid-call, and the modern era removed it. Your handlers are unaffected by that: a [sampling](/clients/sampling), [roots](/clients/roots), or [elicitation](/clients/elicitation) handler you register answers a modern server's [input-required rounds](/clients/elicitation#input-required-rounds) from the same registration. Pin `mode="legacy"` when you connect to a server that pushes, or when your code calls `client.ping()` or `transport.get_session_id()`, which need the session the modern era does not open.

Conversely, [background tasks](/clients/tasks) are **modern-only**: the tasks capability is negotiated over `2026-07-28` connections, so `mode="legacy"` never triggers one and a task-enabled tool just runs synchronously.

A FastMCP server serves both eras, so a default client negotiates the modern one and the session-dependent calls raise an era-specific error there. Pinning the handshake restores them.

You can also pin a specific modern protocol version to adopt it directly, without a discovery probe:

```python
from fastmcp import Client

client = Client("https://example.com/mcp", mode="2026-07-28")
```

Once connected, the negotiated version, server identity, capabilities, and instructions are available as properties. They are populated from either the legacy `InitializeResult` or modern `DiscoverResult`, and reset to `None` when the client disconnects. `instructions` is also `None` when the server does not provide any.

When you pin a modern version directly, the client skips discovery and adopts that version with minimal synthesized metadata. In that mode, `server_info` has an empty name and `instructions` is `None`.

```python
async with Client("https://example.com/mcp", mode="auto") as client:
    print(client.protocol_version)      # e.g. "2026-07-28"
    print(client.server_info)           # Implementation | None
    print(client.server_capabilities)   # ServerCapabilities | None
    print(client.instructions)          # str | None
```

<Note>
`mode="auto"` is the default as of FastMCP 4.0. Earlier versions defaulted to `"legacy"`. If a server behaves unexpectedly under discovery, or you depend on the legacy `initialize` result, pin the old behavior with `Client(..., mode="legacy")`.

The SSE transport is legacy-only — it cannot carry the sessionless modern era — so a client connecting over SSE always negotiates the legacy handshake, even under `mode="auto"`. A multi-server config (`MCPConfigTransport` with more than one server) negotiates the best era shared by every connected backend: it stays modern when every backend is modern-capable and reconnects every leg under the handshake era when any backend requires legacy. Pinning `mode="legacy"` or a modern version applies that mode to every backend. All-modern configurations follow normal modern semantics; applications that rely on handshake-era server-initiated sampling or elicitation should pin `mode="legacy"`. To keep each server on its own natively negotiated era instead, use one client per server — [Client Groups](/clients/client-groups) coordinate several independent clients under one tool catalog.
</Note>

## Response caching

<VersionBadge version="4.0.0" />

The client can cache the results of `list_tools`, `list_resources`, and `list_prompts` so that repeated calls avoid a network round-trip. Caching is opt-in and honors the server's own cache hints, so it only takes effect against modern-era servers that advertise them — a cache is inert on a legacy connection.

Enable the default in-memory cache by passing `cache=True`. It respects the `ttlMs` and `cacheScope` hints the server attaches to each response.

```python
from fastmcp import Client

client = Client("https://example.com/mcp", mode="auto", cache=True)

async with client:
    tools = await client.list_tools()   # fetched from the server
    tools = await client.list_tools()   # served from the cache
```

The default (`cache=None`) and `cache=False` both disable caching. For control over the store, TTL, or partitioning, pass a `CacheConfig`. A config with a custom `store` also requires a `target_id`, since FastMCP transports expose no server URL to derive a shared-store identity from.

```python
from fastmcp import Client
from mcp.client.caching import CacheConfig

config = CacheConfig(target_id="weather-api", default_ttl_ms=60_000)
client = Client("https://example.com/mcp", mode="auto", cache=config)
```

The listing methods use the cache by default when one is configured. To override the behavior for a single call, pass `cache_mode`: `"use"` (the default) serves and stores, `"refresh"` stores a fresh result without serving a cached one, and `"bypass"` skips the cache entirely. `list_tools` accepts it directly; the lower-level `list_tools_mcp`, `list_resources_mcp`, `list_resource_templates_mcp`, and `list_prompts_mcp` variants accept it as well.

```python
async with client:
    fresh = await client.list_tools(cache_mode="refresh")
```

### Sharing a cache across clients

The default cache lives in each client's process. To share cached responses across a fleet — a set of proxy replicas backed by one Redis, for example — pass a `KeyValueResponseCacheStore`, FastMCP's adapter over the same `AsyncKeyValue` key-value abstraction the event store and OAuth proxy use. It accepts any compatible backend (memory, Redis, and more).

A shared store mingles responses from different principals, so it requires an explicit `partition` that isolates them. Derive the partition from a verified credential — never from request data or the server URL — and construct a new client when the principal changes. By default no response is served across partitions; set `share_public=True` on the `CacheConfig` to serve responses the server marks `"public"` to every partition.

```python
from fastmcp import Client
from fastmcp.client.caching import KeyValueResponseCacheStore
from mcp.client.caching import CacheConfig
from key_value.aio.stores.redis import RedisStore

backend = RedisStore(url="redis://localhost")
store = KeyValueResponseCacheStore(storage=backend)

config = CacheConfig(store=store, partition="tenant-a", target_id="weather-api")
client = Client("https://example.com/mcp", mode="auto", cache=config)
```

The adapter serializes each result through a type-tagged envelope validated against an allowlist of cacheable result models, so a value naming an unknown type is treated as a cache miss rather than deserialized blindly. Each store reads and writes one collection, set with `collection=`, and `clear()` removes only that collection's entries. Stores created without `collection=` share the default collection, so give each tenant its own collection when one tenant's `clear()` must not drop another's entries.

## Client extensions

<VersionBadge version="4.0.0" />

Client extensions (SEP-2133) are the advanced mechanism a client uses to opt into vendor capabilities that live outside the core protocol. An extension is a `ClientExtension` instance that bundles three things: a capability *advertisement* the server can read, one or more *result claims* that let the client parse extra `tools/call` result shapes, and *notification bindings* that observe server notifications the core protocol doesn't define. Pass a sequence of them to `extensions=`.

```python
from fastmcp import Client
from myproject.extensions import AppsExtension

client = Client("https://example.com/mcp", extensions=[AppsExtension()])
```

Each extension's contributions are threaded into the underlying session. When `fastmcp_tasks` is imported, FastMCP folds in its internal extension for [background tasks](/clients/tasks) automatically, and your own extensions *compose* with it rather than replacing it — pass your own tasks extension with the same identifier if you need to override it. When a tool returns a shape an extension claims, `client.call_tool()` resolves it transparently through the owning claim's resolver and hands you back an ordinary result. Result claims and their advertisements are honored only on modern-era connections, so they are inert on a legacy handshake.

For the rare case where you need to register additional result claims against an extension that is already advertised, pass them through `result_claims=`, keyed by the extension's identifier. Prefer declaring claims on the extension itself; this parameter merges extra claims with an extension's own.

```python
client = Client(
    "https://example.com/mcp",
    extensions=[AppsExtension()],
    result_claims={"example.com/apps": [extra_claim]},
)
```

### Skills extension

To discover skills from a server that implements the MCP Skills extension
(SEP-2640), opt in with `SkillsClientExtension`. The client then exposes
`list_skills_mcp()` for one protocol page, `list_skills()` for automatic
pagination, and `get_skill_mcp()` or `get_skill()` for authoritative lookup by
the URI of a skill's `SKILL.md`.

```python
from fastmcp import Client
from fastmcp.skills import SkillsClientExtension

client = Client(
    "https://example.com/mcp",
    extensions=[SkillsClientExtension()],
)

async with client:
    skills = await client.list_skills()
    skill = await client.get_skill("skill://code-review/SKILL.md")
```

The Skills extension is available only on modern MCP connections. These methods
raise before sending a request when the client did not opt in or the negotiated
server did not advertise `io.modelcontextprotocol/skills`.

Both protocol results carry the server's response-cache hints. A client created
with `cache=True` honors those hints; pass `cache_mode="refresh"` or
`cache_mode="bypass"` to a Skills method to override the cache for one call.

## Operations

FastMCP clients interact with three types of server components.

**Tools** are server-side functions that the client can execute with arguments. Call them with `call_tool()` and receive structured results.

```python
async with client:
    tools = await client.list_tools()
    result = await client.call_tool("multiply", {"a": 5, "b": 3})
    print(result.data)  # 15
```

See [Tools](/clients/tools) for detailed documentation including version selection, error handling, and structured output.

**Resources** are data sources that the client can read, either static or templated. Access them with `read_resource()` using URIs.

```python
async with client:
    resources = await client.list_resources()
    content = await client.read_resource("file:///config/settings.json")
    print(content[0].text)
```

See [Resources](/clients/resources) for detailed documentation including templates and binary content.

**Prompts** are reusable message templates that can accept arguments. Retrieve rendered prompts with `get_prompt()`.

```python
async with client:
    prompts = await client.list_prompts()
    messages = await client.get_prompt("analyze_data", {"data": [1, 2, 3]})
    print(messages.messages)
```

See [Prompts](/clients/prompts) for detailed documentation including argument serialization.

## Callback Handlers

The client supports callback handlers for advanced server interactions. These let you respond to server-initiated requests and receive notifications.

Sampling, elicitation, and roots are the requests a server makes of the client. A server reaches your handler by whichever route its [era](#protocol-negotiation) allows — pushed down the open session on the handshake, returned as an input-required result on the modern protocol — and both routes dispatch to the same handler, so one registration covers both. Logging and progress arrive as notifications on the response stream and work in either era.

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.logging import LogMessage

async def log_handler(message: LogMessage):
    print(f"Server log: {message.data}")

async def progress_handler(progress: float, total: float | None, message: str | None):
    print(f"Progress: {progress}/{total} - {message}")

async def sampling_handler(messages, params, context):
    # Integrate with your LLM service here
    return "Generated response"

client = Client(
    Path("my_mcp_server.py"),
    log_handler=log_handler,
    progress_handler=progress_handler,
    sampling_handler=sampling_handler,
    timeout=30.0
)
```

Each handler type has its own documentation:

- **[Sampling](/clients/sampling)** - Respond to server LLM requests
- **[Elicitation](/clients/elicitation)** - Handle server requests for user input
- **[Progress](/clients/progress)** - Monitor long-running operations
- **[Logging](/clients/logging)** - Handle server log messages
- **[Roots](/clients/roots)** - Provide local context to servers

<Tip>
The FastMCP Client is designed as a foundational tool. Use it directly for deterministic operations, or build higher-level agentic systems on top of its reliable, type-safe interface.
</Tip>

---

### Clients Elicitation (`docs/clients/elicitation.mdx`)

---
title: User Elicitation
sidebarTitle: Elicitation
description: Handle server requests for structured user input.
icon: message-question
---

import { VersionBadge } from "/snippets/version-badge.mdx";

<VersionBadge version="2.10.0" />

Use this when you need to respond to server requests for user input during tool execution.

Elicitation allows MCP servers to request structured input from users during operations. Instead of requiring all inputs upfront, servers can interactively ask for missing parameters, request clarification, or gather additional context.

<Note>
**These sections show the server-initiated flow, which the handshake-era protocol uses.** On `2026-07-28` the server asks by returning a request instead — see [input-required rounds](#input-required-rounds). One `elicitation_handler` serves both, so the examples below pin `mode="legacy"` only to exercise the pushed form.
</Note>

## Handler Template

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.elicitation import ElicitResult, ElicitRequestParams, RequestContext

async def elicitation_handler(
    message: str,
    response_type: type | None,
    params: ElicitRequestParams,
    context: RequestContext
) -> ElicitResult | object:
    """
    Handle server requests for user input.

    Args:
        message: The prompt to display to the user
        response_type: Python dataclass type for form responses (None for URL requests or empty schemas)
        params: Original MCP elicitation parameters
        context: Request context with metadata

    Returns:
        - Data directly (implicitly accepts the elicitation)
        - ElicitResult for explicit control over the action
    """
    # Present the message and collect input
    user_input = input(f"{message}: ")

    if not user_input:
        return ElicitResult(action="decline")

    # URL requests and empty-object schemas have no response type to construct,
    # so accepting is the whole response.
    if response_type is None:
        return ElicitResult(action="accept")

    # A scalar request, such as ctx.elicit(..., response_type=str), has one `value` field
    return response_type(value=user_input)

client = Client(
    Path("my_mcp_server.py"),
    mode="legacy",
    elicitation_handler=elicitation_handler,
)
```

## How It Works

When a server needs user input, it sends an elicitation request with a message prompt. Form elicitation requests include a JSON schema describing the expected response structure, and FastMCP automatically converts that schema into a Python dataclass type. A server that asks for a single scalar, such as a string or number, gets a dataclass with one `value` field, which is what the examples on this page construct. URL elicitation requests and empty-object schemas use `response_type=None`.

The handler receives four parameters:

<Card icon="code" title="Handler Parameters">
<ResponseField name="message" type="str">
  The prompt message to display to the user
</ResponseField>

<ResponseField name="response_type" type="type | None">
  A Python dataclass type that FastMCP created from a form request's JSON schema. Use this to construct your response with proper typing. For URL requests or empty-object schemas, this will be `None`.
</ResponseField>

<ResponseField name="params" type="ElicitRequestParams">
  The original MCP elicitation parameters. Form requests carry the raw JSON schema on `params.requested_schema`; URL requests carry `params.url` instead and have no schema.
</ResponseField>

<ResponseField name="context" type="RequestContext">
  Request context containing metadata about the elicitation request
</ResponseField>
</Card>

## Response Actions

You can return data directly, either an instance of `response_type` or a plain `dict`, which implicitly accepts the elicitation:

```python
async def elicitation_handler(message, response_type, params, context):
    user_input = input(f"{message}: ")
    return response_type(value=user_input)  # Implicit accept
```

Or return an `ElicitResult` for explicit control over the action:

```python
from fastmcp.client.elicitation import ElicitResult

async def elicitation_handler(message, response_type, params, context):
    user_input = input(f"{message}: ")

    if not user_input:
        return ElicitResult(action="decline")  # User declined

    if user_input == "cancel":
        return ElicitResult(action="cancel")   # Cancel entire operation

    return ElicitResult(
        action="accept",
        content=response_type(value=user_input)
    )
```

**Action types:**
- **`accept`**: User provided valid input. Include the data in the `content` field.
- **`decline`**: User chose not to provide the requested information. Omit `content`.
- **`cancel`**: User cancelled the entire operation. Omit `content`.

## Example

A file management tool might ask which directory to create:

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.elicitation import ElicitResult

async def elicitation_handler(message, response_type, params, context):
    print(f"Server asks: {message}")

    user_response = input("Your response: ")

    if not user_response:
        return ElicitResult(action="decline")

    # Use the response_type dataclass to create a properly structured response
    return response_type(value=user_response)

client = Client(
    Path("my_mcp_server.py"),
    mode="legacy",
    elicitation_handler=elicitation_handler
)
```

## Input-required rounds

<VersionBadge version="4.0.0" />

On protocol version `2026-07-28` and later, a server can ask for input before it returns a final result. Nothing is held open: the tool *returns* a description of what it needs, which completes that round as an ordinary response, and the client answers by issuing a **new** `call_tool`, `get_prompt`, or `read_resource` request carrying the answer. `fastmcp.Client` drives that loop for you — it fulfils each round's requests using the callbacks you already configured (your `elicitation_handler`, `sampling_handler`, and roots) and repeats until the call reaches a terminal result. No extra wiring is needed beyond the handlers described above.

The `input_required_max_rounds` parameter caps how many rounds the client will answer before giving up, guarding against a server that never terminates. It defaults to `10`.

```python
from fastmcp import Client

client = Client(
    "https://example.com/mcp",
    mode="auto",
    elicitation_handler=elicitation_handler,
    input_required_max_rounds=5,
)
```

---

### Clients Fastmcp Remote (`docs/clients/fastmcp-remote.mdx`)

---
title: fastmcp-remote
description: Bridge remote MCP servers into stdio-only MCP hosts with uvx fastmcp-remote.
icon: bridge
---

`fastmcp-remote` is FastMCP's standalone stdio bridge for remote MCP servers. Use it when an MCP host expects to launch a local command, but the server you want to use is hosted over Streamable HTTP or SSE.

```json
{
  "mcpServers": {
    "linear": {
      "command": "uvx",
      "args": ["fastmcp-remote", "https://mcp.linear.app/mcp"]
    }
  }
}
```

The package is powered by FastMCP. It builds one FastMCP client for the remote URL, exposes that client as a local stdio proxy, and keeps the executable focused on that bridge. For running Python server files, local project environments, FastMCP config files, and development reload loops, use [`fastmcp run`](/cli/running).

The command shape follows the original [`mcp-remote`](https://github.com/geelen/mcp-remote) npm project, which established this stdio-to-remote bridge pattern for MCP hosts.

## Installation

Most MCP hosts can run `fastmcp-remote` directly through `uvx`, so you usually do not need to install it yourself:

```bash
uvx fastmcp-remote https://example.com/mcp
```

If your host requires an already-installed command, install the package with your Python package manager:

```bash
uv tool install fastmcp-remote
```

## Host Configuration

For hosts that use `mcpServers` JSON configuration, set the command to `uvx` and pass `fastmcp-remote` plus the remote server URL as arguments:

```json
{
  "mcpServers": {
    "remote-api": {
      "command": "uvx",
      "args": ["fastmcp-remote", "https://example.com/mcp"]
    }
  }
}
```

## Endpoint URLs and Connection Status

Pass the full MCP endpoint URL for the remote server. Many FastMCP HTTP servers expose MCP at `/mcp`, so a local development server may need `http://localhost:8000/mcp` rather than `http://localhost:8000`.

`fastmcp-remote` starts a local stdio bridge, then connects to the upstream server when the MCP host initializes that bridge. If the upstream server is unavailable, the URL does not point to an MCP endpoint, or authentication cannot complete, initialization fails and the host should report the remote server as failed. After initialization succeeds, later tool, resource, prompt, and ping requests continue to proxy through the same remote server configuration.

OAuth is enabled automatically unless you provide an `Authorization` header or pass `--auth none`. The first connection opens the browser-based OAuth flow when the server requires authentication, then stores tokens locally for future runs.

To pass a bearer token or another custom header directly, provide `--header` in `Name: Value` form. The header name ends at the first colon, so values can contain additional colons. Quote the header when the value contains spaces, just like any other shell argument. An `Authorization` header disables OAuth by default:

```json
{
  "mcpServers": {
    "private-api": {
      "command": "uvx",
      "args": [
        "fastmcp-remote",
        "https://example.com/mcp",
        "--header",
        "Authorization: Bearer <token>"
      ]
    }
  }
}
```

Repeat `--header` to send multiple headers:

```bash
uvx fastmcp-remote https://example.com/mcp \
  --header "Authorization: Bearer <token>" \
  --header "X-Workspace: production" \
  --header "X-Client-Name: My MCP Host" \
  --header "X-Callback-Url: https://example.com/oauth/callback"
```

Some MCP hosts on Windows have trouble preserving spaces inside command arguments. Put the spaced value in an environment variable and reference it from the header value:

```json
{
  "mcpServers": {
    "remote-api": {
      "command": "uvx",
      "args": [
        "fastmcp-remote",
        "https://example.com/mcp",
        "--header",
        "Authorization:${AUTH_HEADER}"
      ],
      "env": {
        "AUTH_HEADER": "Bearer <token>"
      }
    }
  }
}
```

For local development servers over plain HTTP, disable OAuth when the server is unauthenticated:

```bash
uvx fastmcp-remote http://localhost:8000/mcp --auth none
```

## Self-Signed Certificates

For servers behind a self-signed certificate, point `--verify` at a CA bundle that trusts the certificate:

```bash
uvx fastmcp-remote https://internal.example.com/mcp --verify /path/to/ca-bundle.pem
```

To disable certificate verification entirely, pass `--verify false`. This is insecure and should only be used for trusted servers on private networks:

```bash
uvx fastmcp-remote https://internal.example.com/mcp --verify false
```

To trust a CA bundle without a flag, set the standard `SSL_CERT_FILE` environment variable, which OpenSSL reads automatically:

```bash
SSL_CERT_FILE=/path/to/ca-bundle.pem uvx fastmcp-remote https://internal.example.com/mcp
```

## OAuth Storage

OAuth tokens are stored under `~/.fastmcp/remote` by default. Set `FASTMCP_REMOTE_CONFIG_DIR` to use another directory:

```bash
FASTMCP_REMOTE_CONFIG_DIR=~/.config/fastmcp-remote uvx fastmcp-remote https://example.com/mcp
```

Use `--resource` to isolate tokens for a particular remote server identity:

```bash
uvx fastmcp-remote https://example.com/mcp --resource example-prod
```

If the remote authorization server requires a fixed callback port or hostname, pass them after the URL:

```bash
uvx fastmcp-remote https://example.com/mcp 3334 --host 127.0.0.1
```

## Options

| Option | Description |
| ------ | ----------- |
| `--transport` | Choose `http` or `sse`. Defaults to `http`. |
| `--header` | Add a header to upstream requests, for example `--header "Authorization: Bearer <token>"`. Values may contain colons. Quote headers whose values contain spaces. Use `${VAR}` to expand environment variables inside values. Repeat for multiple headers. |
| `--auth` | Choose `oauth` or `none`. The default uses OAuth unless an `Authorization` header is provided. |
| `--verify` | Control TLS certificate verification. Pass a path to a CA bundle to trust a self-signed certificate, or `false` to disable verification (insecure). Defaults to verification enabled. |
| `--resource` | Isolate OAuth token storage for a named remote resource. |
| `--host` | Set the OAuth callback hostname. Defaults to `localhost`. |
| `--auth-timeout` | Set how long to wait for the OAuth callback. Defaults to 300 seconds. |
| `--ignore-tool` | Hide tools whose names match a glob pattern. Repeat for multiple patterns. |
| `--debug` | Enable debug logging. |
| `--silent` | Suppress non-critical logs. |

---

### Clients Logging (`docs/clients/logging.mdx`)

---
title: Server Logging
sidebarTitle: Logging
description: Receive and handle log messages from MCP servers.
icon: receipt
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.0.0" />

Use this when you need to capture or process log messages sent by the server.

MCP servers can emit log messages to clients. The client handles these through a log handler callback.

## Log Handler

Provide a `log_handler` function when creating the client:

```python
import logging
from pathlib import Path

from fastmcp import Client
from fastmcp.client.logging import LogMessage

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)

logger = logging.getLogger(__name__)
LOGGING_LEVEL_MAP = {
    "DEBUG": logging.DEBUG,
    "INFO": logging.INFO,
    "NOTICE": logging.INFO,
    "WARNING": logging.WARNING,
    "ERROR": logging.ERROR,
    "CRITICAL": logging.CRITICAL,
    "ALERT": logging.CRITICAL,
    "EMERGENCY": logging.CRITICAL,
}

async def log_handler(message: LogMessage):
    """Forward MCP server logs to Python's logging system."""
    data = message.data
    if isinstance(data, dict):
        msg = data.get('msg', data)
        extra = data.get('extra')
    else:
        msg = data
        extra = None

    # Python's logging requires `extra` to be a mapping, but a server can send
    # any JSON value, so fold anything else into the message instead.
    if extra is not None and not isinstance(extra, dict):
        msg = f"{msg} ({extra})"
        extra = None

    level = LOGGING_LEVEL_MAP.get(message.level.upper(), logging.INFO)
    logger.log(level, msg, extra=extra)

client = Client(
    Path("my_mcp_server.py"),
    log_handler=log_handler,
)
```

The handler receives a `LogMessage` object:

<Card icon="code" title="LogMessage">
<ResponseField name="level" type='Literal["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]'>
  The log level
</ResponseField>

<ResponseField name="logger" type="str | None">
  The logger name (may be None)
</ResponseField>

<ResponseField name="data" type="Any">
  The JSON-serializable log payload sent by the server. FastMCP's structured logger uses a dictionary with `msg` and `extra` keys, but other MCP servers may send any JSON value.
</ResponseField>
</Card>

## Structured Logs

The `message.data` attribute contains the server's JSON-serializable log payload. FastMCP servers commonly send a dictionary with `msg` and `extra` keys, which enables structured logging with rich contextual information.

```python
from fastmcp.client.logging import LogMessage

async def detailed_log_handler(message: LogMessage):
    data = message.data
    msg = data.get('msg', data) if isinstance(data, dict) else data
    extra = data.get('extra') if isinstance(data, dict) else None

    if message.level == "error":
        print(f"ERROR: {msg} | Details: {extra}")
    elif message.level == "warning":
        print(f"WARNING: {msg} | Details: {extra}")
    else:
        print(f"{message.level.upper()}: {msg}")
```

This structure is preserved even when logs are forwarded through a FastMCP proxy, making it useful for debugging multi-server applications.

## Default Behavior

If you do not provide a custom `log_handler`, FastMCP's default handler routes server logs to Python's logging system through the `fastmcp.client.from_server` logger, at the matching severity. The MCP levels map as follows: `notice` becomes INFO; `alert` and `emergency` become CRITICAL.

```python
from pathlib import Path

from fastmcp import Client

client = Client(Path("my_mcp_server.py"))

async with client:
    # Server logs are forwarded at proper severity automatically
    await client.call_tool("some_tool")
```

---

### Clients Notifications (`docs/clients/notifications.mdx`)

---
title: Notifications
sidebarTitle: Notifications
description: Handle server-sent notifications for list changes and other events.
icon: envelope
---

import { VersionBadge } from "/snippets/version-badge.mdx";

<VersionBadge version="2.9.1" />

Use this when you need to react to server-side changes like tool list updates or resource modifications.

MCP servers can send notifications to inform clients about state changes. The message handler provides a unified way to process these notifications.

## Handling Notifications

The simplest approach is a function that receives all messages and filters for the notifications you care about:

```python
from pathlib import Path

from fastmcp import Client

async def message_handler(message):
    """Handle MCP notifications from the server."""
    if hasattr(message, 'method'):
        method = message.method

        if method == "notifications/tools/list_changed":
            print("Tools have changed - refresh tool cache")
        elif method == "notifications/resources/list_changed":
            print("Resources have changed")
        elif method == "notifications/prompts/list_changed":
            print("Prompts have changed")
        elif method == "notifications/resources/updated":
            print("A resource was updated")

client = Client(
    Path("my_mcp_server.py"),
    message_handler=message_handler,
)
```

## MessageHandler Class

For fine-grained targeting, subclass `MessageHandler` to use specific hooks:

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.messages import MessageHandler
import mcp_types

class MyMessageHandler(MessageHandler):
    async def on_tool_list_changed(
        self, notification: mcp_types.ToolListChangedNotification
    ) -> None:
        """Handle tool list changes."""
        print("Tool list changed - refreshing available tools")

    async def on_resource_list_changed(
        self, notification: mcp_types.ResourceListChangedNotification
    ) -> None:
        """Handle resource list changes."""
        print("Resource list changed")

    async def on_prompt_list_changed(
        self, notification: mcp_types.PromptListChangedNotification
    ) -> None:
        """Handle prompt list changes."""
        print("Prompt list changed")

client = Client(
    Path("my_mcp_server.py"),
    message_handler=MyMessageHandler(),
)
```

### Handler Template

```
/* Detailed source-code truncated for AI context efficiency. */
```

## List Change Notifications

A practical example of maintaining a tool cache that refreshes when tools change:

```python
from pathlib import Path
from fastmcp import Client
from fastmcp.client.messages import MessageHandler
import mcp_types

class ToolCacheHandler(MessageHandler):
    def __init__(self):
        self.cached_tools = []

    async def on_tool_list_changed(
        self, notification: mcp_types.ToolListChangedNotification
    ) -> None:
        """Clear tool cache when tools change."""
        print("Tools changed - clearing cache")
        self.cached_tools = []  # Force refresh on next access

client = Client(Path("server.py"), message_handler=ToolCacheHandler())
```

## Server Requests

The message handler receives only notifications and transport exceptions; server-initiated requests never reach it. Answer those through the client's dedicated parameters:

- **Sampling requests**: Use [`sampling_handler`](/clients/sampling)
- **Elicitation requests**: Use [`elicitation_handler`](/clients/elicitation)
- **Roots requests**: Use [`roots`](/clients/roots)

Progress and log notifications reach the message handler as well, but their dedicated callbacks are simpler to use:

- **Progress updates**: Use [`progress_handler`](/clients/progress)
- **Log messages**: Use [`log_handler`](/clients/logging)

---

### Clients Progress (`docs/clients/progress.mdx`)

---
title: Progress Monitoring
sidebarTitle: Progress
description: Handle progress notifications from long-running server operations.
icon: bars-progress
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.3.5" />

Use this when you need to track progress of long-running operations.

MCP servers can report progress during operations. The client receives these updates through a progress handler.

## Progress Handler

Set a handler when creating the client:

```python
from pathlib import Path

from fastmcp import Client

async def progress_handler(
    progress: float,
    total: float | None,
    message: str | None
) -> None:
    if total:
        percentage = (progress / total) * 100
        print(f"Progress: {percentage:.1f}% - {message or ''}")
    else:
        print(f"Progress: {progress} - {message or ''}")

client = Client(
    Path("my_mcp_server.py"),
    progress_handler=progress_handler
)
```

The handler receives three parameters:

<Card icon="code" title="Handler Parameters">
<ResponseField name="progress" type="float">
  Current progress value
</ResponseField>

<ResponseField name="total" type="float | None">
  Expected total value (may be None if unknown)
</ResponseField>

<ResponseField name="message" type="str | None">
  Optional status message
</ResponseField>
</Card>

## Per-Call Handler

Override the client-level handler for specific tool calls:

```python
async with client:
    result = await client.call_tool(
        "long_running_task",
        {"param": "value"},
        progress_handler=my_progress_handler
    )
```

---

### Clients Prompts (`docs/clients/prompts.mdx`)

---
title: Getting Prompts
sidebarTitle: Prompts
description: Retrieve rendered message templates with automatic argument serialization.
icon: message-lines
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.0.0" />

Use this when you need to retrieve server-defined message templates for LLM interactions.

Prompts are reusable message templates exposed by MCP servers. They can accept arguments to generate personalized message sequences for LLM interactions.

## Basic Usage

Request a rendered prompt with `get_prompt()`:

```python
async with client:
    # Simple prompt without arguments
    result = await client.get_prompt("welcome_message")
    # result -> mcp_types.GetPromptResult

    # Access the generated messages
    for message in result.messages:
        print(f"Role: {message.role}")
        print(f"Content: {message.content}")
```

Pass arguments to customize the prompt:

```python
async with client:
    result = await client.get_prompt("user_greeting", {
        "name": "Alice",
        "role": "administrator"
    })

    for message in result.messages:
        print(f"Generated message: {message.content}")
```

## Argument Serialization

<VersionBadge version="2.9.0" />

FastMCP automatically serializes complex arguments to JSON strings as required by the MCP specification. You can pass typed objects directly:

```python
from dataclasses import dataclass

@dataclass
class UserData:
    name: str
    age: int

async with client:
    result = await client.get_prompt("analyze_user", {
        "user": UserData(name="Alice", age=30),     # Automatically serialized
        "preferences": {"theme": "dark"},           # Dict serialized
        "scores": [85, 92, 78],                     # List serialized
        "simple_name": "Bob"                        # Strings unchanged
    })
```

The client handles serialization using `pydantic_core.to_json()` for consistent formatting. FastMCP servers automatically deserialize these JSON strings back to the expected types.

## Working with Results

The `get_prompt()` method returns a `GetPromptResult` containing a list of messages:

```python
async with client:
    result = await client.get_prompt("conversation_starter", {"topic": "climate"})

    for i, message in enumerate(result.messages):
        print(f"Message {i + 1}:")
        print(f"  Role: {message.role}")
        print(f"  Content: {message.content.text if hasattr(message.content, 'text') else message.content}")
```

Every prompt message has the role `user` or `assistant`; MCP prompts have no system role. A prompt can return a single message that sets up the LLM's task:

```python
async with client:
    result = await client.get_prompt("system_configuration", {
        "role": "helpful assistant",
        "expertise": "python programming"
    })

    # Access the returned messages
    message = result.messages[0]
    print(f"Prompt: {message.content}")
```

Conversation templates generate multi-turn flows:

```python
async with client:
    result = await client.get_prompt("interview_template", {
        "candidate_name": "Alice",
        "position": "Senior Developer"
    })

    # Multiple messages for a conversation flow
    for message in result.messages:
        print(f"{message.role}: {message.content}")
```

## Version Selection

<VersionBadge version="3.0.0" />

When a server exposes multiple versions of a prompt, you can request a specific version:

```python
async with client:
    # Get the highest version (default)
    result = await client.get_prompt("summarize", {"text": "..."})

    # Get a specific version
    result_v1 = await client.get_prompt("summarize", {"text": "..."}, version="1.0")
```

See [Version Discovery](/servers/versioning#version-discovery) for how to discover available versions.

## Multi-Server Clients

When using multi-server clients, prompt names are prefixed with the server name, just like tools, so `weather_prompt` on the `weather` server becomes `weather_weather_prompt`:

```python
async with client:  # Multi-server client
    result1 = await client.get_prompt("weather_weather_prompt", {"city": "London"})
    result2 = await client.get_prompt("assistant_assistant_prompt", {"query": "help"})
```

## Raw Protocol Access

For complete control, use `get_prompt_mcp()` which returns the full MCP protocol object:

```python
async with client:
    result = await client.get_prompt_mcp("example_prompt", {"arg": "value"})
    # result -> mcp_types.GetPromptResult
```

---

### Clients Resources (`docs/clients/resources.mdx`)

---
title: Reading Resources
sidebarTitle: Resources
description: Access static and templated data sources from MCP servers.
icon: folder-open
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.0.0" />

Use this when you need to read data from server-exposed resources like configuration files, generated content, or external data sources.

Resources are data sources exposed by MCP servers. They can be static files with fixed content, or dynamic templates that generate content based on parameters in the URI.

## Reading Resources

Read a resource using its URI:

```python
async with client:
    content = await client.read_resource("file:///path/to/README.md")
    # content -> list[TextResourceContents | BlobResourceContents]

    # Access text content
    if hasattr(content[0], 'text'):
        print(content[0].text)

    # Access binary content
    if hasattr(content[0], 'blob'):
        print(f"Binary data: {len(content[0].blob)} bytes")
```

Resource templates generate content based on URI parameters. The template defines a pattern like `weather://{city}/current`, and you fill in the parameters when reading:

```python
async with client:
    # Read from a resource template
    weather_content = await client.read_resource("weather://london/current")
    print(weather_content[0].text)
```

## Content Types

Resources return different content types depending on what they expose.

Text resources include configuration files, JSON data, and other human-readable content:

```python
async with client:
    content = await client.read_resource("resource://config/settings.json")

    for item in content:
        if hasattr(item, 'text'):
            print(f"Text content: {item.text}")
            print(f"MIME type: {item.mime_type}")
```

Binary resources include images, PDFs, and other non-text data. They arrive as `BlobResourceContents`, whose `blob` field is a base64 **string**, so decode it before writing bytes to disk:

```python
import base64

from mcp_types import BlobResourceContents

async with client:
    content = await client.read_resource("resource://images/logo.png")

    for item in content:
        if isinstance(item, BlobResourceContents):
            data = base64.b64decode(item.blob)
            print(f"Binary content: {len(data)} bytes")
            print(f"MIME type: {item.mime_type}")

            # Save to file
            with open("downloaded_logo.png", "wb") as f:
                f.write(data)
```

## Multi-Server Clients

When using multi-server clients, the server name is inserted after the URI scheme, so `weather://icons/sunny` on the `weather` server becomes `weather://weather/icons/sunny`:

```python
async with client:  # Multi-server client
    weather_icons = await client.read_resource("weather://weather/icons/sunny")
    templates = await client.read_resource("resource://assistant/templates/list")
```

## Version Selection

<VersionBadge version="3.0.0" />

When a server exposes multiple versions of a resource, you can request a specific version:

```python
async with client:
    # Read the highest version (default)
    content = await client.read_resource("data://config")

    # Read a specific version
    content_v1 = await client.read_resource("data://config", version="1.0")
```

See [Version Discovery](/servers/versioning#version-discovery) for how to discover available versions.

## Raw Protocol Access

For complete control, use `read_resource_mcp()` which returns the full MCP protocol object:

```python
async with client:
    result = await client.read_resource_mcp("resource://example")
    # result -> mcp_types.ReadResourceResult
```

---

### Clients Roots (`docs/clients/roots.mdx`)

---
title: Client Roots
sidebarTitle: Roots
description: Tell servers which local paths your client can reach.
icon: folder-tree
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.0.0" />

Use this when you need to tell servers what local resources the client has access to.

A root is a path your client is willing to expose — a project directory, a workspace, a document store. Servers read them to scope their work, so a tool that searches files searches where you pointed it, and a server that gets no roots has to ask the user for paths instead. Roots describe where the client can reach; the server takes them as its working boundary.

Register them once with `roots=`, and the client answers however the server asks. A handshake-era server pushes a `roots/list` request down the open session and reads the reply mid-call; a modern (`2026-07-28`) server has no such channel, so it returns a roots request and `fastmcp.Client` fulfils it from the same registration and re-issues the call with the answer attached. The default `mode="auto"` negotiates whichever era the server speaks, so the examples below work on either — see [protocol negotiation](/clients/client#protocol-negotiation) for how that choice is made, and [the guard pattern](/servers/elicitation#sampling-and-roots) for how a server issues the modern form.

## Static Roots

When the paths are known up front, pass them as a list. The client holds them for the life of the connection and hands back the same set every time a server asks.

```python
from pathlib import Path

from fastmcp import Client

client = Client(
    Path("my_mcp_server.py"),
    roots=["file:///path/to/root1", "file:///path/to/root2"]
)
```

## Dynamic Roots

Pass a callback instead when the roots depend on something the client learns at runtime, such as the workspace the user has open. It runs at the moment a server asks, on either route, and receives the request context so you can see which request it is answering:

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.roots import RequestContext

async def roots_callback(context: RequestContext) -> list[str]:
    print(f"Server requested roots (Request ID: {context.request_id})")
    return ["file:///path/to/root1", "file:///path/to/root2"]

client = Client(
    Path("my_mcp_server.py"),
    roots=roots_callback
)
```

---

### Clients Sampling (`docs/clients/sampling.mdx`)

---
title: LLM Sampling
sidebarTitle: Sampling
description: Answer a server's request for an LLM completion.
icon: robot
---

import { VersionBadge } from "/snippets/version-badge.mdx";

<VersionBadge version="2.0.0" />

Use this when a server asks your client to run an LLM completion on its behalf.

Sampling is how a server borrows your model. Rather than hold an API key of its own, the server describes the messages it wants completed and asks you to run them — you pick the model, and you pay for the tokens. Your side of that arrangement is one function, a **sampling handler**, registered when you create the client.

The handler receives the conversation the server wants completed, the parameters it asked for, and a request context carrying metadata about the call. Return the generated text as a string and FastMCP wraps it in the protocol's result for you; return a `CreateMessageResult` yourself when you want to report the real model name or hand back content that isn't text. If the handler raises, the client sends the error back in place of a completion and the server's tool decides what to do about it.

## Handler Template

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.sampling import RequestContext, SamplingMessage, SamplingParams
from mcp_types import TextContent


async def sampling_handler(
    messages: list[SamplingMessage],
    params: SamplingParams,
    context: RequestContext,
) -> str:
    """Run the server's messages against your LLM and return the completion."""
    conversation = [
        f"{message.role}: {message.content.text}"
        for message in messages
        if isinstance(message.content, TextContent)
    ]
    system_prompt = params.system_prompt or "You are a helpful assistant."

    # Call your LLM here with `conversation` and `system_prompt`.
    return "Generated response based on the messages"


client = Client(Path("my_mcp_server.py"), sampling_handler=sampling_handler)
```

The client answers with this handler however the server asks for a completion. The default `mode="auto"` negotiates whichever protocol era the server speaks, and one handler covers both of the routes an era can use — see [Request Routes](#request-routes).

## Handler Parameters

Everything the server sends arrives in the first two arguments. The messages are the conversation to complete; the parameters are how the server would like it completed. You decide how much of that to honor, since the client owns the model — a preference your provider cannot express is yours to ignore.

<Card icon="code" title="SamplingMessage">
<ResponseField name="role" type='Literal["user", "assistant"]'>
  The role of the message
</ResponseField>

<ResponseField name="content" type="TextContent | ImageContent | AudioContent | ToolUseContent | ToolResultContent | list[...]">
  The content of the message: one content block or a list of them. `TextContent` has a `.text` attribute; tool-use and tool-result blocks appear only in requests that carry tools.
</ResponseField>
</Card>

<Card icon="code" title="SamplingParams">
<ResponseField name="system_prompt" type="str | None">
  Optional system prompt the server wants to use
</ResponseField>

<ResponseField name="model_preferences" type="ModelPreferences | None">
  Server preferences for model selection (hints, cost/speed/intelligence priorities)
</ResponseField>

<ResponseField name="temperature" type="float | None">
  Sampling temperature
</ResponseField>

<ResponseField name="max_tokens" type="int">
  Maximum tokens to generate
</ResponseField>

<ResponseField name="stop_sequences" type="list[str] | None">
  Stop sequences for sampling
</ResponseField>

<ResponseField name="tools" type="list[Tool] | None">
  Tools the LLM can use during sampling
</ResponseField>

<ResponseField name="tool_choice" type="ToolChoice | None">
  Tool usage behavior; its `mode` is `auto`, `required`, or `none`
</ResponseField>
</Card>

## Built-in Handlers

Writing the provider call yourself is rarely worth it. FastMCP ships handlers for OpenAI, Anthropic, and Google Gemini that implement the full sampling API, tool use included, and translate the protocol's parameters into each provider's own. Give one a default model and pass it where your own handler would go. Write a custom handler when you need routing across providers, caching, or a provider FastMCP does not cover.

### OpenAI Handler

<VersionBadge version="2.11.0" />

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.sampling.handlers.openai import OpenAISamplingHandler

client = Client(
    Path("my_mcp_server.py"),
    sampling_handler=OpenAISamplingHandler(default_model="gpt-4o"),
)
```

Point the handler at any OpenAI-compatible API, including a local model server, by passing your own provider client:

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.sampling.handlers.openai import OpenAISamplingHandler
from openai import AsyncOpenAI

client = Client(
    Path("my_mcp_server.py"),
    sampling_handler=OpenAISamplingHandler(
        default_model="llama-3.1-70b",
        client=AsyncOpenAI(base_url="http://localhost:8000/v1"),
    ),
)
```

<Note>
Install the OpenAI handler with `pip install 'fastmcp[openai]'`.
</Note>

### Anthropic Handler

<VersionBadge version="2.14.1" />

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.sampling.handlers.anthropic import AnthropicSamplingHandler

client = Client(
    Path("my_mcp_server.py"),
    sampling_handler=AnthropicSamplingHandler(default_model="claude-sonnet-4-5"),
)
```

<Note>
Install the Anthropic handler with `pip install 'fastmcp[anthropic]'`. The handler supports Anthropic SDK 0.48.0 through 1.x.

When upgrading to Anthropic SDK 1.x, custom HTTP clients passed to `AsyncAnthropic` must use `httpx2` instead of `httpx`. See Anthropic's [migration guide](https://github.com/anthropics/anthropic-sdk-python/blob/main/MIGRATION.md) for changes to SDK integrations. The handler continues to forward an explicitly requested temperature, including zero, for models that support it.
</Note>

### Google Gemini Handler

<VersionBadge version="3.1.0" />

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.sampling.handlers.google_genai import GoogleGenaiSamplingHandler

client = Client(
    Path("my_mcp_server.py"),
    sampling_handler=GoogleGenaiSamplingHandler(default_model="gemini-2.0-flash"),
)
```

<Note>
Install the Google Gemini handler with `pip install 'fastmcp[gemini]'`.
</Note>

The [source of these handlers](https://github.com/PrefectHQ/fastmcp/tree/main/fastmcp_slim/fastmcp/client/sampling/handlers) is the best reference for writing your own.

## Tool Use

A sampling request can carry tools. When it does, your handler passes them to the model and returns whatever comes back, tool calls included — the server executes the tools itself and sends a follow-up sampling request with the results if it needs another turn. Your handler never runs a tool.

Registering a `sampling_handler` advertises basic sampling only, and the protocol lets a server send tools only to a client that declares the `sampling.tools` capability. When your handler can pass tools to its model, as the built-in handlers can, declare it with `sampling_capabilities`:

```python
from pathlib import Path

from fastmcp import Client
from fastmcp.client.sampling.handlers.openai import OpenAISamplingHandler
from mcp_types import SamplingCapability, SamplingToolsCapability

client = Client(
    Path("my_mcp_server.py"),
    sampling_handler=OpenAISamplingHandler(default_model="gpt-4o"),
    sampling_capabilities=SamplingCapability(tools=SamplingToolsCapability()),
)
```

## Request Routes

Servers reach your handler by two routes, and which one applies depends on the protocol era the connection negotiated. A handshake-era server pushes a `sampling/createMessage` request down the open session while a tool is running and waits for the reply. A modern (`2026-07-28`) connection has no such channel, so the tool ends its round by returning a request for a completion instead; the client answers from your handler and calls the tool again with the result attached.

One registration covers both, so this is rarely something you configure — it matters only when you pin an era, since `mode="legacy"` is the sole route that carries a pushed request. See [protocol negotiation](/clients/client#protocol-negotiation) for how the era is chosen, and [Sampling](/servers/sampling) under Servers for how a server issues these requests.

---

### Clients Tasks (`docs/clients/tasks.mdx`)

---
title: Background Tasks
sidebarTitle: Tasks
description: Call long-running tools without blocking, and answer questions they ask mid-run.
icon: clock
tag: "NEW"
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="4.0.0" />

Some tool calls take a while. The MCP background tasks extension lets a server run one in the background instead of holding the request open, and FastMCP's client drives the whole thing for you — most of the time you don't need to know a call was tasked at all.

<Note>
**Client task support is opt-in.** Install the `fastmcp-tasks` package (`pip install "fastmcp[tasks]"`) and import it — importing `fastmcp_tasks` anywhere (which you do to use `call_tool_task`) enables task support for every `Client` in the process. Without it, a `Client` never advertises the tasks capability, so the server runs its calls synchronously and background tasks simply don't happen.

**Tasks also require the modern protocol.** The capability is negotiated over `2026-07-28` connections. `mode="auto"` (the client default) negotiates it automatically; `mode="legacy"` never does. See [protocol negotiation](/clients/client#protocol-negotiation).
</Note>

## Transparent Calls

With task support enabled, just call the tool. If the server runs it as a background task, `call_tool` polls it to completion under the hood and returns the same result you'd get from a synchronous call — the task is invisible.

```python
import fastmcp_tasks  # enables client task support
from fastmcp import Client

async with Client(server, mode="auto") as client:
    result = await client.call_tool("slow_computation", {"duration": 10})
    print(result.data)
```

This is the right default for most code: it works whether or not the server actually tasks the call, so you can write ordinary tool-calling code without checking server capabilities.

## Driving a Task Explicitly

When you want to do other work while a task runs — or check on it, or cancel it — use `call_tool_task` instead. It returns a `ToolTask` handle immediately rather than waiting for completion.

```python
from fastmcp import Client
from fastmcp_tasks import call_tool_task

async with Client(server, mode="auto") as client:
    task = await call_tool_task(client, "slow_computation", {"duration": 10})
    print(f"Task started: {task.task_id}")

    # Do other work while it runs...

    result = await task.result()
```

`call_tool_task` requires the server to actually run the call as a task — if the tool isn't `task=True`, or the server doesn't have the tasks extension registered, it raises `ToolError`. Use it when you specifically need the handle; use `call_tool` when you just want the result.

### Checking Status

```python
status = await task.status()
print(f"{status.status}: {status.status_message}")
# status.status is "working", "input_required", "completed", "failed", or "cancelled"
```

### Waiting with Control

`task.wait()` polls until a terminal state (or a specific one you name), without answering any input the task asks for — use it when you want to observe an `input_required` pause yourself rather than have it answered automatically.

```python
# Wait up to 30 seconds for completion
status = await task.wait(timeout=30.0)

# Wait for a specific state
status = await task.wait(state="input_required", timeout=30.0)
```

### Getting the Result

`task.result()` drives the task the rest of the way — including answering any input it asks for — and returns the finished result, same as `client.call_tool` would. Awaiting the task directly is shorthand for this.

```python
result = await task.result()
# or: result = await task
```

By default a failed or cancelled task raises `ToolError`. Pass `raise_on_error=False` to `call_tool_task` to get an error result back instead.

### Cancellation

```python
await task.cancel()
```

Cancellation is cooperative — the task may still finish before the server notices the request.

## Answering Questions Mid-Task

A task can pause partway through to ask a question, the same way a foreground [multi-round-trip](/clients/elicitation#input-required-rounds) tool does. Pass an `elicitation_handler` and both `call_tool` and `task.result()` answer it automatically as part of driving the task to completion:

```python
from fastmcp import Client

async def handle_elicitation(message, response_type, params, context):
    return {"cuisine": "Thai", "vegetarian": True}

async with Client(server, mode="auto", elicitation_handler=handle_elicitation) as client:
    result = await client.call_tool("plan_dinner", {})
    print(result.data)
```

Without an `elicitation_handler`, a task that asks for input raises `ToolError` rather than hanging. See [server-side background tasks](/servers/tasks#gathering-input-mid-task) for how a tool asks a question in the first place.

## Example

Putting it together, here is a client that submits a background task with `call_tool_task` and awaits its result:

```python
import asyncio
from fastmcp import Client
from fastmcp_tasks import call_tool_task

server = "http://localhost:8000/mcp"

async def main():
    async with Client(server, mode="auto") as client:
        # Return immediately and drive the task yourself
        task = await call_tool_task(client, "slow_computation", {"duration": 10})
        print(f"Task started: {task.task_id}")

        # Do other work while the task runs
        while True:
            status = await task.status()
            if status.status in ("completed", "failed", "cancelled"):
                break
            print(f"Still working... ({status.status})")
            await asyncio.sleep(1)

        result = await task.result()
        print(f"Result: {result.data}")

asyncio.run(main())
```

See [Server Background Tasks](/servers/tasks) for how to enable background task support on the server side.

---

### Clients Tools (`docs/clients/tools.mdx`)

---
title: Calling Tools
sidebarTitle: Tools
description: Execute server-side tools and handle structured results.
icon: wrench
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.0.0" />

Use this when you need to execute server-side functions and process their results.

Tools are executable functions exposed by MCP servers. The client's `list_tools()` method discovers what a server offers, and `call_tool()` executes a tool by name with arguments and returns structured results.

## Discovering Tools

`list_tools()` returns every tool the server advertises as a list of `mcp_types.Tool` objects, each carrying the tool's name, description, and JSON `input_schema`. It follows pagination automatically, so the result is the complete catalog.

```python
async with client:
    tools = await client.list_tools()
    for tool in tools:
        print(tool.name, tool.description)
        print(tool.input_schema)
```

Servers can change their catalog while the connection is open and notify the client with a `notifications/tools/list_changed` notification; a fresh `list_tools()` call reflects the new set. See [Notifications](/clients/notifications) for reacting to that notification.

For page-by-page control over large catalogs, `list_tools_mcp()` returns one raw `ListToolsResult` at a time and accepts the `cursor` from the previous page's `next_cursor`.

```python
async with client:
    page = await client.list_tools_mcp()
    while page.next_cursor is not None:
        page = await client.list_tools_mcp(cursor=page.next_cursor)
```

Both methods accept a `cache_mode` argument when the client was built with a [response cache](/clients/client#response-caching).

## Basic Execution

```python
async with client:
    result = await client.call_tool("add", {"a": 5, "b": 3})
    # result -> CallToolResult with structured and unstructured data

    # Access structured data (automatically deserialized)
    print(result.data)  # 8

    # Access traditional content blocks
    print(result.content[0].text)  # "8"
```

Arguments are passed as a dictionary. For multi-server clients, tool names are automatically prefixed with the server name (e.g., `weather_get_forecast` for a tool named `get_forecast` on the `weather` server).

## Execution Options

The `call_tool()` method supports timeout control and progress monitoring:

```python
async with client:
    # With timeout (aborts if execution takes longer than 2 seconds)
    result = await client.call_tool(
        "long_running_task",
        {"param": "value"},
        timeout=2.0
    )

    # With progress handler
    result = await client.call_tool(
        "long_running_task",
        {"param": "value"},
        progress_handler=my_progress_handler
    )
```

## Structured Results

<VersionBadge version="2.10.0" />

Tool execution returns a `CallToolResult` object. The `.data` property provides fully hydrated Python objects including complex types like datetimes and UUIDs, reconstructed from the server's output schema.

Pydantic models can combine named fields with typed additional properties. The client retains those additional fields in `.data` and hydrates their values using the advertised schema, including inside nested objects and lists.

```python
from datetime import datetime
from uuid import UUID

async with client:
    result = await client.call_tool("get_weather", {"city": "London"})

    # FastMCP reconstructs complete Python objects
    weather = result.data
    print(f"Temperature: {weather.temperature}C at {weather.timestamp}")

    # Complex types are properly deserialized
    assert isinstance(weather.timestamp, datetime)
    assert isinstance(weather.station_id, UUID)

    # Raw structured JSON is also available
    print(f"Raw JSON: {result.structured_content}")
```

<Card icon="code" title="CallToolResult Properties">
<ResponseField name=".data" type="Any">
  Fully hydrated Python objects with complex type support (datetimes, UUIDs, custom classes). FastMCP exclusive.
</ResponseField>

<ResponseField name=".content" type="list[mcp_types.ContentBlock]">
  Standard MCP content blocks (`TextContent`, `ImageContent`, `AudioContent`, etc.).
</ResponseField>

<ResponseField name=".structured_content" type="dict[str, Any] | None">
  Standard MCP structured JSON data as sent by the server.
</ResponseField>

<ResponseField name=".is_error" type="bool">
  Boolean indicating if the tool execution failed.
</ResponseField>

<ResponseField name=".meta" type="dict[str, Any] | None">
  The `_meta` object the server attached to the result, if any.
</ResponseField>
</Card>

Structured content without an output schema is returned as a dictionary in `.data`, including an empty object (`{}`). When structured content is absent or deserialization fails, `.data` is `None`. Fall back to content blocks in that case:

```python
async with client:
    result = await client.call_tool("legacy_tool", {"param": "value"})

    if result.data is not None:
        print(f"Structured: {result.data}")
    else:
        for content in result.content:
            if hasattr(content, 'text'):
                print(f"Text result: {content.text}")
```

<Tip>
FastMCP servers automatically wrap primitive results (like `int`, `str`, `bool`) in a `{"result": value}` structure. FastMCP clients automatically unwrap this, so you get the original value in `.data`.
</Tip>

## Error Handling

By default, `call_tool()` raises a `ToolError` if the tool execution fails:

```python
from fastmcp.exceptions import ToolError

async with client:
    try:
        result = await client.call_tool("potentially_failing_tool", {"param": "value"})
        print("Tool succeeded:", result.data)
    except ToolError as e:
        print(f"Tool failed: {e}")
```

To handle errors manually instead of catching exceptions, disable automatic error raising:

```python
async with client:
    result = await client.call_tool(
        "potentially_failing_tool",
        {"param": "value"},
        raise_on_error=False
    )

    if result.is_error:
        print(f"Tool failed: {result.content[0].text}")
    else:
        print(f"Tool succeeded: {result.data}")
```

## Sending Metadata

<VersionBadge version="2.13.1" />

The `meta` parameter sends ancillary information alongside tool calls for observability, debugging, or client identification:

```python
async with client:
    result = await client.call_tool(
        name="send_email",
        arguments={
            "to": "user@example.com",
            "subject": "Hello",
            "body": "Welcome!"
        },
        meta={
            "trace_id": "abc-123",
            "request_source": "mobile_app"
        }
    )
```

See [Client Metadata](/servers/context#client-metadata) to learn how servers access this data.

## Version Selection

<VersionBadge version="3.0.0" />

When a server exposes multiple versions of a tool, `call_tool()` runs the highest by default. Pass `version` to call a specific one:

```python
async with client:
    result = await client.call_tool("calculate", {"x": 1, "y": 2}, version="1.0")
```

See [Version Discovery](/servers/versioning#version-discovery) for how to discover available versions.

## Raw Protocol Access

For complete control, use `call_tool_mcp()` which returns the raw MCP protocol object:

```python
async with client:
    result = await client.call_tool_mcp("my_tool", {"param": "value"})
    # result -> mcp_types.CallToolResult

    if result.is_error:
        print(f"Tool failed: {result.content}")
    else:
        print(f"Tool succeeded: {result.content}")
        # Note: No automatic deserialization with call_tool_mcp()
```

---

### Clients Transports (`docs/clients/transports.mdx`)

---
title: Client Transports
sidebarTitle: Transports
description: Configure how clients connect to and communicate with MCP servers.
icon: link
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.0.0" />

Transports handle the underlying connection between your client and MCP servers. While the client can automatically select a transport based on what you pass to it, instantiating transports explicitly gives you full control over configuration.

## STDIO Transport

STDIO transport communicates with MCP servers through subprocess pipes. When using STDIO, your client launches and manages the server process, controlling its lifecycle and environment.

<Warning>
STDIO servers inherit only a small allowlist of environment variables — just enough to locate an interpreter and a home directory. Anything else in your shell, including API keys and other credentials, does not reach the server unless you pass it through `env` explicitly.

The allowlist is platform-specific. On POSIX systems it is `HOME`, `LOGNAME`, `PATH`, `SHELL`, `TERM`, and `USER`; on Windows it is `APPDATA`, `HOMEDRIVE`, `HOMEPATH`, `LOCALAPPDATA`, `PATH`, `PATHEXT`, `PROCESSOR_ARCHITECTURE`, `SYSTEMDRIVE`, `SYSTEMROOT`, `TEMP`, `USERNAME`, and `USERPROFILE`.
</Warning>

```python
from fastmcp import Client
from fastmcp.client.transports import StdioTransport

transport = StdioTransport(
    command="python",
    args=["my_server.py", "--verbose"],
    env={"API_KEY": "secret", "LOG_LEVEL": "DEBUG"},
    cwd="/path/to/server"
)
client = Client(transport)
```

For convenience, the client can infer STDIO transport from file paths, though this limits configuration options. Pass a `Path`: inferring a subprocess from a bare *string* like `Client("my_server.py")` is deprecated as of 4.0 — it warns, and in FastMCP 5 a string will only ever mean a URL:

```python
from pathlib import Path
from fastmcp import Client

client = Client(Path("my_server.py"))  # Limited - no configuration options
```

<Warning>
Transport inference treats its input as trusted configuration. A string naming an existing `.py` or `.js` file starts that file as a subprocess, and a configuration dictionary can run any command with any arguments. An application that accepts server locations from users should validate them at its own boundary and construct the transport explicitly, for example `StreamableHttpTransport(url=...)` for a URL, rather than passing the raw value to `Client`.
</Warning>

### Environment Variables

Values you pass through `env` are merged on top of the inherited allowlist, so you add configuration rather than replacing the base environment. Anything your server needs beyond the allowlist has to be listed explicitly.

**Selective forwarding** passes only the variables your server needs:

```python
import os

from fastmcp import Client
from fastmcp.client.transports import StdioTransport

required_vars = ["API_KEY", "DATABASE_URL", "REDIS_HOST"]
env = {var: os.environ[var] for var in required_vars if var in os.environ}

transport = StdioTransport(command="python", args=["server.py"], env=env)
client = Client(transport)
```

**Loading from .env files** keeps configuration separate from code:

```python
from dotenv import dotenv_values
from fastmcp import Client
from fastmcp.client.transports import StdioTransport

env = {
    key: value
    for key, value in dotenv_values(".env").items()
    if value is not None
}
transport = StdioTransport(command="python", args=["server.py"], env=env)
client = Client(transport)
```

### Session Persistence

STDIO transports maintain sessions across multiple client contexts by default (`keep_alive=True`). This reuses the same subprocess for multiple connections, improving performance.

```python
from fastmcp import Client
from fastmcp.client.transports import StdioTransport

transport = StdioTransport(command="python", args=["server.py"])
client = Client(transport)

async def efficient_multiple_operations():
    async with client:
        await client.list_tools()

    async with client:  # Reuses the same subprocess
        await client.call_tool("process_data", {"file": "data.csv"})
```

A kept-alive session is reused when the transport options and request timeout
match. Connecting with a different `Client(timeout=...)` restarts an idle
subprocess. If another client is still connected, the new client shares its
session and that session's timeout, and FastMCP logs a warning; use separate
transports when concurrent clients need different defaults. Per-call `timeout`
overrides do not restart the session.

For complete isolation between connections, disable session persistence:

```python
transport = StdioTransport(command="python", args=["server.py"], keep_alive=False)
```

A persisted session belongs to the event loop that created it, so reuse from a different loop transparently starts a fresh subprocess instead. Sharing one transport between loops still works, but only reuses the subprocess within a single loop — and it raises if two loops try to hold overlapping sessions on the same transport, which needs one transport per loop. The old subprocess is shut down on the loop that started it, so that loop must still be running or already closed: if it is stopped but still open (as after `loop.run_until_complete(...)`), reuse from another loop raises until you close the client on the original loop.

## HTTP Transport

<VersionBadge version="2.3.0" />

HTTP transport connects to MCP servers running as web services. This is the recommended transport for production deployments.

Incoming SSE events are limited to 1 MiB by default. If a server returns larger
tool results or resources, set `max_sse_event_size` on `StreamableHttpTransport`
to a byte limit that accommodates them, or use `None` to disable the limit:

```python
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport

transport = StreamableHttpTransport(
    "https://api.example.com/mcp",
    max_sse_event_size=8 * 1024 * 1024,
)
client = Client(transport)
```

The same field is available as `max_sse_event_size` on an [MCP config](/integrations/mcp-json-configuration)'s remote server entry, which forwards it when building the transport. A client created from a bare URL (`Client("https://api.example.com/mcp")`) keeps the 1 MiB default; pass an explicit `StreamableHttpTransport` as above to raise or disable it.

```python
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport

transport = StreamableHttpTransport(
    url="https://api.example.com/mcp",
    headers={
        "Authorization": "Bearer your-token-here",
        "X-Custom-Header": "value"
    }
)
client = Client(transport)
```

FastMCP also provides authentication helpers:

```python
from fastmcp import Client
from fastmcp.client.auth import BearerAuth

client = Client(
    "https://api.example.com/mcp",
    auth=BearerAuth("your-token-here")
)
```

### SSL Verification

By default, HTTPS connections verify the server's SSL certificate using the operating system's trust store through HTTPX2. You can customize this behavior with the `verify` parameter; see [HTTPX2's SSL guide](https://pydantic.dev/docs/httpx2/advanced/ssl/).

Keep the trust store used by your deployment current. Updating certifi does not update the operating system's CA store or a custom bundle selected by `SSL_CERT_FILE`, `SSL_CERT_DIR`, or `verify`. Custom client factories configure their own TLS verification. Rebuild containers and restart processes after updating trust stores. This also matters for servers making outbound HTTPS requests to OAuth providers, JWKS endpoints, and upstream APIs.

For the October 2026 eMudhra CA incident, follow the [FastMCP security notice](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026). A FastMCP package upgrade alone does not remediate every trust store.

The `verify` parameter on `Client` accepts a boolean, a CA bundle path, or an `ssl.SSLContext`:

```python
from fastmcp import Client

# Disable SSL verification (e.g., for self-signed certs in development)
client = Client("https://dev-server.internal/mcp", verify=False)

# Use a custom CA bundle
client = Client("https://corp-server.internal/mcp", verify="/path/to/ca-bundle.pem")

# Use a custom SSL context for full control
import ssl
ctx = ssl.create_default_context()
ctx.load_verify_locations("/path/to/internal-ca.pem")
client = Client("https://corp-server.internal/mcp", verify=ctx)
```

The `verify` parameter is also available directly on `StreamableHttpTransport` and `SSETransport`:

```python
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport

transport = StreamableHttpTransport(
    url="https://dev-server.internal/mcp",
    verify=False,
)
client = Client(transport)
```

### Custom HTTP Client

For anything beyond SSL settings — proxies, mTLS, event hooks — pass an `httpx_client_factory`. The factory receives `headers`, `auth`, and `follow_redirects`, plus `timeout` when the client has one configured (for example `Client(transport, timeout=60)`). Accept `**kwargs` so the factory stays forward-compatible.

When no client timeout is configured, the factory **owns the timeout**: none is passed, and an `httpx2.AsyncClient` built without one uses httpx's 5 second default, which is too short for many MCP tool calls. Set a default with `setdefault`, so an explicit client timeout still wins:

```python
import httpx2
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport

def httpx_client_factory(**kwargs):
    kwargs.setdefault("timeout", httpx2.Timeout(30.0, read=300.0))
    return httpx2.AsyncClient(verify=False, **kwargs)

transport = StreamableHttpTransport(
    url="https://api.example.com/mcp",
    httpx_client_factory=httpx_client_factory,
)
client = Client(transport)
```

These 30s connect / 300s read values match the defaults FastMCP applies when no factory is used.

### SSE Transport

Server-Sent Events transport is maintained for backward compatibility. Use Streamable HTTP for new deployments unless you have specific infrastructure requirements.

```python
from fastmcp import Client
from fastmcp.client.transports import SSETransport

transport = SSETransport(
    url="https://api.example.com/sse",
    headers={"Authorization": "Bearer token"}
)
client = Client(transport)
```

## In-Memory Transport

In-memory transport connects directly to a FastMCP server instance within the same Python process. This eliminates both subprocess management and network overhead, making it ideal for testing.

```python
from fastmcp import FastMCP, Client
import os

mcp = FastMCP("TestServer")

@mcp.tool
def greet(name: str) -> str:
    prefix = os.environ.get("GREETING_PREFIX", "Hello")
    return f"{prefix}, {name}!"

client = Client(mcp)

async with client:
    result = await client.call_tool("greet", {"name": "World"})
```

<Note>
Unlike STDIO transports, in-memory servers share the same memory space and environment variables as your client code.
</Note>

## Multi-Server Configuration

<VersionBadge version="2.4.0" />

Connect to multiple servers defined in a configuration dictionary:

```python
from fastmcp import Client

config = {
    "mcpServers": {
        "weather": {
            "url": "https://weather.example.com/mcp",
            "transport": "http"
        },
        "assistant": {
            "command": "python",
            "args": ["./assistant.py"],
            "env": {"LOG_LEVEL": "INFO"}
        }
    }
}

client = Client(config)

async with client:
    # Tools are namespaced by server
    weather = await client.call_tool("weather_get_forecast", {"city": "NYC"})
    answer = await client.call_tool("assistant_ask", {"question": "What?"})
```

### Per-server Timeouts

Set `timeout` on a server entry to limit how long its requests can wait. Entry timeouts use **milliseconds**, apply to HTTP, SSE, and STDIO servers, and take precedence over the timeout passed to `Client`. An omitted or `null` entry timeout uses the client timeout; `0` disables the timeout for that backend session.

For example, give the weather server 5 seconds and use a 30-second client timeout for entries without their own limit:

```python
from fastmcp import Client

config = {
    "mcpServers": {
        "weather": {
            "url": "https://weather.example.com/mcp",
            "timeout": 5000,
        },
        "assistant": {
            "command": "python",
            "args": ["./assistant.py"],
        },
    }
}

client = Client(config, timeout=30)
```

With multiple servers, the client timeout also limits the entire routed request, so a backend timeout cannot extend that outer limit. Composite clients and configurations with tool transformations or tag filters use backend proxy sessions: a per-call `timeout` cannot extend those sessions' configured limits. `sse_read_timeout` remains a separate setting for the SSE connection.

### Tool Transformations

FastMCP supports tool transformations within the configuration. You can change names, descriptions, tags, and arguments for tools from a server. Key each transformation by the tool's name on that server, before any server-name prefix is added.

```python
config = {
    "mcpServers": {
        "weather": {
            "url": "https://weather.example.com/mcp",
            "transport": "http",
            "tools": {
                "get_forecast": {
                    "name": "miami_weather",
                    "description": "Get the weather for Miami",
                    "arguments": {
                        "city": {
                            "default": "Miami",
                            "hide": True,
                        }
                    }
                }
            }
        }
    }
}
```

To filter tools by tag, use `include_tags` or `exclude_tags` at the server level:

```python
config = {
    "mcpServers": {
        "weather": {
            "url": "https://weather.example.com/mcp",
            "include_tags": ["forecast"]  # Only tools with this tag
        }
    }
}
```

Omit `include_tags` to leave inclusion unrestricted. An empty `include_tags` list
includes no tools, while an empty `exclude_tags` list excludes none. These filters
apply to each server in both single-server and multi-server configurations.

---

### Community Showcase (`docs/community/showcase.mdx`)

---
title: 'Community Showcase'
description: 'High-quality projects and examples from the FastMCP community'
icon: 'users'
---

import { YouTubeEmbed } from '/snippets/youtube-embed.mdx'

## Join the Community

<Card title="FastMCP Discord" icon="discord" href="https://discord.gg/uu8dJCgttd">
  Connect with other FastMCP developers, share your projects, and discuss ideas.
</Card>

## Featured Projects

Discover exemplary MCP servers and implementations created by our community. These projects demonstrate best practices and innovative uses of FastMCP.

### Learning Resources

#### Video Tutorials

**Build Remote MCP Servers w/ Python & FastMCP** - Claude Integrations Tutorial by Greg + Code

<YouTubeEmbed 
  videoId="bOYkbXP-GGo" 
  title="Build Remote MCP Servers w/ Python & FastMCP" 
/>

**FastMCP — the best way to build an MCP server with Python** - Tutorial by ZazenCodes

<YouTubeEmbed 
  videoId="rnljvmHorQw" 
  title="FastMCP — the best way to build an MCP server with Python" 
/>

**Speedrun a MCP server for Claude Desktop (fastmcp)** - Tutorial by Nate from Prefect

<YouTubeEmbed 
  videoId="67ZwpkUEtSI" 
  title="Speedrun a MCP server for Claude Desktop (fastmcp)" 
/>

### Community Examples

Have you built something interesting with FastMCP? We'd love to feature high-quality examples here! Start a [discussion on GitHub](https://github.com/PrefectHQ/fastmcp/discussions) to share your project.

## Contributing

To get your project featured:

1. Ensure your project demonstrates best practices
2. Include comprehensive documentation
3. Add clear usage examples
4. Open a discussion in our [GitHub Discussions](https://github.com/PrefectHQ/fastmcp/discussions)

We review submissions regularly and feature projects that provide value to the FastMCP community.

## Further Reading

- [Contrib Modules](/patterns/contrib) - Community-contributed modules that are distributed with FastMCP itself

---

### Deployment Fastmcp Gateway (`docs/deployment/fastmcp-gateway.mdx`)

---
title: FastMCP Gateway
sidebarTitle: FastMCP Gateway
description: The MCP platform from the FastMCP team
icon: cloud
---

[FastMCP Gateway](https://www.prefect.io/horizon?utm_source=gofastmcp&utm_medium=docs&utm_campaign=docs_horizon&utm_content=guide_intro), formerly Horizon, is a platform for deploying and managing MCP servers.
Built by the FastMCP team at [Prefect](https://www.prefect.io), FastMCP Gateway provides managed hosting, authentication, access control, and a registry of MCP capabilities.

FastMCP Gateway includes a **free personal tier for FastMCP users**, making it the fastest way to get a secure, production-ready server URL with built-in OAuth authentication.

<Info>
FastMCP Gateway is free for personal projects. Enterprise governance features are available for teams deploying to thousands of users.
</Info>

## FastMCP CLI Account

Sign in to FastMCP Gateway from the FastMCP CLI with the device authorization flow.

```bash
fastmcp login
```

The command uses an environment key or a valid stored key when one is available.
When login needs a new key, it shows a verification URL and code before it opens the browser.
If the browser cannot open, visit the shown URL and enter the code.
To switch accounts, run `fastmcp logout` before you run `fastmcp login` again.
New users can register and create their first FastMCP Gateway organization in the browser.

Check the active account after login.

```bash
fastmcp whoami
```

Remove the local credential and revoke the active personal API key when possible.

```bash
fastmcp logout
```

Login does not select or store a deployment organization.

For an agent or a CI process, set `HORIZON_API_KEY` instead of storing a key.
The CLI never writes the environment value to its credential file.
When this variable controls the session, logout does not revoke or remove any credential.
Remove the variable from the environment to sign out.

## The Platform

FastMCP Gateway provides four capabilities:

- **Deploy**: Managed hosting with CI/CD, scaling, monitoring, and rollbacks. Push code and get a live, governed endpoint in 60 seconds.
- **Registry**: A central catalog of MCP servers across your organization—first-party, third-party, and curated remix servers composed from multiple sources.
- **Gateway**: Role-based access control, authentication, and audit logs. Define what agents can see and do at the tool level.
- **Agents**: A permissioned chat interface for interacting with any MCP server or curated combination of servers.

This guide focuses on **managed hosting**, the deployment capability that gives you the fastest path from a FastMCP server to a production URL.

## Prerequisites

To use FastMCP Gateway, you'll need a [GitHub](https://github.com) account and a GitHub repo containing a FastMCP server.
If you don't have one yet, FastMCP Gateway can create a starter repo for you during onboarding.

Your repo can be public or private, but must include at least a Python file containing a FastMCP server instance.

<Tip>
Run `fastmcp inspect <file.py:server_object>` to verify that your server loads and list its tools, resources, prompts, and metadata.
</Tip>

If you have a `requirements.txt` or `pyproject.toml` in the repo, FastMCP Gateway will automatically detect your server's dependencies and install them.
Your file *can* have an `if __name__ == "__main__"` block, but FastMCP Gateway will ignore it.

For example, a minimal server file might look like:

```python
from fastmcp import FastMCP

mcp = FastMCP("MyServer")

@mcp.tool
def hello(name: str) -> str:
    return f"Hello, {name}!"
```

## Getting Started

There are just three steps to deploying a server to FastMCP Gateway:

### Step 1: Select a Repository

Visit [horizon.prefect.io](https://horizon.prefect.io?utm_source=gofastmcp&utm_medium=docs) and sign in with your GitHub account. Connect your GitHub account to grant FastMCP Gateway access to your repositories, then select the repo you want to deploy.

<img src="/assets/images/horizon/select-repo.png" alt="FastMCP Gateway repository selection" />

### Step 2: Configure Your Server

Next, you'll configure how FastMCP Gateway should build and deploy your server.

<img src="/assets/images/horizon/configure-server.png" alt="FastMCP Gateway server configuration" />

The configuration screen lets you specify:
- **Server name**: A unique name for your server. This determines your server's URL.
- **Description**: A brief description of what your server does.
- **Entrypoint**: The Python file containing your FastMCP server (e.g., `main.py`). This field has the same syntax as the `fastmcp run` command—use `main.py:mcp` to specify a specific object in the file.
- **Authentication**: When enabled, only authenticated users in your organization can connect. FastMCP Gateway handles OAuth authentication for you.

FastMCP Gateway will automatically detect your server's Python dependencies from either a `requirements.txt` or `pyproject.toml` file.

### Step 3: Deploy and Connect

Click **Deploy Server** and FastMCP Gateway will clone your repository, build your server, and deploy it to a unique URL, typically in under 60 seconds.

<img src="/assets/images/horizon/deployment-live.png" alt="FastMCP Gateway deployment view showing live server" />

Once deployed, your server is accessible at a URL like:

```text
https://your-server-name.fastmcp.app/mcp
```

FastMCP Gateway monitors your repo and redeploys automatically whenever you push to `main`. It also builds preview deployments for every PR, so you can test changes before they go live.

## Testing Your Server

FastMCP Gateway provides two ways to verify your server is working before connecting external clients.

### Inspector

The Inspector gives you a structured view of everything your server exposes—tools, resources, and prompts. You can click any tool, fill in the inputs, execute it, and see the output. This is useful for systematically validating each capability and debugging specific behaviors.

### ChatMCP

For quick end-to-end testing, ChatMCP lets you interact with your server conversationally. It uses a fast model optimized for rapid iteration—you can verify the server works, test tool calls in context, and confirm the overall behavior before sharing it with others.

<img src="/assets/images/horizon/chat.png" alt="FastMCP Gateway ChatMCP interface" />

ChatMCP is designed for testing, not as a daily work environment. Once you've confirmed your server works, you can copy connection snippets for Claude Desktop, Cursor, Claude Code, and other MCP clients—or use the FastMCP client library to connect programmatically.

<a id="horizon-agents" />

## Agents

Beyond testing individual servers, FastMCP Gateway lets you create **Agents**, chat interfaces backed by one or more MCP servers. While ChatMCP tests a single server, Agents let you compose capabilities from multiple servers into a unified experience.

<img src="/assets/images/horizon/agent-detail.png" alt="FastMCP Gateway Agent configuration" />

To create an agent:
1. Navigate to **Agents** in the sidebar
2. Click **Create Agent** and give it a name and description
3. Add MCP servers to the agent—these can be servers you've deployed to FastMCP Gateway or external servers in the registry

Once configured, you can chat with your agent directly in FastMCP Gateway:

<img src="/assets/images/horizon/agent-chat.png" alt="Chatting with an Agent in FastMCP Gateway" />

Agents are useful for creating purpose-built interfaces that combine tools from different servers. For example, you might create an agent that has access to both your company's internal data server and a general-purpose utilities server.

---

### Deployment Http (`docs/deployment/http.mdx`)

---
title: HTTP Deployment
sidebarTitle: HTTP Deployment
description: Deploy your FastMCP server over HTTP for remote access
icon: server
---

import { VersionBadge } from "/snippets/version-badge.mdx";

<Tip>
STDIO transport is perfect for local development and desktop applications. But to unlock the full potential of MCP—centralized services, multi-client access, and network availability—you need remote HTTP deployment.
</Tip>

This guide walks you through deploying your FastMCP server as a remote MCP service that's accessible via a URL. Once deployed, your MCP server will be available over the network, allowing multiple clients to connect simultaneously and enabling integration with cloud-based LLM applications. This guide focuses specifically on remote MCP deployment, not local STDIO servers.

## Choosing Your Approach

FastMCP provides two ways to deploy your server as an HTTP service. Understanding the trade-offs helps you choose the right approach for your needs.

The **direct HTTP server** approach is simpler and perfect for getting started quickly. You modify your server's `run()` method to use HTTP transport, and FastMCP handles all the web server configuration. This approach works well for standalone deployments where you want your MCP server to be the only service running on a port.

The **ASGI application** approach gives you more control and flexibility. Instead of running the server directly, you create an ASGI application that can be served by Uvicorn. This approach is better when you need advanced server features like multiple workers, custom middleware, or when you're integrating with existing web applications.

### Direct HTTP Server

The simplest way to get your MCP server online is to use the built-in `run()` method with HTTP transport. This approach handles all the server configuration for you and is ideal when you want a standalone MCP server without additional complexity.

```python server.py
from fastmcp import FastMCP

mcp = FastMCP("My Server")

@mcp.tool
def process_data(input: str) -> str:
    """Process data on the server"""
    return f"Processed: {input}"

if __name__ == "__main__":
    mcp.run(transport="http", host="0.0.0.0", port=8000)
```

Run your server with a simple Python command:
```bash
python server.py
```

Your server is now accessible at `http://localhost:8000/mcp` (or use your server's actual IP address for remote access).

This approach is ideal when you want to get online quickly with minimal configuration. It's perfect for internal tools, development environments, or simple deployments where you don't need advanced server features. The built-in server handles all the HTTP details, letting you focus on your MCP implementation.

### ASGI Application

For production deployments, you'll often want more control over how your server runs. FastMCP can create a standard ASGI application that works with any ASGI server like Uvicorn, Gunicorn, or Hypercorn. This approach is particularly useful when you need to configure advanced server options, run multiple workers, or integrate with existing infrastructure.

```python app.py
from fastmcp import FastMCP

mcp = FastMCP("My Server")

@mcp.tool
def process_data(input: str) -> str:
    """Process data on the server"""
    return f"Processed: {input}"

# Create ASGI application
app = mcp.http_app()
```

Run with any ASGI server - here's an example with Uvicorn:
```bash
uvicorn app:app --host 0.0.0.0 --port 8000
```

Your server is accessible at the same URL: `http://localhost:8000/mcp` (or use your server's actual IP address for remote access).

The ASGI approach shines in production environments where you need reliability and performance. You can run multiple worker processes to handle concurrent requests, add custom middleware for logging or monitoring, integrate with existing deployment pipelines, or mount your MCP server as part of a larger application.

## Configuring Your Server

### Custom Path

By default, your MCP server is accessible at `/mcp` on your domain. You can customize this path to fit your URL structure or avoid conflicts with existing endpoints. This is particularly useful when integrating MCP into an existing application or following specific API conventions.

```python
from fastmcp import FastMCP

mcp = FastMCP("My Server")

# Option 1: With mcp.run()
mcp.run(transport="http", host="0.0.0.0", port=8000, path="/api/mcp")

# Option 2: With ASGI app
app = mcp.http_app(path="/api/mcp")
```

Now your server is accessible at `http://localhost:8000/api/mcp`.

### Authentication

<Warning>
Authentication is **highly recommended** for remote MCP servers. Some LLM clients require authentication for remote servers and will refuse to connect without it.
</Warning>

FastMCP supports multiple authentication methods to secure your remote server. See the [Authentication Overview](/servers/auth/authentication) for complete configuration options including Bearer tokens, JWT, and OAuth.

If you're mounting an authenticated server under a path prefix, see [Mounting Authenticated Servers](#mounting-authenticated-servers) below for important routing considerations.

### Host and Origin Protection

FastMCP can validate `Host` and browser `Origin` headers before requests reach MCP session handling. The same settings apply to Streamable HTTP and to the legacy SSE transport. This request guard protects localhost-bound servers from DNS rebinding attacks, and it stays opt-in to preserve compatibility with existing ASGI, serverless, and reverse-proxy deployments.

Think of this as a request guard rather than CORS middleware. It decides whether a request can reach MCP session handling. CORS remains a separate browser response-header policy; configure CORS middleware separately when browser JavaScript must read cross-origin responses.

Enable strict validation with `host_origin_protection=True`. When you deploy behind a public hostname, add the hostname clients use to reach your MCP endpoint. If a browser-based MCP client runs on a separate origin, add that origin as well:

```python
from fastmcp import FastMCP

mcp = FastMCP("My Server")

app = mcp.http_app(
    host_origin_protection=True,
    allowed_hosts=["mcp.example.com"],
    allowed_origins=["https://app.example.com"],
)
```

For the direct server approach, pass the same values to `run()`:

```python
from fastmcp import FastMCP

mcp = FastMCP("My Server")

if __name__ == "__main__":
    mcp.run(
        transport="http",
        host="0.0.0.0",
        port=8000,
        host_origin_protection=True,
        allowed_hosts=["mcp.example.com"],
        allowed_origins=["https://app.example.com"],
    )
```

You can also configure these values with environment variables:

```bash
export FASTMCP_HTTP_HOST_ORIGIN_PROTECTION=true
export FASTMCP_HTTP_ALLOWED_HOSTS='["mcp.example.com"]'
export FASTMCP_HTTP_ALLOWED_ORIGINS='["https://app.example.com"]'
```

Use `host_origin_protection="auto"` to protect localhost-bound direct servers while allowing ASGI, serverless, and reverse-proxy deployments to keep their existing Host handling unless they configure explicit trust rules. The default `host_origin_protection=False` disables the request guard: FastMCP then provides no Host/Origin validation or DNS-rebinding protection for this endpoint. This reduces protection compared with `True`; if you rely on a reverse proxy for these checks, you must configure and enforce them there. Authentication and CORS serve separate purposes and do not replace Host/Origin validation.

### Gateway Routing Headers

<VersionBadge version="4.0.0" />

A gateway, load balancer, or reverse proxy in front of your MCP server often needs to route a request before it reads the JSON-RPC body — the body may be an SSE stream, or the gateway may simply want to avoid parsing it. On a connection that negotiates the modern `2026-07-28` protocol, Streamable HTTP clients built on the MCP Python SDK (including FastMCP's own client) attach routing information to each request as HTTP headers so an intermediary can dispatch on headers alone:

- `Mcp-Method` carries the JSON-RPC method (for example `tools/call`) on every request.
- `Mcp-Name` carries the target's name on named operations — the tool name for `tools/call`, the prompt name for `prompts/get`, the resource URI for `resources/read`.
- `Mcp-Param-*` carries selected argument values for a `tools/call`, one header per opted-in parameter.

FastMCP's HTTP transport neither strips nor rewrites these headers, so a gateway sees them exactly as the client sent them. The `Host`/`Origin` request guard inspects only `Host` and `Origin` and leaves the routing headers untouched.

<Warning>
These headers are a feature of the modern `2026-07-28` protocol. A client connected over an earlier protocol revision — including one running in legacy mode or one that has fallen back to a legacy server — sends no routing headers at all. Design gateway routing to require the headers rather than assume their presence: if a request arrives without them, fall back to inspecting the body or route it to a default backend, rather than dropping it.
</Warning>

To expose an argument as an `Mcp-Param-*` header, annotate the parameter with the `x-mcp-header` JSON Schema extension. FastMCP carries the annotation into the tool's advertised input schema, and a conforming client mirrors the argument into a header named `Mcp-Param-<token>`:

```python
from typing import Annotated

from pydantic import Field

from fastmcp import FastMCP

mcp = FastMCP("My Server")

@mcp.tool
def query_tenant(
    tenant: Annotated[str, Field(json_schema_extra={"x-mcp-header": "Tenant"})],
    sql: str,
) -> str:
    """A call to this tool sends the tenant value as an `Mcp-Param-Tenant` header."""
    ...
```

A gateway can now route on `Mcp-Param-Tenant` — for example, pinning each tenant to a dedicated backend — without inspecting the request body. The annotation is only permitted on `string`, `integer`, and `boolean` parameters. These headers advertise routing intent; treat them as untrusted hints, since the server still validates the request body as the source of truth.

<Tip>
When you put a FastMCP [proxy](/servers/providers/proxy) in front of another server, the proxy re-advertises each backend tool's `x-mcp-header` annotation, so routing headers work across the proxy hop as well. The headers themselves are regenerated per hop rather than forwarded verbatim, since each describes a single HTTP request.
</Tip>

### Health Checks

Health check endpoints are essential for monitoring your deployed server and ensuring it's responding correctly. FastMCP allows you to add custom routes alongside your MCP endpoints, making it easy to implement health checks that work with both deployment approaches.

```python
from starlette.requests import Request
from starlette.responses import JSONResponse

from fastmcp import FastMCP

mcp = FastMCP("My Server")


@mcp.custom_route("/health", methods=["GET"])
async def health_check(request: Request) -> JSONResponse:
    return JSONResponse({"status": "healthy", "service": "mcp-server"})
```

This health endpoint will be available at `http://localhost:8000/health` and can be used by load balancers, monitoring systems, or deployment platforms to verify your server is running.

<Note>
Custom routes are never protected by the server's authentication middleware, even when an `AuthProvider` is configured. This is by design — the primary use case for custom routes is unauthenticated operational endpoints like health checks and readiness probes. If you need authenticated HTTP endpoints alongside your MCP server, [mount it in a FastAPI app](/integrations/fastapi) and use FastAPI's `Depends()` for auth on your routes.
</Note>

### Custom Middleware


<VersionBadge version="2.3.2" />

Add custom Starlette middleware to your FastMCP ASGI apps:

```python
from fastmcp import FastMCP
from starlette.middleware import Middleware
from starlette.middleware.cors import CORSMiddleware

# Create your FastMCP server
mcp = FastMCP("MyServer")

# Define middleware
middleware = [
    Middleware(
        CORSMiddleware,
        allow_origins=["*"],
        allow_methods=["*"],
        allow_headers=["*"],
    )
]

# Create ASGI app with middleware
http_app = mcp.http_app(middleware=middleware)
```

### CORS for Browser-Based Clients

<Tip>
Most MCP clients, including those that you access through a browser like ChatGPT or Claude, don't need CORS configuration. Only enable CORS if you're working with an MCP client that connects directly from a browser, such as debugging tools or inspectors.
</Tip>

CORS (Cross-Origin Resource Sharing) is needed when JavaScript running in a web browser connects directly to your MCP server. This is different from using an LLM through a browser—in that case, the browser connects to the LLM service, and the LLM service connects to your MCP server (no CORS needed).

Host and Origin protection runs before CORS when it is active for a request. Add browser client origins to `allowed_origins` so trusted browser requests reach the CORS middleware, then configure CORS to let browser JavaScript read the MCP response headers it needs. Setting `allowed_origins` trusts the request; it does not emit `Access-Control-Allow-Origin` or other CORS response headers.

Browser-based MCP clients that need CORS include:

- **MCP Inspector** - Browser-based debugging tool for testing MCP servers
- **Custom browser-based MCP clients** - If you're building a web app that directly connects to MCP servers

For these scenarios, add CORS middleware with the specific headers required for MCP protocol:

```python
from fastmcp import FastMCP
from starlette.middleware import Middleware
from starlette.middleware.cors import CORSMiddleware

mcp = FastMCP("MyServer")

# Configure CORS for browser-based clients
middleware = [
    Middleware(
        CORSMiddleware,
        allow_origins=["*"],  # Allow all origins; use specific origins for security
        allow_methods=["GET", "POST", "DELETE", "OPTIONS"],
        allow_headers=[
            "mcp-protocol-version",
            "mcp-session-id",
            "mcp-method",
            "mcp-name",
            "Authorization",
            "Content-Type",
        ],
        expose_headers=["mcp-session-id"],
    )
]

app = mcp.http_app(middleware=middleware)
```

**Key configuration details:**

- **`allow_origins`**: Specify exact origins (e.g., `["http://localhost:3000"]`) rather than `["*"]` for production deployments
- **`allow_headers`**: Must include `mcp-protocol-version`, `mcp-session-id`, and `Authorization` (for authenticated servers). Clients on the `2026-07-28` protocol also send the `mcp-method` and `mcp-name` [routing headers](#gateway-routing-headers), plus one `Mcp-Param-*` header for each tool parameter annotated with `x-mcp-header`; list those too
- **`expose_headers`**: Must include `mcp-session-id` so JavaScript can read the session ID from responses and send it in subsequent requests

Without `expose_headers=["mcp-session-id"]`, browsers will receive the session ID but JavaScript won't be able to access it, causing session management to fail.

<Warning>
**Production Security**: Never use `allow_origins=["*"]` in production. Specify the exact origins of your browser-based clients. Using wildcards exposes your server to unauthorized access from any website.
</Warning>

### SSE Polling for Long-Running Operations

<VersionBadge version="2.14.0" />

<Note>
This feature only applies to the **StreamableHTTP transport** (the default for `http_app()`). It does not apply to the legacy SSE transport (`transport="sse"`).
</Note>

When running tools that take a long time to complete, you may encounter issues with load balancers or proxies terminating connections that stay idle too long. [SEP-1699](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1699) introduces SSE polling to solve this by allowing the server to gracefully close connections and have clients automatically reconnect.

To enable SSE polling, configure an `EventStore` when creating your HTTP application:

```python
import asyncio

from fastmcp import FastMCP, Context
from fastmcp.server.event_store import EventStore

mcp = FastMCP("My Server")


async def do_expensive_work() -> None:
    await asyncio.sleep(1)


@mcp.tool
async def long_running_task(ctx: Context) -> str:
    """A task that takes several minutes to complete."""
    for i in range(100):
        await ctx.report_progress(i, 100)

        # Periodically close the connection to avoid load balancer timeouts
        # Client will automatically reconnect and resume receiving progress
        if i % 30 == 0 and i > 0:
            await ctx.close_sse_stream()

        await do_expensive_work()

    return "Done!"

# Configure with EventStore for resumability
event_store = EventStore()
app = mcp.http_app(
    event_store=event_store,
    retry_interval=2000,  # Client reconnects after 2 seconds
)
```

**How it works:**

1. When `event_store` is configured, the server stores all events (progress updates, results) with unique IDs
2. Calling `ctx.close_sse_stream()` gracefully closes the HTTP connection
3. The client automatically reconnects with a `Last-Event-ID` header
4. The server replays any events the client missed during the disconnection

The `retry_interval` parameter (in milliseconds) controls how long clients wait before reconnecting. Choose a value that balances responsiveness with server load.

<Note>
`close_sse_stream()` is a no-op if called without an `EventStore` configured, so you can safely include it in tools that may run in different deployment configurations.
</Note>

#### Custom Storage Backends

By default, `EventStore` uses in-memory storage. For production deployments with multiple server instances, you can provide a custom storage backend using the `key_value` package:

```python
from fastmcp import FastMCP
from fastmcp.server.event_store import EventStore
from key_value.aio.stores.redis import RedisStore

mcp = FastMCP("My Server")

# Use Redis for distributed deployments
redis_store = RedisStore(url="redis://localhost:6379")
event_store = EventStore(
    storage=redis_store,
    max_events_per_stream=100,  # Keep last 100 events per stream
    ttl=3600,  # Events expire after 1 hour
)

app = mcp.http_app(event_store=event_store)
```

## Integration with Web Frameworks

If you already have a web application running, you can add MCP capabilities by mounting a FastMCP server as a sub-application. This allows you to expose MCP tools alongside your existing API endpoints, sharing the same domain and infrastructure. The MCP server becomes just another route in your application, making it easy to manage and deploy.

### Mounting in Starlette

Mount your FastMCP server in a Starlette application:

```python
from fastmcp import FastMCP
from starlette.applications import Starlette
from starlette.routing import Mount

# Create your FastMCP server
mcp = FastMCP("MyServer")

@mcp.tool
def analyze(data: str) -> dict:
    return {"result": f"Analyzed: {data}"}

# Create the ASGI app
mcp_app = mcp.http_app(path="/mcp")

# Create a Starlette app and mount the MCP server
app = Starlette(
    routes=[
        Mount("/mcp-server", app=mcp_app),
        # Add other routes as needed
    ],
    lifespan=mcp_app.lifespan,
)
```

The MCP endpoint will be available at `/mcp-server/mcp` of the resulting Starlette app.

<Warning>
For Streamable HTTP transport, you **must** pass the lifespan context from the FastMCP app to the resulting Starlette app, as nested lifespans are not recognized. Otherwise, the FastMCP server's session manager will not be properly initialized.
</Warning>

#### Nested Mounts

You can create complex routing structures by nesting mounts:

```python
from fastmcp import FastMCP
from starlette.applications import Starlette
from starlette.routing import Mount

# Create your FastMCP server
mcp = FastMCP("MyServer")

# Create the ASGI app
mcp_app = mcp.http_app(path="/mcp")

# Create nested application structure
inner_app = Starlette(routes=[Mount("/inner", app=mcp_app)])
app = Starlette(
    routes=[Mount("/outer", app=inner_app)],
    lifespan=mcp_app.lifespan,
)
```

In this setup, the MCP server is accessible at the `/outer/inner/mcp` path.

### FastAPI Integration

For FastAPI-specific integration patterns including both mounting MCP servers into FastAPI apps and generating MCP servers from FastAPI apps, see the [FastAPI Integration guide](/integrations/fastapi).

Here's a quick example showing how to add MCP to an existing FastAPI application:

```python
from fastapi import FastAPI
from fastmcp import FastMCP

# Create your MCP server
mcp = FastMCP("API Tools")

@mcp.tool
def query_database(query: str) -> dict:
    """Run a database query"""
    return {"result": "data"}

# Create the MCP ASGI app with path="/" since we'll mount at /mcp
mcp_app = mcp.http_app(path="/")

# Create FastAPI app with MCP lifespan (required for session management)
api = FastAPI(lifespan=mcp_app.lifespan)

@api.get("/api/status")
def status():
    return {"status": "ok"}

# Mount MCP at /mcp
api.mount("/mcp", mcp_app)

# Run with: uvicorn app:api --host 0.0.0.0 --port 8000
```

Your existing API remains at `http://localhost:8000/api` while MCP is available at `http://localhost:8000/mcp`.

<Warning>
Just like with Starlette, you **must** pass the lifespan from the MCP app to FastAPI. Without this, the session manager won't initialize properly and requests will fail.
</Warning>

## Mounting Authenticated Servers

<VersionBadge version="2.13.0" />

<Tip>
This section only applies if you're **mounting an OAuth-protected FastMCP server under a path prefix** (like `/api`) inside another application using `Mount()`.

If you're deploying your FastMCP server at root level without any `Mount()` prefix, the well-known routes are automatically included in `mcp.http_app()` and you don't need to do anything special.
</Tip>

OAuth specifications (RFC 8414 and RFC 9728) require discovery metadata to be accessible at well-known paths under the root level of your domain. When you mount an OAuth-protected FastMCP server under a path prefix like `/api`, this creates a routing challenge: your operational OAuth endpoints move under the prefix, but discovery endpoints must remain at the root.

<Warning>
**Common Mistakes to Avoid:**

1. **Forgetting to mount `.well-known` routes at root** - FastMCP cannot do this automatically when your server is mounted under a path prefix. You must explicitly mount well-known routes at the root level.

2. **Including mount prefix in both base_url AND mcp_path** - The mount prefix (like `/api`) should only be in `base_url`, not in `mcp_path`. Otherwise you'll get double paths.

   ✅ **Correct:**
   ```python
   base_url = "http://localhost:8000/api"
   mcp_path = "/mcp"
   # Result: /api/mcp
   ```

   ❌ **Wrong:**
   ```python
   base_url = "http://localhost:8000/api"
   mcp_path = "/api/mcp"
   # Result: /api/api/mcp (double prefix!)
   ```

Follow the configuration instructions below to set up mounting correctly.
</Warning>

<Warning>
**CORS Middleware Conflicts:**

If you're integrating FastMCP into an existing application with its own CORS middleware, be aware that layering CORS middleware can cause conflicts (such as 404 errors on `.well-known` routes or OPTIONS requests).

FastMCP and the MCP SDK already handle CORS for OAuth routes. If you need CORS on your own application routes, consider using the sub-app pattern: mount FastMCP and your routes as separate apps, each with their own middleware, rather than adding application-wide CORS middleware.
</Warning>

### Route Types

OAuth-protected MCP servers expose two categories of routes:

**Operational routes** handle the OAuth flow and MCP protocol:
- `/authorize` - OAuth authorization endpoint
- `/token` - Token exchange endpoint
- `/auth/callback` - OAuth callback handler
- `/mcp` - MCP protocol endpoint

**Discovery routes** provide metadata for OAuth clients:
- `/.well-known/oauth-authorization-server` - Authorization server metadata
- `/.well-known/oauth-protected-resource/*` - Protected resource metadata

When you mount your MCP app under a prefix, operational routes move with it, but discovery routes must stay at root level for RFC compliance.

### Configuration Parameters

Three parameters control where routes are located and how they combine:

**`base_url`** tells clients where to find operational endpoints. This includes any Starlette `Mount()` path prefix (e.g., `/api`):

```python
base_url="http://localhost:8000/api"  # Includes mount prefix
```

**`mcp_path`** is the internal FastMCP endpoint path, which gets appended to `base_url`:

```python
mcp_path="/mcp"  # Internal MCP path, NOT the mount prefix
```

**`issuer_url`** (optional) controls the authorization server identity for OAuth discovery. Defaults to `base_url`. It sets the `issuer` advertised in the authorization server metadata and the `iss` on issued tokens, while the endpoints in that metadata continue to point at `base_url`.

```python
# Usually not needed - just set base_url and it works
issuer_url="http://localhost:8000"  # Only if you want root-level discovery
```

When `issuer_url` has a path (either explicitly or by defaulting from `base_url`), FastMCP creates path-aware discovery routes per RFC 8414. For example, if `base_url` is `http://localhost:8000/api`, the authorization server metadata will be at `/.well-known/oauth-authorization-server/api`.

**Key Invariant:** `base_url + mcp_path = actual externally-accessible MCP URL`

Example:
- `base_url`: `http://localhost:8000/api` (mount prefix `/api`)
- `mcp_path`: `/mcp` (internal path)
- Result: `http://localhost:8000/api/mcp` (final MCP endpoint)

Note that the mount prefix (`/api` from `Mount("/api", ...)`) goes in `base_url`, while `mcp_path` is just the internal MCP route. Don't include the mount prefix in both places or you'll get `/api/api/mcp`.

### Mounting Strategy

When mounting an OAuth-protected server under a path prefix, declare your URLs upfront to make the relationships clear:

```python
from fastmcp import FastMCP
from fastmcp.server.auth.providers.github import GitHubProvider
from starlette.applications import Starlette
from starlette.routing import Mount

# Define the routing structure
ROOT_URL = "http://localhost:8000"
MOUNT_PREFIX = "/api"
MCP_PATH = "/mcp"
```

Create the auth provider with `base_url`:

```python
auth = GitHubProvider(
    client_id="your-client-id",
    client_secret="your-client-secret",
    base_url=f"{ROOT_URL}{MOUNT_PREFIX}",  # Operational endpoints under prefix
    # issuer_url defaults to base_url - path-aware discovery works automatically
)
```

Create the MCP app, which generates operational routes at the specified path:

```python
mcp = FastMCP("Protected Server", auth=auth)
mcp_app = mcp.http_app(path=MCP_PATH)
```

Retrieve the discovery routes from the auth provider. The `mcp_path` argument should match the path used when creating the MCP app:

```python
well_known_routes = auth.get_well_known_routes(mcp_path=MCP_PATH)
```

Finally, mount everything in the Starlette app with discovery routes at root and the MCP app under the prefix:

```python
app = Starlette(
    routes=[
        *well_known_routes,  # Discovery routes at root level
        Mount(MOUNT_PREFIX, app=mcp_app),  # Operational routes under prefix
    ],
    lifespan=mcp_app.lifespan,
)
```

This configuration produces the following URL structure:

- MCP endpoint: `http://localhost:8000/api/mcp`
- OAuth authorization: `http://localhost:8000/api/authorize`
- OAuth callback: `http://localhost:8000/api/auth/callback`
- Authorization server metadata: `http://localhost:8000/.well-known/oauth-authorization-server/api`
- Protected resource metadata: `http://localhost:8000/.well-known/oauth-protected-resource/api/mcp`

Both discovery endpoints use path-aware URLs per RFC 8414 and RFC 9728, matching the `base_url` path.

### Complete Example

Here's a complete working example showing all the pieces together:

```python
from fastmcp import FastMCP
from fastmcp.server.auth.providers.github import GitHubProvider
from starlette.applications import Starlette
from starlette.routing import Mount
import uvicorn

# Define routing structure
ROOT_URL = "http://localhost:8000"
MOUNT_PREFIX = "/api"
MCP_PATH = "/mcp"

# Create OAuth provider
auth = GitHubProvider(
    client_id="your-client-id",
    client_secret="your-client-secret",
    base_url=f"{ROOT_URL}{MOUNT_PREFIX}",
    # issuer_url defaults to base_url - path-aware discovery works automatically
)

# Create MCP server
mcp = FastMCP("Protected Server", auth=auth)

@mcp.tool
def analyze(data: str) -> dict:
    return {"result": f"Analyzed: {data}"}

# Create MCP app
mcp_app = mcp.http_app(path=MCP_PATH)

# Get discovery routes for root level
well_known_routes = auth.get_well_known_routes(mcp_path=MCP_PATH)

# Assemble the application
app = Starlette(
    routes=[
        *well_known_routes,
        Mount(MOUNT_PREFIX, app=mcp_app),
    ],
    lifespan=mcp_app.lifespan,
)

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)
```

For more details on OAuth authentication, see the [Authentication guide](/servers/auth/authentication).

## Production Deployment

### Running with Uvicorn

When deploying to production, you'll want to optimize your server for performance and reliability. Uvicorn provides several options to improve your server's capabilities:

```bash
# Run with basic configuration
uvicorn app:app --host 0.0.0.0 --port 8000

# Run with multiple workers for production (requires stateless mode - see below)
uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4
```

### Horizontal Scaling

<VersionBadge version="2.10.2" />

When deploying FastMCP behind a load balancer or running multiple server instances, you need to understand how the HTTP transport handles sessions and configure your server appropriately.

#### Understanding Sessions

By default, FastMCP's Streamable HTTP transport maintains server-side sessions. A session holds the context a server keeps across multiple requests from the same client, and it carries the handshake-era back-channel that server-initiated requests like [elicitation](/servers/elicitation) push down.

This works perfectly for single-instance deployments. However, sessions are stored in memory on each server instance, which creates challenges when scaling horizontally.

#### Without Stateless Mode

When running multiple server instances behind a load balancer (Traefik, nginx, HAProxy, Kubernetes, etc.), requests from the same client may be routed to different instances:

1. Client connects to Instance A → session created on Instance A
2. Next request routes to Instance B → session doesn't exist → **request fails**

You might expect sticky sessions (session affinity) to solve this, but they don't work reliably with MCP clients.

<Warning>
**Why sticky sessions don't work:** Most MCP clients—including Cursor and Claude Code—use `fetch()` internally and don't properly forward `Set-Cookie` headers. Without cookies, load balancers can't identify which instance should handle subsequent requests. This is a limitation in how these clients implement HTTP, not something you can fix with load balancer configuration.
</Warning>

#### Enabling Stateless Mode

For horizontally scaled deployments, enable stateless HTTP mode. In stateless mode, each request creates a fresh transport context, eliminating the need for session affinity entirely.

**Option 1: Via `http_app()`**

```python
from fastmcp import FastMCP

mcp = FastMCP("My Server")

@mcp.tool
def process(data: str) -> str:
    return f"Processed: {data}"

app = mcp.http_app(stateless_http=True)
```

**Option 2: Via `run()`**

```python
from fastmcp import FastMCP

mcp = FastMCP("My Server")

if __name__ == "__main__":
    mcp.run(transport="http", stateless_http=True)
```

**Option 3: Via environment variable**

```bash
FASTMCP_STATELESS_HTTP=true uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4
```

### Environment Variables

Production deployments should never hardcode sensitive information like API keys or authentication tokens. Instead, use environment variables to configure your server at runtime. This keeps your code secure and makes it easy to deploy the same code to different environments with different configurations.

Here's an example using static token authentication for development (OAuth is recommended for production):

```python
import os
from fastmcp import FastMCP
from fastmcp.server.auth import StaticTokenVerifier

# Read configuration from environment
auth_token = os.environ.get("MCP_AUTH_TOKEN")
if auth_token:
    auth = StaticTokenVerifier(tokens={auth_token: {"sub": "admin", "client_id": "cli"}})
    mcp = FastMCP("Production Server", auth=auth)
else:
    mcp = FastMCP("Production Server")

app = mcp.http_app()
```

Deploy with your secrets safely stored in environment variables:
```bash
MCP_AUTH_TOKEN=secret uvicorn app:app --host 0.0.0.0 --port 8000
```

### OAuth Token Security

<VersionBadge version="2.13.0" />

If you're using the [OAuth Proxy](/servers/auth/oauth-proxy), FastMCP issues its own JWT tokens to clients instead of forwarding upstream provider tokens. This maintains proper OAuth 2.0 token boundaries.

**Default Behavior (Development Only):**

By default, FastMCP automatically manages cryptographic keys the same way on every platform: the signing key is deterministically derived from your OAuth client secret, so it survives server restarts as long as the secret doesn't change. Suitable **only** for development and local testing.

This automatic approach is convenient for development but not suitable for production deployments.

**For Production:**

Production requires explicit key management to ensure tokens survive restarts and can be shared across multiple server instances. This requires the following two things working together:

1. **Explicit JWT signing key** for signing tokens issued to clients
2. **Persistent network-accessible storage** for upstream tokens (wrapped in `FernetEncryptionWrapper` to encrypt sensitive data at rest)

**Configuration:**

Add two parameters to your auth provider:

```python {12-16}
import os

from cryptography.fernet import Fernet
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper

from fastmcp.server.auth.providers.github import GitHubProvider

auth = GitHubProvider(
    client_id=os.environ["GITHUB_CLIENT_ID"],
    client_secret=os.environ["GITHUB_CLIENT_SECRET"],
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(host="redis.example.com", port=6379),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    ),
    base_url="https://your-server.com"  # use HTTPS
)
```

Both parameters are required for production. Without an explicit signing key, tokens are signed with a key derived from the client secret, so rotating the client secret invalidates every issued token. Without persistent storage, tokens are local to the server and won't be trusted across hosts. **Wrap your storage backend in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without encryption, tokens are stored in plaintext.

For more details on the token architecture and key management, see [OAuth Proxy Key and Storage Management](/servers/auth/oauth-proxy#key-and-storage-management).

## Reverse Proxy (nginx)

In production, you'll typically run your FastMCP server behind a reverse proxy like nginx. A reverse proxy provides TLS termination, domain-based routing, static file serving, and an additional layer of security between the internet and your application.

### Running FastMCP as a Linux Service

Before configuring nginx, you need your FastMCP server running as a background service. A systemd unit file ensures your server starts automatically and restarts on failure.

Create a file at `/etc/systemd/system/fastmcp.service`:

```ini
[Unit]
Description=FastMCP Server
After=network.target

[Service]
User=www-data
Group=www-data
WorkingDirectory=/opt/fastmcp
ExecStart=/opt/fastmcp/.venv/bin/uvicorn app:app --host 127.0.0.1 --port 8000
Restart=always
RestartSec=5
Environment="PATH=/opt/fastmcp/.venv/bin"

[Install]
WantedBy=multi-user.target
```

Enable and start the service:

```bash
sudo systemctl daemon-reload
sudo systemctl enable fastmcp
sudo systemctl start fastmcp
```

This assumes your ASGI application is in `/opt/fastmcp/app.py` with a virtual environment at `/opt/fastmcp/.venv`. Adjust paths to match your deployment layout.

### nginx Configuration

FastMCP's Streamable HTTP transport uses Server-Sent Events (SSE) for streaming responses. This requires specific nginx settings to prevent buffering from breaking the event stream.

Create a site configuration at `/etc/nginx/sites-available/fastmcp`:

```nginx
server {
    listen 80;
    server_name mcp.example.com;

    # Redirect HTTP to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name mcp.example.com;

    ssl_certificate /etc/letsencrypt/live/mcp.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mcp.example.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_http_version 1.1;
        proxy_set_header Connection '';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # Required for SSE (Server-Sent Events) streaming
        proxy_buffering off;
        proxy_cache off;

        # Allow long-lived connections for streaming responses
        proxy_read_timeout 300s;
        proxy_send_timeout 300s;
    }
}
```

Enable the site and reload nginx:

```bash
sudo ln -s /etc/nginx/sites-available/fastmcp /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
```

Your FastMCP server is now accessible at `https://mcp.example.com/mcp`.

<Warning>
**SSE buffering is the most common issue.** If clients connect but never receive streaming responses (progress updates, tool results), verify that `proxy_buffering off` is set. Without it, nginx buffers the entire SSE stream and delivers it only when the connection closes, which breaks real-time communication.
</Warning>

### Key Considerations

When deploying FastMCP behind a reverse proxy, keep these points in mind:

- **Disable buffering**: SSE requires `proxy_buffering off` so events reach clients immediately. This is the single most important setting.
- **Increase timeouts**: The default nginx `proxy_read_timeout` is 60 seconds. Long-running MCP tools will cause the connection to drop. Set timeouts to at least 300 seconds, or higher if your tools run longer. For tools that may exceed any timeout, use [SSE Polling](#sse-polling-for-long-running-operations) to gracefully handle proxy disconnections.
- **Use HTTP/1.1**: Set `proxy_http_version 1.1` and `proxy_set_header Connection ''` to enable keep-alive connections between nginx and your server. Clearing the `Connection` header prevents clients from sending `Connection: close` to your upstream, which would break SSE streams. Both settings are required for proper SSE support.
- **Forward headers**: Pass `X-Forwarded-For` and `X-Forwarded-Proto` so your FastMCP server can determine the real client IP and protocol. This is important for logging and for OAuth redirect URLs.
- **TLS termination**: Let nginx handle TLS certificates (e.g., via Let's Encrypt with Certbot). Your FastMCP server can then run on plain HTTP internally.

### Mounting Under a Path Prefix

If you want your MCP server available at a subpath like `https://example.com/api/mcp` instead of at the root domain, adjust the nginx `location` block:

```nginx
location /api/ {
    proxy_pass http://127.0.0.1:8000/;
    proxy_http_version 1.1;
    proxy_set_header Connection '';
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    # Required for SSE streaming
    proxy_buffering off;
    proxy_cache off;
    proxy_read_timeout 300s;
    proxy_send_timeout 300s;
}
```

Note the trailing `/` on both `location /api/` and `proxy_pass http://127.0.0.1:8000/` — this ensures nginx strips the `/api` prefix before forwarding to your server.

If you serve the legacy SSE transport this way, also set Uvicorn's `root_path` to the stripped prefix (`--root-path /api`, or `uvicorn_config={"root_path": "/api"}` with `mcp.run()`) so the server advertises its message endpoint as `/api/messages/`. Only set `root_path` when a proxy strips the prefix: a client that connects directly to a server with `root_path` set gets the prefix twice and a 404.

If you're using OAuth authentication with a mount prefix, see [Mounting Authenticated Servers](#mounting-authenticated-servers) for additional configuration.

## Testing Your Deployment

Once your server is deployed, connect to its URL with the [FastMCP client](/clients/client) to confirm it is reachable and lists the tools you expect. To test your server's behavior in code, see [Testing](/servers/testing).

## Hosting Your Server

This guide has shown you how to create an HTTP-accessible MCP server, but you'll still need a hosting provider to make it available on the internet. Your FastMCP server can run anywhere that supports Python web applications:

- **Cloud VMs** (AWS EC2, Google Compute Engine, Azure VMs)
- **Container platforms** (Cloud Run, Container Instances, ECS)  
- **Platform-as-a-Service** (Railway, Render, Vercel)
- **Edge platforms** (Cloudflare Workers)
- **Kubernetes clusters** (self-managed or managed)

The key requirements are Python 3.11+ support and the ability to expose an HTTP port. Most providers will require you to package your server (requirements.txt, Dockerfile, etc.) according to their deployment format. For managed, zero-configuration deployment, see [FastMCP Gateway](/deployment/fastmcp-gateway).

---

### Deployment Running Server (`docs/deployment/running-server.mdx`)

---
title: Running Your Server
sidebarTitle: Running Your Server
description: Learn how to run your FastMCP server locally for development and testing
icon: circle-play
---

import { VersionBadge } from '/snippets/version-badge.mdx'

FastMCP servers can be run in different ways depending on your needs. This guide focuses on running servers locally for development and testing. For production deployment to a URL, see the [HTTP Deployment](/deployment/http) guide.

## The `run()` Method

Every FastMCP server needs to be started to accept connections. The simplest way to run a server is by calling the `run()` method on your FastMCP instance. This method starts the server and blocks until it's stopped, handling all the connection management for you.

<Tip>
For maximum compatibility, it's best practice to place the `run()` call within an `if __name__ == "__main__":` block. This ensures the server starts only when the script is executed directly, not when imported as a module.
</Tip>

```python {9-10} my_server.py
from fastmcp import FastMCP

mcp = FastMCP(name="MyServer")

@mcp.tool
def hello(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run()
```

You can now run this MCP server by executing `python my_server.py`.

## Transport Protocols

MCP servers communicate with clients through different transport protocols. Think of transports as the "language" your server speaks to communicate with clients. FastMCP supports three main transport protocols, each designed for specific use cases and deployment scenarios.

The choice of transport determines how clients connect to your server, what network capabilities are available, and how many clients can connect simultaneously. Understanding these transports helps you choose the right approach for your application.

### STDIO Transport (Default)

STDIO (Standard Input/Output) is the default transport for FastMCP servers. When you call `run()` without arguments, your server uses STDIO transport. This transport communicates through standard input and output streams, making it perfect for command-line tools and desktop applications like Claude Desktop.

With STDIO transport, the client spawns a new server process for each session and manages its lifecycle. The server reads MCP messages from stdin and writes responses to stdout. This is why STDIO servers don't stay running - they're started on-demand by the client.

```python
from fastmcp import FastMCP

mcp = FastMCP("MyServer")

@mcp.tool
def hello(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run()  # Uses STDIO transport by default
```

STDIO is ideal for:
- Local development and testing
- Claude Desktop integration
- Command-line tools
- Single-user applications

### HTTP Transport (Streamable)

HTTP transport turns your MCP server into a web service accessible via a URL. This transport uses the Streamable HTTP protocol, which allows clients to connect over the network. Unlike STDIO where each client gets its own process, an HTTP server can handle multiple clients simultaneously.

The Streamable HTTP protocol provides full bidirectional communication between client and server, supporting all MCP operations including streaming responses. This makes it the recommended choice for network-based deployments.

To use HTTP transport, specify it in the `run()` method along with networking options:

```python
from fastmcp import FastMCP

mcp = FastMCP("MyServer")

@mcp.tool
def hello(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    # Start an HTTP server on port 8000
    mcp.run(transport="http", host="127.0.0.1", port=8000)
```

Your server is now accessible at `http://localhost:8000/mcp`. This URL is the MCP endpoint that clients will connect to. HTTP transport enables:
- Network accessibility
- Multiple concurrent clients
- Integration with web infrastructure
- Remote deployment capabilities

For production HTTP deployment with authentication and advanced configuration, see the [HTTP Deployment](/deployment/http) guide.

### SSE Transport (Legacy)

Server-Sent Events (SSE) transport was the original HTTP-based transport for MCP. While still supported for backward compatibility, it has limitations compared to the newer Streamable HTTP transport. SSE only supports server-to-client streaming, making it less efficient for bidirectional communication.

```python
from fastmcp import FastMCP

mcp = FastMCP("MyServer")

if __name__ == "__main__":
    mcp.run(transport="sse", host="127.0.0.1", port=8000)
```

We recommend using HTTP transport instead of SSE for all new projects. SSE remains available only for compatibility with older clients that haven't upgraded to Streamable HTTP.

### Choosing the Right Transport

Each transport serves different needs. STDIO is perfect when you need simple, local execution - it's what Claude Desktop and most command-line tools expect. HTTP transport is essential when you need network access, want to serve multiple clients, or plan to deploy your server remotely. SSE exists only for backward compatibility and shouldn't be used in new projects.

Consider your deployment scenario: Are you building a tool for local use? STDIO is your best choice. Need a centralized service that multiple clients can access? HTTP transport is the way to go.

## The FastMCP CLI

FastMCP provides a powerful command-line interface for running servers without modifying the source code. The CLI can automatically find and run your server with different transports, manage dependencies, and handle development workflows:

```bash
fastmcp run server.py
```

The CLI automatically finds a FastMCP instance in your file (named `mcp`, `server`, or `app`) and runs it with the specified options. This is particularly useful for testing different transports or configurations without changing your code.

### Dependency Management

The CLI integrates with `uv` to manage Python environments and dependencies:

```bash
# Run with a specific Python version
fastmcp run server.py --python 3.11

# Run with additional packages
fastmcp run server.py --with pandas --with numpy

# Run with dependencies from a requirements file
fastmcp run server.py --with-requirements requirements.txt

# Combine multiple options
fastmcp run server.py --python 3.12 --with httpx --transport http

# Run within a specific project directory
fastmcp run server.py --project /path/to/project
```

<Note>
When using `--python`, `--with`, `--project`, or `--with-requirements`, the server runs via `uv run` subprocess instead of using your local environment.
</Note>

### Passing Arguments to Servers

When servers accept command line arguments (using argparse, click, or other libraries), you can pass them after `--`:

```bash
fastmcp run config_server.py -- --config config.json
fastmcp run database_server.py -- --database-path /tmp/db.sqlite --debug
```

This is useful for servers that need configuration files, database paths, API keys, or other runtime options.

For more CLI features including development mode with the MCP Inspector, see the [CLI documentation](/cli/running).

### Auto-Reload for Development

<VersionBadge version="3.0.0" />

During development, you can use the `--reload` flag to automatically restart your server when source files change:

```bash
fastmcp run server.py --reload
```

The server watches the current directory and restarts when you save a source file. The watcher covers Python files along with common frontend, markup, style, config, and image files (`.js`, `.ts`, `.html`, `.css`, `.json`, `.toml`, `.svg`, and similar), so changes to app assets also trigger a restart.

```bash
# Watch specific directories for changes
fastmcp run server.py --reload --reload-dir ./src --reload-dir ./lib

# Combine with other options
fastmcp run server.py --reload --transport http --port 8080
```

<Note>
Auto-reload uses stateless mode to enable seamless restarts. For stdio transport, this is fully featured. For HTTP transport, handshake-era `ctx.elicit()` is not available during reload mode; the modern guard pattern (returning `InputRequiredResult`) needs no session back-channel and is unaffected.
</Note>

SSE transport does not support auto-reload due to session limitations. Use HTTP transport instead if you need both network access and auto-reload.

### Async Usage

FastMCP servers are built on async Python, but the framework provides both synchronous and asynchronous APIs to fit your application's needs. The `run()` method we've been using is actually a synchronous wrapper around the async server implementation.

For applications that are already running in an async context, FastMCP provides the `run_async()` method:

```python {10-12}
from fastmcp import FastMCP
import asyncio

mcp = FastMCP(name="MyServer")

@mcp.tool
def hello(name: str) -> str:
    return f"Hello, {name}!"

async def main():
    # Use run_async() in async contexts
    await mcp.run_async(transport="http", port=8000)

if __name__ == "__main__":
    asyncio.run(main())
```

<Warning>
The `run()` method cannot be called from inside an async function because it creates its own async event loop internally. If you attempt to call `run()` from inside an async function, you'll get an error about the event loop already running.

Always use `run_async()` inside async functions and `run()` in synchronous contexts.
</Warning>

Both `run()` and `run_async()` accept the same transport arguments, so all the examples above apply to both methods.

## Custom Routes

When using HTTP transport, you might want to add custom web endpoints alongside your MCP server. This is useful for health checks, status pages, or simple APIs. FastMCP lets you add custom routes using the `@custom_route` decorator:

```python
from fastmcp import FastMCP
from starlette.requests import Request
from starlette.responses import PlainTextResponse

mcp = FastMCP("MyServer")

@mcp.custom_route("/health", methods=["GET"])
async def health_check(request: Request) -> PlainTextResponse:
    return PlainTextResponse("OK")

@mcp.tool
def process(data: str) -> str:
    return f"Processed: {data}"

if __name__ == "__main__":
    mcp.run(transport="http")  # Health check at http://localhost:8000/health
```

Custom routes are served by the same web server as your MCP endpoint. They're available at the root of your domain while the MCP endpoint is at `/mcp`. For more complex web applications, consider [mounting your MCP server into a FastAPI or Starlette app](/deployment/http#integration-with-web-frameworks).

## Alternative Initialization Patterns

The `if __name__ == "__main__"` pattern works well for standalone scripts, but some deployment scenarios require different approaches. FastMCP handles these cases automatically.

### CLI-Only Servers

When using the FastMCP CLI, you don't need the `if __name__` block at all. The CLI will find your FastMCP instance and run it:

```python
# server.py
from fastmcp import FastMCP

mcp = FastMCP("MyServer")  # CLI looks for 'mcp', 'server', or 'app'

@mcp.tool
def process(data: str) -> str:
    return f"Processed: {data}"

# No if __name__ block needed - CLI will find and run 'mcp'
```

### ASGI Applications

For ASGI deployment (running with Uvicorn or similar), you'll want to create an ASGI application object. This approach is common in production deployments where you need more control over the server configuration:

```python
# app.py
from fastmcp import FastMCP

def create_app():
    mcp = FastMCP("MyServer")
    
    @mcp.tool
    def process(data: str) -> str:
        return f"Processed: {data}"
    
    return mcp.http_app()

app = create_app()  # Uvicorn will use this
```

See the [HTTP Deployment](/deployment/http) guide for more ASGI deployment patterns.

---

### Deployment Sandboxed Agents (`docs/deployment/sandboxed-agents.mdx`)

---
title: Sandboxed Agents
sidebarTitle: Sandboxed Agents
description: Expose MCP tools to isolated agents without giving the sandbox long-lived credentials.
icon: box-open
---

This guide is for deployments where an agent runs inside an isolated container, subprocess, or remote worker and still needs MCP access. In that setup, the sandbox itself becomes part of your trust boundary.

The core recommendation is simple: use FastMCP as the capability boundary. Run a remote FastMCP server, authenticate the sandbox with short-lived scoped credentials, and keep privileged credentials on the server side.

## When to Use This Pattern

This pattern is useful when:

- your agent runs in an ephemeral container or subprocess
- you do not want long-lived credentials inside that sandbox
- you need per-run, per-tenant, or per-job scoping
- the sandbox must call internal APIs, databases, or upstream MCP servers indirectly

If you are building a local desktop integration, STDIO and normal local configuration may be enough. This guide is for cases where the sandbox is isolated enough that secret distribution, credential lifetimes, and privilege boundaries become part of the design.

## What Changes in a Sandboxed Deployment

A desktop MCP client usually runs on a developer's machine and launches local servers with configuration the developer controls. A sandboxed agent is different:

- It often runs in an ephemeral container or subprocess.
- Its filesystem may be inspected after the fact.
- Its environment variables may be broader than you intend.
- You may launch many sandboxes concurrently for different users, tenants, or jobs.

That means convenience patterns that are acceptable locally become risky in sandboxes. Passing a GitHub token, database password, or cloud credentials directly into the sandbox creates a secret distribution problem you do not need to have.

The safer approach is to make your FastMCP server the only component with privileged access and let the sandbox call it over MCP.

## Recommended Architecture

Use this shape by default:

```mermaid
flowchart LR
    A["Sandboxed agent"] -->|"short-lived token"| B["FastMCP server"]
    B --> C["internal APIs"]
    B --> D["databases"]
    B --> E["other MCP servers"]
```

The sandbox gets:

- the MCP server URL
- a short-lived token scoped to its job, tenant, or run
- no long-lived upstream credentials

The FastMCP server does the privileged work:

- verifies the sandbox token
- authorizes the request from token claims, scopes, or other server-side policy
- exposes only the tools that sandbox should see
- talks to internal APIs, databases, or upstream MCP servers on the sandbox's behalf

The key design rule is simple:

<Tip>
Give the sandbox capabilities, not credentials.
</Tip>

With that boundary in place, the next questions are how the sandbox connects, how the server verifies and authorizes it, and how you design the tools the sandbox is allowed to call.

## Prefer HTTP for Sandboxed Agents

For sandboxes, prefer a remote HTTP server over a local STDIO server.

STDIO is still excellent for local development, but a remote HTTP server is usually the better production boundary for sandboxed agents because:

- authentication is explicit
- the server lifecycle is independent from the sandbox lifecycle
- secrets stay on the server
- one deployment can safely serve many sandboxes
- auditing and revocation happen in one place

This means the sandbox should connect as a client:

```python
from fastmcp import Client
from fastmcp.client.auth import BearerAuth

client = Client(
    "https://sandbox-tools.example.com/mcp",
    auth=BearerAuth("short-lived-sandbox-token"),
)
```

And your FastMCP server should run remotely:

```python
from fastmcp import FastMCP

mcp = FastMCP("Sandbox Tools")

if __name__ == "__main__":
    mcp.run(transport="http", host="0.0.0.0", port=8000)
```

For production transport setup, see [HTTP Deployment](/deployment/http).

## Use Short-Lived, Scoped Credentials

For sandboxed agents, it is usually cleaner to issue credentials for the sandbox session than to place long-lived upstream credentials directly inside the container.

In practice, that usually means issuing a short-lived bearer token for each sandbox, run, or tenant and validating it on your FastMCP server with a token verifier.

```python
from fastmcp import FastMCP
from fastmcp.server.auth.providers.jwt import JWTVerifier

auth = JWTVerifier(
    jwks_uri="https://auth.example.com/.well-known/jwks.json",
    issuer="https://auth.example.com",
    audience="sandbox-mcp",
)

mcp = FastMCP("Sandbox Tools", auth=auth)
```

The token should identify the sandbox's scope. Depending on your system, it may represent a job, a tenant, a run, or a user-authorized session. Useful claims often include:

- sandbox or run id
- tenant or installation id
- user or actor id when applicable
- expiration
- optional capability scopes

Avoid shared static tokens across many sandboxes. If one sandbox token leaks, you want the blast radius to be small and the lifetime to be short.

Token verification is only one half of the boundary. Authorization still belongs on the FastMCP server: use scopes, claims, middleware, or custom auth checks to decide which tools and resources that sandbox can actually access.

For example, you can verify the token globally and still require a narrower scope on a specific tool:

```python
from fastmcp import FastMCP
from fastmcp.server.auth import require_scopes
from fastmcp.server.auth.providers.jwt import JWTVerifier

auth = JWTVerifier(
    jwks_uri="https://auth.example.com/.well-known/jwks.json",
    issuer="https://auth.example.com",
    audience="sandbox-mcp",
)

mcp = FastMCP("Sandbox Tools", auth=auth)

@mcp.tool(auth=require_scopes("write:summary"))
def write_summary(content: str) -> str:
    return f"Stored summary with {len(content)} characters"
```

For validation patterns, see [Token Verification](/servers/auth/token-verification). For policy enforcement, see [Authorization](/servers/authorization).

## Expose Capabilities, Not Raw Access

The sandbox should not need:

- GitHub app private keys
- database passwords
- upstream OAuth client secrets
- cloud provider credentials

Instead, expose MCP tools that perform privileged work on the server side.

Good sandbox-facing tools tend to look like this:

- `get_recent_updates`
- `write_summary`
- `fetch_repo_context`
- `publish_review_comment`

These tools describe the capability the sandbox needs, not the low-level credentialed action required to perform it.

That distinction matters. A tool like `write_summary` lets the server decide where and how to persist the summary. A tool like `run_sql` or `call_internal_api` pushes privilege and policy into the sandbox where they are much harder to control.

Sandboxed agents behave best when those tools are narrow and structured:

```python
from fastmcp import FastMCP

mcp = FastMCP("Sandbox Tools")

@mcp.tool
def write_summary(content: str) -> str:
    """Store the final summary for the current run."""
    return f"Stored summary with {len(content)} characters"

@mcp.tool
def publish_review_comment(pr_number: int, body: str) -> str:
    """Queue a review comment for a specific pull request."""
    return f"Queued comment for PR #{pr_number}"
```

These are easier to audit, easier to authorize, and easier for agents to use reliably than a broad catch-all tool like `mutate_state(kind: str, payload: dict)`.

Narrow tools also let you express different policies per tool instead of creating one large privileged escape hatch.

## Use a Proxy When Upstream Systems Are More Privileged

If the sandbox needs access to other MCP servers or internal systems, put FastMCP in front of them instead of forwarding secrets into the sandbox.

This is where proxying becomes useful. Your public-facing FastMCP server can authenticate the sandbox, then forward allowed capabilities to upstream systems with stronger credentials.

Typical examples:

- a sandbox-safe MCP gateway in front of internal MCP servers
- a FastMCP layer in front of internal HTTP APIs
- a job-scoped server that fronts a Git provider, issue tracker, or storage system

If the upstream system is itself an MCP server, FastMCP's proxy support is a natural fit. See [MCP Proxy](/servers/providers/proxy).

## mcp.json for Sandboxed Clients

If your sandboxed agent is configured through `mcp.json`, keep that configuration minimal. Point it at the remote FastMCP server and pass only the values the sandbox actually needs.

```json
{
  "mcpServers": {
    "sandbox-tools": {
      "url": "https://sandbox-tools.example.com/mcp",
      "transport": "http"
    }
  }
}
```

In many systems, authentication is injected by the launcher or environment rather than hardcoded in `mcp.json`. That is usually the right tradeoff for sandboxes. Avoid baking long-lived credentials directly into generated config files, and avoid treating `mcp.json` as the place where secret material should live.

That is all this section needs to do: tell the sandbox where the server lives. Keep auth and secret handling elsewhere.

For configuration details, see [MCP.json](/integrations/mcp-json-configuration).

## Common Mistakes

The same few mistakes show up again and again in sandboxed deployments:

- passing long-lived API keys directly into the sandbox
- treating helper scripts in the sandbox as a security boundary
- exposing broad mutation tools instead of narrow capabilities
- using one shared token for every sandbox
- relying on STDIO inheritance for configuration in production

Each of these works at first. Each becomes painful once you have multiple tenants, multiple jobs, or an incident that requires revoking access quickly.

## Production Checklist

Before shipping a sandbox-facing FastMCP server, check these:

- The sandbox connects over HTTP, not with privileged local credentials.
- Tokens are short-lived and scoped to a run, tenant, or job.
- The FastMCP server verifies tokens on every request.
- Long-lived secrets stay on the server side.
- Tools are narrow, explicit, and structured.
- Upstream privileged systems sit behind the FastMCP server or proxy.
- Revocation and audit live at the server boundary, not inside the sandbox.

If you adopt those defaults, sandbox support stops being a special case and becomes a normal deployment pattern: isolated workers talk to a constrained FastMCP surface, and the server handles the privileged parts centrally.

---

### Deployment Server Configuration (`docs/deployment/server-configuration.mdx`)

---
title: "Project Configuration"
sidebarTitle: "Project Configuration"
description: Use fastmcp.json for portable, declarative project configuration
icon: file-code
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.12.0" />

FastMCP supports declarative configuration through `fastmcp.json` files. This is the canonical and preferred way to configure FastMCP projects, providing a single source of truth for server settings, dependencies, and deployment options that replaces complex command-line arguments.

The `fastmcp.json` file is designed to be a portable description of your server configuration that can be shared across environments and teams. When running from a `fastmcp.json` file, you can override any configuration values using CLI arguments.

## Overview

The `fastmcp.json` configuration file allows you to define all aspects of your FastMCP server in a structured, shareable format. Instead of remembering command-line arguments or writing shell scripts, you declare your server's configuration once and use it everywhere.

When you have a `fastmcp.json` file, running your server becomes as simple as:

```bash
# Run the server using the configuration
fastmcp run fastmcp.json

# Or if fastmcp.json exists in the current directory
fastmcp run
```

This configuration approach ensures reproducible deployments across different environments, from local development to production servers. It works seamlessly with Claude Desktop, VS Code extensions, and any MCP-compatible client.

## File Structure

The `fastmcp.json` configuration answers three fundamental questions about your server:

- **Source** = WHERE does your server code live?
- **Environment** = WHAT environment setup does it require?
- **Deployment** = HOW should the server run?

This conceptual model helps you understand the purpose of each configuration section and organize your settings effectively. The configuration file maps directly to these three concerns:

`source` is the *where*, `environment` the *what*, and `deployment` the *how*:

```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "type": "filesystem",
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "type": "uv",
    "python": ">=3.11",
    "dependencies": ["pandas", "numpy"]
  },
  "deployment": {
    "transport": "stdio",
    "log_level": "INFO"
  }
}
```

Only the `source` field is required. The `environment` and `deployment` sections are optional and provide additional configuration when needed. Both `type` fields shown above are optional too, defaulting to `"filesystem"` and `"uv"` respectively.

<Warning>
`fastmcp.json` is parsed as strict JSON, so it accepts no comments or trailing commas.
</Warning>

### JSON Schema Support

FastMCP provides JSON schemas for IDE autocomplete and validation. Add the schema reference to your `fastmcp.json` for enhanced developer experience:

```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  }
}
```

Two schema URLs are available:
- **Version-specific**: `https://gofastmcp.com/public/schemas/fastmcp.json/v1.json`
- **Latest version**: `https://gofastmcp.com/public/schemas/fastmcp.json/latest.json`

Modern IDEs like VS Code will automatically provide autocomplete suggestions, validation, and inline documentation when the schema is specified.

### Source Configuration

The source configuration determines **WHERE** your server code lives. It tells FastMCP how to find and load your server, whether it's a local Python file, a remote repository, or hosted in the cloud. This section is required and forms the foundation of your configuration.

<Card icon="code" title="Source">
<ParamField body="source" type="object" required>
  The server source configuration that determines where your server code lives.
  
  <ParamField body="type" type="string" default="filesystem">
    The source type identifier that determines which implementation to use. Currently supports `"filesystem"` for local files. Future releases will add support for `"git"` and `"cloud"` source types.
  </ParamField>
  
  <Expandable title="FileSystemSource">
    When `type` is `"filesystem"` (or omitted), the source points to a local Python file containing your FastMCP server:
    
    <ParamField body="path" type="string" required>
      Path to the Python file containing your FastMCP server. 
    </ParamField>
    
    <ParamField body="entrypoint" type="string">
      Name of the server instance or factory function within the module:
      - Can be a FastMCP server instance (e.g., `mcp = FastMCP("MyServer")`)
      - Can be a function with no arguments that returns a FastMCP server
      - If not specified, FastMCP searches for common names: `mcp`, `server`, or `app`
    </ParamField>
    
    **Example:**
    ```json
    "source": {
      "type": "filesystem",
      "path": "src/server.py",
      "entrypoint": "mcp"
    }
    ```
    
    Note: File paths are resolved relative to the configuration file's location.
  </Expandable>
</ParamField>
</Card>

<Note>
**Future Source Types**

Future releases will support additional source types:
- **Git repositories** (`type: "git"`) for loading server code directly from version control
- **FastMCP Gateway** (`type: "cloud"`) for hosted servers with automatic scaling and management
</Note>

### Environment Configuration

The environment configuration determines **WHAT** environment setup your server requires. It controls the build-time setup of your Python environment, ensuring your server runs with the exact Python version and dependencies it requires. This section creates isolated, reproducible environments across different systems.

FastMCP uses an extensible environment system with a base `Environment` class that can be implemented by different environment providers. Currently, FastMCP supports the `UVEnvironment` for Python environment management using `uv`'s powerful dependency resolver.

<Card icon="code" title="Environment">
<ParamField body="environment" type="object">
  Optional environment configuration. When specified, FastMCP uses the appropriate environment implementation to set up your server's runtime.
  
  <ParamField body="type" type="string" default="uv">
    The environment type identifier that determines which implementation to use. Currently supports `"uv"` for Python environments managed by uv. If omitted, defaults to `"uv"`.
  </ParamField>
  
  <Expandable title="UVEnvironment">
    When `type` is `"uv"` (or omitted), the environment uses uv to manage Python dependencies:
    
    <ParamField body="python" type="string">
      Python version constraint. Examples:
      - Exact version: `"3.12"`
      - Minimum version: `">=3.11"`
      - Version range: `">=3.11,<3.14"`
    </ParamField>
    
    <ParamField body="dependencies" type="list[str]">
      List of pip packages with optional version specifiers (PEP 508 format).
      ```json
      "dependencies": ["pandas>=2.0", "requests", "httpx"]
      ```
    </ParamField>
    
    <ParamField body="requirements" type="string">
      Path to a requirements.txt file, resolved relative to the config file location.
      ```json
      "requirements": "requirements.txt"
      ```
    </ParamField>
    
    <ParamField body="project" type="string">
      Path to a project directory containing pyproject.toml for uv project management.
      ```json
      "project": "."
      ```
    </ParamField>
    
    <ParamField body="editable" type="list[string]">
      List of paths to packages to install in editable/development mode. Useful for local development when you want changes to be reflected immediately. Supports multiple packages for monorepo setups or shared libraries.
      ```json
      "editable": ["."]
      ```
      Or with multiple packages:
      ```json
      "editable": [".", "../shared-lib", "/path/to/another-package"]
      ```
    </ParamField>
    
    **Example:**
    ```json
    "environment": {
      "type": "uv",
      "python": ">=3.11",
      "dependencies": ["pandas", "numpy"],
      "editable": ["."]
    }
    ```
    
    Note: When any UVEnvironment field is specified, FastMCP automatically creates an isolated environment using `uv` before running your server.
  </Expandable>
</ParamField>
</Card>

When environment configuration is provided, FastMCP:
1. Detects the environment type (defaults to `"uv"` if not specified)
2. Creates an isolated environment using the appropriate provider
3. Installs the specified dependencies
4. Runs your server in this clean environment

This build-time setup ensures your server always has the dependencies it needs, without polluting your system Python or conflicting with other projects.

<Note>
**Future Environment Types**

Similar to source types, future releases may support additional environment types for different runtime requirements, such as Docker containers or language-specific environments beyond Python.
</Note>

### Deployment Configuration

The deployment configuration controls **HOW** your server runs. It defines the runtime behavior including network settings, environment variables, and execution context. These settings determine how your server operates when it executes, from transport protocols to logging levels.

Environment variables are included in this section because they're runtime configuration that affects how your server behaves when it executes, not how its environment is built. The deployment configuration is applied every time your server starts, controlling its operational characteristics.

<Card icon="code" title="Deployment Fields">
<ParamField body="deployment" type="object">
  Optional runtime configuration for the server.
  
  <Expandable title="Deployment Fields">
    <ParamField body="transport" type="string" default="stdio">
      Protocol for client communication. `"http"` and `"streamable-http"` both select FastMCP's Streamable HTTP transport:
      - `"stdio"`: Standard input/output for desktop clients
      - `"http"`: Network-accessible Streamable HTTP server
      - `"streamable-http"`: Explicit alias for Streamable HTTP
      - `"sse"`: Server-sent events
    </ParamField>
    
    <ParamField body="host" type="string" default="127.0.0.1">
      Network interface to bind (HTTP transport only):
      - `"127.0.0.1"`: Local connections only
      - `"0.0.0.0"`: All network interfaces
    </ParamField>
    
    <ParamField body="port" type="integer" default="8000">
      Port number for HTTP transport. If omitted, FastMCP uses the server runtime default.
    </ParamField>
    
    <ParamField body="path" type="string" default="/mcp">
      URL path for the MCP endpoint when using HTTP transport. The default is `/mcp` for Streamable HTTP and `/sse` for SSE.
    </ParamField>
    
    <ParamField body="log_level" type="string" default="INFO">
      Server logging verbosity. Options:
      - `"DEBUG"`: Detailed debugging information
      - `"INFO"`: General informational messages
      - `"WARNING"`: Warning messages
      - `"ERROR"`: Error messages only
      - `"CRITICAL"`: Critical errors only
    </ParamField>
    
    <ParamField body="env" type="object">
      Environment variables to set when running the server. Supports `${VAR_NAME}` syntax for runtime interpolation.
      ```json
      "env": {
        "API_KEY": "secret-key",
        "DATABASE_URL": "postgres://${DB_USER}@${DB_HOST}/mydb"
      }
      ```
    </ParamField>
    
    <ParamField body="cwd" type="string">
      Working directory for the server process. Relative paths are resolved from the config file location.
    </ParamField>
    
    <ParamField body="args" type="list[str]">
      Command-line arguments to pass to the server, passed after `--` to the server's argument parser.
      ```json
      "args": ["--config", "server-config.json"]
      ```
    </ParamField>
  </Expandable>
</ParamField>
</Card>

#### Environment Variable Interpolation

The `env` field in deployment configuration supports runtime interpolation of environment variables using `${VAR_NAME}` syntax. This enables dynamic configuration based on your deployment environment:

```json
{
  "deployment": {
    "env": {
      "API_URL": "https://api.${ENVIRONMENT}.example.com",
      "DATABASE_URL": "postgres://${DB_USER}:${DB_PASS}@${DB_HOST}/myapp",
      "CACHE_KEY": "myapp_${ENVIRONMENT}_${VERSION}"
    }
  }
}
```

When the server starts, FastMCP replaces `${ENVIRONMENT}`, `${DB_USER}`, etc. with values from your system's environment variables. If a variable doesn't exist, the placeholder is preserved as-is.

For example, suppose your system has `ENVIRONMENT=production` and `DB_HOST=db.example.com`, and your configuration contains:

```json
{
  "deployment": {
    "env": {
      "API_URL": "https://api.${ENVIRONMENT}.example.com",
      "DB_HOST": "${DB_HOST}"
    }
  }
}
```

The server process then starts with these values:

```json
{
  "API_URL": "https://api.production.example.com",
  "DB_HOST": "db.example.com"
}
```

This feature is particularly useful for:
- Deploying the same configuration across development, staging, and production
- Keeping sensitive values out of configuration files
- Building dynamic URLs and connection strings
- Creating environment-specific prefixes or suffixes

## Usage with CLI Commands

FastMCP automatically detects and uses a file specifically named `fastmcp.json` in the current directory, making server execution simple and consistent. Files with FastMCP configuration format but different names are not auto-detected and must be specified explicitly:

```bash
# Auto-detect fastmcp.json in current directory
cd my-project
fastmcp run  # No arguments needed!

# Or specify a configuration file explicitly
fastmcp run prod.fastmcp.json

# Skip environment setup when already in a uv environment
fastmcp run fastmcp.json --skip-env

# Skip source preparation when source is already prepared
fastmcp run fastmcp.json --skip-source

# Skip both environment and source preparation
fastmcp run fastmcp.json --skip-env --skip-source
```

### Pre-building Environments

You can use `fastmcp project prepare` to create a persistent uv project with all dependencies pre-installed:

```bash
# Create a persistent environment
fastmcp project prepare fastmcp.json --output-dir ./env

# Use the pre-built environment to run the server
fastmcp run fastmcp.json --project ./env
```

This pattern separates environment setup (slow) from server execution (fast), useful for deployment scenarios.

### Using an Existing Environment

By default, FastMCP creates an isolated environment with `uv` based on your configuration. When you already have a suitable Python environment, use the `--skip-env` flag to skip environment creation:

```bash
fastmcp run fastmcp.json --skip-env
```

**When you already have an environment:**
- You're in an activated virtual environment with all dependencies installed
- You're inside a Docker container with pre-installed dependencies  
- You're in a CI/CD pipeline that pre-builds the environment
- You're using a system-wide installation with all required packages
- You're in a uv-managed environment (prevents infinite recursion)

This flag tells FastMCP: "I already have everything installed, just run the server."

### Using an Existing Source

When working with source types that require preparation (future support for git repositories or cloud sources), use the `--skip-source` flag when you already have the source code available:

```bash
fastmcp run fastmcp.json --skip-source
```

**When you already have the source:**
- You've previously cloned a git repository and don't need to re-fetch
- You have a cached copy of a cloud-hosted server
- You're in a CI/CD pipeline where source checkout is a separate step
- You're iterating locally on already-downloaded code

This flag tells FastMCP: "I already have the source code, skip any download/clone steps."

Note: For filesystem sources (local Python files), this flag has no effect since they don't require preparation.

The configuration file works with server-loading commands that explicitly accept FastMCP config files:
- **`run`** - Start the server in production mode
- **`dev inspector`** - Launch with the Inspector UI for development
- **`inspect`** - View server capabilities and configuration
- **`install`** - Install to Claude Desktop, Cursor, or another MCP client

`run`, `dev inspector`, and `inspect` search the current directory for a file named exactly `fastmcp.json` when you don't pass a file argument, so you can navigate to your project directory and run `fastmcp run` to start your server with all its configured settings. `install` requires an explicit path to the config file — it never searches.

### CLI Override Behavior

Command-line arguments take precedence over configuration file values, allowing ad-hoc adjustments without modifying the file:

```bash
# Config specifies port 8000, CLI overrides to 8080
fastmcp run fastmcp.json --port 8080

# Config specifies stdio, CLI overrides to HTTP
fastmcp run fastmcp.json --transport http

# Add extra dependencies not in config
fastmcp run fastmcp.json --with requests --with httpx
```

This precedence order enables:
- Quick testing of different settings
- Environment-specific overrides in deployment scripts
- Debugging with increased log levels
- Temporary configuration changes

### Custom Naming Patterns

You can use different configuration files for different environments:

- `fastmcp.json` - Default configuration
- `dev.fastmcp.json` - Development settings
- `prod.fastmcp.json` - Production settings
- `test_fastmcp.json` - Test configuration

Only a file named exactly `fastmcp.json` is auto-detected when you omit the path. Other FastMCP configuration files can use any `.json` name, but you must pass them explicitly.

## Examples

<Tabs>
<Tab title="Basic Configuration">

A minimal configuration for a simple server:

```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  }
}
```
This configuration explicitly specifies the server entrypoint (`mcp`), making it clear which server instance or factory function to use. Uses all defaults: STDIO transport, no special dependencies, standard logging.
</Tab>
<Tab title="Development Configuration">

A configuration optimized for local development:

```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "src/server.py",
    "entrypoint": "app"
  },
  "environment": {
    "type": "uv",
    "python": "3.12",
    "dependencies": ["fastmcp"],
    "editable": ["."]
  },
  "deployment": {
    "transport": "http",
    "host": "127.0.0.1",
    "port": 8000,
    "log_level": "DEBUG",
    "env": {
      "DEBUG": "true",
      "ENV": "development"
    }
  }
}
```
</Tab>
<Tab title="Production Configuration">

A production-ready configuration with full dependency management:

```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "app/main.py",
    "entrypoint": "mcp_server"
  },
  "environment": {
    "python": "3.11",
    "requirements": "requirements/production.txt",
    "project": "."
  },
  "deployment": {
    "transport": "http",
    "host": "0.0.0.0",
    "port": 3000,
    "path": "/api/mcp",
    "log_level": "INFO",
    "env": {
      "ENV": "production",
      "API_BASE_URL": "https://api.example.com",
      "DATABASE_URL": "postgresql://user:pass@db.example.com/prod"
    },
    "cwd": "/app",
    "args": ["--workers", "4"]
  }
}
```
</Tab>
<Tab title="Data Science Server">

Configuration for a data analysis server with scientific packages:

```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "analysis_server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "python": "3.11",
    "dependencies": [
      "pandas>=2.0",
      "numpy",
      "scikit-learn",
      "matplotlib",
      "jupyterlab"
    ]
  },
  "deployment": {
    "transport": "stdio",
    "env": {
      "MATPLOTLIB_BACKEND": "Agg",
      "DATA_PATH": "./datasets"
    }
  }
}
```
</Tab>
<Tab title="Multi-Environment Setup"> 

You can maintain multiple configuration files for different environments:

**dev.fastmcp.json**:
```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "deployment": {
    "transport": "http",
    "log_level": "DEBUG"
  }
}
```

**prod.fastmcp.json**:
```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "requirements": "requirements/production.txt"
  },
  "deployment": {
    "transport": "http",
    "host": "0.0.0.0",
    "log_level": "WARNING"
  }
}
```

Run different configurations:
```bash
fastmcp run dev.fastmcp.json   # Development
fastmcp run prod.fastmcp.json  # Production
```
</Tab>
</Tabs>

## Migrating from CLI Arguments

If you're currently using command-line arguments or shell scripts, migrating to `fastmcp.json` simplifies your workflow. Here's how common CLI patterns map to configuration:

**CLI Command**:
```bash
uv run --with pandas --with requests \
  fastmcp run server.py \
  --transport http \
  --port 8000 \
  --log-level INFO
```

**Equivalent fastmcp.json**:
```json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "dependencies": ["pandas", "requests"]
  },
  "deployment": {
    "transport": "http",
    "port": 8000,
    "log_level": "INFO"
  }
}
```

Now simply run:
```bash
fastmcp run  # Automatically finds and uses fastmcp.json
```

The configuration file approach provides better documentation, easier sharing, and consistent execution across different environments while maintaining the flexibility to override settings when needed.

---

### Development Contributing (`docs/development/contributing.mdx`)

---
title: "Contributing"
description: "Choose a contribution, set up FastMCP, and prepare it for review"
icon: code-pull-request
---

Identifying a real problem is often the most valuable contribution you can make to FastMCP. Start with a clear issue: a reproducible bug or a concrete use case that current behavior does not support. That report is a contribution on its own, and maintainers can handle the implementation. If your issue leads to a merged change implemented by a maintainer, you receive [contributor credit](#contributor-credit) for that change.

This guide covers which changes FastMCP accepts, how contributions enter review, and how to develop and validate a change.

Report vulnerabilities privately through the [security policy](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md). Community participation follows the [Code of Conduct](https://github.com/PrefectHQ/fastmcp/blob/main/CODE_OF_CONDUCT.md).

## Choose a contribution

A useful bug report states the problem, includes a minimal reproducible example, and explains the expected behavior. Search existing issues and pull requests first, including closed PRs: the contribution gate may have closed a proposal while it waits for assignment.

Simple, scoped bug fixes, documentation improvements, and authentication providers are welcome. Enhancements need a maintainer-approved design in an issue before implementation. Third-party integrations generally belong in a separate package. For a proposed in-repository community module, read [Contrib Modules](/patterns/contrib) and discuss its maintenance model first.

FastMCP prioritizes readable Python, clear APIs, and fixes at the source of a problem. A working implementation can still be unsuitable if it changes an intentional contract or adds a workaround that the framework must maintain indefinitely.

### Issues and assignment

External PRs must link an issue with an auto-close keyword such as `Fixes #123`. The author must also be assigned to that issue, unless it carries the `prs welcome` label. A PR that doesn't meet both conditions is closed automatically. The issue stays open as your report, and the PR reopens on its own once the link is present and a maintainer assigns you.

Assignment commits maintainers to reviewing a contribution, not to merging it. Assigning an author reruns the gate and can reopen their previously closed PR. Update that PR rather than opening a duplicate. The issue reporter has first claim on implementing the fix; an open issue does not by itself mean a maintainer has accepted a proposed solution.

Do not post comments just to claim an issue or ask to be assigned. A concise report, a scoped linked PR, or a substantive design discussion gives maintainers something concrete to evaluate. The gate exempts maintainers and trusted contributors. Draft PRs are checked when marked ready for review.

### Contributor credit

This policy recognizes community contributions. Maintainers are generally exempt from supplemental credit checks: reporting, reviewing, or backporting another maintainer's change does not require adding them as a contributor. Routine backports preserve existing community attribution without repeating the credit review.

If your issue leads to a merged change implemented by a maintainer, we credit you as a contributor to that change. This applies to bug reports, enhancement requests, and documentation issues. You do not need to write code, diagnose the root cause, or propose an implementation: identifying the problem or explaining the use case is a contribution.

Credit includes co-authorship of the merged commit and attribution alongside the PR author in the release notes. If this is your first contribution to FastMCP, you are included under **New Contributors** in the release that first includes the change. Maintainers and agents working on their behalf handle this as part of preparing, merging, and releasing the PR. Opening an issue does not guarantee that it will be implemented.

The PR author adds a `Co-authored-by` trailer to the implementation commit and the PR description, using an email associated with your GitHub account. Prefer your GitHub-provided noreply address; if your preferred identity is unclear, ask rather than guessing an email. Honor requests to omit attribution. Preserve attribution for anyone whose implementation work is carried forward, and credit each issue author whose report contributed to the change. Closing an unrelated or duplicate issue alone does not earn co-authorship.

The merging maintainer preserves those trailers through the chosen merge strategy and verifies the landed commit. For a squash merge, explicitly include them in the final squash commit message. The release author carries that recorded attribution into the release notes and verifies the preview, investigating individual PRs or issues only when credit appears missing or inconsistent. The same completed notes feed the GitHub release and docs changelog. A thank-you in the PR description alone does not fulfill this policy.

### Working with an agent

AI assistance is welcome under the same standards as other contributions. You remain responsible for understanding the change, verifying its behavior, and responding to review. Avoid generated boilerplate that obscures the problem or substitutes speculation for a reproduction.

Have your agent read [AGENTS.md](https://github.com/PrefectHQ/fastmcp/blob/main/AGENTS.md). It contains the required checks, repository conventions, and a table routing tasks to the [repository skills](https://github.com/PrefectHQ/fastmcp/tree/main/.agents/skills). Use the testing and review procedures on your own change before submitting it. Skills live in `.agents/skills/`.

## Set up the repository

Use Python 3.11 or newer and [uv](https://docs.astral.sh/uv/). Fork the repository for an external contribution, clone your fork, then install the workspace dependencies and commit hooks:

```bash
git clone https://github.com/YOUR-USERNAME/fastmcp.git
cd fastmcp
uv sync
uv run prek install
```

The workspace contains several distributions. Most framework code lives in `fastmcp_slim/fastmcp/`; `fastmcp_tasks/` and `fastmcp_remote/` hold the task and remote packages. Tests live under `tests/`, and the documentation source lives under `docs/`. Extend the tests nearest the behavior you change.

Target `main` for current development. Fixes specifically for older supported lines target their maintenance branch, such as `release/3.x` or `release/2.x`.

## Implement and verify

Establish what the public API promises before writing a regression test. A test that fails on existing code only demonstrates a difference; docs, protocol requirements, history, and maintainer decisions establish whether that difference is a bug. If the intended behavior is unclear, settle that question in the issue.

Keep the change scoped to one problem and fix the causal code path. Avoid speculative explanations, sweeping unrelated changes, and generated boilerplate; maintainers may close contributions that do not meet these requirements. Trace the callers and adjacent behavior that share it. In particular, preserve supported explicit overrides when changing a default. Use full type annotations, specific exceptions, and the surrounding code's conventions.

For a bug fix, run the regression on unchanged code and confirm it fails for the reported reason, then run it with the fix. Assert the actual result and relevant types. Exercise neighboring supported behavior as well. The [Testing Guide](/development/tests) covers fixtures, protocol tests, HTTP helpers, and subprocess tests.

Before committing, install dependencies and run the tests relevant to your change,
including neighboring behavior that shares its implementation. For example, a
skills change can use:

```bash
uv sync
uv run pytest tests/skills tests/utilities/test_skills.py -n 0
uv run prek run --files path/to/changed_file.py
```

Prek runs lint, formatting, typing, and other repository checks; pytest is separate. Hooks also run on commit. Fix failures before committing, and use a new commit rather than amending to repair a failed hook.

Broaden local testing when a concrete dependency or failure warrants it and the
check is expedient. Routine full-suite and platform-matrix runs belong in CI;
do not repeat them locally for each commit or PR in a stack. Run the full suite
locally when explicitly requested or when investigating a failure that requires
it. Repository-wide configuration changes may also need `uv run prek run --all-files`.

## Update documentation

Document new capabilities and changes to public behavior alongside the implementation. Explain the use case before the code, include imports, and keep examples runnable. Add new pages to `docs/docs.json` so they appear in navigation. When a setting changes, update `docs/more/settings.mdx`.

Edit source docstrings for API-reference changes. Do not manually edit `docs/python-sdk/`, `docs/public/schemas/`, or the generated MCP server configuration schema; automation maintains those outputs. The `docs/v2/` and `docs/v3/` trees are frozen version snapshots, apart from maintenance release changelog entries.

Check documentation links and examples from the repository root:

```bash
just docs-broken-links
uv run pytest tests/docs -n 0
```

[just](https://github.com/casey/just) provides convenience commands. Without it, run `npx --yes mint@latest broken-links` from `docs/`. Preview rendering with `just docs`, or run `npx --yes mint@latest dev` from that directory. The docs tests check Python syntax and FastMCP imports; execute changed examples too, since those checks do not prove behavior.

The live site serves `published-docs`, so merging a docs change into `main` does not publish it immediately. See [Releases](/development/releases#creating-releases) for the publication workflow.

## Submit and follow through

Write a short PR description explaining the problem and the resulting behavior, with a focused example when it helps. Include the issue link and explain any compatibility decision. Keep "Allow edits by maintainers" enabled when available so maintainers can finish small adjustments without replacing your contribution.

Review the entire diff, not just your latest commit. A useful review checks the intended contract, root cause, supported behavior, tests, and documentation. Green CI is evidence that checks passed; it does not decide whether a behavior change belongs in FastMCP.

Read review-bot comments and maintainer replies, evaluate concrete findings, and respond to requested changes. A new push needs checks against that revision. Stay involved until the PR is resolved; assignment is a commitment to follow through.

## Maintenance and automation

The [public backlog dashboard](https://prefecthq.github.io/fastmcp/) charts open issues and PRs, incoming work, and closure outcomes. Backlog snapshots update every 30 minutes; older reconstructed counts and the limits of closure history are identified on the page. The [maintenance status page](https://prefecthq.github.io/fastmcp/operations.html) reports automation health and the contributor queue twice a day. Check its timestamp before treating a status as current. The accompanying `status.json` uses the `fastmcp-maintenance/1` schema; `idle` means there was nothing to do, while `degraded` means a run failed.

Automation labels and deduplicates issues, enforces the contribution gate, explains CI failures, and checks new dependency releases nightly. Issues marked as duplicates close automatically after three days without further activity, and reports still missing a reproduction close after seven days without an author reply. Maintainers can request work with `/marvin`. A separate triage agent reproduces reported bugs and may leave comment-only reviews on linked pull requests; it does not assign contributors, approve, or merge.

Maintainers decide assignments, merge readiness, changes to supported behavior or APIs, releases, and security-report classification. Release publishing and docs deployment run automatically after the corresponding maintainer actions; see [Releases](/development/releases#creating-releases).

### Triage and merge decisions

Decide whether FastMCP wants a change before verifying it. Name who hits the problem in supported, realistic usage, what merging commits the project to carrying, and whether a docs fix, a smaller fix elsewhere, or closing is the better answer. A correct, tested, green patch can still be declined.

Labels such as `high-priority` and confident diagnoses from bots or commenters are claims, not evidence. Before treating an issue as a bug, confirm its current state, since a fix may already be merged or reverted, and check whether the behavior is a decision already made in maintainer comments, closed PRs, upgrade guides, or docs. Close a settled decision with that history linked; leave a deferred design open as its tracker. When intended behavior surprises users, fix the docs or the behavior rather than adding a warning.

When PRs compete for one issue, prefer the reporter's, then the one fixing the right layer with a real regression test, then the smaller one. Before merging several PRs together, verify their composition on current `main` with relevant tests and applicable static checks, and confirm full CI actually ran on the combined revision. Fork PR runs can wait for approval, and runs older than a month cannot be re-run, so update the branch instead.

---

### Development Releases (`docs/development/releases.mdx`)

---
title: "Releases"
description: "Compatibility decisions, release branches, and documentation publishing"
icon: truck-fast
---

FastMCP releases when changes are ready. Release notes describe the user-visible changes and any migration required. Maintainers choose the release scope and version; passing tests alone does not settle a compatibility decision.

## Versioning Policy

Patch releases contain fixes and refinements without breaking supported public behavior. Minor releases add capabilities and may include deliberate breaking changes when their benefit justifies the disruption. Major releases cover larger changes to the framework and its APIs.

### Breaking changes

Evaluate the intended behavior and the users affected before deciding how to ship a change. Compare the cost of migration with the complexity or incorrect behavior that retaining the old contract would preserve. A change described as a bug fix still needs this assessment; a breaking change does not automatically require waiting for the next major version.

Breaking changes in a minor release require a maintainer decision, clear release notes, and migration guidance. Provide deprecation warnings at least one minor release ahead when possible. Do not put a breaking change into a patch release merely because a regression test passes.

The public compatibility contract covers `FastMCP`, `Client`, `Context`, core MCP components and transports, and their public methods and documented behavior. Private implementation details do not have the same guarantee. Experimental APIs may change or disappear; pin versions when relying on them and read the release notes before upgrading.

FastMCP also supports multiple MCP protocol eras. Negotiating an older protocol does not select an older FastMCP implementation; see [protocol version support](/getting-started/upgrading/from-fastmcp-3#protocol-version-support).

### Production upgrades

Use a lockfile or an exact version pin for reproducible deployments. Review the changelog, test your supported workflows, and update the pin deliberately. For example, an exact dependency constraint has this form:

```text
fastmcp==4.0.10
```

This illustrates a pin, not a recommendation to remain on that release. Check the [release history](https://github.com/PrefectHQ/fastmcp/releases) for available updates and [SECURITY.md](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md) for security support and private reporting.

## Creating Releases

Only maintainers cut releases. Use the repository's [release skill](https://github.com/PrefectHQ/fastmcp/blob/main/.agents/skills/release/SKILL.md) for the commands and verification steps. It is the maintained procedure; the sequence below explains how the pieces fit together.

1. Review changes since the last stable release on the target line and agree on the version, title, and handwritten notes.
2. Merge the changelog documentation PR on the release branch before tagging, so the entry is included in the release commit.
3. Create the GitHub release from that branch. Generate notes starting at the last stable tag, so intervening prereleases do not truncate the changelog.
4. Verify package publication and, for a current-major stable release, complete documentation publication.

Current-major releases come from `main`. Maintenance releases come from the branch that owns their line, such as `release/3.x` or `release/2.x`. A branch's existence does not by itself promise ongoing security support; consult the security policy.

Publishing a release triggers the package workflows. On the current line, `fastmcp-slim` publishes first, followed by the dependent `fastmcp-tasks`, `fastmcp-remote`, and `fastmcp` distributions. Verify the relevant workflows and package versions on PyPI rather than treating the GitHub release alone as completion. Published versions are immutable; a correction needs a new release.

## Publishing documentation

The documentation at `https://gofastmcp.com/docs` is built by Mintlify from `docs/` on `published-docs`; `main` is the authoring source. The separate `PrefectHQ/gofastmcp-website` repository deploys its `main` branch to Vercel for the root landing page and `/docs` proxy. A stable release from the default-branch lineage opens a PR that copies the exact release tree to `published-docs` after package publishing succeeds. A maintainer merges that PR, then verifies the `Deploy docs` workflow completed successfully and checks the changed public docs.

Prereleases and manual package-workflow dispatch do not open that publication PR automatically. Docs-only changes between releases can be published through a PR that synchronizes `main` to `published-docs`; follow the release skill's manual publication procedure and publication checks, including preservation of `/docs` metadata in the candidate tree. Do not push directly to the publication branch. Ordinary publication does not change domains or Mintlify's `/docs` base path.

Maintenance releases update their own changelog and packages without repointing the current documentation site. The `docs/v2/` and `docs/v3/` trees preserve historical documentation; outside their release changelogs, they are frozen snapshots.

---

### Development Tests (`docs/development/tests.mdx`)

---
title: "Tests"
description: "Verify FastMCP behavior through real clients, HTTP applications, and targeted regressions"
icon: vial
---

Test the behavior a user relies on through the smallest boundary that exercises it. Most FastMCP tests can use a real server and client in memory. HTTP and subprocess helpers cover behavior that depends on those transports.

## Run tests

Install the repository dependencies and select the tests relevant to your change.
For example, to check client behavior:

```bash
uv sync
uv run pytest tests/client/client/test_client.py -n 0
```

During development, run the owning test module or select a behavior by name:

```bash
uv run pytest tests/client/client/test_client.py -n 0
uv run pytest tests/server -k list_tools -n 0
```

Use `-n 0` for a single process when debugging. The full suite uses pytest-xdist for parallel execution. To run the same marker selection as the unit CI job:

```bash
uv run pytest -n auto -m "not integration and not client_process and not subprocess_heavy and not conformance"
```

Broaden local coverage when a concrete dependency or failure warrants it. Leave
routine full-suite and platform-matrix runs to CI, rather than repeating them for
each commit or PR in a stack. Run `uv run pytest -n auto` locally when explicitly
requested or when investigating a failure that requires the full suite.

The default timeout is five seconds, and `asyncio_mode = "auto"` enables async tests without `@pytest.mark.asyncio`. These settings and the registered markers live in [pyproject.toml](https://github.com/PrefectHQ/fastmcp/blob/main/pyproject.toml).

### Test organization and markers

Extend the module that owns the behavior, using nearby tests and fixtures as the starting point. The test tree generally mirrors the library: authentication tests are under `tests/server/auth/`, client tests under `tests/client/`, and resource tests under `tests/resources/`.

| Marker | Use |
| --- | --- |
| `integration` | Tests needing integration resources or longer execution; CI gives this group a longer timeout. |
| `client_process` | Tests spawning client processes through stdio. |
| `subprocess_heavy` | Tests starting a fresh Python interpreter that imports FastMCP. |
| `conformance` | MCP conformance tests requiring Node.js and npx. |

The [pytest CI action](https://github.com/PrefectHQ/fastmcp/blob/main/.github/actions/run-pytest/action.yml) runs `client_process` and `subprocess_heavy` serially and excludes them from parallel unit tests. A minimal stdlib subprocess does not need `subprocess_heavy` merely because it is a subprocess. Use the marker when the fresh interpreter imports FastMCP.

A marker selects a CI group; it does not itself change the local timeout. To reproduce the integration group's timeout locally:

```bash
uv run pytest -m integration --timeout=30 -n 0
```

## Write a regression that proves the contract

First establish the promised behavior from the public API, docs, protocol, and relevant maintainer decisions. A reproducible result is not automatically a bug. Once the contract is clear, run the regression on the unchanged base and confirm that it fails for the intended reason, then run it with the fix. An import error or broken fixture is not evidence of the reported defect.

To run a PR's test against unchanged code, copy the test file into a checkout of the base and run pytest there: the `pythonpath` setting in `pyproject.toml` takes precedence over `PYTHONPATH`, so pointing one checkout's tests at another checkout's source silently tests the wrong code. When a bug may depend on dependency versions, also reproduce after `uv sync --upgrade`, since the lockfile can trail what a fresh install resolves.

Assert values and types that distinguish the correct result from the bug. For example, Python equality treats `True` and `1` as equal, so a JSON type-preservation test needs a type assertion too. Avoid assertions that only check whether some result exists when the result's contents are the contract.

Keep each test focused on one behavior, with as many assertions as that behavior needs. Parameterize variations of the same contract; separate unrelated cases. Include omitted defaults and explicit overrides when both enter the changed branch.

Use function-scoped setup and temporary paths so tests work independently and in parallel. Prefer events or waits for the exact condition being asserted to arbitrary sleeps. When diagnosing a failure, separate an assertion failure from a worker crash or infrastructure error; reproduce a supposedly pre-existing failure on the unchanged base before calling it unrelated.

## Test through an in-memory client

`Client(server)` exercises real FastMCP dispatch and protocol behavior without opening a socket. This complete test checks how arguments and results travel through the client:

```python
from fastmcp import Client, FastMCP


async def test_add_returns_sum() -> None:
    server = FastMCP("Calculator")

    @server.tool
    def add(a: int, b: int) -> int:
        return a + b

    async with Client(server) as client:
        result = await client.call_tool("add", {"a": 2, "b": 3})

    assert result.data == 5
    assert type(result.data) is int
```

Save examples as a test module in the repository and run them with `uv run pytest path/to/test_example.py -n 0`. Use the existing fixture patterns for the subsystem instead of mocking the FastMCP method under test.

### Failure behavior

Assert the exception users receive, including a meaningful message when that is part of the behavior:

```python
import pytest

from fastmcp import Client, FastMCP
from fastmcp.exceptions import ToolError


async def test_division_by_zero_is_reported() -> None:
    server = FastMCP("Calculator")

    @server.tool
    def divide(a: float, b: float) -> float:
        if b == 0:
            raise ValueError("Cannot divide by zero")
        return a / b

    async with Client(server) as client:
        with pytest.raises(ToolError, match="Cannot divide by zero"):
            await client.call_tool("divide", {"a": 10, "b": 0})
```

### Reusable fixtures

Build the server in a fixture and manage the client context in the test. This keeps connection ownership and cleanup visible:

```python
import pytest

from fastmcp import Client, FastMCP


@pytest.fixture
def weather_server() -> FastMCP:
    server = FastMCP("Weather")

    @server.tool
    def temperature(city: str) -> int:
        return {"NYC": 72, "LA": 85}[city]

    return server


@pytest.mark.parametrize(("city", "expected"), [("NYC", 72), ("LA", 85)])
async def test_temperature(weather_server: FastMCP, city: str, expected: int) -> None:
    async with Client(weather_server) as client:
        result = await client.call_tool("temperature", {"city": city})

    assert result.data == expected
```

### Schema snapshots

Use the repository's `inline-snapshot` conventions for complex structures. Inspect each generated expectation against the contract before accepting it. This example checks the schema returned through the protocol:

```python
from inline_snapshot import snapshot

from fastmcp import Client, FastMCP


async def test_tool_input_schema() -> None:
    server = FastMCP("Calculator")

    @server.tool
    def double(value: int) -> int:
        return value * 2

    async with Client(server) as client:
        tools = await client.list_tools()

    assert tools[0].input_schema == snapshot(
        {
            "type": "object",
            "properties": {"value": {"type": "integer"}},
            "required": ["value"],
            "additionalProperties": False,
        }
    )
```

The repository disables snapshot updates by default. For an intentional change, run the relevant module with `--inline-snapshot=fix` and review the diff. Use `--inline-snapshot=create` when populating a new empty snapshot.

## Test HTTP behavior without a socket

Use `asgi_client` when the subject is HTTP routing, headers, authentication, or streaming. It builds the real application and starts its lifespan, then sends requests directly through ASGI in the same process:

```python
from fastmcp import FastMCP
from fastmcp.utilities.tests import asgi_client


async def test_greet_over_http() -> None:
    server = FastMCP("Greeting")

    @server.tool
    def greet(name: str) -> str:
        return f"Hello, {name}!"

    async with asgi_client(server) as client:
        result = await client.call_tool("greet", {"name": "World"})

    assert result.data == "Hello, World!"
```

Pass `headers=` or `auth=` to configure requests, `path=` for a custom MCP route, or `transport="sse"` to exercise the SSE application. Other client options, such as `timeout=`, go to `Client`.

### Multiple clients and raw requests

Use `asgi_server` when a test needs several clients or raw HTTP responses. Each `client()` call creates its own client. `http_client()` returns an `httpx2.AsyncClient` bound to the same application; an ordinary network client cannot reach this in-process server.

```python
from fastmcp import FastMCP
from fastmcp.utilities.tests import asgi_server


async def test_two_clients_share_the_application() -> None:
    server = FastMCP("Empty")

    async with asgi_server(server) as running:
        async with running.client() as first, running.client() as second:
            assert await first.list_tools() == []
            assert await second.list_tools() == []

        async with running.http_client() as http:
            response = await http.get("/missing")
            assert response.status_code == 404
```

Test the client's default protocol mode. A test specifically about legacy MCP sessions or `ping` should pass `mode="legacy"` to the client; pinning it elsewhere hides behavior that differs between eras. The modern protocol era is sessionless; see [protocol negotiation](/clients/client#protocol-negotiation). For custom client transports, `running.transport()` returns a transport wired to the same application.

## Test external and process boundaries

Mock external services at their boundary, while keeping the FastMCP path real. For outgoing HTTP requests, use `httpx2.MockTransport` and assert the method, URL, headers, or body that matter. Do not mock the framework function whose behavior the test is meant to verify.

Use `run_server_async` when the network itself is the subject: a socket, TLS, or a client outside the in-process application. It starts uvicorn in the current process and cleans it up on exit:

```python
from fastmcp import Client, FastMCP
from fastmcp.utilities.tests import run_server_async


async def test_server_accepts_network_requests() -> None:
    server = FastMCP("Empty")

    async with run_server_async(server) as url:
        async with Client(url) as client:
            assert await client.list_tools() == []
```

Use `run_server_in_process` only when process isolation is part of the test. Follow nearby subprocess fixtures for startup, transport selection, and cleanup. Stdio lifecycle tests can use `tests/client/minimal_stdio_server.py` when a minimal MCP responder suffices; use a real FastMCP subprocess when its behavior is what you need to test.

## Check documentation examples

Run the documentation checks from the repository root:

```bash
just docs-broken-links
uv run pytest tests/docs -n 0
```

The docs tests parse Python fences and resolve FastMCP imports. They do not execute every example or detect every missing non-import name, so run changed examples yourself. Use `just docs` to preview rendering. Without just, run `npx --yes mint@latest broken-links` or `npx --yes mint@latest dev` from `docs/`.

See the [Contributing Guide](/development/contributing#implement-and-verify) for local checks before committing and CI expectations.

---

### Getting Started Ai Assisted Development (`docs/getting-started/ai-assisted-development.mdx`)

---
title: AI-assisted Development
sidebarTitle: Coding Agents
description: Give your coding agent FastMCP authoring guidance and documentation matched to your project.
icon: robot
---

Give your coding agent [llms.txt](https://gofastmcp.com/llms.txt) as its starting point for FastMCP. This index links to the documentation as Markdown. Ask the agent to check your project's installed version and read the relevant pages before writing code.

## Read version-matched documentation

For FastMCP 3, use the index entries under `/v3/`; unversioned pages describe FastMCP 4. Every page is available as Markdown by appending `.md` to its URL, such as [the tools guide](https://gofastmcp.com/servers/tools.md). Read the pages relevant to the task; [llms-full.txt](https://gofastmcp.com/llms-full.txt) contains the entire documentation and may exceed your agent's context window.

Agents with MCP support can also search the documentation at `https://gofastmcp.com/mcp`. See [LLM-friendly docs](/getting-started/welcome#llm-friendly-docs) for a client example.

## Add authoring guidance

The optional `fastmcp-server` skill adds a workflow for building, extending, and reviewing servers: choose suitable MCP interfaces, preserve useful schemas and errors, consult version-matched documentation, and verify behavior through a real client. The documentation index helps the agent find API information; installing the skill makes this authoring guidance available for the agent to select across tasks.

Install it with the [Skills CLI](https://github.com/vercel-labs/skills), which lets you choose your coding agent:

```bash
npx skills add https://gofastmcp.com --skill fastmcp-server
```

The site's [skill discovery index](https://gofastmcp.com/.well-known/skills/index.json) lists the available skills. The [skill source](https://github.com/PrefectHQ/fastmcp/tree/main/skills/fastmcp-server) lives alongside FastMCP's client CLI skill; the site publishes those same files. You can also install from the repository with `npx skills add PrefectHQ/fastmcp --skill fastmcp-server`. The skill uses the agent's documentation access and code execution tools.

Start a new agent session after installing. Ask it to use the `fastmcp-server` skill when working on your server. For example:

```text
Use the fastmcp-server skill to build an MCP server for this issue tracker.
Expose paginated search and issue details, preserve upstream failures as errors,
and test the interface through a FastMCP client. Keep the project's FastMCP version.
```

The skill is maintained in the FastMCP repository and evolves separately from package releases. Update your installed copy to pick up changes, or install from a Git revision when you need reproducible instructions. Your project's dependency constraints still determine which FastMCP APIs the agent should use.

<Tip>
  For an agent that needs to discover and call an existing server, use the [client CLI skill](https://github.com/PrefectHQ/fastmcp/tree/main/skills/fastmcp-client-cli). The server authoring skill is for writing server code.
</Tip>

## Verify the generated server

Run the server's tests and inspect the schemas and results that clients receive. A successful import or the agent's final message does not establish that the server works. The [testing guide](/development/tests#test-through-an-in-memory-client) shows how to connect `fastmcp.Client` directly to your server without starting a network listener.

For deployment work, also test the intended transport and authentication. Use local fixtures or a test account for operations that change data.

If your server's users need guidance for workflows spanning several operations, consider supplying skills with the server. [Skills over MCP](/servers/skills) shows how to serve a skills folder as resources and through standard skills discovery. Check the installed FastMCP version and target host's support, and verify that the host actually reads and uses the skill. Discovery alone does not activate it.

---

### Getting Started Installation (`docs/getting-started/installation.mdx`)

---
title: Installation
description: Install FastMCP and verify your setup
icon: arrow-down-to-line
---
## Install FastMCP

We recommend using [uv](https://docs.astral.sh/uv/getting-started/installation/) to install and manage FastMCP.

```bash
uv add fastmcp
```

Or with pip:

```bash
pip install fastmcp
```

### Optional Dependencies

FastMCP provides optional extras for specific features. For example, to install the background tasks extra:

```bash
pip install "fastmcp[tasks]"
```

See [Background Tasks](/servers/tasks) for details on the task system.

### Verify Installation

To verify that FastMCP is installed correctly, you can run the following command:

```bash
fastmcp version
```

You should see output like the following:

```bash
$ fastmcp version

FastMCP version:                           4.0.0
MCP version:                                2.0.0
Python version:                            3.12.2
Platform:            macOS-15.3.1-arm64-arm-64bit
FastMCP root path:            ~/Developer/fastmcp
```

### Dependency Licensing

<Info>
FastMCP depends on Cyclopts for its CLI. Older Cyclopts installs pull in docutils through rich-rst 1.x, and docutils has licensing that can trigger compliance reviews. rich-rst 2 no longer depends on docutils, and a fresh install resolves to rich-rst 2. If a scan flags docutils in an existing environment, upgrade both packages:

```bash
pip install -U cyclopts rich-rst
```

See [this issue](https://github.com/BrianPugh/cyclopts/issues/672) for background.
</Info>

## Upgrading

### From FastMCP 3.0

Most FastMCP 3 servers run on 4 without changes. See [Upgrading from FastMCP 3](/getting-started/upgrading/from-fastmcp-3) for the breaks that do exist, and [What's New](/getting-started/whats-new) for what the new version adds.

### From FastMCP 2.0

See the [Upgrade Guide](/getting-started/upgrading/from-fastmcp-2) for a complete list of breaking changes and migration steps.

### From the MCP SDK

Which guide you want depends on which `mcp` version you're on and which of its two server APIs you used.

#### From the high-level server

If you're using FastMCP 1.0 via SDK v1 (meaning you import FastMCP as `from mcp.server.fastmcp import FastMCP`), upgrading is straightforward — for most servers it's a single import change. See [Upgrading from MCP SDK v1](/getting-started/upgrading/from-mcp-sdk-v1), which also explains why that route is usually easier than moving to MCP SDK v2.

If you already moved to SDK v2 and write against `MCPServer`, see [Upgrading from MCP SDK v2](/getting-started/upgrading/from-mcp-sdk-v2) — that migration is mostly renaming.

#### From the low-level server

If you built your server directly on the `mcp` package's `Server` class, the guide you want depends on how its handlers are registered. Decorators like `@server.list_tools()` mean SDK v1 — see [Upgrading from the Low-Level SDK v1](/getting-started/upgrading/from-low-level-sdk-v1). Handlers passed to the constructor as `on_list_tools=` mean SDK v2 — see [Upgrading from the Low-Level SDK v2](/getting-started/upgrading/from-low-level-sdk-v2).

## Troubleshooting

### `import fastmcp` fails after a pip upgrade

This affects one specific case: upgrading to FastMCP 3.3 or later from FastMCP 3.2 or earlier with `pip`. Fresh installs and `uv` upgrades are unaffected, so you can skip this unless you did exactly that.

If `import fastmcp` raises `ModuleNotFoundError`, or `from fastmcp import FastMCP` raises `ImportError`, immediately after the upgrade, your install is in a half-removed state. Reinstall in a single step:

```bash
pip install --force-reinstall fastmcp
```

If that doesn't resolve it, remove both distributions and reinstall from a clean state:

```bash
pip uninstall -y fastmcp fastmcp-slim
pip install fastmcp
```

FastMCP 3.3 moved the importable code from the `fastmcp` distribution into `fastmcp-slim`. During a single-command `pip` upgrade, pip can install the new files and then delete them while uninstalling the old `fastmcp` distribution, whose file manifest still lists those paths. `uv` uninstalls before it installs, so it is unaffected.

## Versioning Policy

FastMCP follows semantic versioning with pragmatic adaptations for the rapidly evolving MCP ecosystem. Breaking changes may occur in minor versions (e.g., 4.1.x to 4.2.0) when necessary to stay current with the MCP Protocol.

For production use, use a lockfile or pin an exact version:

```text
fastmcp==4.0.5    # Good - an exact version
fastmcp>=4.0.0    # Bad - may install breaking changes
```

See the full [versioning and release policy](/development/releases#versioning-policy) for details on our public API, deprecation practices, and breaking change philosophy.

## Contributing to FastMCP

The [Contributing Guide](/development/contributing) covers setting up a development environment, running the test suite and pre-commit hooks, and the standards we hold contributed code to.

---

### Getting Started Welcome (`docs/getting-started/welcome.mdx`)

---
title: "FastMCP: The Framework for MCP"
sidebarTitle: "Welcome!"
description: FastMCP is the standard framework for building Model Context Protocol (MCP) servers, clients, and interactive applications.
icon: hand-wave
mode: center
---

<video
  aria-hidden="true"
  autoPlay
  muted
  loop
  playsInline
  className="rounded-2xl block dark:hidden"
  src="/assets/brand/f-watercolor-waves-4-animated.mp4"
></video>
<video
  aria-hidden="true"
  autoPlay
  muted
  loop
  playsInline
  className="rounded-2xl hidden dark:block"
  src="/assets/brand/f-watercolor-waves-4-dark-animated.mp4"
></video>

**FastMCP is a full framework for building [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) applications.** It gives you one coherent API for servers, clients, and interactive apps. Use it to expose Python functions as MCP tools, connect to local or remote MCP servers, and return interactive interfaces directly from your tools. FastMCP manages schema generation, validation, transport, authentication, and protocol compatibility around your application code.

A FastMCP server starts with ordinary Python:

```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()
```

## Move fast and make things

An effective MCP application needs more than a function registry. Models need accurate schemas, callers need validated results, clients need compatible transports, and production servers need authentication and predictable lifecycle management.

FastMCP treats those as framework responsibilities. Declare a Python function and FastMCP derives its schema, validates its inputs and outputs, and exposes it through MCP. Connect a client to a URL and FastMCP handles protocol negotiation, authentication, and connection lifecycle. Your application remains ordinary Python while FastMCP keeps the MCP boundary correct.

**That's why FastMCP is the standard framework for working with MCP.** FastMCP created the high-level Python API incorporated into the official MCP Python SDK in 2024. The actively maintained standalone project is now downloaded more than a million times a day, and some version of FastMCP powers 70% of MCP servers across all languages.

## Servers, clients, and apps

FastMCP covers the full MCP application lifecycle through three complementary pillars:

<CardGroup cols={3}>
  <Card title="Servers" img="/assets/images/servers-card.png" href="/servers/server">
    Expose Python functions, data, and instructions as MCP tools, resources, and prompts.
  </Card>
  <Card title="Apps" img="/assets/images/apps-card.png" href="/apps/overview">
    Give MCP tools interactive user interfaces rendered directly in the conversation.
  </Card>
  <Card title="Clients" img="/assets/images/clients-card.png" href="/clients/client">
    Connect to any MCP server through Python, the command line, or another MCP application.
  </Card>
</CardGroup>

**[Servers](/servers/server)** turn your application logic into MCP capabilities with generated schemas and validation. **[Clients](/clients/client)** connect to local or remote MCP servers with full protocol support. **[Apps](/apps/overview)** let tools return forms, tables, charts, and other interactive interfaces alongside ordinary MCP results.

The three pillars share one model: FastMCP owns the protocol machinery while your code defines what the application does.

**Building in TypeScript?** [FastMCP for TypeScript](https://github.com/PrefectHQ/fastmcp-ts) is the official counterpart, built and maintained by the same team. Its servers, clients, and apps follow the same concepts, so what you learn here carries over.

<CardGroup cols={2}>
  <Card title="Install FastMCP" icon="download" href="/getting-started/installation">
    Add FastMCP to your project with `uv add fastmcp`, verify the package, and find the right upgrade guide.
  </Card>
  <Card title="Build your first server" icon="rocket-launch" href="/getting-started/quickstart">
    Create a tool, run its server, call it from a client, and add an interactive UI.
  </Card>
</CardGroup>

FastMCP is made with 💙 by [Prefect](https://www.prefect.io/).

<Tip>
**This documentation reflects FastMCP's `main` branch**, so it may describe features that have not reached a stable release. Version badges identify when features were introduced.
</Tip>

<a id="scale-mcp-with-horizon" />

## Scale MCP with FastMCP Gateway

FastMCP handles the MCP application layer. **[FastMCP Gateway](https://www.prefect.io/horizon?utm_source=gofastmcp&utm_medium=docs&utm_campaign=docs_welcome&utm_content=welcome_body)** is the enterprise MCP gateway for scaling servers and tools across teams, with centralized governance over how they are deployed, discovered, secured, and used.

FastMCP Gateway applies the operational patterns developed while maintaining FastMCP: deploy servers from GitHub with branch previews and instant rollback, organize them in a private registry, protect access with SSO and tool-level RBAC, and observe activity through audit logs and telemetry.

FastMCP Gateway can also combine approved tools into purpose-built MCP endpoints for different teams and agents, while keeping access policy and governance centralized.

Start with FastMCP. [Scale with FastMCP Gateway →](https://www.prefect.io/horizon?utm_source=gofastmcp&utm_medium=docs&utm_campaign=docs_welcome&utm_content=welcome_cta)

## LLM-friendly docs

FastMCP documentation is designed for developers and coding agents. Every page is available as Markdown, the complete documentation is published in `llms.txt` formats, and the documentation itself is exposed through an MCP server.

### MCP server

Point any MCP-compatible agent at `https://gofastmcp.com/mcp` to let it search the documentation as it works. You can also connect with FastMCP's Python client directly:

```python
import asyncio

from fastmcp import Client


async def main() -> None:
    async with Client("https://gofastmcp.com/mcp") as client:
        result = await client.call_tool(
            name="search_fast_mcp",
            arguments={"query": "deploy a FastMCP server"},
        )
        print(result)


asyncio.run(main())
```

### Markdown formats

The documentation is also available in [`llms.txt`](https://llmstxt.org/) formats:

- [`llms.txt`](https://gofastmcp.com/llms.txt) lists every documentation page.
- [`llms-full.txt`](https://gofastmcp.com/llms-full.txt) contains the complete documentation in one file and may exceed some context windows.

Append `.md` to any documentation URL to retrieve that page as Markdown. For example, this page is available at `https://gofastmcp.com/getting-started/welcome.md`. You can also copy the current page as Markdown by pressing `Cmd+C` or `Ctrl+C`.

---

### Getting Started Whats New (`docs/getting-started/whats-new.mdx`)

---
title: "What's New in FastMCP 4"
sidebarTitle: "What's New"
description: FastMCP 4 makes stateful MCP applications work on the sessionless protocol while one server serves every protocol era.
icon: sparkles
---

FastMCP 4 makes stateful MCP applications work on MCP's sessionless protocol. Tools can ask follow-up questions across requests, preserve authenticated user state, and move long-running work into background tasks without sticky sessions or a continuously connected client.

The protocol changed completely underneath those APIs. Your application usually does not: one FastMCP server negotiates both protocol eras per connection, and most FastMCP 3 servers upgrade unchanged.

That is the theme of version 4: stateless transport without stateless application code. The release also makes protocol extensions a first-class surface, adds enterprise identity for agents acting on behalf of users, and strengthens production defaults across caching, routing, and security.

<Note>
Install with `pip install fastmcp -U`. Upgrading from FastMCP 3? Start with [the upgrade guide](/getting-started/upgrading/from-fastmcp-3). The release announcement, [FastMCP 4 is GA](https://blog.gofastmcp.com/3mufbh2vcv22o), is on the [FastMCP blog](https://blog.gofastmcp.com), and every release since is in the [changelog](/changelog).
</Note>

## Protocol compatibility

A protocol migration usually forces a choice between breaking clients that have not moved yet and holding the server back with them. FastMCP 4 serves both eras from one deployment, negotiating the best mutual version for each connection. Modern clients get the sessionless protocol while handshake-era clients continue working unchanged.

Statelessness changes how that deployment scales. Each modern request carries everything needed to answer it, so any replica behind an ordinary load balancer can serve any request and session affinity stops being a requirement.

The client default follows the same rule. `Client(url)` probes for the modern protocol and falls back to the handshake when necessary. Pin `mode="legacy"` only when your application specifically needs the session back-channel.

```python
from fastmcp import Client

# Negotiate the best mutual protocol
client = Client("https://example.com/mcp")

# Require the handshake-era protocol
legacy = Client("https://example.com/mcp", mode="legacy")
```

Once connected, `client.protocol_version`, `client.server_info`, `client.server_capabilities`, and `client.instructions` expose the same interface whichever era was negotiated. Application code that inspects a server does not need a protocol-version branch. See [Protocol negotiation](/clients/client#protocol-negotiation).

On modern connections, FastMCP also attaches the method, target name, and opted-in argument values as HTTP headers. Gateways and load balancers can route requests without parsing JSON-RPC bodies. See [Gateway routing headers](/deployment/http#gateway-routing-headers).

For applications that talk to several servers at once, `ClientGroup` manages one client per server behind a single tool catalog — collision-checked `{server}_{tool}` namespacing, call routing, and no proxy in the middle. Each member negotiates its own protocol version, so one group can span a modern server, a handshake-era server, and a local subprocess. See [Client groups](/clients/client-groups).

## Stateful applications

The modern protocol removes transport-level sessions, but applications still need conversations, user state, and long-running work. FastMCP moves those concerns into explicit application primitives that survive fresh connections. Shared stores and request-state keys extend them across replicas and worker restarts.

### Interactive tools

Many useful tools need more than one exchange. A booking tool asks for a destination, then a date, then confirmation. A destructive operation asks the user to approve it before continuing.

On the modern protocol, the tool returns a description of the input it needs. That result completes the request normally. The client fulfils the request and calls the tool again with the answer attached; the tool runs from the top, reads `ctx.input_responses`, and either asks another question or returns its final result.

Each request completes while the user responds. Single-process servers use an automatic process-local key to protect the state carried between rounds; load-balanced deployments configure one shared key so any replica can validate and resume the next round:

```python
import os

from fastmcp import Context, FastMCP
from mcp.server.request_state import RequestStateSecurity
from mcp.types import ElicitRequest, ElicitRequestFormParams, InputRequiredResult

mcp = FastMCP(
    "Booking",
    request_state_security=RequestStateSecurity(
        keys=[os.environ["REQUEST_STATE_KEY"].encode()]
    ),
)


@mcp.tool
async def book_flight(ctx: Context) -> str | InputRequiredResult:
    answers = ctx.input_responses
    if answers is None:
        params = ElicitRequestFormParams(
            message="Where would you like to fly?",
            requested_schema={
                "type": "object",
                "properties": {"destination": {"type": "string"}},
                "required": ["destination"],
            },
        )
        return InputRequiredResult(
            result_type="input_required",
            input_requests={
                "destination": ElicitRequest(
                    method="elicitation/create",
                    params=params,
                )
            },
        )

    response = answers["destination"]
    if response.action != "accept" or response.content is None:
        return "Booking cancelled."

    destination = response.content["destination"]
    return f"Booked a flight to {destination}."
```

Every replica must receive the same `REQUEST_STATE_KEY`, containing at least 32 bytes of secret key material. A FastMCP client drives the loop through its existing elicitation handler, so client code receives the terminal result without managing the intermediate rounds. See [Elicitation on the modern protocol](/servers/elicitation#elicitation-on-the-modern-protocol).

### Session state

Application state follows the same explicit model. FastMCP stores state server-side and binds it to the authenticated user, so a session handle is inert in another user's hands.

Most tools want one state bucket per user. Declare a `UserSession` parameter and FastMCP injects it like `Context`: it never appears in the tool schema, and the caller passes nothing because their authenticated identity selects the bucket.

```python
from fastmcp import FastMCP
from fastmcp.server.sessions import UserSession

mcp = FastMCP("Assistant")


@mcp.tool
async def remember(fact: str, session: UserSession) -> str:
    facts = await session.get("facts", default=[])
    facts.append(fact)
    await session.set("facts", facts)
    return f"Remembered {len(facts)} facts."
```

`UserSession` requires [authentication](/servers/auth/authentication), since an unauthenticated request has no user to key on. When one user needs several independent buckets, such as separate carts or conversations, `SessionId` exposes the handle as an explicit string argument.

The default in-memory state store is process-local. To preserve state across restarts or share it among replicas, pass a shared persistent `session_state_store`. See [Session state](/servers/sessions).

### Background work

Long-running tools create a different kind of state problem: holding a request open for several minutes invites timeouts and leaves the user unable to tell whether work is progressing. Background tasks accept the call and return a handle immediately, then let the client poll while work proceeds asynchronously.

FastMCP implements the `io.modelcontextprotocol/tasks` extension in the optional `fastmcp-tasks` package, installed with `pip install "fastmcp[tasks]"`. The authoring API remains `@mcp.tool(task=True)`, backed by [Docket](https://github.com/chrisguidry/docket):

```python
import asyncio

from fastmcp import FastMCP
from fastmcp_tasks import TasksExtension

mcp = FastMCP("MyServer")
mcp.add_extension(TasksExtension())


@mcp.tool(task=True)
async def slow_computation(duration: int) -> str:
    """Run a long computation."""
    await asyncio.sleep(duration)
    return f"Completed in {duration} seconds"
```

`fastmcp.Client` handles the task handle and polling cycle, so `client.call_tool(...)` returns the same way whether the tool ran inline or in the background. See [Background tasks](/servers/tasks).

`TasksExtension()` uses an in-memory, single-process backend by default. Configure a Redis or Valkey backend for durable work that survives restarts and runs across separate workers.

## Extensible protocol

Background tasks are built on a general extension surface. An MCP extension advertises a capability under a reverse-DNS identifier and can add behavior negotiated between a server and client.

### Server extensions

`FastMCP.add_extension()` lets an extension advertise capabilities, add request methods, intercept `tools/call`, and own lifespan behavior with access to the component registry, `Context`, and authentication. Client extensions use the matching `Client(extensions=...)` interface.

Cross-cutting protocol behavior can therefore live in a supported plugin instead of requiring changes to FastMCP core. `TasksExtension` is a complete example of the interface. See [Server extensions](/servers/extensions).

### Argument completion

FastMCP 4 also lets servers answer MCP argument-completion requests. A completion handler sees the prompt or resource-template argument, its partial value, and values already supplied, so suggestions can depend on earlier choices.

```python
from fastmcp import FastMCP
from mcp.types import PromptReference

mcp = FastMCP("Docs")


@mcp.prompt
def write_poem(theme: str) -> str:
    return f"Write a poem about {theme}"


@mcp.completion
def complete(ref, argument, context):
    if isinstance(ref, PromptReference) and argument.name == "theme":
        options = ["nature", "love", "adventure"]
        return [option for option in options if option.startswith(argument.value)]
    return None
```

Registering the handler advertises the completion capability during negotiation, so clients only send requests to servers that support them. See [Argument completion](/servers/completions).

## Enterprise identity

Interactive OAuth authorization assumes a person can complete a browser flow. Internal agents often act for employees without a person waiting at a keyboard, while the server still needs the employee's identity for authorization and audit.

Identity assertion carries that identity through the agent. A corporate identity provider signs an assertion, the agent presents it, and the server exchanges it for a short-lived token without an interactive login or consent screen. FastMCP performs signature verification, binding checks, replay rejection, and scoped token issuance through the authentication providers you already use.

```python
from fastmcp import FastMCP
from fastmcp.server.auth import IdentityAssertion, OAuthProxy

auth = OAuthProxy(
    # ... your existing upstream configuration (required kwargs elided) ...
    identity_assertion=IdentityAssertion(
        trusted_issuers=["https://login.acme-corp.com"]
    ),
)
mcp = FastMCP("Internal API", auth=auth)
```

The asserted subject enters the normal authentication context, so tools read it through `get_access_token()` like any other identity. Identity assertion is in beta; the API may change in a minor release. See [Identity assertion](/servers/auth/oauth-proxy#identity-assertion-sep-990).

Authorization gained a provider-neutral role check as well. `require_roles` takes a required `extract` function so provider-specific claim shapes (`realm_access.roles`, `cognito:groups`) stay at the call site; a role denial is a plain authorization error. Separately, [scope step-up challenges](/servers/authorization#signaling-scope-shortfalls) tell a client exactly which scopes to request.

For clients with no user behind them, such as backend services and scheduled jobs, `ClientCredentialsOAuthProvider` implements the OAuth 2.0 client-credentials grant with no browser or redirect. See [Machine-to-machine authentication](/clients/auth/client-credentials).

## Production defaults

A server can now attach freshness hints to its results, and a caching client can reuse those results without another round trip. Set a default time-to-live and scope on the server:

```python
from fastmcp import FastMCP

mcp = FastMCP("Weather", cache_ttl=300, cache_scope="public")
```

`KeyValueResponseCacheStore` can place the client cache in Redis or another key-value store so a fleet of clients or proxies shares fills. Cache entries are partitioned by the requested component version, so an explicit `version=` request never returns another version's cached result, and middleware response limits now align with declared output schemas. See [Response caching](/clients/client#response-caching).

Resource templates now reject path traversal, absolute paths, and null bytes in their parameters before the handler runs. The protection is enabled by default and applies to mounted and proxied templates. See [Path security](/servers/resources#path-security).

OAuth defaults also distinguish native clients from web applications during Dynamic Client Registration, and missing scopes now produce an `InsufficientScopeError` that names the scopes required to continue. See [Application type](/servers/auth/oauth-proxy#application-type-web-vs-native) and [scope shortfalls](/servers/authorization#signaling-scope-shortfalls).

## Upgrade note

The sessionless protocol has no live connection for a server to call back into during execution. FastMCP 4 therefore removes `ctx.sample()`, `ctx.sample_step()`, and `ctx.list_roots()` from every protocol era so incompatible code fails immediately during an upgrade.

For generation, call an LLM directly from the server when your application owns the model. When borrowing the caller's model is the point, return an `InputRequiredResult` carrying a sampling request and read the answer on the next round. Roots use the same return-and-resume pattern. See [Sampling](/servers/sampling) and [the guard pattern](/servers/elicitation#sampling-and-roots).

`ctx.elicit()` remains available on handshake-era connections; modern connections use the multi-round pattern described above. Code that constructs MCP protocol models directly must also use snake_case Python field names with SDK v2.

One deprecation to note: `Client("server.py")` — inferring a stdio transport from a bare string — now warns. Pass a `Path` to run local code and keep strings for URLs; the string form will be removed in FastMCP 5.

[Upgrading from FastMCP 3](/getting-started/upgrading/from-fastmcp-3) covers these changes and every other compatibility break.

---

### Integrations Anthropic (`docs/integrations/anthropic.mdx`)

---
title: Anthropic API 🤝 FastMCP
sidebarTitle: Anthropic API
description: Connect FastMCP servers to the Anthropic API
icon: message-code
---

import { VersionBadge } from "/snippets/version-badge.mdx"


Anthropic's [Messages API](https://docs.anthropic.com/en/api/messages) supports MCP servers as remote tool sources. This tutorial will show you how to create a FastMCP server and deploy it to a public URL, then how to call it from the Messages API.

<Tip>
Currently, the MCP connector only accesses **tools** from MCP servers—it queries the `list_tools` endpoint and exposes those functions to Claude. Other MCP features like resources and prompts are not currently supported. You can read more about the MCP connector in the [Anthropic documentation](https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector).
</Tip>

## Create a Server

First, create a FastMCP server with the tools you want to expose. For this example, we'll create a server with a single tool that rolls dice.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

## Deploy the Server

Your server must be deployed to a public URL in order for Anthropic to access it. The MCP connector supports both SSE and Streamable HTTP transports.

For development, you can use tools like `ngrok` to temporarily expose a locally-running server to the internet. We'll do that for this example (you may need to install `ngrok` and create a free account), but you can use any other method to deploy your server.

Assuming you saved the above code as `server.py`, you can run the following two commands in two separate terminals to deploy your server and expose it to the internet:

<CodeGroup>
```bash FastMCP server
python server.py
```

```bash ngrok
ngrok http 8000
```
</CodeGroup>

<Warning>
This exposes your unauthenticated server to the internet. Only run this command in a safe environment if you understand the risks.
</Warning>

## Call the Server

To use the Messages API with MCP servers, you'll need to install the Anthropic Python SDK (not included with FastMCP):

```bash
pip install anthropic
```

You'll also need to authenticate with Anthropic. You can do this by setting the `ANTHROPIC_API_KEY` environment variable. Consult the Anthropic SDK documentation for more information.

```bash
export ANTHROPIC_API_KEY="your-api-key"
```

Here is an example of how to call your server from Python. Note that you'll need to replace `https://your-server-url.com` with the actual URL of your server. In addition, we use `/mcp` as the endpoint because we deployed a streamable-HTTP server with the default path; you may need to use a different endpoint if you customized your server's deployment.

The connector is in beta, so the call goes through `client.beta.messages` with the `mcp-client-2025-11-20` flag. Each entry in `mcp_servers` also needs a matching `mcp_toolset` entry in `tools` that references it by name; declaring the server without the toolset is rejected as a validation error.

```python {5, 12, 14-21}
import anthropic
from rich import print

# Your server URL (replace with your actual URL)
url = 'https://your-server-url.com'

client = anthropic.Anthropic()

response = client.beta.messages.create(
    model="claude-sonnet-5",
    max_tokens=1000,
    betas=["mcp-client-2025-11-20"],
    messages=[{"role": "user", "content": "Roll a few dice!"}],
    mcp_servers=[
        {
            "type": "url",
            "url": f"{url}/mcp",
            "name": "dice-server",
        }
    ],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "dice-server"}],
)

print(response.content)
```

If you run this code, you'll see something like the following output:

```text
I'll roll some dice for you! Let me use the dice rolling tool.

I rolled 3 dice and got: 4, 2, 6

The results were 4, 2, and 6. Would you like me to roll again or roll a different number of dice?
```


## Authentication

<VersionBadge version="2.6.0" />

The MCP connector supports OAuth authentication through authorization tokens, which means you can secure your server while still allowing Anthropic to access it.

### Server Authentication

The simplest way to add authentication to the server is to use a bearer token scheme. 

For this example, we'll quickly generate our own tokens with FastMCP's `RSAKeyPair` utility, but this may not be appropriate for production use. For more details, see the complete server-side [Token Verification](/servers/auth/token-verification) documentation. 

We'll start by creating an RSA key pair to sign and verify tokens.

```python
from fastmcp.server.auth.providers.jwt import RSAKeyPair

key_pair = RSAKeyPair.generate()
access_token = key_pair.create_token(audience="dice-server")
```

<Warning>
FastMCP's `RSAKeyPair` utility is for development and testing only.
</Warning> 

Next, we'll create a `JWTVerifier` to authenticate the server. 

```python
from fastmcp import FastMCP
from fastmcp.server.auth import JWTVerifier

auth = JWTVerifier(
    public_key=key_pair.public_key,
    audience="dice-server",
)

mcp = FastMCP(name="Dice Roller", auth=auth)
```

Here is a complete example that you can copy/paste. For simplicity and the purposes of this example only, it will print the token to the console. **Do NOT do this in production!**

```python server.py [expandable]
from fastmcp import FastMCP
from fastmcp.server.auth import JWTVerifier
from fastmcp.server.auth.providers.jwt import RSAKeyPair
import random

key_pair = RSAKeyPair.generate()
access_token = key_pair.create_token(audience="dice-server")

auth = JWTVerifier(
    public_key=key_pair.public_key,
    audience="dice-server",
)

mcp = FastMCP(name="Dice Roller", auth=auth)

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    print(f"\n---\n\n🔑 Dice Roller access token:\n\n{access_token}\n\n---\n")
    mcp.run(transport="http", port=8000)
```

### Client Authentication

If you try to call the authenticated server with the same Anthropic code we wrote earlier, you'll get an error indicating that the server rejected the request because it's not authenticated.

```text
Error code: 400 - {
    "type": "error", 
    "error": {
        "type": "invalid_request_error", 
        "message": "MCP server 'dice-server' requires authentication. Please provide an authorization_token.",
    },
}
```

To authenticate the client, you can pass the token using the `authorization_token` parameter in your MCP server configuration:

```python {8, 22}
import anthropic
from rich import print

# Your server URL (replace with your actual URL)
url = 'https://your-server-url.com'

# Your access token (replace with your actual token)
access_token = 'your-access-token'

client = anthropic.Anthropic()

response = client.beta.messages.create(
    model="claude-sonnet-5",
    max_tokens=1000,
    betas=["mcp-client-2025-11-20"],
    messages=[{"role": "user", "content": "Roll a few dice!"}],
    mcp_servers=[
        {
            "type": "url",
            "url": f"{url}/mcp",
            "name": "dice-server",
            "authorization_token": access_token
        }
    ],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "dice-server"}],
)

print(response.content)
```

You should now see the dice roll results in the output.

---

### Integrations Auth0 (`docs/integrations/auth0.mdx`)

---
title: Auth0 OAuth 🤝 FastMCP
sidebarTitle: Auth0
description: Secure your FastMCP server with Auth0 OAuth
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.12.4" />

FastMCP supports two Auth0 integration paths:

- **[Auth for MCP](#auth-for-mcp-dcr)** — Auth0 handles OAuth, DCR, and CIMD; FastMCP validates tokens (`Auth0MCPProvider`). Use this for MCP-native clients and Auth0's [Auth for MCP](https://auth0.com/ai/docs/mcp/intro/overview) setup.
- **[OIDC Proxy](#oidc-proxy-fixed-credentials)** — FastMCP proxies OAuth with fixed application credentials (`Auth0Provider`). Use this when you manage an Auth0 application manually and do not need tenant-level DCR.

## Auth for MCP (DCR)

<VersionBadge version="4.0.0" />

This path uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern. Auth0 acts as the authorization server; FastMCP is the resource server.

### Prerequisites

1. An **[Auth0 account](https://auth0.com/)** with **Auth for MCP** enabled
2. **Resource Parameter Compatibility Profile** enabled (Settings → Advanced)
3. Your FastMCP server URL (use `http://127.0.0.1:8000` in development — not `localhost`)

See Auth0's [authorization quickstart](https://auth0.com/ai/docs/mcp/get-started/authorization-for-your-mcp-server) for tenant setup (API identifier, domain-level connections, CIMD approval).

### Step 1: Create an Auth0 API

Create an API (Resource Server) whose **identifier** is your MCP resource URL, for example `http://127.0.0.1:8000/mcp`. Use `RS256` signing and the `rfc9068_profile_authz` token dialect if you need `permissions` claims on tokens.

When the server starts, it logs the exact `aud` value it validates — your API identifier must match.

### Step 2: FastMCP configuration

```python server_mcp.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.auth0 import Auth0MCPProvider

auth_provider = Auth0MCPProvider(
    config_url="https://YOUR_TENANT.auth0.com/.well-known/openid-configuration",
    base_url="http://127.0.0.1:8000",
)

mcp = FastMCP(name="Auth0 MCP Server", auth=auth_provider)
```

No `client_id` or `client_secret` is required on the FastMCP side — MCP clients register with Auth0 directly.

### Testing

See `examples/auth/auth0_mcp/` for a runnable server and DCR client. Set `AUTH0_CONFIG_URL` to your tenant's OIDC discovery URL before starting the server.

## OIDC Proxy (fixed credentials)

This integration uses the [**OIDC Proxy**](/servers/auth/oidc-proxy) pattern when you use a fixed Auth0 application instead of tenant-level DCR.

### Prerequisites

Before you begin, you will need:
1. An **[Auth0 Account](https://auth0.com/)** with access to create Applications
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Create an Auth0 Application

Create an Application in your Auth0 settings to get the credentials needed for authentication:

<Steps>
<Step title="Navigate to Applications">
    Go to **Applications → Applications** in your Auth0 account.

    Click **"+ Create Application"** to create a new application.
</Step>

<Step title="Create Your Application">
    - **Name**: Choose a name users will recognize (e.g., "My FastMCP Server")
    - **Choose an application type**: Choose "Single Page Web Applications"
    - Click **Create** to create the application
</Step>

<Step title="Configure Your Application">
    Select the "Settings" tab for your application, then find the "Application URIs" section.

    - **Allowed Callback URLs**: Your server URL + `/auth/callback` (e.g., `http://localhost:8000/auth/callback`)
    - Click **Save** to save your changes

    <Warning>
    The callback URL must match exactly. The default path is `/auth/callback`, but you can customize it using the `redirect_path` parameter.
    </Warning>

    <Tip>
    If you want to use a custom callback path (e.g., `/auth/auth0/callback`), make sure to set the same path in both your Auth0 Application settings and the `redirect_path` parameter when configuring the Auth0Provider.
    </Tip>
</Step>

<Step title="Save Your Credentials">
    After creating the app, in the "Basic Information" section you'll see:

    - **Client ID**: A public identifier like `tv2ObNgaZAWWhhycr7Bz1LU2mxlnsmsB`
    - **Client Secret**: A private hidden value that should always be stored securely

    <Tip>
    Store these credentials securely. Never commit them to version control. Use environment variables or a secrets manager in production.
    </Tip>
</Step>

<Step title="Select Your Audience">
  Go to **Applications → APIs** in your Auth0 account.

    - Find the API that you want to use for your application
    - **API Audience**: A URL that uniquely identifies the API

    <Tip>
    Store the audience alongside the credentials above; `Auth0Provider` needs it.
    </Tip>
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server using the `Auth0Provider`.

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.auth0 import Auth0Provider

# The Auth0Provider utilizes Auth0 OIDC configuration
auth_provider = Auth0Provider(
    config_url="https://.../.well-known/openid-configuration",  # Your Auth0 configuration URL
    client_id="tv2ObNgaZAWWhhycr7Bz1LU2mxlnsmsB",               # Your Auth0 application Client ID
    client_secret="vPYqbjemq...",                               # Your Auth0 application Client Secret
    audience="https://...",                                     # Your Auth0 API audience
    base_url="http://localhost:8000",                           # Must match your application configuration
    # redirect_path="/auth/callback"                            # Default value, customize if needed
)

mcp = FastMCP(name="Auth0 Secured App", auth=auth_provider)

# Add a protected tool to test authentication
@mcp.tool
async def get_token_info() -> dict:
    """Returns information about the Auth0 token."""
    from fastmcp.server.dependencies import get_access_token

    token = get_access_token()

    return {
        "issuer": token.claims.get("iss"),
        "audience": token.claims.get("aud"),
        "scope": token.claims.get("scope")
    }
```

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by Auth0 authentication.

### Testing with a Client

Create a test client that authenticates with your Auth0-protected server:

```python test_client.py
from fastmcp import Client
import asyncio

async def main():
    # The client will automatically handle Auth0 OAuth flows
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        # First-time connection will open Auth0 login in your browser
        print("✓ Authenticated with Auth0!")

        # Test the protected tool
        result = await client.call_tool("get_token_info")
        token_info = result.data
        print(f"Auth0 audience: {token_info['audience']}")

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to Auth0's authorization page
2. After you authorize the app, you'll be redirected back
3. The client receives the token and can make authenticated requests

## Production Configuration

<VersionBadge version="2.13.0" />

For production deployments with persistent token management across server restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.auth0 import Auth0Provider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

# Production setup with encrypted persistent token storage
auth_provider = Auth0Provider(
    config_url="https://.../.well-known/openid-configuration",
    client_id="tv2ObNgaZAWWhhycr7Bz1LU2mxlnsmsB",
    client_secret="vPYqbjemq...",
    audience="https://...",
    base_url="https://your-production-domain.com",

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production Auth0 App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

---

### Integrations Authkit (`docs/integrations/authkit.mdx`)

---
title: AuthKit 🤝 FastMCP
sidebarTitle: AuthKit
description: Secure your FastMCP server with AuthKit by WorkOS
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.11.0" />

This guide shows you how to secure your FastMCP server using WorkOS's **AuthKit**, a complete authentication and user management solution. This integration uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern with [RFC 8707](https://www.rfc-editor.org/rfc/rfc8707.html) resource indicators: AuthKit issues tokens whose `aud` claim is bound to your server's resource URL, and FastMCP validates that claim automatically.

## Configuration

### Prerequisites

Before you begin, you will need:
1.  A **[WorkOS Account](https://workos.com/)** and a new **Project**.
2.  An **[AuthKit](https://www.authkit.com/)** instance configured within your WorkOS project.
3.  Your FastMCP server's URL (can be localhost for development, e.g., `http://127.0.0.1:8000`).

### Step 1: WorkOS Dashboard

In the WorkOS Dashboard, go to **Connect → Configuration** and configure:

<Steps>
<Step title="MCP Auth">
    Enable **Dynamic Client Registration** (DCR) so MCP clients can register themselves. Alternatively, enable **Client ID Metadata Document** (CIMD) if your clients support it.
</Step>

<Step title="MCP resource indicators">
    Add your FastMCP server's resource URL (e.g., `http://127.0.0.1:8000/mcp`) as a valid resource indicator.

    This must exactly match what FastMCP advertises in its protected resource metadata. Start your server first and it will log the correct URL on startup — copy that value.

    Without this step, AuthKit falls back to a default environment-scoped audience and audience validation will fail with a 401.
</Step>

<Step title="Note Your AuthKit Domain">
    Find your **AuthKit Domain** on the configuration page. It will look like `https://your-project-12345.authkit.app`. You'll need this for your FastMCP server configuration.
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server file and use the `AuthKitProvider` to handle all the OAuth integration automatically:

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.workos import AuthKitProvider

# AuthKitProvider automatically discovers WorkOS endpoints, configures JWT
# validation, and binds the token audience to this server's resource URL.
auth_provider = AuthKitProvider(
    authkit_domain="https://your-project-12345.authkit.app",
    base_url="http://127.0.0.1:8000",  # Use your actual server URL
)

mcp = FastMCP(name="AuthKit Secured App", auth=auth_provider)
```

When the server starts, it logs the resource URL it is validating against. Paste that URL into your Dashboard's **MCP resource indicators** list.

## Testing

To test your server, you can use the `fastmcp` CLI to run it locally. Assuming you've saved the above code to `server.py` (after replacing the `authkit_domain` and `base_url` with your actual values!), you can run the following command:

```bash
fastmcp run server.py --transport http --port 8000
```

AuthKit defaults DCR clients to `client_secret_basic` for token exchange, which conflicts with how some MCP clients send credentials. To avoid token exchange errors, register as a public client by setting `token_endpoint_auth_method` to `"none"`:

```python client.py
from fastmcp import Client
from fastmcp.client.auth import OAuth
import asyncio

auth = OAuth(additional_client_metadata={"token_endpoint_auth_method": "none"})

async def main():
    async with Client("http://127.0.0.1:8000/mcp", auth=auth) as client:
        tools = await client.list_tools()
        print(f"Authenticated. Server exposes {len(tools)} tools.")

if __name__ == "__main__":
    asyncio.run(main())
```

## Production Configuration

For production deployments, load configuration from environment variables:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.workos import AuthKitProvider

# Load configuration from environment variables
auth = AuthKitProvider(
    authkit_domain=os.environ["AUTHKIT_DOMAIN"],
    base_url=os.environ.get("BASE_URL", "https://your-server.com"),
)

mcp = FastMCP(name="AuthKit Secured App", auth=auth)
```

---

### Integrations Aws Cognito (`docs/integrations/aws-cognito.mdx`)

---
title: AWS Cognito OAuth 🤝 FastMCP
sidebarTitle: AWS Cognito
description: Secure your FastMCP server with AWS Cognito user pools
icon: aws
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.12.4" />

This guide shows you how to secure your FastMCP server using **AWS Cognito user pools**. Since AWS Cognito doesn't support Dynamic Client Registration, this integration uses the [**OIDC Proxy**](/servers/auth/oidc-proxy) pattern to bridge AWS Cognito's traditional OAuth with MCP's authentication requirements, and validates Cognito's JWTs on every request.

## Configuration

### Prerequisites

Before you begin, you will need:
1. An **[AWS Account](https://aws.amazon.com/)** with access to create AWS Cognito user pools
2. Basic familiarity with AWS Cognito concepts (user pools, app clients)
3. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Create an AWS Cognito User Pool and App Client

Set up AWS Cognito user pool with an app client to get the credentials needed for authentication:

<Steps>
<Step title="Navigate to AWS Cognito">
    Go to the **[AWS Cognito Console](https://console.aws.amazon.com/cognito/)** and ensure you're in your desired AWS region.

    Select **"User pools"** from the side navigation (click on the hamburger icon at the top left in case you don't see any), and click **"Create user pool"** to create a new user pool.
</Step>

<Step title="Define Your Application">
    AWS Cognito now provides a streamlined setup experience:

    1. **Application type**: Select **"Traditional web application"** (this is the correct choice for FastMCP server-side authentication)
    2. **Name your application**: Enter a descriptive name (e.g., `FastMCP Server`)

    The traditional web application type automatically configures:
    - Server-side authentication with client secrets
    - Authorization code grant flow
    - Appropriate security settings for confidential clients

    <Info>
    Choose "Traditional web application" rather than SPA, Mobile app, or Machine-to-machine options. This ensures proper OAuth 2.0 configuration for FastMCP.
    </Info>
</Step>

<Step title="Configure Options">
    AWS will guide you through configuration options:

    - **Sign-in identifiers**: Choose how users will sign in (email, username, or phone)
    - **Required attributes**: Select any additional user information you need
    - **Return URL**: Add your callback URL (e.g., `http://localhost:8000/auth/callback` for development)

    <Tip>
    The simplified interface handles most OAuth security settings automatically based on your application type selection.
    </Tip>
</Step>

<Step title="Review and Create">
    Review your configuration and click **"Create user pool"**.

    After creation, you'll see your user pool details. Save these important values:
    - **User pool ID** (format: `eu-central-1_XXXXXXXXX`)
    - **Client ID** (found under → "Applications" → "App clients" in the side navigation → \<Your application name, e.g., `FastMCP Server`\> → "App client information")
    - **Client Secret** (found under → "Applications" → "App clients" in the side navigation → \<Your application name, e.g., `FastMCP Server`\> → "App client information")

    <Tip>
    The user pool ID and app client credentials are all you need for FastMCP configuration.
    </Tip>
</Step>

<Step title="Configure OAuth Settings">
    Under "Login pages" in your app client's settings, you can double check and adjust the OAuth configuration:

    - **Allowed callback URLs**: Add your server URL + `/auth/callback` (e.g., `http://localhost:8000/auth/callback`)
    - **Allowed sign-out URLs**: Optional, for logout functionality
    - **OAuth 2.0 grant types**: Ensure "Authorization code grant" is selected
    - **OpenID Connect scopes**: Select scopes your application needs (e.g., `openid`, `email`, `profile`)

    <Tip>
    For local development, you can use `http://localhost` URLs. For production, you must use HTTPS.
    </Tip>
</Step>

<Step title="Configure Resource Server">
    AWS Cognito requires a resource server entry to support OAuth with protected resources. Without this, token exchange will fail with an `invalid_grant` error.

    Navigate to **"Branding" → "Domain"** in the side navigation, then:

    1. Click **"Create resource server"**
    2. **Resource server name**: Enter a descriptive name (e.g., `My MCP Server`)
    3. **Resource server identifier**: Enter your MCP endpoint URL exactly as it will be accessed (e.g., `http://localhost:8000/mcp` for development, or `https://your-server.com/mcp` for production)
    4. Click **"Create resource server"**

    <Warning>
    The resource server identifier must exactly match your `base_url + mcp_path`. For the default configuration with `base_url="http://localhost:8000"` and `path="/mcp"`, use `http://localhost:8000/mcp`.
    </Warning>
</Step>

<Step title="Save Your Credentials">
    After setup, you'll have:

    - **User Pool ID**: Format like `eu-central-1_XXXXXXXXX`
    - **Client ID**: Your application's client identifier
    - **Client Secret**: Generated client secret (keep secure)
    - **AWS Region**: Where your AWS Cognito user pool is located

    <Tip>
    Store these credentials securely. Never commit them to version control. Use environment variables or AWS Secrets Manager in production.
    </Tip>
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server using the `AWSCognitoProvider`, which handles AWS Cognito's JWT tokens and user claims automatically:

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.aws import AWSCognitoProvider
from fastmcp.server.dependencies import get_access_token

# The AWSCognitoProvider handles JWT validation and user claims
auth_provider = AWSCognitoProvider(
    user_pool_id="eu-central-1_XXXXXXXXX",   # Your AWS Cognito user pool ID
    aws_region="eu-central-1",               # AWS region (defaults to eu-central-1)
    client_id="your-app-client-id",          # Your app client ID
    client_secret="your-app-client-secret",  # Your app client Secret
    base_url="http://localhost:8000",        # Must match your callback URL
    # redirect_path="/auth/callback"         # Default value, customize if needed
)

mcp = FastMCP(name="AWS Cognito Secured App", auth=auth_provider)

# Add a protected tool to test authentication
@mcp.tool
async def get_access_token_claims() -> dict:
    """Get the authenticated user's access token claims."""
    token = get_access_token()
    return {
        "sub": token.claims.get("sub"),
        "username": token.claims.get("username"),
        "cognito:groups": token.claims.get("cognito:groups", []),
    }
```

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by AWS Cognito OAuth authentication.

### Testing with a Client

Create a test client that authenticates with your AWS Cognito-protected server:

```python test_client.py
from fastmcp import Client
import asyncio

async def main():
    # The client will automatically handle AWS Cognito OAuth
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        # First-time connection will open AWS Cognito login in your browser
        print("✓ Authenticated with AWS Cognito!")

        # Test the protected tool
        print("Calling protected tool: get_access_token_claims")
        result = await client.call_tool("get_access_token_claims")
        user_data = result.data
        print("Available access token claims:")
        print(f"- sub: {user_data.get('sub', 'N/A')}")
        print(f"- username: {user_data.get('username', 'N/A')}")
        print(f"- cognito:groups: {user_data.get('cognito:groups', [])}")

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to AWS Cognito's hosted UI login page
2. After you sign in (or sign up), you'll be redirected back to your MCP server
3. The client receives the JWT token and can make authenticated requests

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

## Production Configuration

<VersionBadge version="2.13.0" />

For production deployments with persistent token management across server restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.aws import AWSCognitoProvider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

# Production setup with encrypted persistent token storage
auth_provider = AWSCognitoProvider(
    user_pool_id="eu-central-1_XXXXXXXXX",
    aws_region="eu-central-1",
    client_id="your-app-client-id",
    client_secret="your-app-client-secret",
    base_url="https://your-production-domain.com",

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production AWS Cognito App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

## Features

### JWT Token Validation

The AWS Cognito provider validates every token it receives:

- **Signature Verification**: Validates tokens against AWS Cognito's public keys (JWKS)
- **Expiration Checking**: Automatically rejects expired tokens
- **Issuer Validation**: Ensures tokens come from your specific AWS Cognito user pool
- **Client Validation**: Ensures the token's `client_id` claim matches your app client
- **Scope Enforcement**: Verifies required OAuth scopes are present

### User Claims and Groups

The provider exposes three claims from the Cognito access token on `token.claims`: `sub`, `username`, and `cognito:groups`. Other claims are dropped.

To restrict a tool to members of a Cognito group, use [`require_roles`](/servers/authorization#require_roles) with an extractor that reads `cognito:groups`:

```python
from fastmcp import FastMCP
from fastmcp.server.auth import require_roles
from fastmcp.server.auth.providers.aws import AWSCognitoProvider

auth_provider = AWSCognitoProvider(
    user_pool_id="eu-central-1_XXXXXXXXX",
    aws_region="eu-central-1",
    client_id="your-app-client-id",
    client_secret="your-app-client-secret",
    base_url="http://localhost:8000",
)

mcp = FastMCP(name="AWS Cognito Secured App", auth=auth_provider)


def cognito_groups(claims: dict) -> list[str]:
    return claims["cognito:groups"]


@mcp.tool(auth=require_roles("admin", extract=cognito_groups))
async def admin_only_tool() -> str:
    """A tool only available to members of the admin group."""
    return "Admin access granted!"
```

### Identity Features

Because Cognito handles sign-in, its user pool features apply without changes on the FastMCP side:

- **Single Sign-On (SSO)**: Federate with corporate identity providers
- **Multi-Factor Authentication (MFA)**: Use AWS Cognito's built-in MFA
- **User Groups**: Gate tools on Cognito groups, as shown above

---

### Integrations Azure (`docs/integrations/azure.mdx`)

---
title: Azure (Microsoft Entra ID) OAuth 🤝 FastMCP
sidebarTitle: Azure (Entra ID)
description: Secure your FastMCP server with Azure/Microsoft Entra OAuth
icon: microsoft
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.13.0" />

This guide shows you how to secure your FastMCP server using **Azure OAuth** (Microsoft Entra ID). Since Azure doesn't support Dynamic Client Registration, this integration uses the [**OAuth Proxy**](/servers/auth/oauth-proxy) pattern to bridge Azure's traditional OAuth with MCP's authentication requirements. FastMCP validates Azure JWTs against your application's client_id.

## Configuration

### Prerequisites

Before you begin, you will need:
1. An **[Azure Account](https://portal.azure.com/)** with access to create App registrations
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)
3. Your Azure tenant ID (found in Azure Portal under Microsoft Entra ID)

### Step 1: Create an Azure App Registration

Create an App registration in Azure Portal to get the credentials needed for authentication:

<Steps>
<Step title="Navigate to App registrations">
    Go to the [Azure Portal](https://portal.azure.com) and navigate to **Microsoft Entra ID → App registrations**.
    
    Click **"New registration"** to create a new application.
</Step>

<Step title="Configure Your Application">
    Fill in the application details:
    
    - **Name**: Choose a name users will recognize (e.g., "My FastMCP Server")
    - **Supported account types**: Choose based on your needs:
      - **Single tenant**: Only users in your organization
      - **Multitenant**: Users in any Microsoft Entra directory
      - **Multitenant + personal accounts**: Any Microsoft account
    - **Redirect URI**: Select "Web" and enter your server URL + `/auth/callback` (e.g., `http://localhost:8000/auth/callback`)
    
    <Warning>
    The redirect URI must match exactly. The default path is `/auth/callback`, but you can customize it using the `redirect_path` parameter. For local development, Azure allows `http://localhost` URLs. For production, you must use HTTPS.
    </Warning>
    
    <Tip>
    If you want to use a custom callback path (e.g., `/auth/azure/callback`), make sure to set the same path in both your Azure App registration and the `redirect_path` parameter when configuring the AzureProvider.
    </Tip>

    - **Expose an API**: Configure your Application ID URI and define scopes
      - Go to **Expose an API** in the App registration sidebar.
      - Click **Set** next to "Application ID URI" and choose one of:
        - Keep the default `api://{client_id}`
        - Set a custom value, following the supported formats (see [Identifier URI restrictions](https://learn.microsoft.com/en-us/entra/identity-platform/identifier-uri-restrictions))
      - Click **Add a scope** and create a scope your app will require, for example:
        - Scope name: `read` (or `write`, etc.)
        - Admin consent display name/description: as appropriate for your org
        - Who can consent: as needed (Admins only or Admins and users)

    - **Configure Access Token Version**: Ensure your app uses access token v2
      - Go to **Manifest** in the App registration sidebar.
      - Find the `requestedAccessTokenVersion` property and set it to `2`:
        ```json
        "api": {
            "requestedAccessTokenVersion": 2
        }
        ```
      - Click **Save** at the top of the manifest editor.

    <Warning>
    Access token v2 is required for FastMCP's Azure integration to work correctly. If this is not set, you may encounter authentication errors.
    </Warning>

    <Note>
    In FastMCP's `AzureProvider`, set `identifier_uri` to your Application ID URI (optional; defaults to `api://{client_id}`) and set `required_scopes` to the unprefixed scope names (e.g., `read`, `write`). During authorization, FastMCP automatically prefixes scopes with your `identifier_uri`.
    </Note>


</Step>


<Step title="Create Client Secret">
    After registration, navigate to **Certificates & secrets** in your app's settings.
    
    - Click **"New client secret"**
    - Add a description (e.g., "FastMCP Server")
    - Choose an expiration period
    - Click **"Add"**
    
    <Warning>
    Copy the secret value immediately - it won't be shown again! You'll need to create a new secret if you lose it.
    </Warning>
</Step>

<Step title="Note Your Credentials">
    From the **Overview** page of your app registration, note:
    
    - **Application (client) ID**: A UUID like `835f09b6-0f0f-40cc-85cb-f32c5829a149`
    - **Directory (tenant) ID**: A UUID like `08541b6e-646d-43de-a0eb-834e6713d6d5`
    - **Client Secret**: The value you copied in the previous step
    
    <Tip>
    Store these credentials securely. Never commit them to version control. Use environment variables or a secrets manager in production.
    </Tip>
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server using the `AzureProvider`, which handles Azure's OAuth flow automatically:

```
/* Detailed source-code truncated for AI context efficiency. */
```

<Note>
**Important**: The `tenant_id` parameter is **REQUIRED**. Azure no longer supports using "common" for new applications due to security requirements. You must use one of:

- **Your specific tenant ID**: Found in Azure Portal (e.g., `08541b6e-646d-43de-a0eb-834e6713d6d5`)
- **"organizations"**: For work and school accounts only
- **"consumers"**: For personal Microsoft accounts only

Using your specific tenant ID is recommended for better security and control.
</Note>

<Note>
**Important**: The `required_scopes` parameter is **REQUIRED** and must include at least one scope. Azure's OAuth API requires the `scope` parameter in all authorization requests - you cannot authenticate without specifying at least one scope. Use the unprefixed scope names from your Azure App registration (e.g., `["read", "write"]`). These scopes must be created under **Expose an API** in your App registration.
</Note>

### Scope Handling

FastMCP automatically prefixes `required_scopes` with your `identifier_uri` (e.g., `api://your-client-id`) since these are your custom API scopes. Scopes in `additional_authorize_scopes` are sent as-is since they target external resources like Microsoft Graph.

**`required_scopes`** — Your custom API scopes, defined in Azure "Expose an API":

| You write | Sent to Azure | Validated on tokens |
|-----------|---------------|---------------------|
| `mcp-read` | `api://xxx/mcp-read` | ✓ |
| `my.scope` | `api://xxx/my.scope` | ✓ |
| `openid` | `openid` | ✗ (OIDC scope) |
| `api://xxx/read` | `api://xxx/read` | ✓ |

**`additional_authorize_scopes`** — External scopes (e.g., Microsoft Graph) for server-side use:

| You write | Sent to Azure | Validated on tokens |
|-----------|---------------|---------------------|
| `User.Read` | `User.Read` | ✗ |
| `Mail.Send` | `Mail.Send` | ✗ |

<Note>
`offline_access` is automatically included to obtain refresh tokens. FastMCP manages token refreshing automatically.
</Note>

<Info>
**Why aren't `additional_authorize_scopes` validated?** Azure issues separate tokens per resource. The access token FastMCP receives is for *your API*—Graph scopes aren't in its `scp` claim. To call Graph APIs, your server uses the upstream Azure token in an on-behalf-of (OBO) flow.
</Info>

<Note>
OIDC scopes (`openid`, `profile`, `email`, `offline_access`) are never prefixed and excluded from validation because Azure doesn't include them in access token `scp` claims.
</Note>

### Account Selection

By default, `AzureProvider` sends `prompt=select_account` to Azure, so Entra shows an account picker rather than reusing whichever session the browser already holds without asking. Users signed in to several Microsoft accounts, or holding a stale session, can then pick the right one.

Pass `extra_authorize_params` to send different parameters to Azure's authorization endpoint:

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.azure import AzureProvider

auth = AzureProvider(
    client_id="your-client-id",
    client_secret="your-client-secret",
    tenant_id="your-tenant-id",
    base_url="http://localhost:8000",
    required_scopes=["read"],
    extra_authorize_params={"domain_hint": "contoso.com"},
)

mcp = FastMCP("My App", auth=auth)
```

A dict you pass replaces the default rather than merging with it. The example above sends `domain_hint` and no `prompt`. To keep the account picker alongside another parameter, name both:

```python
extra_authorize_params={"prompt": "select_account", "domain_hint": "contoso.com"}
```

Passing `{}` sends no extra parameters at all, which leaves Azure to its own default of silent single sign-on.

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by Azure OAuth authentication.

### Testing with a Client

Create a test client that authenticates with your Azure-protected server:

```python test_client.py
from fastmcp import Client
import asyncio

async def main():
    # The client will automatically handle Azure OAuth
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        # First-time connection will open Azure login in your browser
        print("✓ Authenticated with Azure!")
        
        # Test the protected tool
        result = await client.call_tool("get_user_info")
        user_info = result.data
        print(f"Azure user: {user_info['username']}")
        print(f"Name: {user_info['name']}")

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to Microsoft's authorization page
2. Sign in with your Microsoft account (work, school, or personal based on your tenant configuration)
3. Grant the requested permissions
4. After authorization, you'll be redirected back
5. The client receives the token and can make authenticated requests

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

## Production Configuration

<VersionBadge version="2.13.0" />

For production deployments with persistent token management across server restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.azure import AzureProvider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

# Production setup with encrypted persistent token storage
auth_provider = AzureProvider(
    client_id="835f09b6-0f0f-40cc-85cb-f32c5829a149",
    client_secret="your-client-secret",
    tenant_id="08541b6e-646d-43de-a0eb-834e6713d6d5",
    base_url="https://your-production-domain.com",
    required_scopes=["your-scope"],

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production Azure App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

## Token Verification Only (Managed Identity)

<VersionBadge version="2.15.0" />

For deployments where your server only needs to **validate incoming tokens** — such as Azure Container Apps with Managed Identity — use `AzureJWTVerifier` with `RemoteAuthProvider` instead of the full `AzureProvider`.

This pattern is ideal when:
- Your infrastructure handles authentication (e.g., Managed Identity)
- You don't need the OAuth proxy flow (no `client_secret` required)
- You just need to verify that incoming Azure AD tokens are valid

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth import RemoteAuthProvider
from fastmcp.server.auth.providers.azure import AzureJWTVerifier
from pydantic import AnyHttpUrl

tenant_id = "your-tenant-id"
client_id = "your-client-id"

# AzureJWTVerifier auto-configures JWKS, issuer, and audience
verifier = AzureJWTVerifier(
    client_id=client_id,
    tenant_id=tenant_id,
    required_scopes=["access_as_user"],  # Scope names from Azure Portal
)

auth = RemoteAuthProvider(
    token_verifier=verifier,
    authorization_servers=[
        AnyHttpUrl(f"https://login.microsoftonline.com/{tenant_id}/v2.0")
    ],
    base_url="https://your-container-app.azurecontainerapps.io",
)

mcp = FastMCP(name="Azure MI App", auth=auth)
```

`AzureJWTVerifier` handles Azure's scope format automatically. You write scope names exactly as they appear in Azure Portal under **Expose an API** (e.g., `access_as_user`). The verifier validates tokens using the short-form scopes that Azure puts in the `scp` claim, while advertising the full URI scopes (e.g., `api://your-client-id/access_as_user`) in OAuth metadata so MCP clients know what to request.

<Note>
For Azure Government, pass `base_authority="login.microsoftonline.us"` to `AzureJWTVerifier`.
</Note>

## On-Behalf-Of (OBO)

<VersionBadge version="3.0.0" />

The On-Behalf-Of (OBO) flow allows your FastMCP server to call downstream Microsoft APIs—like Microsoft Graph—using the authenticated user's identity. When a user authenticates to your MCP server, you receive a token for your API. OBO exchanges that token for a new token that can call other services, maintaining the user's identity and permissions throughout the chain.

This pattern is useful when your tools need to access user-specific data from Microsoft services: reading emails, accessing calendar events, querying SharePoint, or any other Graph API operation that requires user context.

<Note>
OBO features require the `azure` extra:

```bash
pip install 'fastmcp[azure]'
```
</Note>

### Azure Portal Setup

OBO requires additional configuration in your Azure App registration beyond basic authentication.

<Steps>
<Step title="Add API Permissions">
    In your App registration, navigate to **API permissions** and add the Microsoft Graph permissions your tools will need.

    - Click **Add a permission** → **Microsoft Graph** → **Delegated permissions**
    - Select the permissions required for your use case (e.g., `Mail.Read`, `Calendars.Read`, `User.Read`)
    - Repeat for any other APIs you need to call

    <Warning>
    Only add delegated permissions for OBO. Application permissions bypass user context entirely and are inappropriate for the OBO flow.
    </Warning>
</Step>

<Step title="Grant Admin Consent">
    OBO requires admin consent for the permissions you've added. In the **API permissions** page, click **Grant admin consent for [Your Organization]**.

    Without admin consent, OBO token exchanges will fail with an `AADSTS65001` error indicating the user or administrator hasn't consented to use the application.

    <Tip>
    For development, you can grant consent for just your own account. For production, an Azure AD administrator must grant tenant-wide consent.
    </Tip>
</Step>
</Steps>

### Configure AzureProvider for OBO

The `additional_authorize_scopes` parameter tells Azure which downstream API permissions to include during the initial authorization. These scopes establish what your server can request through OBO later.

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.azure import AzureProvider

auth_provider = AzureProvider(
    client_id="your-client-id",
    client_secret="your-client-secret",
    tenant_id="your-tenant-id",
    base_url="http://localhost:8000",
    required_scopes=["mcp-access"],  # Your API scope
    # Include Graph scopes for OBO
    additional_authorize_scopes=[
        "https://graph.microsoft.com/Mail.Read",
        "https://graph.microsoft.com/User.Read",
        "offline_access",  # Enables refresh tokens
    ],
)

mcp = FastMCP(name="Graph-Enabled Server", auth=auth_provider)
```

Scopes listed in `additional_authorize_scopes` are requested during the initial OAuth flow but aren't validated on incoming tokens. They establish permission for your server to later exchange the user's token for downstream API access.

<Info>
Use fully-qualified scope URIs for downstream APIs (e.g., `https://graph.microsoft.com/Mail.Read`). Short forms like `Mail.Read` work for authorization requests, but fully-qualified URIs are clearer and avoid ambiguity.
</Info>

### EntraOBOToken Dependency

The `EntraOBOToken` dependency handles the complete OBO flow automatically. Declare it as a parameter default with the scopes you need, and FastMCP exchanges the user's token for a downstream API token before your function runs.

```python
from fastmcp import FastMCP
from fastmcp.server.auth.providers.azure import AzureProvider, EntraOBOToken
import httpx2

auth_provider = AzureProvider(
    client_id="your-client-id",
    client_secret="your-client-secret",
    tenant_id="your-tenant-id",
    base_url="http://localhost:8000",
    required_scopes=["mcp-access"],
    additional_authorize_scopes=[
        "https://graph.microsoft.com/Mail.Read",
        "https://graph.microsoft.com/User.Read",
    ],
)

mcp = FastMCP(name="Email Reader", auth=auth_provider)

@mcp.tool
async def get_recent_emails(
    count: int = 10,
    graph_token: str = EntraOBOToken(["https://graph.microsoft.com/Mail.Read"]),
) -> list[dict]:
    """Get the user's recent emails from Microsoft Graph."""
    async with httpx2.AsyncClient() as client:
        response = await client.get(
            f"https://graph.microsoft.com/v1.0/me/messages?$top={count}",
            headers={"Authorization": f"Bearer {graph_token}"},
        )
        response.raise_for_status()
        data = response.json()

    return [
        {"subject": msg["subject"], "from": msg["from"]["emailAddress"]["address"]}
        for msg in data.get("value", [])
    ]
```

The `graph_token` parameter receives a ready-to-use access token for Microsoft Graph. FastMCP handles the OBO exchange transparently—your function just uses the token to call the API.

<Warning>
**Scope alignment is critical.** The scopes passed to `EntraOBOToken` must be a subset of the scopes in `additional_authorize_scopes`. If you request a scope during OBO that wasn't included in the initial authorization, the exchange will fail.
</Warning>

<Tip>
For advanced OBO scenarios, use `CurrentAccessToken()` to get the user's token, then construct an `azure.identity.aio.OnBehalfOfCredential` directly with your Azure credentials.
</Tip>

<Tip>
For a complete working example of Azure OBO with FastMCP, see [Pamela Fox's blog post on OBO flow for Entra-based MCP servers](https://blog.pamelafox.org/2026/01/using-on-behalf-of-flow-for-entra-based.html).
</Tip>

## Azure AD B2C

<VersionBadge version="3.3.0" />

Azure AD B2C (Business-to-Consumer) uses different endpoints, scope URIs, and
token issuers than standard Microsoft Entra ID. The `AzureProvider.from_b2c()`
factory handles all of these differences automatically.

<Warning>
Azure AD B2C does **not** support the On-Behalf-Of (OBO) flow. If you need
OBO for downstream API calls, use `AzureProvider` with standard Entra ID
instead.
</Warning>

### Quick Start

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.azure import AzureProvider

auth = AzureProvider.from_b2c(
    tenant_name="mytenant",
    policy_name="B2C_1_susi",
    client_id="00000000-0000-0000-0000-000000000000",
    client_secret="my-secret",
    required_scopes=["mcp-access"],
    base_url="https://myserver.com",
)

mcp = FastMCP("My App", auth=auth)
```

`from_b2c()` derives the following values automatically:

| Derived value | Formula |
|---|---|
| Authority host | `{tenant_name}.b2clogin.com` |
| Authorization endpoint | `https://{tenant_name}.b2clogin.com/{tenant_name}.onmicrosoft.com/{policy_name}/oauth2/v2.0/authorize` |
| Token endpoint | `https://{tenant_name}.b2clogin.com/{tenant_name}.onmicrosoft.com/{policy_name}/oauth2/v2.0/token` |
| Scope identifier URI | `https://{tenant_name}.onmicrosoft.com/{client_id}` |

<Note>
B2C user flows accept `prompt=login` and reject `prompt=select_account`. `from_b2c()` therefore sends no `prompt` at all, rather than the account-picker default described under [Account Selection](#account-selection). Pass `extra_authorize_params={"prompt": "login"}` to make B2C users re-enter their credentials.
</Note>

### Token Issuer Validation

B2C access tokens carry the **tenant GUID** (not the `.onmicrosoft.com` name)
in the `iss` claim, and the exact format varies by policy and custom-domain
configuration. `from_b2c()` therefore **disables issuer validation by
default**; **audience validation still enforces that tokens target the correct
application**.

Once you have confirmed a successful end-to-end login, read the actual `iss`
value from the decoded claims and enable strict validation:

```python
auth = AzureProvider.from_b2c(
    tenant_name="mytenant",
    policy_name="B2C_1_susi",
    client_id="00000000-0000-0000-0000-000000000000",
    client_secret="my-secret",
    required_scopes=["mcp-access"],
    base_url="https://myserver.com",
    token_issuer="https://mytenant.b2clogin.com/11111111-2222-3333-4444-555555555555/v2.0/",
)
```

### Custom Domains

If your B2C tenant uses a [custom domain](https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-domain)
(e.g. `auth.mycompany.com` instead of `mytenant.b2clogin.com`), pass it via
`custom_domain`:

```python
auth = AzureProvider.from_b2c(
    tenant_name="mytenant",
    policy_name="B2C_1_susi",
    client_id="00000000-0000-0000-0000-000000000000",
    client_secret="my-secret",
    required_scopes=["mcp-access"],
    base_url="https://myserver.com",
    custom_domain="auth.mycompany.com",
)
```

---

### Integrations Chatgpt (`docs/integrations/chatgpt.mdx`)

---
title: ChatGPT 🤝 FastMCP
sidebarTitle: ChatGPT
description: Connect FastMCP servers to ChatGPT in Chat and Deep Research modes
icon: message-smile
---

[ChatGPT](https://chatgpt.com/) supports MCP servers through remote HTTP connections in two modes: **Chat mode** for interactive conversations and **Deep Research mode** for comprehensive information retrieval.

<Tip>
**Developer Mode Required for Chat Mode**: To use MCP servers in regular ChatGPT conversations, you must first enable Developer Mode in your ChatGPT settings. [OpenAI's Developer Mode guide](https://platform.openai.com/docs/guides/developer-mode) lists which plans include it.
</Tip>

<Note>
OpenAI's official MCP documentation and examples are built with **FastMCP v2**! Learn more from their [MCP documentation](https://platform.openai.com/docs/mcp) and [Developer Mode guide](https://platform.openai.com/docs/guides/developer-mode).
</Note>

## Build a Server

First, let's create a simple FastMCP server:

```python server.py
from fastmcp import FastMCP
import random

mcp = FastMCP("Demo Server")

@mcp.tool
def roll_dice(sides: int = 6) -> int:
    """Roll a dice with the specified number of sides."""
    return random.randint(1, sides)

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

### Deploy Your Server

Your server must be accessible from the internet. For development, use `ngrok`:

<CodeGroup>
```bash Terminal 1
python server.py
```

```bash Terminal 2
ngrok http 8000
```
</CodeGroup>

Note your public URL (e.g., `https://abc123.ngrok.io`) for the next steps.

## Chat Mode

Chat mode lets you use MCP tools directly in ChatGPT conversations. See [OpenAI's Developer Mode guide](https://platform.openai.com/docs/guides/developer-mode) for the latest requirements.

### Add to ChatGPT

#### 1. Enable Developer Mode

1. Open ChatGPT and go to **Settings** → **Connectors**
2. Under **Advanced**, toggle **Developer Mode** to enabled

#### 2. Create Connector

1. In **Settings** → **Connectors**, click **Create**
2. Enter:
   - **Name**: Your server name
   - **Server URL**: `https://your-server.ngrok.io/mcp`
3. Check **I trust this provider**
4. Add authentication if needed
5. Click **Create**

<Note>
**Without Developer Mode**: If you don't have search/fetch tools, ChatGPT will reject the server. With Developer Mode enabled, you don't need search/fetch tools for Chat mode.
</Note>

#### 3. Use in Chat

1. Start a new chat
2. Click the **+** button → **More** → **Developer Mode**
3. **Enable your MCP server connector** (required - the connector must be explicitly added to each chat)
4. Now you can use your tools:

Example usage:
- "Roll a 20-sided dice"
- "Roll dice" (uses default 6 sides)

<Tip>
The connector must be explicitly enabled in each chat session through Developer Mode. Once added, it remains active for the entire conversation.
</Tip>

### Skip Confirmations

Use `annotations=ToolAnnotations(readOnlyHint=True)` to skip confirmation prompts for read-only tools:

```python
from fastmcp import FastMCP
from mcp_types import ToolAnnotations

mcp = FastMCP("Demo Server")

@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True))
def get_status() -> str:
    """Check system status."""
    return "All systems operational"

@mcp.tool()  # No annotation - ChatGPT may ask for confirmation
def delete_item(id: str) -> str:
    """Delete an item."""
    return f"Deleted {id}"
```

## Deep Research Mode

Deep Research mode provides systematic information retrieval with citations. See [OpenAI's MCP documentation](https://platform.openai.com/docs/mcp) for the latest Deep Research specifications.

<Warning>
**Search and Fetch Required**: Without Developer Mode, ChatGPT will reject any server that doesn't have both `search` and `fetch` tools. Even in Developer Mode, Deep Research only uses these two tools.
</Warning>

### Tool Implementation

Deep Research tools must follow this pattern:

```python
from fastmcp import FastMCP

mcp = FastMCP("Research Server")

@mcp.tool()
def search(query: str) -> dict:
    """
    Search for records matching the query.
    Must return {"ids": [list of string IDs]}
    """
    # Your search logic
    matching_ids = ["id1", "id2", "id3"]
    return {"ids": matching_ids}

@mcp.tool()
def fetch(id: str) -> dict:
    """
    Fetch a complete record by ID.
    Return the full record data for ChatGPT to analyze.
    """
    # Your fetch logic
    return {
        "id": id,
        "title": "Record Title",
        "content": "Full record content...",
        "metadata": {"author": "Jane Doe", "date": "2024"}
    }
```

### Using Deep Research

1. Ensure your server is added to ChatGPT's connectors (same as Chat mode)
2. Start a new chat
3. Click **+** → **Deep Research**
4. Select your MCP server as a source
5. Ask research questions

ChatGPT will use your `search` and `fetch` tools to find and cite relevant information.

---

### Integrations Claude Code (`docs/integrations/claude-code.mdx`)

---
title: Claude Code 🤝 FastMCP
sidebarTitle: Claude Code
description: Install and use FastMCP servers in Claude Code
icon: message-smile
---

import { VersionBadge } from "/snippets/version-badge.mdx"
import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

[Claude Code](https://docs.anthropic.com/en/docs/claude-code) supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Claude's capabilities with custom tools, resources, and prompts from your FastMCP servers.

## Requirements

This integration uses STDIO transport to run your FastMCP server locally. For remote deployments, you can run your FastMCP server with HTTP or SSE transport and configure it directly using Claude Code's built-in MCP management commands.

## Create a Server

The examples in this guide will use the following simple dice-rolling server, saved as `server.py`.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run()
```

## Install the Server

### FastMCP CLI
<VersionBadge version="2.10.3" />

The easiest way to install a FastMCP server in Claude Code is using the `fastmcp install claude-code` command. This automatically handles the configuration, dependency management, and calls Claude Code's built-in MCP management system.

```bash
fastmcp install claude-code server.py
```

The install command supports the same `file.py:object` notation as the `run` command. If no object is specified, it will automatically look for a FastMCP server object named `mcp`, `server`, or `app` in your file:

```bash
# These are equivalent if your server object is named 'mcp'
fastmcp install claude-code server.py
fastmcp install claude-code server.py:mcp

# Use explicit object name if your server has a different name
fastmcp install claude-code server.py:my_custom_server
```

The command will automatically configure the server with Claude Code's `claude mcp add` command.

#### Dependencies

FastMCP provides flexible dependency management options for your Claude Code servers:

**Individual packages**: Use the `--with` flag to specify packages your server needs. You can use this flag multiple times:

```bash
fastmcp install claude-code server.py --with pandas --with requests
```

**Requirements file**: If you maintain a `requirements.txt` file with all your dependencies, use `--with-requirements` to install them:

```bash
fastmcp install claude-code server.py --with-requirements requirements.txt
```

**Editable packages**: For local packages under development, use `--with-editable` to install them in editable mode:

```bash
fastmcp install claude-code server.py --with-editable ./my-local-package
```

Alternatively, you can use a `fastmcp.json` configuration file (recommended):

```json fastmcp.json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "dependencies": ["pandas", "requests"]
  }
}
```

Pass the configuration file to the install command in place of the server file:

```bash
fastmcp install claude-code fastmcp.json
```


#### Python Version and Project Configuration

Control the Python environment for your server with these options:

**Python version**: Use `--python` to specify which Python version your server requires. This ensures compatibility when your server needs specific Python features:

```bash
fastmcp install claude-code server.py --python 3.11
```

**Project directory**: Use `--project` to select the directory containing your MCP server's `pyproject.toml`. FastMCP passes this to `uv run --project`, which discovers the project's configuration and installs its dependencies into the project environment:

```bash
fastmcp install claude-code /path/to/mcp-server/server.py --project /path/to/mcp-server
```

`--project` selects the Python environment without changing the server's working directory. If your server reads local files, use absolute paths or resolve them relative to the server file.

#### Environment Variables

If your server needs environment variables (like API keys), you must include them:

```bash
fastmcp install claude-code server.py --name "Weather Server" \
  --env API_KEY=your-api-key \
  --env DEBUG=true
```

Or load them from a `.env` file:

```bash
fastmcp install claude-code server.py --name "Weather Server" --env-file .env
```

<Warning>
**Claude Code must be installed**. The integration looks for the `claude` executable on your `PATH`, then in common install locations such as `~/.claude/local/claude`, and uses the `claude mcp add` command to register servers.
</Warning>

### Manual Configuration

For more control over the configuration, you can manually use Claude Code's built-in MCP management commands. This gives you direct control over how your server is launched:

```bash
# Add a server with custom configuration
claude mcp add dice-roller -- uv run --with fastmcp fastmcp run server.py

# Add with environment variables
claude mcp add weather-server -e API_KEY=secret -e DEBUG=true -- uv run --with fastmcp fastmcp run server.py

# Add with specific scope (local, user, or project)
claude mcp add my-server --scope user -- uv run --with fastmcp fastmcp run server.py
```

You can also manually specify Python versions and project directories in your Claude Code commands:

```bash
# With specific Python version
claude mcp add ml-server -- uv run --python 3.11 --with fastmcp fastmcp run server.py

# Within a project directory
claude mcp add project-server -- uv run --project /path/to/project --with fastmcp fastmcp run server.py
```

## Using the Server

Once your server is installed, you can start using your FastMCP server with Claude Code.

Try asking Claude something like:

> "Roll some dice for me"

Claude will automatically detect your `roll_dice` tool and use it to fulfill your request, returning something like:

> I'll roll some dice for you! Here are your results: [4, 2, 6]
> 
> You rolled three dice and got a 4, a 2, and a 6!

Claude Code can now access all the tools, resources, and prompts you've defined in your FastMCP server. 

If your server provides resources, you can reference them with `@` mentions using the format `@server:protocol://resource/path`. If your server provides prompts, you can use them as slash commands with `/mcp__servername__promptname`.

---

### Integrations Claude Desktop (`docs/integrations/claude-desktop.mdx`)

---
title: Claude Desktop 🤝 FastMCP
sidebarTitle: Claude Desktop
description: Connect FastMCP servers to Claude Desktop
icon: message-smile
---

import { VersionBadge } from "/snippets/version-badge.mdx"
import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

[Claude Desktop](https://www.claude.com/download) supports MCP servers through local STDIO connections and remote servers (beta), allowing you to extend Claude's capabilities with custom tools, resources, and prompts from your FastMCP servers.

<Note>
Remote MCP server support is currently in beta and available for users on Claude Pro, Max, Team, and Enterprise plans (as of June 2025). Most users will still need to use local STDIO connections.
</Note>

<Note>
This guide focuses specifically on using FastMCP servers with Claude Desktop. For general Claude Desktop MCP setup and official examples, see the [official Claude Desktop quickstart guide](https://modelcontextprotocol.io/quickstart/user).
</Note>


## Requirements

Claude Desktop traditionally requires MCP servers to run locally using STDIO transport, where your server communicates with Claude through standard input/output rather than HTTP. However, users on certain plans now have access to remote server support as well.

<Tip>
If you don't have access to remote server support or need to connect to remote servers, you can create a **proxy server** that runs locally via STDIO and forwards requests to remote HTTP servers. See the [Remote Servers](#remote-servers) section below.
</Tip>

## Create a Server

The examples in this guide will use the following simple dice-rolling server, saved as `server.py`.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run()
```

## Install the Server

### FastMCP CLI
<VersionBadge version="2.10.3" />

The easiest way to install a FastMCP server in Claude Desktop is using the `fastmcp install claude-desktop` command. This automatically handles the configuration and dependency management.

<Tip>
Prior to version 2.10.3, Claude Desktop could be managed by running `fastmcp install <path>` without specifying the client.
</Tip>

```bash
fastmcp install claude-desktop server.py
```

The install command supports the same `file.py:object` notation as the `run` command. If no object is specified, it will automatically look for a FastMCP server object named `mcp`, `server`, or `app` in your file:

```bash
# These are equivalent if your server object is named 'mcp'
fastmcp install claude-desktop server.py
fastmcp install claude-desktop server.py:mcp

# Use explicit object name if your server has a different name
fastmcp install claude-desktop server.py:my_custom_server
```

After installation, restart Claude Desktop completely. You should see a hammer icon (🔨) in the bottom left of the input box, indicating that MCP tools are available.

#### Dependencies

FastMCP provides several ways to manage your server's dependencies when installing in Claude Desktop:

If your server declares its dependencies in `pyproject.toml`, use the [`--project` option](#python-version-and-project-directory) to select that Python project.

**Individual packages**: Use the `--with` flag to specify packages your server needs. You can use this flag multiple times:

```bash
fastmcp install claude-desktop server.py --with pandas --with requests
```

**Requirements file**: If you have a `requirements.txt` file listing all your dependencies, use `--with-requirements` to install them all at once:

```bash
fastmcp install claude-desktop server.py --with-requirements requirements.txt
```

**Editable packages**: For local packages in development, use `--with-editable` to install them in editable mode:

```bash
fastmcp install claude-desktop server.py --with-editable ./my-local-package
```

Alternatively, you can use a `fastmcp.json` configuration file (recommended):

```json fastmcp.json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "dependencies": ["pandas", "requests"]
  }
}
```

Pass the configuration file to the install command in place of the server file:

```bash
fastmcp install claude-desktop fastmcp.json
```


#### Python Version and Project Directory

FastMCP allows you to control the Python environment for your server:

**Python version**: Use `--python` to specify which Python version your server should run with. This is particularly useful when your server requires a specific Python version:

```bash
fastmcp install claude-desktop server.py --python 3.11
```

**Project directory**: Use `--project` to select the directory containing your MCP server's `pyproject.toml`. FastMCP passes this to `uv run --project`, which discovers the project's configuration and installs its dependencies into the project environment:

```bash
fastmcp install claude-desktop /path/to/mcp-server/server.py --project /path/to/mcp-server
```

`--project` selects the Python environment without changing the server's working directory. If your server reads local files, use absolute paths or resolve them relative to the server file.

#### Environment Variables

<Warning>
Claude Desktop runs servers in a completely isolated environment with no access to your shell environment or locally installed applications. You must explicitly pass any environment variables your server needs.
</Warning>

If your server needs environment variables (like API keys), you must include them:

```bash
fastmcp install claude-desktop server.py --name "Weather Server" \
  --env API_KEY=your-api-key \
  --env DEBUG=true
```

Or load them from a `.env` file:

```bash
fastmcp install claude-desktop server.py --name "Weather Server" --env-file .env
```
<Warning>
- **`uv` must be installed and available in your system PATH**. Claude Desktop runs in its own isolated environment and needs `uv` to manage dependencies.
- **On macOS, it is recommended to install `uv` globally with Homebrew** so that Claude Desktop will detect it: `brew install uv`. Installing `uv` with other methods may not make it accessible to Claude Desktop.
</Warning>


### Manual Configuration

For more control over the configuration, you can manually edit Claude Desktop's configuration file. You can open the configuration file from Claude's developer settings, or find it in the following locations:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

The configuration file is a JSON object with a `mcpServers` key, which contains the configuration for each MCP server.

```json
{
  "mcpServers": {
    "dice-roller": {
      "command": "python",
      "args": ["path/to/your/server.py"]
    }
  }
}
```

After updating the configuration file, restart Claude Desktop completely. Look for the hammer icon (🔨) to confirm your server is loaded.

#### Dependencies

If your server has dependencies, you can use `uv` or another package manager to set up the environment.


When manually configuring dependencies, the recommended approach is to use `uv` with FastMCP. The configuration uses `uv run` to create an isolated environment with your specified packages:

```json
{
  "mcpServers": {
    "dice-roller": {
      "command": "uv",
      "args": [
        "run",
        "--with", "fastmcp",
        "--with", "pandas",
        "--with", "requests", 
        "fastmcp",
        "run",
        "path/to/your/server.py"
      ]
    }
  }
}
```

You can also manually specify Python versions and project directories in your configuration. Add `--python` to use a specific Python version, or `--project` to run within a project directory:

```json
{
  "mcpServers": {
    "dice-roller": {
      "command": "uv",
      "args": [
        "run",
        "--python", "3.11",
        "--project", "/path/to/project",
        "--with", "fastmcp",
        "fastmcp",
        "run",
        "path/to/your/server.py"
      ]
    }
  }
}
```

The order of arguments matters: Python version and project settings come before package specifications, which come before the actual command to run.

<Warning>
- **`uv` must be installed and available in your system PATH**. Claude Desktop runs in its own isolated environment and needs `uv` to manage dependencies.
- **On macOS, it is recommended to install `uv` globally with Homebrew** so that Claude Desktop will detect it: `brew install uv`. Installing `uv` with other methods may not make it accessible to Claude Desktop.
</Warning>

#### Environment Variables

You can also specify environment variables in the configuration:

```json
{
  "mcpServers": {
    "weather-server": {
      "command": "python",
      "args": ["path/to/weather_server.py"],
      "env": {
        "API_KEY": "your-api-key",
        "DEBUG": "true"
      }
    }
  }
}
```
<Warning>
Claude Desktop runs servers in a completely isolated environment with no access to your shell environment or locally installed applications. You must explicitly pass any environment variables your server needs.
</Warning>


## Remote Servers


Users on Claude Pro, Max, Team, and Enterprise plans have first-class remote server support via integrations. For other users, or as an alternative approach, FastMCP can create a proxy server that forwards requests to a remote HTTP server. You can install the proxy server in Claude Desktop.

Create a proxy server that connects to a remote HTTP server:

```python proxy_server.py
from fastmcp.server import create_proxy

# Create a proxy to a remote server
proxy = create_proxy(
    "https://example.com/mcp",
    name="Remote Server Proxy"
)

if __name__ == "__main__":
    proxy.run()  # Runs via STDIO for Claude Desktop
```

### Authentication

For authenticated remote servers, create an authenticated client following the guidance in the [client auth documentation](/clients/auth/bearer) and pass it to the proxy:

```python auth_proxy_server.py {8}
from fastmcp import Client
from fastmcp.client.auth import BearerAuth
from fastmcp.server import create_proxy

# Create authenticated client
client = Client(
    "https://api.example.com/mcp",
    auth=BearerAuth(token="your-access-token")
)

# Create proxy using the authenticated client
proxy = create_proxy(client, name="Authenticated Proxy")

if __name__ == "__main__":
    proxy.run()
```

---

### Integrations Cursor (`docs/integrations/cursor.mdx`)

---
title: Cursor 🤝 FastMCP
sidebarTitle: Cursor
description: Install and use FastMCP servers in Cursor
icon: message-smile
---

import { VersionBadge } from "/snippets/version-badge.mdx"
import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

[Cursor](https://www.cursor.com/) supports MCP servers through multiple transport methods including STDIO, SSE, and Streamable HTTP, allowing you to extend Cursor's AI assistant with custom tools, resources, and prompts from your FastMCP servers.

## Requirements

This integration uses STDIO transport to run your FastMCP server locally. For remote deployments, you can run your FastMCP server with HTTP or SSE transport and configure it directly in Cursor's settings.

## Create a Server

The examples in this guide will use the following simple dice-rolling server, saved as `server.py`.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run()
```

## Install the Server

### FastMCP CLI
<VersionBadge version="2.10.3" />

The easiest way to install a FastMCP server in Cursor is using the `fastmcp install cursor` command. This automatically handles the configuration, dependency management, and opens Cursor with a deeplink to install the server.

```bash
fastmcp install cursor server.py
```

#### Workspace Installation
<VersionBadge version="2.12.0" />

By default, FastMCP installs servers globally for Cursor. You can also install servers to project-specific workspaces using the `--workspace` flag:

```bash
# Install to current directory's .cursor/ folder
fastmcp install cursor server.py --workspace .

# Install to specific workspace
fastmcp install cursor server.py --workspace /path/to/project
```

This creates a `.cursor/mcp.json` configuration file in the specified workspace directory, allowing different projects to have their own MCP server configurations.

The install command supports the same `file.py:object` notation as the `run` command. If no object is specified, it will automatically look for a FastMCP server object named `mcp`, `server`, or `app` in your file:

```bash
# These are equivalent if your server object is named 'mcp'
fastmcp install cursor server.py
fastmcp install cursor server.py:mcp

# Use explicit object name if your server has a different name
fastmcp install cursor server.py:my_custom_server
```

After running the command, Cursor will open automatically and prompt you to install the server. The command will be `uv`, which is expected as this is a Python STDIO server. Click "Install" to confirm:



#### Dependencies

FastMCP offers multiple ways to manage dependencies for your Cursor servers:

If your server declares its dependencies in `pyproject.toml`, use the [`--project` option](#python-version-and-project-configuration) to select that Python project.

**Individual packages**: Use the `--with` flag to specify packages your server needs. You can use this flag multiple times:

```bash
fastmcp install cursor server.py --with pandas --with requests
```

**Requirements file**: For projects with a `requirements.txt` file, use `--with-requirements` to install all dependencies at once:

```bash
fastmcp install cursor server.py --with-requirements requirements.txt
```

**Editable packages**: When developing local packages, use `--with-editable` to install them in editable mode:

```bash
fastmcp install cursor server.py --with-editable ./my-local-package
```

Alternatively, you can use a `fastmcp.json` configuration file (recommended):

```json fastmcp.json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "dependencies": ["pandas", "requests"]
  }
}
```

Pass the configuration file to the install command in place of the server file:

```bash
fastmcp install cursor fastmcp.json
```


#### Python Version and Project Configuration

Control your server's Python environment with these options:

**Python version**: Use `--python` to specify which Python version your server should use. This is essential when your server requires specific Python features:

```bash
fastmcp install cursor server.py --python 3.11
```

**Project directory**: Use `--project` to select the directory containing your MCP server's `pyproject.toml`. FastMCP passes this to `uv run --project`, which discovers the project's configuration and installs its dependencies into the project environment:

```bash
fastmcp install cursor /path/to/mcp-server/server.py --project /path/to/mcp-server
```

`--project` selects the server's Python environment. [`--workspace`](#workspace-installation) selects the Cursor workspace where FastMCP writes `.cursor/mcp.json`. Use both when your MCP server and editor workspace live in different directories:

```bash
fastmcp install cursor /path/to/mcp-server/server.py \
    --project /path/to/mcp-server \
    --workspace /path/to/editor-workspace
```

`--project` does not change the server's working directory. If your server reads local files, use absolute paths or resolve them relative to the server file.

#### Environment Variables

<Warning>
Cursor runs servers in a completely isolated environment with no access to your shell environment or locally installed applications. You must explicitly pass any environment variables your server needs.
</Warning>

If your server needs environment variables (like API keys), you must include them:

```bash
fastmcp install cursor server.py --name "Weather Server" \
  --env API_KEY=your-api-key \
  --env DEBUG=true
```

Or load them from a `.env` file:

```bash
fastmcp install cursor server.py --name "Weather Server" --env-file .env
```

<Warning>
**`uv` must be installed and available in your system PATH**. Cursor runs in its own isolated environment and needs `uv` to manage dependencies.
</Warning>

### Generate MCP JSON

<Note>
**Use the first-class integration above for the best experience.** The MCP JSON generation is useful for advanced use cases, manual configuration, or integration with other tools.
</Note>

You can generate MCP JSON configuration for manual use:

```bash
# Generate configuration and output to stdout
fastmcp install mcp-json server.py --name "Dice Roller" --with pandas

# Copy configuration to clipboard for easy pasting
fastmcp install mcp-json server.py --name "Dice Roller" --copy
```

This generates the standard `mcpServers` configuration format that can be used with any MCP-compatible client.

### Manual Configuration

For more control over the configuration, you can manually edit Cursor's configuration file. The configuration file is located at:
- **All platforms**: `~/.cursor/mcp.json`

The configuration file is a JSON object with a `mcpServers` key, which contains the configuration for each MCP server.

```json
{
  "mcpServers": {
    "dice-roller": {
      "command": "python",
      "args": ["path/to/your/server.py"]
    }
  }
}
```

After updating the configuration file, your server should be available in Cursor.

#### Dependencies

If your server has dependencies, you can use `uv` or another package manager to set up the environment.

When manually configuring dependencies, the recommended approach is to use `uv` with FastMCP. The configuration should use `uv run` to create an isolated environment with your specified packages:

```json
{
  "mcpServers": {
    "dice-roller": {
      "command": "uv",
      "args": [
        "run",
        "--with", "fastmcp",
        "--with", "pandas",
        "--with", "requests", 
        "fastmcp",
        "run",
        "path/to/your/server.py"
      ]
    }
  }
}
```

You can also manually specify Python versions and project directories in your configuration:

```json
{
  "mcpServers": {
    "dice-roller": {
      "command": "uv",
      "args": [
        "run",
        "--python", "3.11",
        "--project", "/path/to/project",
        "--with", "fastmcp",
        "fastmcp",
        "run",
        "path/to/your/server.py"
      ]
    }
  }
}
```

Note that the order of arguments is important: Python version and project settings should come before package specifications.

<Warning>
**`uv` must be installed and available in your system PATH**. Cursor runs in its own isolated environment and needs `uv` to manage dependencies.
</Warning>

#### Environment Variables

You can also specify environment variables in the configuration:

```json
{
  "mcpServers": {
    "weather-server": {
      "command": "python",
      "args": ["path/to/weather_server.py"],
      "env": {
        "API_KEY": "your-api-key",
        "DEBUG": "true"
      }
    }
  }
}
```

<Warning>
Cursor runs servers in a completely isolated environment with no access to your shell environment or locally installed applications. You must explicitly pass any environment variables your server needs.
</Warning>

## Using the Server

Once your server is installed, you can start using your FastMCP server with Cursor's AI assistant.

Try asking Cursor something like:

> "Roll some dice for me"

Cursor will automatically detect your `roll_dice` tool and use it to fulfill your request, returning something like:

> 🎲 Here are your dice rolls: 4, 6, 4
> 
> You rolled 3 dice with a total of 14! The 6 was a nice high roll there!

The AI assistant can now access all the tools, resources, and prompts you've defined in your FastMCP server.

---

### Integrations Descope (`docs/integrations/descope.mdx`)

---
title: Descope 🤝 FastMCP
sidebarTitle: Descope
description: Secure your FastMCP server with Descope
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx";

<VersionBadge version="2.12.4" />

This guide shows you how to secure your FastMCP server using [**Descope**](https://www.descope.com), a complete authentication and user management solution. This integration uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern, where Descope handles user login and your FastMCP server validates the tokens.

## Configuration

### Prerequisites

Before you begin, you will need:

1. To [sign up](https://www.descope.com/sign-up) for a Free Forever Descope account
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Configure Descope

<Steps>
<Step title="Configure a Descope application">
    You can use either a resource-specific Descope MCP Server or a project-level inbound app.

    To create an MCP Server, go to the [MCP Servers page](https://app.descope.com/mcp-servers) of the Descope Console, create a server, and enable **Dynamic Client Registration (DCR)**.
    
    
    <Warning>
    DCR is required for FastMCP clients to automatically register with your authentication server.
    </Warning>
</Step>

<Step title="Copy the Well-Known URL">
    `DescopeProvider` accepts both resource-specific MCP Server URLs:

    ```text
    https://api.descope.com/v1/apps/agentic/P.../M.../.well-known/openid-configuration
    ```

    and project-level inbound app URLs:

    ```text
    https://api.descope.com/v1/apps/P.../.well-known/openid-configuration
    ```

    The project-level URL is the recommended one.
</Step>
</Steps>

### Step 2: Environment Setup

Create a `.env` file with your Descope configuration:

```bash
DESCOPE_CONFIG_URL=https://api.descope.com/v1/apps/P.../.well-known/openid-configuration
BASE_URL=http://localhost:8000
```

### Step 3: FastMCP Configuration

Create your FastMCP server file and use the DescopeProvider to handle all the OAuth integration automatically. Nothing reads `.env` automatically, so load it explicitly with [python-dotenv](https://pypi.org/project/python-dotenv/) (`pip install python-dotenv`) before constructing the provider — otherwise the values you just wrote stay invisible to `os.environ`.

```python server.py
import os

from dotenv import load_dotenv
from fastmcp import FastMCP
from fastmcp.server.auth.providers.descope import DescopeProvider

load_dotenv()

# DescopeProvider accepts either supported Well-Known URL format.
auth_provider = DescopeProvider(
    config_url=os.environ["DESCOPE_CONFIG_URL"],
    base_url=os.environ.get("BASE_URL", "http://localhost:8000"),
)

# Create FastMCP server with auth
mcp = FastMCP(name="My Descope Protected Server", auth=auth_provider)
```

### Scope discovery and validation

<VersionBadge version="4.0.0" />

When both `scopes_supported` and `required_scopes` are omitted, `DescopeProvider` discovers `scopes_supported` lazily from the OpenID configuration and advertises them to MCP clients. Provider construction remains network-free, and a transient discovery failure is retried on a later metadata request.

Set both options when clients should request a broader set of scopes than the server requires on every token:

```python
from fastmcp.server.auth.providers.descope import DescopeProvider

auth_provider = DescopeProvider(
    config_url="https://api.descope.com/v1/apps/P.../.well-known/openid-configuration",
    base_url="https://your-fastmcp-server.com",
    scopes_supported=["mcp:read", "mcp:write"],
    required_scopes=["mcp:read"],
)
```

`scopes_supported` controls what the protected resource metadata advertises. `required_scopes` controls what the JWT verifier requires during token validation. When only `required_scopes` is set, those scopes are also advertised to clients.

## Testing

To test your server, you can use the `fastmcp` CLI to run it locally. Assuming you've saved the above code to `server.py` (after replacing the environment variables with your actual values!), you can run the following command:

```bash
fastmcp run server.py --transport http --port 8000
```

Now, you can use a FastMCP client to test that you can reach your server after authenticating:

```python
from fastmcp import Client
import asyncio

async def main():
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        tools = await client.list_tools()
        print(f"Authenticated. Server exposes {len(tools)} tools.")

if __name__ == "__main__":
    asyncio.run(main())
```

## Production Configuration

For production deployments, load configuration from environment variables:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.descope import DescopeProvider

# Load configuration from environment variables
auth = DescopeProvider(
    config_url=os.environ["DESCOPE_CONFIG_URL"],
    base_url=os.environ.get("BASE_URL", "https://your-server.com")
)

mcp = FastMCP(name="My Descope Protected Server", auth=auth)
```

---

### Integrations Discord (`docs/integrations/discord.mdx`)

---
title: Discord OAuth 🤝 FastMCP
sidebarTitle: Discord
description: Secure your FastMCP server with Discord OAuth
icon: discord
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.13.2" />

This guide shows you how to secure your FastMCP server using **Discord OAuth**. Since Discord doesn't support Dynamic Client Registration, this integration uses the [**OAuth Proxy**](/servers/auth/oauth-proxy) pattern to bridge Discord's traditional OAuth with MCP's authentication requirements.

## Configuration

### Prerequisites

Before you begin, you will need:
1. A **[Discord Account](https://discord.com/)** with access to create applications
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Create a Discord Application

Create an application in the Discord Developer Portal to get the credentials needed for authentication:

<Steps>
<Step title="Navigate to Discord Developer Portal">
    Go to the [Discord Developer Portal](https://discord.com/developers/applications).

    Click **"New Application"** and give it a name users will recognize (e.g., "My FastMCP Server").
</Step>

<Step title="Configure OAuth2 Settings">
    In the left sidebar, click **"OAuth2"**.

    In the **Redirects** section, click **"Add Redirect"** and enter your callback URL:
    - For development: `http://localhost:8000/auth/callback`
    - For production: `https://your-domain.com/auth/callback`

    <Warning>
    The redirect URL must match exactly. The default path is `/auth/callback`, but you can customize it using the `redirect_path` parameter. Discord allows `http://localhost` URLs for development. For production, use HTTPS.
    </Warning>
</Step>

<Step title="Save Your Credentials">
    On the same OAuth2 page, you'll find:

    - **Client ID**: A numeric string like `12345`
    - **Client Secret**: Click "Reset Secret" to generate one

    <Tip>
    Store these credentials securely. Never commit them to version control. Use environment variables or a secrets manager in production.
    </Tip>
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server using the `DiscordProvider`, which handles Discord's OAuth flow automatically:

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.discord import DiscordProvider

auth_provider = DiscordProvider(
    client_id="12345",      # Your Discord Application Client ID
    client_secret="your-client-secret",    # Your Discord OAuth Client Secret
    base_url="http://localhost:8000",      # Must match your OAuth configuration
)

mcp = FastMCP(name="Discord Secured App", auth=auth_provider)

@mcp.tool
async def get_user_info() -> dict:
    """Returns information about the authenticated Discord user."""
    from fastmcp.server.dependencies import get_access_token

    token = get_access_token()
    return {
        "discord_id": token.claims.get("sub"),
        "username": token.claims.get("username"),
        "avatar": token.claims.get("avatar"),
    }
```

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by Discord OAuth authentication.

### Testing with a Client

Create a test client that authenticates with your Discord-protected server:

```python test_client.py
from fastmcp import Client
import asyncio

async def main():
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        print("✓ Authenticated with Discord!")

        result = await client.call_tool("get_user_info")
        user_info = result.data
        print(f"Discord user: {user_info['username']}")

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to Discord's authorization page
2. Sign in with your Discord account and authorize the app
3. After authorization, you'll be redirected back
4. The client receives the token and can make authenticated requests

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

## Discord Scopes

Discord OAuth supports several scopes for accessing different types of user data:

| Scope | Description |
|-------|-------------|
| `identify` | Access username, avatar, and discriminator (default) |
| `email` | Access the user's email address |
| `guilds` | Access the user's list of servers |
| `guilds.join` | Ability to add the user to a server |

To request additional scopes:

```python
from fastmcp.server.auth.providers.discord import DiscordProvider

auth_provider = DiscordProvider(
    client_id="...",
    client_secret="...",
    base_url="http://localhost:8000",
    required_scopes=["identify", "email"],
)
```

## Production Configuration

For production deployments with persistent token management across server restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.discord import DiscordProvider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

auth_provider = DiscordProvider(
    client_id="12345",
    client_secret=os.environ["DISCORD_CLIENT_SECRET"],
    base_url="https://your-production-domain.com",

    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production Discord App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

---

### Integrations Eunomia Authorization (`docs/integrations/eunomia-authorization.mdx`)

---
title: Eunomia Authorization 🤝 FastMCP
sidebarTitle: Eunomia Auth
description: Add policy-based authorization to your FastMCP servers with Eunomia
icon: shield-check
---

Add **policy-based authorization** to your FastMCP servers with a single line of code using the **[Eunomia][eunomia-github] authorization middleware**.

Control which tools, resources and prompts MCP clients can view and execute on your server. Define dynamic JSON-based policies and obtain a comprehensive audit log of all access attempts and violations.

## How it Works

Built on FastMCP's [Middleware][fastmcp-middleware], the Eunomia middleware intercepts all MCP requests to your server and automatically maps MCP methods to authorization checks.

### Listing Operations

The middleware behaves as a filter for listing operations (`tools/list`, `resources/list`, `prompts/list`), hiding components that the defined policies do not authorize.

```mermaid
sequenceDiagram
    participant MCPClient as MCP Client
    participant EunomiaMiddleware as Eunomia Middleware
    participant MCPServer as FastMCP Server
    participant EunomiaServer as Eunomia Server

    MCPClient->>EunomiaMiddleware: MCP Listing Request (e.g., tools/list)
    EunomiaMiddleware->>MCPServer: MCP Listing Request
    MCPServer-->>EunomiaMiddleware: MCP Listing Response
    EunomiaMiddleware->>EunomiaServer: Authorization Checks
    EunomiaServer->>EunomiaMiddleware: Authorization Decisions
    EunomiaMiddleware-->>MCPClient: Filtered MCP Listing Response
```

### Execution Operations

The middleware behaves as a firewall for execution operations (`tools/call`, `resources/read`, `prompts/get`), blocking operations that are not authorized by the defined policies.

```mermaid
sequenceDiagram
    participant MCPClient as MCP Client
    participant EunomiaMiddleware as Eunomia Middleware
    participant MCPServer as FastMCP Server
    participant EunomiaServer as Eunomia Server

    MCPClient->>EunomiaMiddleware: MCP Execution Request (e.g., tools/call)
    EunomiaMiddleware->>EunomiaServer: Authorization Check
    EunomiaServer->>EunomiaMiddleware: Authorization Decision
    EunomiaMiddleware-->>MCPClient: MCP Unauthorized Error (if denied)
    EunomiaMiddleware->>MCPServer: MCP Execution Request (if allowed)
    MCPServer-->>EunomiaMiddleware: MCP Execution Response (if allowed)
    EunomiaMiddleware-->>MCPClient: MCP Execution Response (if allowed)
```

## Add Authorization to Your Server

<Note>
Eunomia is an AI-specific authorization server that handles policy decisions. The server runs embedded within your MCP server by default for a zero-effort configuration, but can alternatively be run remotely for centralized policy decisions.

</Note>

### Create a Server with Authorization

First, install the `eunomia-mcp` package:

```bash
pip install eunomia-mcp
```

Then create a FastMCP server and add the Eunomia middleware in one line:

```python server.py
from fastmcp import FastMCP
from eunomia_mcp import create_eunomia_middleware

# Create your FastMCP server
mcp = FastMCP("Secure MCP Server 🔒")

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

# Add middleware to your server
middleware = create_eunomia_middleware(policy_file="mcp_policies.json")
mcp.add_middleware(middleware)

if __name__ == "__main__":
    mcp.run()
```

### Configure Access Policies

Use the `eunomia-mcp` CLI in your terminal to manage your authorization policies:

```bash
# Create a default policy file
eunomia-mcp init

# Or create a policy file customized for your FastMCP server
eunomia-mcp init --custom-mcp "app.server:mcp"
```

This creates `mcp_policies.json` file that you can further edit to your access control needs.

```bash
# Once edited, validate your policy file
eunomia-mcp validate mcp_policies.json
```

### Run the Server

Start your FastMCP server normally:

```bash
python server.py
```

The middleware now intercepts all MCP requests and checks them against your policies, mapping each MCP method to an authorization resource and action. Over HTTP transports, the middleware identifies the caller from the `X-Agent-ID`, `X-User-ID`, and `User-Agent` headers; over stdio there are no headers, so requests are evaluated as an unknown agent.

<Tip>
  For detailed policy configuration, custom authentication, and remote
  deployments, visit the [Eunomia MCP Middleware
  repository][eunomia-mcp-github].
</Tip>

[eunomia-github]: https://github.com/whataboutyou-ai/eunomia
[eunomia-mcp-github]: https://github.com/whataboutyou-ai/eunomia/tree/main/pkgs/extensions/mcp
[fastmcp-middleware]: /servers/middleware

---

### Integrations Fastapi (`docs/integrations/fastapi.mdx`)

---
title: FastAPI 🤝 FastMCP
sidebarTitle: FastAPI
description: Integrate FastMCP with FastAPI applications
icon: bolt
---

import { VersionBadge } from '/snippets/version-badge.mdx'

FastMCP provides two powerful ways to integrate with FastAPI applications:

1. **[Generate an MCP server FROM your FastAPI app](#generating-an-mcp-server)** - Convert existing API endpoints into MCP tools
2. **[Mount an MCP server INTO your FastAPI app](#mounting-an-mcp-server)** - Add MCP functionality to your web application

<Note>
When generating an MCP server from FastAPI, FastMCP uses OpenAPIProvider (v3.0.0+) under the hood to source tools from your FastAPI app's OpenAPI spec. See [Providers](/servers/providers/overview) to understand how FastMCP sources components.
</Note>


<Tip>
Generating MCP servers from OpenAPI is a great way to get started with FastMCP, but in practice LLMs achieve **significantly better performance** with well-designed and curated MCP servers than with auto-converted OpenAPI servers. This is especially true for complex APIs with many endpoints and parameters.

We recommend using the FastAPI integration for bootstrapping and prototyping, not for mirroring your API to LLM clients. See the post [Stop Converting Your REST APIs to MCP](https://www.jlowin.dev/blog/stop-converting-rest-apis-to-mcp) for more details.
</Tip>


<Note>
FastMCP does *not* include FastAPI as a dependency; you must install it separately to use this integration.
</Note>

## Example FastAPI Application

Throughout this guide, we'll use this e-commerce API as our example (click the `Copy` button to copy it for use with other code blocks):

```
/* Detailed source-code truncated for AI context efficiency. */
```

<Tip>
All subsequent code examples in this guide assume you have the above FastAPI application code already defined. Each example builds upon this base application, `app`.
</Tip>

## Generating an MCP Server

<VersionBadge version="2.0.0" />

One of the most common ways to bootstrap an MCP server is to generate it from an existing FastAPI application. FastMCP will expose your FastAPI endpoints as MCP components (tools, by default) in order to expose your API to LLM clients.



### Basic Conversion

Convert the FastAPI app to an MCP server with a single line:

```python {5}
# Assumes the FastAPI app from above is already defined
from fastmcp import FastMCP

# Convert to MCP server
mcp = FastMCP.from_fastapi(app=app)

if __name__ == "__main__":
    mcp.run()
```

### Adding Components

Your converted MCP server is a full FastMCP instance, meaning you can add new tools, resources, and other components to it just like you would with any other FastMCP instance.

```python {8-11}
# Assumes the FastAPI app from above is already defined
from fastmcp import FastMCP

# Convert to MCP server
mcp = FastMCP.from_fastapi(app=app)

# Add a new tool
@mcp.tool
def get_product(product_id: int) -> ProductResponse:
    """Get a product by ID."""
    return products_db[product_id]

# Run the MCP server
if __name__ == "__main__":
    mcp.run()
```





### Interacting with the MCP Server

Once you've converted your FastAPI app to an MCP server, you can interact with it using the FastMCP client to test functionality before deploying it to an LLM-based application.

```python {3}
# Assumes the FastAPI app from above is already defined
from fastmcp import FastMCP
from fastmcp.client import Client
import asyncio

# Convert to MCP server
mcp = FastMCP.from_fastapi(app=app)

async def demo():
    async with Client(mcp) as client:
        # List available tools
        tools = await client.list_tools()
        print(f"Available tools: {[t.name for t in tools]}")
        
        # Create a product
        result = await client.call_tool(
            "create_product_products_post",
            {
                "name": "Wireless Keyboard",
                "price": 79.99,
                "category": "Electronics",
                "description": "Bluetooth mechanical keyboard"
            }
        )
        print(f"Created product: {result.data}")
        
        # List electronics under $100
        result = await client.call_tool(
            "list_products_products_get",
            {"category": "Electronics", "max_price": 100}
        )
        print(f"Affordable electronics: {result.data}")

if __name__ == "__main__":
    asyncio.run(demo())
```

### Custom Route Mapping

Because FastMCP's FastAPI integration is based on its [OpenAPI integration](/integrations/openapi), you can customize how endpoints are converted to MCP components in exactly the same way. For example, here we use a `RouteMap` to map all GET requests to MCP resources, and all POST/PUT/DELETE requests to MCP tools:

```python
# Assumes the FastAPI app from above is already defined
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import RouteMap, MCPType

# Custom mapping rules
mcp = FastMCP.from_fastapi(
    app=app,
    route_maps=[
        # GET with path params → ResourceTemplates
        RouteMap(
            methods=["GET"], 
            pattern=r".*\{.*\}.*", 
            mcp_type=MCPType.RESOURCE_TEMPLATE
        ),
        # Other GETs → Resources
        RouteMap(
            methods=["GET"], 
            pattern=r".*", 
            mcp_type=MCPType.RESOURCE
        ),
        # POST/PUT/DELETE → Tools (default)
    ],
)

# Now:
# - GET /products → Resource
# - GET /products/{id} → ResourceTemplate
# - POST/PUT/DELETE → Tools
```

<Tip>
To learn more about customizing the conversion process, see the [OpenAPI Integration guide](/integrations/openapi).
</Tip>

### Authentication and Headers

You can configure headers and other client options via the `httpx_client_kwargs` parameter. For example, to add authentication to your FastAPI app, you can pass a `headers` dictionary to the `httpx_client_kwargs` parameter:

```python {26-30}
# Assumes the FastAPI app from above is already defined
from fastmcp import FastMCP

# Add authentication to your FastAPI app
from fastapi import Depends
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials

security = HTTPBearer()

def verify_token(credentials: HTTPAuthorizationCredentials = Depends(security)):
    if credentials.credentials != "secret-token":
        raise HTTPException(status_code=401, detail="Invalid authentication")
    return credentials.credentials

# Add a protected endpoint
@app.get("/admin/stats", dependencies=[Depends(verify_token)])
def get_admin_stats():
    return {
        "total_products": len(products_db),
        "categories": list(set(p.category for p in products_db.values()))
    }

# Create MCP server with authentication headers
mcp = FastMCP.from_fastapi(
    app=app,
    httpx_client_kwargs={
        "headers": {
            "Authorization": "Bearer secret-token",
        }
    }
)
```

## Mounting an MCP Server

<VersionBadge version="2.3.1" />

In addition to generating servers, FastMCP can facilitate adding MCP servers to your existing FastAPI application. You can do this by mounting the MCP ASGI application.

### Basic Mounting

To mount an MCP server, you can use the `http_app` method on your FastMCP instance. This will return an ASGI application that can be mounted to your FastAPI application.

```python {24-30}
# Assumes products_db from the example app above is already defined
from fastmcp import FastMCP
from fastapi import FastAPI

# Create MCP server
mcp = FastMCP("Analytics Tools")

@mcp.tool
def analyze_pricing(category: str) -> dict:
    """Analyze pricing for a category."""
    products = [p for p in products_db.values() if p.category == category]
    if not products:
        return {"error": f"No products in {category}"}
    
    prices = [p.price for p in products]
    return {
        "category": category,
        "avg_price": round(sum(prices) / len(prices), 2),
        "min": min(prices),
        "max": max(prices),
    }

# Create ASGI app from MCP server
mcp_app = mcp.http_app(path='/mcp')

# Key: Pass lifespan to FastAPI
app = FastAPI(title="E-commerce API", lifespan=mcp_app.lifespan)

# Mount the MCP server
app.mount("/analytics", mcp_app)

# Now: MCP at /analytics/mcp
```

### Testing a Mounted Server

To test the mounted HTTP endpoint, connect the FastMCP client through `StreamingASGITransport`. This sends requests through your FastAPI application in the same process, including its middleware, routing, and authentication, without starting a separate HTTP server. Use `run_asgi_lifespan` to run the parent application's startup and shutdown.

The following standalone test uses a test-only bearer token. Configure `pytest-asyncio` in `auto` mode as described in the [testing guide](/servers/testing):

```python
import httpx2
from fastapi import FastAPI

from fastmcp import Client, FastMCP
from fastmcp.client.transports import StreamableHttpTransport
from fastmcp.server.auth.providers.jwt import StaticTokenVerifier
from fastmcp.utilities.asgi_transport import (
    StreamingASGITransport,
    run_asgi_lifespan,
)


async def test_mounted_mcp():
    auth = StaticTokenVerifier(
        tokens={"test-token": {"client_id": "test-client", "scopes": []}}
    )
    mcp = FastMCP("Test Tools", auth=auth)

    @mcp.tool
    def add(a: int, b: int) -> int:
        return a + b

    mcp_app = mcp.http_app(path="/mcp")
    app = FastAPI(lifespan=mcp_app.lifespan)
    app.mount("/analytics", mcp_app)

    def http_client_factory(**kwargs):
        return httpx2.AsyncClient(
            transport=StreamingASGITransport(app),
            **kwargs,
        )

    transport = StreamableHttpTransport(
        url="http://testserver/analytics/mcp",
        auth="test-token",
        httpx_client_factory=http_client_factory,
    )
    async with run_asgi_lifespan(app):
        async with Client(transport) as client:
            result = await client.call_tool("add", {"a": 1, "b": 2})
            assert result.data == 3
```

The client URL includes both the mount prefix (`/analytics`) and the MCP application's path (`/mcp`). `StreamingASGITransport` streams responses as they arrive; the standard `httpx2.ASGITransport` buffers responses and cannot complete a long-lived SSE response. Passing `**kwargs` through the HTTP client factory preserves the transport's headers, authentication, and timeout settings.

## Offering an LLM-Friendly API

A common pattern is to generate an MCP server from your FastAPI app and serve both interfaces from the same application. This provides an LLM-optimized interface alongside your regular API:

```python
# Assumes the FastAPI app from above is already defined
from fastmcp import FastMCP
from fastapi import FastAPI

# 1. Generate MCP server from your API
mcp = FastMCP.from_fastapi(app=app, name="E-commerce MCP")

# 2. Create the MCP's ASGI app
mcp_app = mcp.http_app(path='/mcp')

# 3. Create a new FastAPI app that combines both sets of routes
combined_app = FastAPI(
    title="E-commerce API with MCP",
    routes=[
        *mcp_app.routes,  # MCP routes
        *app.routes,      # Original API routes
    ],
    lifespan=mcp_app.lifespan,
)

# Now you have:
# - Regular API: http://localhost:8000/products
# - LLM-friendly MCP: http://localhost:8000/mcp
# Both served from the same FastAPI application!
```

This approach lets you maintain a single codebase while offering both traditional REST endpoints and MCP-compatible endpoints for LLM clients.

## Key Considerations

### Operation IDs

FastAPI operation IDs become MCP component names, cut at the first double underscore (`__`). Without an explicit `operation_id`, FastAPI generates one such as `get_user_users__user_id__get`, which becomes the tool name `get_user_users`. Specify meaningful operation IDs:

```python
# Good - explicit operation_id
@app.get("/users/{user_id}", operation_id="get_user_by_id")
def get_user(user_id: int):
    return {"id": user_id}

# Less ideal - auto-generated name
@app.get("/users/{user_id}")
def get_user(user_id: int):
    return {"id": user_id}
```

### Lifespan Management

When mounting MCP servers, always pass the lifespan context:

```python
# Correct - lifespan passed, path="/" since we mount at /mcp
mcp_app = mcp.http_app(path="/")
app = FastAPI(lifespan=mcp_app.lifespan)
app.mount("/mcp", mcp_app)  # MCP endpoint at /mcp

# Incorrect - missing lifespan
app = FastAPI()
app.mount("/mcp", mcp.http_app(path="/"))  # Session manager won't initialize
```

If you're mounting an authenticated MCP server under a path prefix, see [Mounting Authenticated Servers](/deployment/http#mounting-authenticated-servers) for important OAuth routing considerations.

### CORS Middleware

If your FastAPI app uses `CORSMiddleware` and you're mounting an OAuth-protected FastMCP server, avoid adding application-wide CORS middleware. FastMCP and the MCP SDK already handle CORS for OAuth routes, and layering CORS middleware can cause conflicts (such as 404 errors on `.well-known` routes or OPTIONS requests).

If you need CORS on your own FastAPI routes, use the sub-app pattern: mount your API and FastMCP as separate apps, each with their own middleware, rather than adding top-level `CORSMiddleware` to the combined application.

### Combining Lifespans

If your FastAPI app already has a lifespan (for database connections, startup tasks, etc.), you can't simply replace it with the MCP lifespan. Use `combine_lifespans` to run both:

```python
from fastapi import FastAPI
from fastmcp import FastMCP
from fastmcp.utilities.lifespan import combine_lifespans
from contextlib import asynccontextmanager

# Your existing lifespan
@asynccontextmanager
async def app_lifespan(app: FastAPI):
    print("Starting up the app...")
    yield
    print("Shutting down the app...")

# Create MCP server
mcp = FastMCP("Tools")
mcp_app = mcp.http_app(path="/")

# Combine both lifespans
app = FastAPI(lifespan=combine_lifespans(app_lifespan, mcp_app.lifespan))
app.mount("/mcp", mcp_app)  # MCP endpoint at /mcp
```

`combine_lifespans` enters lifespans in order and exits in reverse order.

### Performance Tips

1. **Use in-memory transport for testing** - Pass MCP servers directly to clients
2. **Design purpose-built MCP tools** - Better than auto-converting complex APIs
3. **Keep tool parameters simple** - LLMs perform better with focused interfaces

For more details on configuration options, see the [OpenAPI Integration guide](/integrations/openapi).

---

### Integrations Gemini Cli (`docs/integrations/gemini-cli.mdx`)

---
title: Gemini CLI 🤝 FastMCP
sidebarTitle: Gemini CLI
description: Install and use FastMCP servers in Gemini CLI
icon: message-smile
---

import { VersionBadge } from "/snippets/version-badge.mdx"
import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

[Gemini CLI](https://geminicli.com/) supports MCP servers through multiple transport methods including STDIO, SSE, and HTTP, allowing you to extend Gemini's capabilities with custom tools, resources, and prompts from your FastMCP servers.

## Requirements

This integration uses STDIO transport to run your FastMCP server locally. For remote deployments, you can run your FastMCP server with HTTP or SSE transport and configure it directly using Gemini CLI's built-in MCP management commands.

## Create a Server

The examples in this guide will use the following simple dice-rolling server, saved as `server.py`.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run()
```

## Install the Server

### FastMCP CLI
<VersionBadge version="2.13.0" />

The easiest way to install a FastMCP server in Gemini CLI is using the `fastmcp install gemini-cli` command. This automatically handles the configuration, dependency management, and calls Gemini CLI's built-in MCP management system.

```bash
fastmcp install gemini-cli server.py
```

The install command supports the same `file.py:object` notation as the `run` command. If no object is specified, it will automatically look for a FastMCP server object named `mcp`, `server`, or `app` in your file:

```bash
# These are equivalent if your server object is named 'mcp'
fastmcp install gemini-cli server.py
fastmcp install gemini-cli server.py:mcp

# Use explicit object name if your server has a different name
fastmcp install gemini-cli server.py:my_custom_server
```

The command will automatically configure the server with Gemini CLI's `gemini mcp add` command.

#### Dependencies

FastMCP provides flexible dependency management options for your Gemini CLI servers:

**Individual packages**: Use the `--with` flag to specify packages your server needs. You can use this flag multiple times:

```bash
fastmcp install gemini-cli server.py --with pandas --with requests
```

**Requirements file**: If you maintain a `requirements.txt` file with all your dependencies, use `--with-requirements` to install them:

```bash
fastmcp install gemini-cli server.py --with-requirements requirements.txt
```

**Editable packages**: For local packages under development, use `--with-editable` to install them in editable mode:

```bash
fastmcp install gemini-cli server.py --with-editable ./my-local-package
```

Alternatively, you can use a `fastmcp.json` configuration file (recommended):

```json fastmcp.json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "dependencies": ["pandas", "requests"]
  }
}
```

Pass the configuration file to the install command in place of the server file:

```bash
fastmcp install gemini-cli fastmcp.json
```


#### Python Version and Project Configuration

Control the Python environment for your server with these options:

**Python version**: Use `--python` to specify which Python version your server requires. This ensures compatibility when your server needs specific Python features:

```bash
fastmcp install gemini-cli server.py --python 3.11
```

**Project directory**: Use `--project` to select the directory containing your MCP server's `pyproject.toml`. FastMCP passes this to `uv run --project`, which discovers the project's configuration and installs its dependencies into the project environment:

```bash
fastmcp install gemini-cli /path/to/mcp-server/server.py --project /path/to/mcp-server
```

`--project` selects the Python environment without changing the server's working directory. If your server reads local files, use absolute paths or resolve them relative to the server file.

#### Environment Variables

If your server needs environment variables (like API keys), you must include them:

```bash
fastmcp install gemini-cli server.py --name "Weather Server" \
  --env API_KEY=your-api-key \
  --env DEBUG=true
```

Or load them from a `.env` file:

```bash
fastmcp install gemini-cli server.py --name "Weather Server" --env-file .env
```

<Warning>
**Gemini CLI must be installed**. The integration looks for the Gemini CLI and uses the `gemini mcp add` command to register servers.
</Warning>

### Manual Configuration

For more control over the configuration, you can manually use Gemini CLI's built-in MCP management commands. This gives you direct control over how your server is launched:

```bash
# Add a server with custom configuration
gemini mcp add dice-roller uv -- run --with fastmcp fastmcp run server.py

# Add with environment variables
gemini mcp add weather-server -e API_KEY=secret -e DEBUG=true uv -- run --with fastmcp fastmcp run server.py

# Add with specific scope (user, or project)
gemini mcp add my-server --scope user uv -- run --with fastmcp fastmcp run server.py
```

You can also manually specify Python versions and project directories in your Gemini CLI commands:

```bash
# With specific Python version
gemini mcp add ml-server uv -- run --python 3.11 --with fastmcp fastmcp run server.py

# Within a project directory
gemini mcp add project-server uv -- run --project /path/to/project --with fastmcp fastmcp run server.py
```

## Using the Server

Once your server is installed, you can start using your FastMCP server with Gemini CLI.

Try asking Gemini something like:

> "Roll some dice for me"

Gemini will automatically detect your `roll_dice` tool and use it to fulfill your request.

Gemini CLI can now access all the tools and prompts you've defined in your FastMCP server. 

If your server provides prompts, you can use them as slash commands with `/prompt_name`.

---

### Integrations Gemini (`docs/integrations/gemini.mdx`)

---
title: Gemini SDK 🤝 FastMCP
sidebarTitle: Gemini SDK
description: Connect FastMCP servers to the Google Gemini SDK
icon: message-code
---

Google's Gemini API includes built-in support for MCP servers in their Python and JavaScript SDKs, allowing you to connect directly to MCP servers and use their tools seamlessly with Gemini models.

## Gemini Python SDK

Google's [Gemini Python SDK](https://ai.google.dev/gemini-api/docs) can use FastMCP clients directly.

<Note>
Google's MCP integration is currently experimental and available in the Python and JavaScript SDKs. The API automatically calls MCP tools when needed and can connect to both local and remote MCP servers.
</Note>

<Tip>
Currently, Gemini's MCP support only accesses **tools** from MCP servers—it queries the `list_tools` endpoint and exposes those functions to the AI. Other MCP features like resources and prompts are not currently supported.
</Tip>

### Create a Server

First, create a FastMCP server with the tools you want to expose. For this example, we'll create a server with a single tool that rolls dice.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run()
```

### Call the Server


To use the Gemini API with MCP, you'll need to install the Google Gen AI SDK:

```bash
pip install google-genai
```

You'll also need to authenticate with Google. You can do this by setting the `GEMINI_API_KEY` environment variable. Consult the Gemini SDK documentation for more information.

```bash
export GEMINI_API_KEY="your-api-key"
```

Gemini's SDK interacts directly with the MCP client session. To call the server, you'll need to instantiate a FastMCP client, enter its connection context, and pass the client session to the Gemini SDK.

```python {6, 10, 16}
from pathlib import Path
from fastmcp import Client
from google import genai
import asyncio

mcp_client = Client(Path("server.py"))
gemini_client = genai.Client()

async def main():
    async with mcp_client:
        response = await gemini_client.aio.models.generate_content(
            model="gemini-2.0-flash",
            contents="Roll 3 dice!",
            config=genai.types.GenerateContentConfig(
                temperature=0,
                tools=[mcp_client.session],  # Pass the FastMCP client session
            ),
        )
        print(response.text)

if __name__ == "__main__":
    asyncio.run(main())
```

If you run this code, you'll see output like:

```text
Okay, I rolled 3 dice and got a 5, 4, and 1.
```

### Remote & Authenticated Servers

In the above example, we connected to our local server using `stdio` transport. Because we're using a FastMCP client, you can also connect to any local or remote MCP server, using any [transport](/clients/transports) or [auth](/clients/auth/oauth) method supported by FastMCP, simply by changing the client configuration.

For example, to connect to a remote, authenticated server, you can use the following client:

```python
from fastmcp import Client
from fastmcp.client.auth import BearerAuth

mcp_client = Client(
    "https://my-server.com/mcp",
    auth=BearerAuth("<your-token>"),
)
```

The rest of the code remains the same.

---

### Integrations Github (`docs/integrations/github.mdx`)

---
title: GitHub OAuth 🤝 FastMCP
sidebarTitle: GitHub
description: Secure your FastMCP server with GitHub OAuth
icon: github
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.12.0" />

This guide shows you how to secure your FastMCP server using **GitHub OAuth**. Since GitHub doesn't support Dynamic Client Registration, this integration uses the [**OAuth Proxy**](/servers/auth/oauth-proxy) pattern to bridge GitHub's traditional OAuth with MCP's authentication requirements.

## Configuration

### Prerequisites

Before you begin, you will need:
1. A **[GitHub Account](https://github.com/)** with access to create OAuth Apps
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Create a GitHub OAuth App

Create an OAuth App in your GitHub settings to get the credentials needed for authentication:

<Steps>
<Step title="Navigate to OAuth Apps">
    Go to **Settings → Developer settings → OAuth Apps** in your GitHub account, or visit [github.com/settings/developers](https://github.com/settings/developers).
    
    Click **"New OAuth App"** to create a new application.
</Step>

<Step title="Configure Your OAuth App">
    Fill in the application details:
    
    - **Application name**: Choose a name users will recognize (e.g., "My FastMCP Server")
    - **Homepage URL**: Your application's homepage or documentation URL
    - **Authorization callback URL**: Your server URL + `/auth/callback` (e.g., `http://localhost:8000/auth/callback`)
    
    <Warning>
    The callback URL must match exactly. The default path is `/auth/callback`, but you can customize it using the `redirect_path` parameter. For local development, GitHub allows `http://localhost` URLs. For production, you must use HTTPS.
    </Warning>
    
    <Tip>
    If you want to use a custom callback path (e.g., `/auth/github/callback`), make sure to set the same path in both your GitHub OAuth App settings and the `redirect_path` parameter when configuring the GitHubProvider.
    </Tip>
</Step>

<Step title="Save Your Credentials">
    After creating the app, you'll see:
    
    - **Client ID**: A public identifier like `Ov23liAbcDefGhiJkLmN`
    - **Client Secret**: Click "Generate a new client secret" and save the value securely
    
    <Tip>
    Store these credentials securely. Never commit them to version control. Use environment variables or a secrets manager in production.
    </Tip>
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server using the `GitHubProvider`, which handles GitHub's OAuth quirks automatically:

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.github import GitHubProvider

# The GitHubProvider handles GitHub's token format and validation
auth_provider = GitHubProvider(
    client_id="Ov23liAbcDefGhiJkLmN",  # Your GitHub OAuth App Client ID
    client_secret="your-github-client-secret",  # Your GitHub OAuth App Client Secret
    base_url="http://localhost:8000",   # Must match your OAuth App configuration
    # redirect_path="/auth/callback"   # Default value, customize if needed
)

mcp = FastMCP(name="GitHub Secured App", auth=auth_provider)

# Add a protected tool to test authentication
@mcp.tool
async def get_user_info() -> dict:
    """Returns information about the authenticated GitHub user."""
    from fastmcp.server.dependencies import get_access_token
    
    token = get_access_token()
    # The GitHubProvider stores user data in token claims
    return {
        "github_user": token.claims.get("login"),
        "name": token.claims.get("name"),
        "email": token.claims.get("email")
    }
```

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by GitHub OAuth authentication.

### Testing with a Client

Create a test client that authenticates with your GitHub-protected server:

```python test_client.py
from fastmcp import Client
import asyncio

async def main():
    # The client will automatically handle GitHub OAuth
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        # First-time connection will open GitHub login in your browser
        print("✓ Authenticated with GitHub!")
        
        # Test the protected tool
        result = await client.call_tool("get_user_info")
        print(f"GitHub user: {result.data['github_user']}")

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to GitHub's authorization page
2. After you authorize the app, you'll be redirected back
3. The client receives the token and can make authenticated requests

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

## Production Configuration

<VersionBadge version="2.13.0" />

For production deployments with persistent token management across server restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.github import GitHubProvider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

# Production setup with encrypted persistent token storage
auth_provider = GitHubProvider(
    client_id="Ov23liAbcDefGhiJkLmN",
    client_secret="your-github-client-secret",
    base_url="https://your-production-domain.com",

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production GitHub App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

---

### Integrations Google (`docs/integrations/google.mdx`)

---
title: Google OAuth 🤝 FastMCP
sidebarTitle: Google
description: Secure your FastMCP server with Google OAuth
icon: google
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.12.0" />

This guide shows you how to secure your FastMCP server using **Google OAuth**. Since Google doesn't support Dynamic Client Registration, this integration uses the [**OAuth Proxy**](/servers/auth/oauth-proxy) pattern to bridge Google's traditional OAuth with MCP's authentication requirements.

## Configuration

### Prerequisites

Before you begin, you will need:
1. A **[Google Cloud Account](https://console.cloud.google.com/)** with access to create OAuth 2.0 Client IDs
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Create a Google OAuth 2.0 Client ID

Create an OAuth 2.0 Client ID in your Google Cloud Console to get the credentials needed for authentication:

<Steps>
<Step title="Navigate to OAuth Consent Screen">
    Go to the [Google Cloud Console](https://console.cloud.google.com/apis/credentials) and select your project (or create a new one).
    
    First, configure the OAuth consent screen by navigating to **APIs & Services → OAuth consent screen**. Choose "External" for testing or "Internal" for Google Workspace organizations.
</Step>

<Step title="Create OAuth 2.0 Client ID">
    Navigate to **APIs & Services → Credentials** and click **"+ CREATE CREDENTIALS"** → **"OAuth client ID"**.
    
    Configure your OAuth client:
    
    - **Application type**: Web application
    - **Name**: Choose a descriptive name (e.g., "FastMCP Server")
    - **Authorized JavaScript origins**: Add your server's base URL (e.g., `http://localhost:8000`)
    - **Authorized redirect URIs**: Add your server URL + `/auth/callback` (e.g., `http://localhost:8000/auth/callback`)
    
    <Warning>
    The redirect URI must match exactly. The default path is `/auth/callback`, but you can customize it using the `redirect_path` parameter. For local development, Google allows `http://localhost` URLs with various ports. For production, you must use HTTPS.
    </Warning>
    
    <Tip>
    If you want to use a custom callback path (e.g., `/auth/google/callback`), make sure to set the same path in both your Google OAuth Client settings and the `redirect_path` parameter when configuring the GoogleProvider.
    </Tip>
</Step>

<Step title="Save Your Credentials">
    After creating the client, you'll receive:
    
    - **Client ID**: A string ending in `.apps.googleusercontent.com`
    - **Client Secret**: A string starting with `GOCSPX-`
    
    Download the JSON credentials or copy these values securely.
    
    <Tip>
    Store these credentials securely. Never commit them to version control. Use environment variables or a secrets manager in production.
    </Tip>
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server using the `GoogleProvider`, which handles Google's OAuth flow automatically:

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.google import GoogleProvider

# The GoogleProvider handles Google's token format and validation
auth_provider = GoogleProvider(
    client_id="123456789.apps.googleusercontent.com",  # Your Google OAuth Client ID
    client_secret="GOCSPX-abc123...",                  # Your Google OAuth Client Secret
    base_url="http://localhost:8000",                  # Must match your OAuth configuration
    required_scopes=[                                  # Request user information
        "openid",
        "https://www.googleapis.com/auth/userinfo.email",
    ],
    # redirect_path="/auth/callback"                  # Default value, customize if needed
)

mcp = FastMCP(name="Google Secured App", auth=auth_provider)

# Add a protected tool to test authentication
@mcp.tool
async def get_user_info() -> dict:
    """Returns information about the authenticated Google user."""
    from fastmcp.server.dependencies import get_access_token
    
    token = get_access_token()
    # The GoogleProvider stores user data in token claims
    return {
        "google_id": token.claims.get("sub"),
        "email": token.claims.get("email"),
        "name": token.claims.get("name"),
        "picture": token.claims.get("picture"),
        "locale": token.claims.get("locale")
    }
```

### Token Verification Caching

By default, every token verification queries Google. For servers receiving repeated requests with the same token, enable an in-memory cache to reduce network calls and latency:

```python
from fastmcp import FastMCP
from fastmcp.server.auth.providers.google import GoogleProvider

auth_provider = GoogleProvider(
    client_id="123456789.apps.googleusercontent.com",
    client_secret="GOCSPX-abc123...",
    base_url="http://localhost:8000",
    cache_ttl_seconds=300,
    max_cache_size=10_000,
)

mcp = FastMCP(name="Google Secured App", auth=auth_provider)
```

`cache_ttl_seconds` defaults to `None`, which disables caching; `0` also disables it. When enabled, successful verification results remain cached for at most this duration or until the token expires, whichever comes first. Failed verifications are not cached. `max_cache_size` defaults to 10,000 entries; setting it to `0` disables caching. Negative values for either parameter raise `ValueError`. The cache belongs to each provider instance and is cleared when the server restarts. The same parameters are available on `GoogleTokenVerifier` when using it directly.

Choose a TTL appropriate for how quickly your server needs to notice token revocation or changes to Google's user profile data: cached results skip Google's endpoints until the entry expires.

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by Google OAuth authentication.

### Testing with a Client

Create a test client that authenticates with your Google-protected server:

```python test_client.py
from fastmcp import Client
import asyncio

async def main():
    # The client will automatically handle Google OAuth
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        # First-time connection will open Google login in your browser
        print("✓ Authenticated with Google!")
        
        # Test the protected tool
        result = await client.call_tool("get_user_info")
        user_info = result.data
        print(f"Google user: {user_info['email']}")
        print(f"Name: {user_info['name']}")

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to Google's authorization page
2. Sign in with your Google account and grant the requested permissions
3. After authorization, you'll be redirected back
4. The client receives the token and can make authenticated requests

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

## Production Configuration

<VersionBadge version="2.13.0" />

For production deployments with persistent token management across server restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.google import GoogleProvider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

# Production setup with encrypted persistent token storage
auth_provider = GoogleProvider(
    client_id="123456789.apps.googleusercontent.com",
    client_secret="GOCSPX-abc123...",
    base_url="https://your-production-domain.com",
    required_scopes=["openid", "https://www.googleapis.com/auth/userinfo.email"],

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production Google App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

---

### Integrations Goose (`docs/integrations/goose.mdx`)

---
title: Goose 🤝 FastMCP
sidebarTitle: Goose
description: Install and use FastMCP servers in Goose
icon: message-smile
---

import { VersionBadge } from "/snippets/version-badge.mdx"
import { LocalFocusTip } from "/snippets/local-focus.mdx"

<LocalFocusTip />

[Goose](https://block.github.io/goose/) is an open-source AI agent from Block that supports MCP servers as extensions. FastMCP can install your server directly into Goose using its deeplink protocol — one command opens Goose with an install dialog ready to go.

## Requirements

This integration uses Goose's deeplink protocol to register your server as a STDIO extension running via `uvx`. You must have Goose installed on your system for the deeplink to open automatically.

For remote deployments, configure your FastMCP server with HTTP transport and add it to Goose directly using `goose configure` or the config file.

## Create a Server

The examples in this guide will use the following simple dice-rolling server, saved as `server.py`.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run()
```

## Install the Server

### FastMCP CLI
<VersionBadge version="3.0.0" />

The easiest way to install a FastMCP server in Goose is using the `fastmcp install goose` command. This generates a `goose://` deeplink and opens it, prompting Goose to install the server.

```bash
fastmcp install goose server.py
```

The install command supports the same `file.py:object` notation as the `run` command. If no object is specified, it will automatically look for a FastMCP server object named `mcp`, `server`, or `app` in your file:

```bash
# These are equivalent if your server object is named 'mcp'
fastmcp install goose server.py
fastmcp install goose server.py:mcp

# Use explicit object name if your server has a different name
fastmcp install goose server.py:my_custom_server
```

Under the hood, the generated command uses `uvx` to run your server in an isolated environment. Goose requires `uvx` rather than `uv run`, so the install produces a command like:

```bash
uvx --with pandas fastmcp run /path/to/server.py
```

#### Dependencies

Use the `--with` flag to specify additional packages your server needs:

```bash
fastmcp install goose server.py --with pandas --with requests
```

Alternatively, you can use a `fastmcp.json` configuration file (recommended):

```json fastmcp.json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "dependencies": ["pandas", "requests"]
  }
}
```

Pass the configuration file to the install command in place of the server file:

```bash
fastmcp install goose fastmcp.json
```

#### Python Version

Use `--python` to specify which Python version your server should use:

```bash
fastmcp install goose server.py --python 3.11
```

<Note>
The Goose install uses `uvx`, which does not support `--project`, `--with-requirements`, or `--with-editable`. If you need these options, use `fastmcp install mcp-json` to generate a full configuration and add it to Goose manually.
</Note>

#### Environment Variables

Goose's deeplink protocol does not support environment variables. If your server needs them (like API keys), you have two options:

1. **Configure after install**: Run `goose configure` and add environment variables to the extension.
2. **Manual config**: Use `fastmcp install mcp-json` to generate the full configuration, then add it to `~/.config/goose/config.yaml` with the `envs` field.

### Manual Configuration

For more control, you can manually edit Goose's configuration file at `~/.config/goose/config.yaml`:

```yaml
extensions:
  dice-roller:
    name: Dice Roller
    cmd: uvx
    args: [fastmcp, run, /path/to/server.py]
    enabled: true
    type: stdio
    timeout: 300
```

#### Dependencies

When manually configuring, add packages using `--with` flags in the args:

```yaml
extensions:
  dice-roller:
    name: Dice Roller
    cmd: uvx
    args: [--with, pandas, --with, requests, fastmcp, run, /path/to/server.py]
    enabled: true
    type: stdio
    timeout: 300
```

#### Environment Variables

Environment variables can be specified in the `envs` field:

```yaml
extensions:
  weather-server:
    name: Weather Server
    cmd: uvx
    args: [fastmcp, run, /path/to/weather_server.py]
    enabled: true
    envs:
      API_KEY: your-api-key
      DEBUG: "true"
    type: stdio
    timeout: 300
```

You can also use `goose configure` to add extensions interactively, which prompts for environment variables.

<Warning>
**`uvx` (from `uv`) must be installed and available in your system PATH**. Goose uses `uvx` to run Python-based extensions in isolated environments.
</Warning>

## Using the Server

Once your server is installed, you can start using your FastMCP server with Goose.

Try asking Goose something like:

> "Roll some dice for me"

Goose will automatically detect your `roll_dice` tool and use it to fulfill your request, returning something like:

> 🎲 Here are your dice rolls: 4, 6, 4
>
> You rolled 3 dice with a total of 14!

Goose can now access all the tools, resources, and prompts you've defined in your FastMCP server.

---

### Integrations Huggingface (`docs/integrations/huggingface.mdx`)

---
title: Hugging Face OAuth 🤝 FastMCP
sidebarTitle: Hugging Face
description: Secure your FastMCP server with Hugging Face OAuth
icon: hugging-face
iconType: brands
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="3.4.3" />

This guide shows you how to secure your FastMCP server using **Hugging Face OAuth**.
The `HuggingFaceProvider` uses FastMCP's [OAuth Proxy](/servers/auth/oauth-proxy)
pattern with Hugging Face's OAuth and OpenID Connect endpoints. It works with
manually created confidential apps, public PKCE apps, and Client ID Metadata
Documents (CIMD).

When deploying your MCP server to Hugging Face Spaces, Spaces can create and
manage the OAuth app for you.

## Configuration

### Prerequisites

Before you begin, you will need:

1. A **[Hugging Face account](https://huggingface.co/join)** with access to create OAuth apps
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Create a Hugging Face OAuth app

Create an OAuth app from your [Hugging Face application settings](https://huggingface.co/settings/applications/new).
For details, see Hugging Face's [OAuth documentation](https://huggingface.co/docs/hub/oauth).

<Steps>
<Step title="Create the OAuth app">
    Go to your [Hugging Face application settings](https://huggingface.co/settings/applications/new)
    and create a new OAuth application.

    Choose a name users will recognize, then configure the redirect URL for
    your FastMCP server:

    - Development: `http://localhost:8000/auth/callback`
    - Production: `https://your-domain.com/auth/callback`

    <Warning>
    The redirect URL must match exactly. The default path is `/auth/callback`,
    but you can customize it using the `redirect_path` parameter. For
    production, use HTTPS.
    </Warning>
</Step>

<Step title="Save your credentials">
    After creating the app, save:

    - **Client ID**: The public identifier for your Hugging Face OAuth app
    - **Client Secret**: The app secret, if you created a confidential app

    <Tip>
    Store the client secret securely. Never commit it to version control. Use
    environment variables or a secrets manager in production.
    </Tip>
</Step>
</Steps>

### Step 2: Configure FastMCP

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider

# The HuggingFaceProvider handles Hugging Face's opaque OAuth access tokens
# and stores user data in token claims.
auth_provider = HuggingFaceProvider(
    client_id="your-huggingface-client-id",        # Your Hugging Face OAuth app client ID
    client_secret="your-huggingface-client-secret", # Your Hugging Face OAuth app client secret
    base_url="http://localhost:8000",              # Must match your OAuth configuration
    required_scopes=["openid", "profile"],         # Default value
    # redirect_path="/auth/callback"               # Default value, customize if needed
)

mcp = FastMCP(name="Hugging Face Secured App", auth=auth_provider)


# Add a protected tool to test authentication
@mcp.tool
async def get_user_info() -> dict:
    """Returns information about the authenticated Hugging Face user."""
    from fastmcp.server.dependencies import get_access_token

    token = get_access_token()
    return {
        "subject": token.claims.get("sub"),
        "username": token.claims.get("preferred_username"),
        "profile": token.claims.get("profile"),
    }
```

## Public OAuth apps, DCR, and CIMD

Hugging Face supports public OAuth apps (no client secret). For public apps,
omit `client_secret` and provide a `jwt_signing_key` so FastMCP can sign its
own proxy tokens:

```python
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider

auth_provider = HuggingFaceProvider(
    client_id="your-public-huggingface-client-id",
    base_url="http://localhost:8000",
    jwt_signing_key="replace-with-a-secure-secret",
)
```

MCP clients can use Dynamic Client Registration with your FastMCP server. The
`HuggingFaceProvider` inherits FastMCP's OAuth Proxy behavior, which handles
client registration locally and forwards authorization to Hugging Face using
your configured Hugging Face OAuth app. In other words, MCP clients register
with FastMCP, while FastMCP uses your Hugging Face `client_id` and optional
`client_secret` for the upstream OAuth flow.

You can also use a Client ID Metadata Document URL as the `client_id` when your
client metadata is hosted at a stable HTTPS URL:

```python
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider

auth_provider = HuggingFaceProvider(
    client_id="https://your-client.example/.well-known/oauth-cimd",
    base_url="http://localhost:8000",
    jwt_signing_key="replace-with-a-secure-secret",
)
```

## Testing

### Running the Server

Start your server with HTTP transport:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by Hugging Face OAuth authentication.

### Testing with a Client

Create a test client that authenticates with your Hugging Face-protected server:

```python test_client.py
import asyncio
from fastmcp import Client


async def main():
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        result = await client.call_tool("get_user_info")
        print(result)


if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:

1. Your browser will open to Hugging Face's authorization page
2. Sign in with your Hugging Face account and grant the requested permissions
3. After authorization, you'll be redirected back
4. The client receives the token and can make authenticated requests

<Info>
The client caches tokens locally, so you won't need to re-authenticate for
subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

## Hugging Face Spaces

When deploying to [Hugging Face Spaces](https://huggingface.co/docs/hub/spaces-oauth),
Spaces can create and manage the OAuth app for you. Add OAuth metadata to your
Space README:

```yaml
---
title: FastMCP Hugging Face OAuth
sdk: docker
hf_oauth: true
hf_oauth_expiration_minutes: 480
hf_oauth_scopes:
  - email
  - inference-api
---
```

Spaces provide `OAUTH_CLIENT_ID`, `OAUTH_CLIENT_SECRET`, `OAUTH_SCOPES`,
`OPENID_PROVIDER_URL`, and `SPACE_HOST` environment variables:

```python
import os

from fastmcp import FastMCP
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider
from fastmcp.utilities.auth import parse_scopes

base_url = f"https://{os.environ['SPACE_HOST']}"

auth_provider = HuggingFaceProvider(
    client_id=os.environ["OAUTH_CLIENT_ID"],
    client_secret=os.environ["OAUTH_CLIENT_SECRET"],
    base_url=base_url,
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    required_scopes=parse_scopes(os.environ.get("OAUTH_SCOPES")) or ["openid", "profile"],
)

mcp = FastMCP(name="Hugging Face Space App", auth=auth_provider)
```

Set `JWT_SIGNING_KEY` as a Space secret.

## Hugging Face scopes

The default scopes are `openid` and `profile`. Add more scopes when your tools
need Hub capabilities:

| Scope | Description |
|-------|-------------|
| `email` | Access the user's email address |
| `read-billing` | Know whether the user has a payment method set up |
| `read-repos` | Read the user's personal repositories |
| `gated-repos` | Read public gated repositories the user can access |
| `contribute-repos` | Create repositories and access app-created repositories |
| `write-repos` | Read and write the user's personal repositories |
| `manage-repos` | Full repository access, including creation and deletion |
| `read-collections` | Read the user's personal collections |
| `write-collections` | Read and write the user's personal collections, including collection creation and deletion |
| `inference-api` | Use Hugging Face Inference Providers as the user |
| `jobs` | Run Hugging Face Jobs |
| `webhooks` | Manage webhooks |
| `write-discussions` | Open discussions and pull requests, and interact with discussions |

```python
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider

auth_provider = HuggingFaceProvider(
    client_id="your-huggingface-client-id",
    client_secret="your-huggingface-client-secret",
    base_url="https://your-domain.com",
    required_scopes=["openid", "profile", "inference-api", "jobs"],
)
```

For organization resources, use Hugging Face's normal OAuth organization grant
flow. If you need a specific organization, pass Hugging Face's `orgIds`
authorization parameter. The value is the organization ID from the
`organizations.sub` field in the Hugging Face userinfo response:

```python
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider

auth_provider = HuggingFaceProvider(
    client_id="your-huggingface-client-id",
    client_secret="your-huggingface-client-secret",
    base_url="https://your-domain.com",
    extra_authorize_params={"orgIds": "your-org-id"},
)
```

## Production Configuration

For production deployments with persistent token management across server
restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from cryptography.fernet import Fernet
from fastmcp import FastMCP
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper

# Production setup with encrypted persistent token storage
auth_provider = HuggingFaceProvider(
    client_id="your-huggingface-client-id",
    client_secret=os.environ["HUGGINGFACE_CLIENT_SECRET"],
    base_url="https://your-production-domain.com",
    required_scopes=["openid", "profile", "email"],

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production Hugging Face App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure
tokens and client registrations survive server restarts. **Wrap your storage in
`FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without
it, tokens are stored in plaintext. Store secrets in environment variables and
use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

---

### Integrations Keycloak (`docs/integrations/keycloak.mdx`)

---
title: Keycloak OAuth 🤝 FastMCP
sidebarTitle: Keycloak
description: Secure your FastMCP server with Keycloak OAuth
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="3.2.4" />

This guide shows you how to secure your FastMCP server using **Keycloak OAuth**. This integration uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern with Dynamic Client Registration (DCR), where Keycloak handles user login and your FastMCP server validates the tokens.

<Note>
**Keycloak 26.6.0 or later is required.** Earlier versions had a DCR incompatibility with MCP clients ([PR #45309](https://github.com/keycloak/keycloak/pull/45309)) that is fixed in 26.6.0.
</Note>

## Configuration

### Prerequisites

Before you begin, you will need:
1. A running **[Keycloak](https://keycloak.org/)** instance (e.g., `http://localhost:8080`)
2. A Keycloak realm with **Dynamic Client Registration** enabled and a trusted host policy that allows your server URL (e.g., `http://localhost:8000/*`)
3. Your FastMCP server's public URL (e.g., `http://localhost:8000`)

### FastMCP Configuration

Create your FastMCP server and use `KeycloakAuthProvider` to handle OAuth:

```python server.py
import os

from fastmcp import FastMCP
from fastmcp.server.auth.providers.keycloak import KeycloakAuthProvider
from fastmcp.server.dependencies import get_access_token

auth = KeycloakAuthProvider(
    realm_url=os.getenv("KEYCLOAK_REALM_URL") or "http://localhost:8080/realms/myrealm",
    base_url="http://localhost:8000",
    # audience="http://localhost:8000",  # Recommended for production
)

mcp = FastMCP("Keycloak Example Server", auth=auth)


@mcp.tool
async def get_access_token_claims() -> dict:
    """Get the authenticated user's access token claims."""
    token = get_access_token()
    return {
        "sub": token.claims.get("sub"),
        "scope": token.claims.get("scope"),
        "azp": token.claims.get("azp"),
    }
```

<Warning>
**Production security**: Always configure the `audience` parameter in production. Without it, your server accepts tokens issued for any audience. Configure Keycloak audience mappers and set `audience` to your server's base URL to ensure tokens are specifically intended for your server.
</Warning>

`required_scopes` defaults to `["openid"]`, which ensures the `sub` claim is present in access tokens. Pass your own list to require additional scopes.

## Local Development

Local infrastructure tooling is deliberately kept out of the FastMCP core library to keep auth integrations slim and the associated maintenance burden as low as possible. That said, Keycloak is a popular identity provider for local development and testing, so a dedicated FastMCP-compatible setup blueprint lives in the companion project [**fastmcp-keycloak-local**](https://github.com/stephaneberle9/fastmcp-keycloak-local).

It provides everything needed to develop and test FastMCP servers with Keycloak OAuth locally: a Docker-based Keycloak setup with a pre-configured `fastmcp` realm (Dynamic Client Registration enabled, test user included), cross-platform start scripts, and integration guides for the MCP Inspector, Claude Desktop, and Claude Code CLI.

## Testing

### Running the Server

```bash
fastmcp run server.py --transport http --port 8000
```

### Testing with a Client

```python client.py
import asyncio
from fastmcp import Client

async def main():
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        print("✓ Authenticated with Keycloak!")
        result = await client.call_tool("get_access_token_claims")
        print(f"sub: {result.data.get('sub', 'N/A')}")

asyncio.run(main())
```

On first run, your browser will open to Keycloak's authorization page. After login, the client receives a token and caches it for subsequent runs.

## Features

### JWT Token Validation

- **Signature Verification**: Validates tokens against Keycloak's JWKS endpoint
- **Expiration Checking**: Automatically rejects expired tokens
- **Issuer Validation**: Ensures tokens come from your specific Keycloak realm
- **Scope Enforcement**: Verifies required OAuth scopes are present
- **Audience Validation**: Optional validation that tokens target your server (configure `audience`)

### User Claims

Access user information from Keycloak JWT tokens:

```python
from fastmcp import FastMCP
from fastmcp.server.auth.providers.keycloak import KeycloakAuthProvider
from fastmcp.server.dependencies import get_access_token

auth = KeycloakAuthProvider(
    realm_url="http://localhost:8080/realms/myrealm",
    base_url="http://localhost:8000",
)

mcp = FastMCP("Keycloak Example Server", auth=auth)


@mcp.tool
async def admin_only_tool() -> str:
    """A tool only available to admin users."""
    token = get_access_token()
    roles = token.claims.get("realm_access", {}).get("roles", [])
    if "admin" not in roles:
        raise ValueError("This tool requires admin access")
    return "Admin access granted!"
```

## Advanced Configuration

### Custom Token Verifier

Pass `token_verifier` to replace the default `JWTVerifier`. The provider's `required_scopes` and `audience` only configure the default verifier, so set them on your custom verifier instead.

```python
from fastmcp.server.auth.providers.jwt import JWTVerifier
from fastmcp.server.auth.providers.keycloak import KeycloakAuthProvider

custom_verifier = JWTVerifier(
    jwks_uri="http://localhost:8080/realms/myrealm/protocol/openid-connect/certs",
    issuer="http://localhost:8080/realms/myrealm",
    audience="my-resource-server",
    required_scopes=["api:read", "api:write"],
)

auth = KeycloakAuthProvider(
    realm_url="http://localhost:8080/realms/myrealm",
    base_url="http://localhost:8000",
    token_verifier=custom_verifier,
)
```

---

### Integrations Mcp Json Configuration (`docs/integrations/mcp-json-configuration.mdx`)

---
title: MCP JSON Configuration 🤝 FastMCP
sidebarTitle: MCP.json
description: Generate standard MCP configuration files for any compatible client
icon: brackets-curly
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.10.3" />

FastMCP can generate standard MCP JSON configuration files that work with any MCP-compatible client including Claude Desktop, VS Code, Cursor, and other applications that support the Model Context Protocol.

## MCP JSON Configuration Standard

The MCP JSON configuration format is an **emergent standard** that has developed across the MCP ecosystem. This format defines how MCP clients should configure and launch MCP servers, providing a consistent way to specify server commands, arguments, and environment variables.

### Configuration Structure

The standard uses a `mcpServers` object where each key represents a server name and the value contains the server's configuration:

```json
{
  "mcpServers": {
    "server-name": {
      "command": "executable",
      "args": ["arg1", "arg2"],
      "env": {
        "VAR": "value"
      }
    }
  }
}
```

### Server Configuration Fields

#### `command` (required)
The executable command to run the MCP server. This should be an absolute path or a command available in the system PATH.

```json
{
  "command": "python"
}
```

#### `args` (optional)
An array of command-line arguments passed to the server executable. Arguments are passed in order.

```json
{
  "args": ["server.py", "--verbose", "--port", "8080"]
}
```

#### `env` (optional)
An object containing environment variables to set when launching the server. All values must be strings.

```json
{
  "env": {
    "API_KEY": "secret-key",
    "DEBUG": "true",
    "PORT": "8080"
  }
}
```

### Client Adoption

This format is widely adopted across the MCP ecosystem:

- **Claude Desktop**: Uses `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, `%APPDATA%\Claude\claude_desktop_config.json` on Windows
- **Cursor**: Uses `~/.cursor/mcp.json`
- **VS Code**: Uses workspace `.vscode/mcp.json`, with servers under a top-level `servers` key instead of `mcpServers`
- **Other clients**: Many MCP-compatible applications follow this standard

## Overview

<Note>
**For the best experience, use FastMCP's first-class integrations:** [`fastmcp install claude-code`](/integrations/claude-code), [`fastmcp install claude-desktop`](/integrations/claude-desktop), or [`fastmcp install cursor`](/integrations/cursor). Use MCP JSON generation for advanced use cases and unsupported clients.
</Note>

The `fastmcp install mcp-json` command generates configuration in the standard `mcpServers` format used across the MCP ecosystem. This is useful when:

- **Working with unsupported clients** - Any MCP client not directly integrated with FastMCP
- **CI/CD environments** - Automated configuration generation for deployments  
- **Configuration sharing** - Easy distribution of server setups to team members
- **Custom tooling** - Integration with your own MCP management tools
- **Manual setup** - When you prefer to manually configure your MCP client

## Basic Usage

Generate configuration and output to stdout (useful for piping):

```bash
fastmcp install mcp-json server.py
```

This outputs the server configuration JSON with the server name as the root key:

```json
{
  "My Server": {
    "command": "uv",
    "args": [
      "run",
      "--with",
      "fastmcp", 
      "fastmcp",
      "run",
      "/absolute/path/to/server.py"
    ]
  }
}
```

To use this in a client configuration file, add it to the `mcpServers` object in your client's configuration:

```json
{
  "mcpServers": {
    "My Server": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp", 
        "fastmcp",
        "run",
        "/absolute/path/to/server.py"
      ]
    }
  }
}
```

<Note>
When using `--python`, `--project`, or `--with-requirements`, the generated configuration will include these options in the `uv run` command, ensuring your server runs with the correct Python version and dependencies. When you pass `--project`, `--python` is omitted because the project defines its own Python.
</Note>

<Note>
Different MCP clients may have specific configuration requirements or formatting needs. Always consult your client's documentation to ensure proper integration.
</Note>

## Configuration Options

### Server Naming

```bash
# Use server's built-in name (from FastMCP constructor)
fastmcp install mcp-json server.py

# Override with custom name
fastmcp install mcp-json server.py --name "Custom Server Name"
```

### Dependencies

Add Python packages your server needs:

```bash
# Single package
fastmcp install mcp-json server.py --with pandas

# Multiple packages  
fastmcp install mcp-json server.py --with pandas --with requests --with httpx

# Editable local package
fastmcp install mcp-json server.py --with-editable ./my-package

# From requirements file
fastmcp install mcp-json server.py --with-requirements requirements.txt
```

You can also use a `fastmcp.json` configuration file (recommended):

```json fastmcp.json
{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "server.py",
    "entrypoint": "mcp"
  },
  "environment": {
    "dependencies": ["pandas", "matplotlib", "seaborn"]
  }
}
```

Then simply install with:
```bash
fastmcp install mcp-json fastmcp.json
```


### Environment Variables

```bash
# Individual environment variables
fastmcp install mcp-json server.py \
  --env API_KEY=your-secret-key \
  --env DEBUG=true

# Load from .env file
fastmcp install mcp-json server.py --env-file .env
```

### Python Version and Project Directory

Specify Python version or run within a specific project:

```bash
# Use specific Python version
fastmcp install mcp-json server.py --python 3.11

# Run within a project directory
fastmcp install mcp-json server.py --project /path/to/project
```

### Server Object Selection

Use the same `file.py:object` notation as other FastMCP commands:

```bash
# Auto-detects server object (looks for 'mcp', 'server', or 'app')
fastmcp install mcp-json server.py

# Explicit server object
fastmcp install mcp-json server.py:my_custom_server
```

## Clipboard Integration

Copy configuration directly to your clipboard for easy pasting:

```bash
fastmcp install mcp-json server.py --copy
```

<Note>
`--copy` uses the `pyperclip` package, which installs with FastMCP. On Linux, `pyperclip` also needs a system clipboard tool such as `xclip`, `xsel`, or `wl-clipboard`.
</Note>

## Usage Examples

### Basic Server

```bash
fastmcp install mcp-json dice_server.py
```

Output:
```json
{
  "Dice Server": {
    "command": "uv",
    "args": [
      "run",
      "--with",
      "fastmcp",
      "fastmcp", 
      "run",
      "/home/user/dice_server.py"
    ]
  }
}
```

### Production Server with Dependencies

```bash
fastmcp install mcp-json api_server.py \
  --name "Production API Server" \
  --with requests \
  --with python-dotenv \
  --env API_BASE_URL=https://api.example.com \
  --env TIMEOUT=30
```

Output:
```json
{
  "Production API Server": {
    "command": "uv",
    "args": [
      "run",
      "--with",
      "fastmcp",
      "--with",
      "python-dotenv", 
      "--with",
      "requests",
      "fastmcp",
      "run", 
      "/home/user/api_server.py"
    ],
    "env": {
      "API_BASE_URL": "https://api.example.com",
      "TIMEOUT": "30"
    }
  }
}
```

### Advanced Configuration

```bash
fastmcp install mcp-json ml_server.py \
  --name "ML Analysis Server" \
  --with-requirements requirements.txt \
  --project /home/user/ml-project \
  --env GPU_DEVICE=0
```

The advanced configuration example generates:
```json
{
  "ML Analysis Server": {
    "command": "uv",
    "args": [
      "run",
      "--project",
      "/home/user/ml-project",
      "--with",
      "fastmcp",
      "--with-requirements",
      "/home/user/requirements.txt",
      "fastmcp",
      "run",
      "/home/user/ml_server.py"
    ],
    "env": {
      "GPU_DEVICE": "0"
    }
  }
}
```

### Pipeline Usage

Save configuration to file:

```bash
fastmcp install mcp-json server.py > mcp-config.json
```

Use in shell scripts:

```bash
#!/bin/bash
CONFIG=$(fastmcp install mcp-json server.py --name "CI Server")
echo "$CONFIG" | jq '."CI Server".command'
# Output: "uv"
```

### UV-Managed Project Dependencies

For servers that live inside a uv-managed project (with `pyproject.toml`), use the `--project` flag to run within that project's environment:

```bash
fastmcp install mcp-json server.py --project .
```

Output:
```json
{
  "My Server": {
    "command": "uv",
    "args": [
      "run",
      "--project",
      "/absolute/path/to/project",
      "--with",
      "fastmcp",
      "fastmcp",
      "run",
      "/absolute/path/to/project/server.py"
    ]
  }
}
```

When you install from a `fastmcp.json` file, `fastmcp install mcp-json` reads its `source` and `environment.dependencies` and ignores the rest of `environment`. Pass `--project` on the command line even when the file sets `environment.project`.

If your server needs additional packages beyond those in `pyproject.toml`, add them via the `dependencies` array or `--with`.

### Published Packages with `uvx`

If your team publishes MCP servers as pip packages, you can configure clients to run them with `uvx` directly instead of `uv run`. For example, if your package is called `my-mcp-server` and provides a CLI entry point of the same name:

```json
{
  "mcpServers": {
    "My Server": {
      "command": "uvx",
      "args": ["my-mcp-server"]
    }
  }
}
```

If the package name differs from the CLI command (e.g., package `weather-mcp` with command `weather-server`):

```json
{
  "mcpServers": {
    "Weather": {
      "command": "uvx",
      "args": ["--from", "weather-mcp", "weather-server"]
    }
  }
}
```

You can also pin Python versions or add extra dependencies:

```json
{
  "mcpServers": {
    "My Server": {
      "command": "uvx",
      "args": [
        "--python", "3.12",
        "--with", "requests",
        "my-mcp-server"
      ]
    }
  }
}
```

<Note>
`fastmcp install mcp-json` generates `uv run` configurations for local development. For published packages, you'll typically write the `uvx` configuration manually or generate it through your own packaging workflow.
</Note>

## Integration with MCP Clients

The generated configuration works with any MCP-compatible application:

### Claude Desktop
<Note>
**Prefer [`fastmcp install claude-desktop`](/integrations/claude-desktop)** for automatic installation. Use MCP JSON for advanced configuration needs.
</Note>
Copy the `mcpServers` object into Claude Desktop's config file (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, `%APPDATA%\Claude\claude_desktop_config.json` on Windows)

### Cursor
<Note>
**Prefer [`fastmcp install cursor`](/integrations/cursor)** for automatic installation. Use MCP JSON for advanced configuration needs.
</Note>
Add to `~/.cursor/mcp.json`

### VS Code
Add the server object to the top-level `servers` key in your workspace's `.vscode/mcp.json` file. VS Code does not read `mcpServers`.

### Custom Applications
Use the JSON configuration with any application that supports the MCP protocol

## Configuration Format

The generated configuration outputs a server object with the server name as the root key:

```json
{
  "<server-name>": {
    "command": "<executable>",
    "args": ["<arg1>", "<arg2>", "..."],
    "env": {
      "<ENV_VAR>": "<value>"
    }
  }
}
```

To use this in an MCP client, add it to the client's `mcpServers` configuration object.

**Fields:**
- `command`: The executable to run (always `uv` for FastMCP servers)
- `args`: Command-line arguments including dependencies and server path
- `env`: Environment variables (only included if specified)

<Warning>
**All file paths in the generated configuration are absolute paths**. This ensures the configuration works regardless of the working directory when the MCP client starts the server.
</Warning>

## Requirements

- **uv**: Must be installed and available in your system PATH
- **A system clipboard tool** (Linux only, optional): `--copy` needs `xclip`, `xsel`, or `wl-clipboard`

Install uv if not already available:

```bash
# macOS
brew install uv

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
```

```powershell
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

---

### Integrations Oci (`docs/integrations/oci.mdx`)

---
title: OCI IAM OAuth 🤝 FastMCP
sidebarTitle: Oracle
description: Secure your FastMCP server with OCI IAM OAuth
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.13.0" />

This guide shows you how to secure your FastMCP server using **OCI IAM OAuth**. Since OCI IAM doesn't support Dynamic Client Registration, this integration uses the [**OIDC Proxy**](/servers/auth/oidc-proxy) pattern to bridge OCI's traditional OAuth with MCP's authentication requirements.

## Configuration

### Prerequisites

1. An OCI cloud Account with access to create an Integrated Application in an Identity Domain.
2. Your FastMCP server's URL (For dev environments, it is http://localhost:8000. For PROD environments, it could be https://mcp.yourdomain.com)

### Step 1: Make sure client access is enabled for JWK's URL

<Steps>
<Step title="Navigate to OCI IAM Domain Settings">

    Login to OCI console (https://cloud.oracle.com for OCI commercial cloud).
    From "Identity & Security" menu, open Domains page.
    On the Domains list page, select the domain that you are using for MCP Authentication.
    Open Settings tab. 
    Click on "Edit Domain Settings" button.

    <Frame>
        <img src="/integrations/images/oci/ocieditdomainsettingsbutton.png" alt="OCI console showing the Edit Domain Settings button in the IAM Domain settings page" />
    </Frame>
</Step>

<Step title="Update Domain Setting">

    Enable "Configure client access" checkbox as shown in the screenshot.

    <Frame>
        <img src="/integrations/images/oci/ocieditdomainsettings.png" alt="OCI IAM Domain Settings" />
    </Frame>
</Step>
</Steps>

### Step 2: Create OAuth client for MCP server authentication

Follow the Steps as mentioned below to create an OAuth client.

<Steps>
<Step title="Navigate to OCI IAM Integrated Applications">

    Login to OCI console (https://cloud.oracle.com for OCI commercial cloud).
    From "Identity & Security" menu, open Domains page.
    On the Domains list page, select the domain in which you want to create MCP server OAuth client. If you need help finding the list page for the domain, see [Listing Identity Domains.](https://docs.oracle.com/en-us/iaas/Content/Identity/domains/to-view-identity-domains.htm#view-identity-domains).
    On the details page, select Integrated applications. A list of applications in the domain is displayed.
</Step>

<Step title="Add an Integrated Application">

    Select Add application.
    In the Add application window, select Confidential Application.
    Select Launch workflow.
    In the Add application details page, Enter name and description as shown below.

    <Frame>
        <img src="/integrations/images/oci/ociaddapplication.png" alt="Adding a Confidential Integrated Application in OCI IAM Domain" />
    </Frame>
</Step>

<Step title="Update OAuth Configuration for an Integrated Application">

    Once the Integrated Application is created, Click on "OAuth configuration" tab.
    Click on "Edit OAuth configuration" button.
    Configure the application as OAuth client by selecting "Configure this application as a client now" radio button.
    Select "Authorization code" grant type. If you are planning to use the same OAuth client application for token exchange, select "Client credentials" grant type as well. In the sample, we will use the same client.
    For Authorization grant type, select redirect URL. In most cases, this will be the MCP server URL followed by "/auth/callback".

    <Frame>
        <img src="/integrations/images/oci/ocioauthconfiguration.png" alt="OAuth Configuration for an Integrated Application in OCI IAM Domain" />
    </Frame>
</Step>

<Step title="Activate the Integrated Application">

    Click on "Submit" button to update OAuth configuration for the client application. 
    **Note: You don't need to do any special configuration to support PKCE for the OAuth client.**
    Make sure to Activate the client application.
    Note down client ID and client secret for the application. You'll use these values when configuring the OCIProvider in your code.
</Step>
</Steps>

### Step 3: FastMCP Configuration

Create your FastMCP server with `OCIProvider`. Set `config_url` to your identity domain's OIDC discovery URL, `https://<IAM_GUID>.identity.oraclecloud.com/.well-known/openid-configuration`, and pass the client ID and secret from Step 2. `required_scopes` defaults to `["openid"]`.

```python server.py
import os

from fastmcp import FastMCP
from fastmcp.server.auth.providers.oci import OCIProvider

auth_provider = OCIProvider(
    config_url=os.environ["OCI_CONFIG_URL"],
    client_id=os.environ["OCI_CLIENT_ID"],
    client_secret=os.environ["OCI_CLIENT_SECRET"],
    base_url="http://localhost:8000",
    required_scopes=["openid", "profile", "email"],
)

mcp = FastMCP(name="OCI Secured App", auth=auth_provider)
```

This is all you need to implement MCP server authentication against OCI IAM. However, you may want to use an authenticated user token to invoke OCI control plane APIs and propagate identity to the OCI control plane instead of using a service user account. In that case, you need to implement token exchange.

### Step 4: Token Exchange Setup (Only if MCP server needs to talk to OCI Control Plane)

Token exchange helps you exchange a logged-in user's OCI IAM token for an OCI control plane session token, also known as UPST (User Principal Session Token). To learn more about token exchange, see the [Workload Identity Federation blog post](https://www.ateam-oracle.com/post/workload-identity-federation)

For token exchange, you need to configure an identity propagation trust. The blog above discusses setting up the trust using REST APIs. However, you can also use OCI CLI. Before using the CLI command below, ensure that you have created a token exchange OAuth client. In most cases, you can use the same OAuth client that you created above. Replace `<IAM_GUID>` and `<CLIENT_ID>` in the CLI command below with your actual values.

```bash
oci identity-domains identity-propagation-trust create \
--schemas '["urn:ietf:params:scim:schemas:oracle:idcs:IdentityPropagationTrust"]' \
--public-key-endpoint "https://<IAM_GUID>.identity.oraclecloud.com/admin/v1/SigningCert/jwk" \
--name "For Token Exchange" --type "JWT" \
--issuer "https://identity.oraclecloud.com/" --active true \
--endpoint "https://<IAM_GUID>.identity.oraclecloud.com" \
--subject-claim-name "sub" --allow-impersonation false \
--subject-mapping-attribute "username" \
--subject-type "User" --client-claim-name "iss" \
--client-claim-values '["https://identity.oraclecloud.com/"]' \
--oauth-clients '["<CLIENT_ID>"]'
```

To exchange access token for OCI token and create a signer object, you need to add below code in MCP server. You can then use the signer object to create any OCI control plane client. 

```
/* Detailed source-code truncated for AI context efficiency. */
```

## Running MCP server

Once the setup is complete, to run the MCP server, run the below command.
```bash
fastmcp run server.py:mcp --transport http --port 8000
```

To run MCP client, run the below command.
```bash
python3 client.py
```

MCP Client sample is as below.
```python client.py
from fastmcp import Client
import asyncio

async def main():
    # The client will automatically handle OCI OAuth flows
    async with Client("http://localhost:8000/mcp/", auth="oauth") as client:
        # First-time connection will open OCI login in your browser
        print("✓ Authenticated with OCI IAM")

        tools = await client.list_tools()
        print(f"🔧 Available tools ({len(tools)}):")
        for tool in tools:
            print(f"   - {tool.name}: {tool.description}")

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to OCI IAM's login page
2. Sign in with your OCI account and grant the requested consent
3. After authorization, you'll be redirected back to the redirect path
4. The client receives the token and can make authenticated requests

## Production Configuration

<VersionBadge version="2.13.0" />

For production deployments with persistent token management across server restarts, configure `jwt_signing_key`, and `client_storage`:

```python server.py

import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.oci import OCIProvider

from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

# Load configuration from environment
# Production setup with encrypted persistent token storage
auth_provider = OCIProvider(
    config_url=os.environ.get("OCI_CONFIG_URL"),
    client_id=os.environ.get("OCI_CLIENT_ID"),
    client_secret=os.environ.get("OCI_CLIENT_SECRET"),
    base_url=os.environ.get("BASE_URL", "https://your-production-domain.com"),

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production OCI App", auth=auth_provider)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

---

### Integrations Openai (`docs/integrations/openai.mdx`)

---
title: OpenAI API 🤝 FastMCP
sidebarTitle: OpenAI API
description: Connect FastMCP servers to the OpenAI API
icon: message-code
---

import { VersionBadge } from "/snippets/version-badge.mdx"


## Responses API

OpenAI's [Responses API](https://platform.openai.com/docs/api-reference/responses) supports [MCP servers](https://platform.openai.com/docs/guides/tools-remote-mcp) as remote tool sources, allowing you to extend AI capabilities with custom functions.

<Note>
The Responses API is a distinct API from OpenAI's Chat Completions and Assistants APIs, which do not support MCP servers.
</Note>

<Tip>
Currently, the Responses API only accesses **tools** from MCP servers—it queries the `list_tools` endpoint and exposes those functions to the AI agent. Other MCP features like resources and prompts are not currently supported.
</Tip>


### Create a Server

First, create a FastMCP server with the tools you want to expose. For this example, we'll create a server with a single tool that rolls dice.

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

### Deploy the Server

Your server must be deployed to a public URL in order for OpenAI to access it.

For development, you can use tools like `ngrok` to temporarily expose a locally-running server to the internet. We'll do that for this example (you may need to install `ngrok` and create a free account), but you can use any other method to deploy your server.

Assuming you saved the above code as `server.py`, you can run the following two commands in two separate terminals to deploy your server and expose it to the internet:

<CodeGroup>
```bash FastMCP server
python server.py
```

```bash ngrok
ngrok http 8000
```
</CodeGroup>

<Warning>
This exposes your unauthenticated server to the internet. Only run this command in a safe environment if you understand the risks.
</Warning>

### Call the Server

To use the Responses API, you'll need to install the OpenAI Python SDK (not included with FastMCP):

```bash
pip install openai
```

You'll also need to authenticate with OpenAI. You can do this by setting the `OPENAI_API_KEY` environment variable. Consult the OpenAI SDK documentation for more information.

```bash
export OPENAI_API_KEY="your-api-key"
```

Here is an example of how to call your server from Python. Note that you'll need to replace `https://your-server-url.com` with the actual URL of your server. In addition, we use `/mcp` as the endpoint because we deployed a streamable-HTTP server with the default path; you may need to use a different endpoint if you customized your server's deployment.

```python {4, 11-16}
from openai import OpenAI

# Your server URL (replace with your actual URL)
url = 'https://your-server-url.com'

client = OpenAI()

resp = client.responses.create(
    model="gpt-4.1",
    tools=[
        {
            "type": "mcp",
            "server_label": "dice_server",
            "server_url": f"{url}/mcp",
            "require_approval": "never",
        },
    ],
    input="Roll a few dice!",
)

print(resp.output_text)
```
If you run this code, you'll see something like the following output:

```text
You rolled 3 dice and got the following results: 6, 4, and 2!
```

### Authentication

<VersionBadge version="2.6.0" />

The Responses API can include headers to authenticate the request, which means you don't have to worry about your server being publicly accessible.

#### Server Authentication

The simplest way to add authentication to the server is to use a bearer token scheme. 

For this example, we'll quickly generate our own tokens with FastMCP's `RSAKeyPair` utility, but this may not be appropriate for production use. For more details, see the complete server-side [Token Verification](/servers/auth/token-verification) documentation. 

We'll start by creating an RSA key pair to sign and verify tokens.

```python
from fastmcp.server.auth.providers.jwt import RSAKeyPair

key_pair = RSAKeyPair.generate()
access_token = key_pair.create_token(audience="dice-server")
```

<Warning>
FastMCP's `RSAKeyPair` utility is for development and testing only.
</Warning> 

Next, we'll create a `JWTVerifier` to authenticate the server. 

```python
from fastmcp import FastMCP
from fastmcp.server.auth import JWTVerifier

auth = JWTVerifier(
    public_key=key_pair.public_key,
    audience="dice-server",
)

mcp = FastMCP(name="Dice Roller", auth=auth)
```

Here is a complete example that you can copy/paste. For simplicity and the purposes of this example only, it will print the token to the console. **Do NOT do this in production!**

```python server.py [expandable]
from fastmcp import FastMCP
from fastmcp.server.auth import JWTVerifier
from fastmcp.server.auth.providers.jwt import RSAKeyPair
import random

key_pair = RSAKeyPair.generate()
access_token = key_pair.create_token(audience="dice-server")

auth = JWTVerifier(
    public_key=key_pair.public_key,
    audience="dice-server",
)

mcp = FastMCP(name="Dice Roller", auth=auth)

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    print(f"\n---\n\n🔑 Dice Roller access token:\n\n{access_token}\n\n---\n")
    mcp.run(transport="http", port=8000)
```

#### Client Authentication

If you try to call the authenticated server with the same OpenAI code we wrote earlier, you'll get an error like this:

```text
APIStatusError: Error code: 424 - {
    "error": {
        "message": "Error retrieving tool list from MCP server: 'dice_server'. Http status code: 401 (Unauthorized)",
        "type": "external_connector_error",
        "param": "tools",
        "code": "http_error"
    }
}
```

As expected, the server is rejecting the request because it's not authenticated.

To authenticate the client, you can pass the token in the `Authorization` header with the `Bearer` scheme:


```python {4, 7, 19-21} [expandable]
from openai import OpenAI

# Your server URL (replace with your actual URL)
url = 'https://your-server-url.com'

# Your access token (replace with your actual token)
access_token = 'your-access-token'

client = OpenAI()

resp = client.responses.create(
    model="gpt-4.1",
    tools=[
        {
            "type": "mcp",
            "server_label": "dice_server",
            "server_url": f"{url}/mcp",
            "require_approval": "never",
            "headers": {
                "Authorization": f"Bearer {access_token}"
            }
        },
    ],
    input="Roll a few dice!",
)

print(resp.output_text)
```

You should now see the dice roll results in the output.

---

### Integrations Openapi (`docs/integrations/openapi.mdx`)

---
title: OpenAPI 🤝 FastMCP
sidebarTitle: OpenAPI
description: Generate MCP servers from any OpenAPI specification
icon: list-tree
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.0.0" />

FastMCP can automatically generate an MCP server from any OpenAPI specification, allowing AI models to interact with existing APIs through the MCP protocol. Instead of manually creating tools and resources, you provide an OpenAPI spec and FastMCP converts API endpoints into the appropriate MCP components.

<Note>
Under the hood, OpenAPI integration uses OpenAPIProvider (v3.0.0+) to source tools from the specification. See [Providers](/servers/providers/overview) to understand how FastMCP sources components.
</Note>

<Tip>
Generating MCP servers from OpenAPI is a great way to get started with FastMCP, but in practice LLMs achieve **significantly better performance** with well-designed and curated MCP servers than with auto-converted OpenAPI servers. This is especially true for complex APIs with many endpoints and parameters.

We recommend using the FastAPI integration for bootstrapping and prototyping, not for mirroring your API to LLM clients. See the post [Stop Converting Your REST APIs to MCP](https://www.jlowin.dev/blog/stop-converting-rest-apis-to-mcp) for more details.
</Tip>

## Create a Server

To convert an OpenAPI specification to an MCP server, use the `FastMCP.from_openapi()` class method:

```python server.py
import httpx2
from fastmcp import FastMCP

# Create an HTTP client for your API
client = httpx2.AsyncClient(base_url="https://api.example.com")

# Load your OpenAPI spec
spec = httpx2.get("https://api.example.com/openapi.json").json()

# Create the MCP server
mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    name="My API Server"
)

if __name__ == "__main__":
    mcp.run()
```

Later examples that call `FastMCP.from_openapi()` reuse `spec` and `client` from this example.

### Authentication

If your API requires authentication, configure it on the HTTP client:

```python
import httpx2
from fastmcp import FastMCP

# Bearer token authentication
api_client = httpx2.AsyncClient(
    base_url="https://api.example.com",
    headers={"Authorization": "Bearer YOUR_TOKEN"}
)

# Create MCP server with authenticated client
mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=api_client,
)
```

### Timeouts

Requests from generated tools, resources, and resource templates use the timeout configured on the HTTP client you pass to `FastMCP.from_openapi()`. An `httpx2.AsyncClient` uses a five-second timeout for network inactivity by default. If your API takes longer to respond, configure the client before creating the MCP server:

```python
import httpx2
from fastmcp import FastMCP

api_client = httpx2.AsyncClient(
    base_url="https://api.example.com",
    timeout=30.0,
)

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=api_client,
)
```

Use `timeout=None` on the HTTP client to disable timeouts, or an `httpx2.Timeout` instance to configure connect, read, write, and pool timeouts separately. See the [HTTPX2 timeout guide](https://pydantic.dev/docs/httpx2/advanced/timeouts/) for details.

If you omit the `client` argument, FastMCP creates an HTTP client with a 30-second timeout using the first server URL in your OpenAPI specification.

## Upstream HTTP errors

When an OpenAPI request receives a non-success status, FastMCP reports the status and reason to the MCP caller. HTTP 429 retains the rate-limit message, "Rate limited by upstream API, please retry later". If your HTTP client returns a redirect response, the error includes its `Location` header. Redirect following is controlled by the HTTP client configuration.

JSON error bodies are rendered as JSON; HTML pages are omitted, and other response text is limited to 1,000 characters with a truncation marker. These details are shared by generated tools, resources, and resource templates. Configure `mask_error_details=True` on `FastMCP.from_openapi()` when callers should not see upstream error details.

## Route Mapping

By default, FastMCP converts **every endpoint** in your OpenAPI specification into an MCP **Tool**. This provides a simple, predictable starting point that ensures all your API's functionality is immediately available to the vast majority of LLM clients which only support MCP tools.

While this is a pragmatic default for maximum compatibility, you can easily customize this behavior. Internally, FastMCP uses an ordered list of `RouteMap` objects to determine how to map OpenAPI routes to various MCP component types.

Each `RouteMap` specifies a combination of methods, patterns, and tags, as well as a corresponding MCP component type. Each OpenAPI route is checked against each `RouteMap` in order, and the first one that matches every criterion is used to determine its converted MCP type. A special type, `EXCLUDE`, can be used to exclude routes from the MCP server entirely.

- **Methods**: HTTP methods to match (e.g. `["GET", "POST"]` or `"*"` for all)
- **Pattern**: Regex pattern to match the route path (e.g. `r"^/users/.*"` or `r".*"` for all)
- **Tags**: A set of OpenAPI tags that must all be present. An empty set (`set()`, the default) means no tag filtering, so the route matches regardless of its tags.
- **MCP type**: What MCP component type to create (`TOOL`, `RESOURCE`, `RESOURCE_TEMPLATE`, or `EXCLUDE`)
- **MCP tags**: A set of custom tags to add to components created from matching routes

Here is FastMCP's default rule:

```python
from fastmcp.server.providers.openapi import RouteMap, MCPType

DEFAULT_ROUTE_MAPPINGS = [
    # All routes become tools
    RouteMap(mcp_type=MCPType.TOOL),
]
```

### Custom Route Maps

When creating your FastMCP server, you can customize routing behavior by providing your own list of `RouteMap` objects. Your custom maps are processed before the default route maps, and routes will be assigned to the first matching custom map.

For example, prior to FastMCP 2.8.0, GET requests were automatically mapped to `Resource` and `ResourceTemplate` components based on whether they had path parameters. (This was changed solely for client compatibility reasons.) You can restore this behavior by providing custom route maps:

```python
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import RouteMap, MCPType

# Restore pre-2.8.0 semantic mapping
semantic_maps = [
    # GET requests with path parameters become ResourceTemplates
    RouteMap(methods=["GET"], pattern=r".*\{.*\}.*", mcp_type=MCPType.RESOURCE_TEMPLATE),
    # All other GET requests become Resources
    RouteMap(methods=["GET"], pattern=r".*", mcp_type=MCPType.RESOURCE),
]

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    route_maps=semantic_maps,
)
```

With these maps, `GET` requests are handled semantically, and all other methods (`POST`, `PUT`, etc.) will fall through to the default rule and become `Tool`s.

Here is a more complete example that uses custom route maps to convert all `GET` endpoints under `/analytics/` to tools while excluding all admin endpoints and all routes tagged "internal". All other routes will be handled by the default rules:

```python
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import RouteMap, MCPType

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    route_maps=[
        # Analytics `GET` endpoints are tools
        RouteMap(
            methods=["GET"], 
            pattern=r"^/analytics/.*", 
            mcp_type=MCPType.TOOL,
        ),

        # Exclude all admin endpoints
        RouteMap(
            pattern=r"^/admin/.*", 
            mcp_type=MCPType.EXCLUDE,
        ),

        # Exclude all routes tagged "internal"
        RouteMap(
            tags={"internal"},
            mcp_type=MCPType.EXCLUDE,
        ),
    ],
)
```

<Tip>
The default route maps are always applied after your custom maps, so you do not have to create route maps for every possible route.
</Tip>

### Excluding Routes

To exclude routes from the MCP server, use a route map to assign them to `MCPType.EXCLUDE`. 

You can use this to remove sensitive or internal routes by targeting them specifically:

```python
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import RouteMap, MCPType

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    route_maps=[
        RouteMap(pattern=r"^/admin/.*", mcp_type=MCPType.EXCLUDE),
        RouteMap(tags={"internal"}, mcp_type=MCPType.EXCLUDE),
    ],
)
```

Or you can use a catch-all rule to exclude everything that your maps don't handle explicitly:

```python
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import RouteMap, MCPType

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    route_maps=[
        # custom mapping logic goes here
        # ... your specific route maps ...
        # exclude all remaining routes
        RouteMap(mcp_type=MCPType.EXCLUDE),
    ],
)
```

<Tip>
Using a catch-all exclusion rule will prevent the default route mappings from being applied, since it will match every remaining route. This is useful if you want to explicitly allow-list certain routes.
</Tip>

### Advanced Route Mapping

<VersionBadge version="2.5.0" />

For advanced use cases that require more complex logic, you can provide a `route_map_fn` callable. After the route map logic is applied, this function is called on each matched route and its assigned MCP component type. It can optionally return a different component type to override the mapped assignment. If it returns `None`, the assigned type is used.

In addition to more precise targeting of methods, patterns, and tags, this function can access any additional OpenAPI metadata about the route.

<Tip>
The `route_map_fn` is called on all routes, even those that matched `MCPType.EXCLUDE` in your custom maps. This gives you an opportunity to customize the mapping or even override an exclusion.
</Tip>

```python
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import RouteMap, MCPType
from fastmcp.utilities.openapi import HTTPRoute

def custom_route_mapper(route: HTTPRoute, mcp_type: MCPType) -> MCPType | None:
    """Advanced route type mapping."""
    # Convert all admin routes to tools regardless of HTTP method
    if "/admin/" in route.path:
        return MCPType.TOOL

    elif "internal" in route.tags:
        return MCPType.EXCLUDE
    
    # Convert user detail routes to templates even if they're POST
    elif route.path.startswith("/users/") and route.method == "POST":
        return MCPType.RESOURCE_TEMPLATE
    
    # Use defaults for all other routes
    return None

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    route_map_fn=custom_route_mapper,
)
```

## Customization

### Component Names

<VersionBadge version="2.5.0" />

FastMCP automatically generates names for MCP components based on the OpenAPI specification. By default, it uses the `operationId` from your OpenAPI spec, up to the first double underscore (`__`). Routes without an `operationId` use their summary, or the HTTP method and path when there is no summary.

All component names are automatically:
- **Slugified**: Spaces and special characters are converted to underscores or removed
- **Truncated**: Limited to 56 characters maximum to ensure compatibility
- **Unique**: If multiple components have the same name, a number is automatically appended to make them unique

For more control over component names, you can provide an `mcp_names` dictionary that maps `operationId` values to your desired names. The `operationId` must be exactly as it appears in the OpenAPI spec. The provided name will always be slugified and truncated.

```python
from fastmcp import FastMCP

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    mcp_names={
        "list_users__with_pagination": "user_list",
        "create_user__admin_required": "create_user", 
        "get_user_details__admin_required": "user_detail",
    }
)
```

Any `operationId` not found in `mcp_names` will use the default strategy (operationId up to the first `__`).

### Tags

<VersionBadge version="2.8.0" />

FastMCP provides several ways to add tags to your MCP components, allowing you to categorize and organize them for better discoverability and filtering. Tags are combined from multiple sources to create the final set of tags on each component.

#### RouteMap Tags

You can add custom tags to components created from specific routes using the `mcp_tags` parameter in `RouteMap`. These tags will be applied to all components created from routes that match that particular route map.

```python
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import RouteMap, MCPType

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    route_maps=[
        # Add custom tags to all POST endpoints
        RouteMap(
            methods=["POST"],
            pattern=r".*",
            mcp_type=MCPType.TOOL,
            mcp_tags={"write-operation", "api-mutation"}
        ),
        
        # Add different tags to detail view endpoints
        RouteMap(
            methods=["GET"],
            pattern=r".*\{.*\}.*",
            mcp_type=MCPType.RESOURCE_TEMPLATE,
            mcp_tags={"detail-view", "parameterized"}
        ),
        
        # Add tags to list endpoints
        RouteMap(
            methods=["GET"],
            pattern=r".*",
            mcp_type=MCPType.RESOURCE,
            mcp_tags={"list-data", "collection"}
        ),
    ],
)
```

#### Global Tags

You can add tags to **all** components by providing a `tags` parameter when creating your MCP server. These global tags will be applied to every component created from your OpenAPI specification.

```python
from fastmcp import FastMCP

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    tags={"api-v2", "production", "external"}
)
```

#### OpenAPI Tags in Client Meta

FastMCP automatically includes OpenAPI tags from your specification in the component's metadata. These tags are available to MCP clients through the `meta.fastmcp.tags` field, allowing clients to filter and organize components based on the original OpenAPI tagging:

<CodeGroup>
```json {5} OpenAPI spec with tags
{
  "paths": {
    "/users": {
      "get": {
        "tags": ["users", "public"],
        "operationId": "list_users",
        "summary": "List all users"
      }
    }
  }
}
```
```python {6-9} Access OpenAPI tags in MCP client
async with client:
    tools = await client.list_tools()
    for tool in tools:
        if tool.meta:
            # OpenAPI tags are now available in fastmcp namespace!
            fastmcp_meta = tool.meta.get('fastmcp', {})
            openapi_tags = fastmcp_meta.get('tags', [])
            if 'users' in openapi_tags:
                print(f"Found user-related tool: {tool.name}")
```
</CodeGroup>

This makes it easy for clients to understand and organize API endpoints based on their original OpenAPI categorization.

### Advanced Customization

<VersionBadge version="2.5.0" />

By default, FastMCP creates MCP components using a variety of metadata from the OpenAPI spec, such as incorporating the OpenAPI description into the MCP component description.

At times you may want to modify those MCP components in a variety of ways, such as adding LLM-specific instructions or tags. For fine-grained customization, you can provide a `mcp_component_fn` when creating the MCP server. After each MCP component has been created, this function is called on it and has the opportunity to modify it in-place.

<Tip>
Your `mcp_component_fn` is expected to modify the component in-place, not to return a new component. The result of the function is ignored.
</Tip>

```python
from fastmcp import FastMCP
from fastmcp.server.providers.openapi import (
    OpenAPITool,
    OpenAPIResource,
    OpenAPIResourceTemplate,
)
from fastmcp.utilities.openapi import HTTPRoute

def customize_components(
    route: HTTPRoute, 
    component: OpenAPITool | OpenAPIResource | OpenAPIResourceTemplate,
) -> None:
    # Add custom tags to all components
    component.tags.add("openapi")
    
    # Customize based on component type
    if isinstance(component, OpenAPITool):
        component.description = f"🔧 {component.description} (via API)"
    
    if isinstance(component, OpenAPIResource):
        component.description = f"📊 {component.description}"
        component.tags.add("data")

mcp = FastMCP.from_openapi(
    openapi_spec=spec,
    client=client,
    mcp_component_fn=customize_components,
)
```

## Request Parameter Handling

Tool arguments map to the parameters and request body that the operation declares. By default, FastMCP logs a warning and drops any other arguments. With [strict input validation](/servers/tools#validation-modes) enabled, the call fails instead, with an error naming the unknown arguments and the accepted ones, and no request is sent.

A header parameter that the operation declares takes the value the tool call supplies. Otherwise, headers you configure on the HTTP client are sent with each request, except `Host`, which FastMCP takes from the request URL. When the MCP server runs over HTTP, FastMCP also forwards headers from the incoming MCP request, except credential and connection headers such as `Authorization`, `Cookie`, and `Host`. Forwarded headers only fill in headers that the outgoing request does not already set. This applies to tools, resources, and resource templates.

FastMCP handles each parameter location as follows.

### Query Parameters

By default, FastMCP skips parameters whose value is `None`. Empty strings are still sent as empty query values, which is useful for APIs that distinguish between an omitted parameter and an explicitly blank one.

```python
# When calling this tool...
await client.call_tool("search_products", {
    "category": "electronics",  # ✅ Included
    "min_price": 100,           # ✅ Included  
    "max_price": None,          # ❌ Excluded
    "brand": "",                # ✅ Included as an empty value
})

# The HTTP request will be: GET /products?category=electronics&min_price=100&brand=
```

### Path Parameters

Path parameters are typically required by REST APIs. FastMCP:
- Filters out `None` values
- Validates that all required path parameters are provided
- Raises clear errors for missing required parameters

Path values must not contain `.` or `..` segments, including percent-encoded forms. Ordinary dotted names such as `report.json` are accepted.

```python
# ✅ This works
await client.call_tool("get_user", {"user_id": 123})

# ❌ This raises: "Missing required path parameters: {'user_id'}"
await client.call_tool("get_user", {"user_id": None})
```

### Array Parameters

FastMCP handles array parameters according to OpenAPI specifications:

- **Query arrays**: Serialized based on `style` and `explode`. When omitted, `explode` defaults to `True` for `form` (the default query style) and `False` for other styles. With `explode=False`, `form` uses commas, `pipeDelimited` uses pipes, and `spaceDelimited` uses spaces.
- **Path arrays**: Serialized as comma-separated values (OpenAPI 'simple' style)

```python
# Query array with style=form, explode=true (defaults)
# ?tags=red&tags=blue&tags=green

# Query array with style=form, explode=false
# ?tags=red,blue,green

# Path array (always comma-separated)
# /items/red,blue,green
```

### Headers

Header parameters are automatically converted to strings and included in the HTTP request.

### Multipart Request Bodies

For `multipart/form-data`, non-empty string arrays use one form field per element. Calling a tool with `{"tags": ["a", "b"]}` sends two `tags` fields, so a backend reading repeated fields receives `["a", "b"]`.

This applies when the property's `encoding` is omitted or explicitly uses the defaults: `style: form`, `explode: true`, `contentType: text/plain`, `allowReserved: false`, and no custom headers. Existing scalar fields and binary file parts keep their serialization.

Other arrays are sent as a single field holding the list's Python string representation. That covers empty arrays (sent as `[]`), non-string arrays, and string arrays whose property declares a custom encoding such as `explode: false`, a JSON part, or a charset override.

If a backend depended on Python list strings for non-empty string arrays, adapt it to read repeated fields.

### JSON Request Bodies

Dictionary bodies without named properties use one tool argument containing the entire dictionary. For a dictionary schema titled `Labels`, calling the tool with `{"labels": {"team": "infra"}}` sends `{"team": "infra"}` to the API. Schemas without a title use the argument name `body`.

If a whole-body argument shares a name with a path, query, header, or cookie parameter, the HTTP parameter receives a location suffix. For example, an array body titled `Values` and a query parameter named `values` become `values` and `values__query`; calling with `{"values": [1, 2], "values__query": "active"}` sends `[1, 2]` as the body and `?values=active` in the URL.

For request bodies declared as `application/json` or a `+json` media type, pass strings, numbers, and booleans as their actual values. FastMCP JSON-encodes them and preserves the declared Content-Type, including media-type parameters. Do not JSON-encode a string yourself: passing `"true"` sends the JSON string `"true"`, while passing `True` sends the JSON boolean `true`.

Earlier versions sent string bodies as raw text even when the schema declared JSON. If you worked around that behavior by pre-encoding a string, remove the extra encoding. Bodies declared as `text/plain` continue to be sent as raw text.

### Composed Request Bodies

A request body becomes a flat set of tool arguments, which is the shape LLM tool-calling APIs fill in most reliably. Schemas composed with `allOf` are resolved first, following `$ref` members, so fields inherited from a parent schema appear alongside the ones a schema declares itself.

Schemas that use a `discriminator` are flattened the same way. FastMCP merges in the fields of every subtype named in the discriminator's `mapping`, marks them optional, and names the accepted values on the discriminator's own description. Given a `Pet` body discriminated by `petType` and mapped onto `Cat` and `Dog`, the tool takes the discriminator plus whichever fields that variant uses:

```python
await client.call_tool("create_pet", {
    "petType": "cat",
    "meowVolume": 11,
})
```

The discriminator stays required; every variant field is optional, because only one variant applies to any given call.

This trades local strictness for a schema models complete accurately. The generated schema permits any combination of variant fields, so sending `packSize` with `petType: "cat"` passes FastMCP's validation and is rejected by the API itself, exactly as it would be for any other HTTP client. Where two variants declare the same field differently, the declarations are combined with `anyOf` so that neither variant's constraints are advertised as applying to both.

---

### Integrations Permit (`docs/integrations/permit.mdx`)

---
title: Permit.io Authorization 🤝 FastMCP
sidebarTitle: Permit.io
description: Add fine-grained authorization to your FastMCP servers with Permit.io
icon: shield-check
---

Add **policy-based authorization** to your FastMCP servers with a single line of code using the **[Permit.io][permit-github] authorization middleware**.

Control which tools, resources and prompts MCP clients can view and execute on your server. Define dynamic policies using Permit.io's powerful RBAC, ABAC, and REBAC capabilities, and obtain comprehensive audit logs of all access attempts and violations.

## How it Works

Leveraging FastMCP's [Middleware][fastmcp-middleware], the Permit.io middleware intercepts all MCP requests to your server and automatically maps MCP methods to authorization checks against your Permit.io policies, covering both server methods and tool execution.

### Policy Mapping

The middleware automatically maps MCP methods to Permit.io resources and actions:

- **MCP server methods** (e.g., `tools/list`, `resources/read`):
  - **Resource**: `{server_name}_{component}` (e.g., `myserver_tools`)
  - **Action**: The method verb (e.g., `list`, `read`)
- **Tool execution** (method `tools/call`):
  - **Resource**: `{server_name}` (e.g., `myserver`)
  - **Action**: The tool name (e.g., `greet`)



*Example: In Permit.io, the 'Admin' role is granted permissions on resources and actions as mapped by the middleware. For example, 'greet', 'greet-jwt', and 'login' are actions on the 'mcp_server' resource, and 'list' is an action on the 'mcp_server_tools' resource.*

> **Note:**
> Don't forget to assign the relevant role (e.g., Admin, User) to the user authenticating to your MCP server (such as the user in the JWT) in the Permit.io Directory. Without the correct role assignment, users will not have access to the resources and actions you've configured in your policies.
>
> 
>
> *Example: In Permit.io Directory, both 'client' and 'admin' users are assigned the 'Admin' role, granting them the permissions defined in your policy mapping.*

For detailed policy mapping examples and configuration, see [Detailed Policy Mapping](https://github.com/permitio/permit-fastmcp/blob/main/docs/policy-mapping.md).

### Listing Operations

The middleware behaves as a filter for listing operations (`tools/list`, `resources/list`, `prompts/list`), hiding components that the defined policies do not authorize.

```mermaid
sequenceDiagram
    participant MCPClient as MCP Client
    participant PermitMiddleware as Permit.io Middleware
    participant MCPServer as FastMCP Server
    participant PermitPDP as Permit.io PDP

    MCPClient->>PermitMiddleware: MCP Listing Request (e.g., tools/list)
    PermitMiddleware->>MCPServer: MCP Listing Request
    MCPServer-->>PermitMiddleware: MCP Listing Response
    PermitMiddleware->>PermitPDP: Authorization Checks
    PermitPDP->>PermitMiddleware: Authorization Decisions
    PermitMiddleware-->>MCPClient: Filtered MCP Listing Response
```

### Execution Operations

The middleware behaves as an enforcement point for execution operations (`tools/call`, `resources/read`, `prompts/get`), blocking operations that are not authorized by the defined policies.

```mermaid
sequenceDiagram
    participant MCPClient as MCP Client
    participant PermitMiddleware as Permit.io Middleware
    participant MCPServer as FastMCP Server
    participant PermitPDP as Permit.io PDP

    MCPClient->>PermitMiddleware: MCP Execution Request (e.g., tools/call)
    PermitMiddleware->>PermitPDP: Authorization Check
    PermitPDP->>PermitMiddleware: Authorization Decision
    PermitMiddleware-->>MCPClient: MCP Unauthorized Error (if denied)
    PermitMiddleware->>MCPServer: MCP Execution Request (if allowed)
    MCPServer-->>PermitMiddleware: MCP Execution Response (if allowed)
    PermitMiddleware-->>MCPClient: MCP Execution Response (if allowed)
```

## Add Authorization to Your Server

<Note>
Permit.io is a cloud-native authorization service. You need a Permit.io account and a running Policy Decision Point (PDP) for the middleware to function. You can run the PDP locally with Docker or use Permit.io's cloud PDP.
</Note>

### Prerequisites

1. **Permit.io Account**: Sign up at [permit.io](https://permit.io)
2. **PDP Setup**: Run the Permit.io PDP locally or use the cloud PDP (RBAC only)
3. **API Key**: Get your Permit.io API key from the dashboard

### Run the Permit.io PDP

Run the PDP locally with Docker:

```bash
docker run -p 7766:7766 permitio/pdp:latest
```

Or use the cloud PDP URL: `https://cloudpdp.api.permit.io`

### Create a Server with Authorization

First, install the `permit-fastmcp` package:

```bash
# Using UV (recommended)
uv add permit-fastmcp

# Using pip
pip install permit-fastmcp
```

Then create a FastMCP server and add the Permit.io middleware:

```python server.py
from fastmcp import FastMCP
from permit_fastmcp.middleware.middleware import PermitMcpMiddleware

mcp = FastMCP("Secure FastMCP Server 🔒")

@mcp.tool
def greet(name: str) -> str:
    """Greet a user by name"""
    return f"Hello, {name}!"

@mcp.tool
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

# Add Permit.io authorization middleware
mcp.add_middleware(PermitMcpMiddleware(
    permit_pdp_url="http://localhost:7766",
    permit_api_key="your-permit-api-key"
))

if __name__ == "__main__":
    mcp.run(transport="http")
```

### Configure Access Policies

Create your authorization policies in the Permit.io dashboard:

1. **Create Resources**: Define resources like `mcp_server` and `mcp_server_tools`
2. **Define Actions**: Add actions like `greet`, `add`, `list`, `read`
3. **Create Roles**: Define roles like `Admin`, `User`, `Guest`
4. **Assign Permissions**: Grant roles access to specific resources and actions
5. **Assign Users**: Assign roles to users in the Permit.io Directory

For step-by-step setup instructions and troubleshooting, see [Getting Started & FAQ](https://github.com/permitio/permit-fastmcp/blob/main/docs/getting-started.md).

#### Example Policy Configuration

Policies are defined in the Permit.io dashboard, but you can also use the [Permit.io Terraform provider](https://github.com/permitio/terraform-provider-permit-io) to define policies in code.


```terraform
# Resources
resource "permitio_resource" "mcp_server" {
  name = "mcp_server"
  key  = "mcp_server"
  
  actions = {
    "greet" = { name = "greet" }
    "add"   = { name = "add" }
  }
}

resource "permitio_resource" "mcp_server_tools" {
  name = "mcp_server_tools"
  key  = "mcp_server_tools"
  
  actions = {
    "list" = { name = "list" }
  }
}

# Roles
resource "permitio_role" "Admin" {
  key         = "Admin"
  name        = "Admin"
  permissions = [
    "mcp_server:greet",
    "mcp_server:add", 
    "mcp_server_tools:list"
  ]
}
```

You can also use the [Permit.io CLI](https://github.com/permitio/permit-cli), [API](https://api.permit.io/scalar) or [SDKs](https://github.com/permitio/permit-python) to manage policies, as well as writing policies directly in REGO (Open Policy Agent's policy language).

For complete policy examples including ABAC and RBAC configurations, see [Example Policies](https://github.com/permitio/permit-fastmcp/tree/main/docs/example_policies).

### Identity Management

The middleware supports multiple identity extraction modes:

- **Fixed Identity**: Use a fixed identity for all requests
- **Header-based**: Extract identity from HTTP headers
- **JWT-based**: Extract and verify JWT tokens
- **Source-based**: Use the MCP context source field

The middleware reads its `PERMIT_MCP_*` environment variables once, when `permit_fastmcp` is imported, so set them before the import. For detailed identity mode configuration and environment variables, see [Identity Modes & Environment Variables](https://github.com/permitio/permit-fastmcp/blob/main/docs/identity-modes.md).

#### JWT Authentication Example

```python
import os

# Configure JWT identity extraction before importing the middleware
os.environ["PERMIT_MCP_IDENTITY_MODE"] = "jwt"
os.environ["PERMIT_MCP_IDENTITY_JWT_SECRET"] = "your-jwt-secret"

from fastmcp import FastMCP
from permit_fastmcp.middleware.middleware import PermitMcpMiddleware

mcp = FastMCP("Secure FastMCP Server 🔒")

mcp.add_middleware(PermitMcpMiddleware(
    permit_pdp_url="http://localhost:7766",
    permit_api_key="your-permit-api-key"
))
```

### ABAC Policies with Tool Arguments

The middleware supports Attribute-Based Access Control (ABAC) policies that can evaluate tool arguments as attributes. Tool arguments are automatically flattened as individual attributes (e.g., `arg_name`, `arg_number`) for granular policy conditions.



*Example: Create dynamic resources with conditions like `resource.arg_number greater-than 10` to allow the `conditional-greet` tool only when the number argument exceeds 10.*

#### Example: Conditional Access

Create a dynamic resource with conditions like `resource.arg_number greater-than 10` to allow the `conditional-greet` tool only when the number argument exceeds 10.

```python
from fastmcp import FastMCP
from permit_fastmcp.middleware.middleware import PermitMcpMiddleware

mcp = FastMCP("Secure FastMCP Server 🔒")
mcp.add_middleware(PermitMcpMiddleware(
    permit_pdp_url="http://localhost:7766",
    permit_api_key="your-permit-api-key"
))


@mcp.tool
def conditional_greet(name: str, number: int) -> str:
    """Greet a user only if number > 10"""
    return f"Hello, {name}! Your number is {number}"
```



*Example: The Admin role is granted access to the "conditional-greet" action on the "Big-greets" dynamic resource, while other tools like "greet", "greet-jwt", and "login" are granted on the base "mcp_server" resource.*

For comprehensive ABAC configuration and advanced policy examples, see [ABAC Policies with Tool Arguments](https://github.com/permitio/permit-fastmcp/blob/main/docs/policy-mapping.md#abac-policies-with-tool-arguments).

### Run the Server

Start your FastMCP server normally:

```bash
python server.py
```

The middleware will now intercept all MCP requests and check them against your Permit.io policies. Requests include user identification through the configured identity mode and automatic mapping of MCP methods to authorization resources and actions.

## Advanced Configuration

### Environment Variables

Configure the middleware using environment variables:

```bash
# Permit.io configuration
export PERMIT_MCP_PERMIT_PDP_URL="http://localhost:7766"
export PERMIT_MCP_PERMIT_API_KEY="your-api-key"

# Identity configuration
export PERMIT_MCP_IDENTITY_MODE="jwt"
export PERMIT_MCP_IDENTITY_JWT_SECRET="your-jwt-secret"

# Method configuration
export PERMIT_MCP_KNOWN_METHODS='["tools/list","tools/call"]'
export PERMIT_MCP_BYPASSED_METHODS='["initialize","ping"]'

# Logging configuration
export PERMIT_MCP_ENABLE_AUDIT_LOGGING="true"
```

For a complete list of all configuration options and environment variables, see [Configuration Reference](https://github.com/permitio/permit-fastmcp/blob/main/docs/configuration-reference.md).

### Custom Middleware Configuration

```python
from fastmcp import FastMCP
from permit_fastmcp.middleware.middleware import PermitMcpMiddleware

mcp = FastMCP("Secure FastMCP Server 🔒")

middleware = PermitMcpMiddleware(
    permit_pdp_url="http://localhost:7766",
    permit_api_key="your-api-key",
    enable_audit_logging=True,
    bypass_methods=["initialize", "ping", "health/*"]
)

mcp.add_middleware(middleware)
```

For advanced configuration options and custom middleware extensions, see [Advanced Configuration](https://github.com/permitio/permit-fastmcp/blob/main/docs/advanced-configuration.md).

## Example: Complete JWT Authentication Server

See the [example server](https://github.com/permitio/permit-fastmcp/blob/main/permit_fastmcp/example_server/example.py) for a full implementation with JWT-based authentication. For additional examples and usage patterns, see [Example Server](https://github.com/permitio/permit-fastmcp/blob/main/permit_fastmcp/example_server/):

```python
import os
import datetime

import jwt

# Configure JWT identity extraction before importing the middleware
os.environ["PERMIT_MCP_IDENTITY_MODE"] = "jwt"
os.environ["PERMIT_MCP_IDENTITY_JWT_SECRET"] = "mysecretkey"

from fastmcp import FastMCP, Context
from permit_fastmcp.middleware.middleware import PermitMcpMiddleware

mcp = FastMCP("My MCP Server")

@mcp.tool
def login(username: str, password: str) -> str:
    """Login to get a JWT token"""
    if username == "admin" and password == "password":
        token = jwt.encode(
            {"sub": username, "exp": datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(hours=1)},
            "mysecretkey",
            algorithm="HS256"
        )
        return f"Bearer {token}"
    raise Exception("Invalid credentials")

@mcp.tool
def greet_jwt(ctx: Context) -> str:
    """Greet a user by extracting their name from JWT"""
    # JWT extraction handled by middleware
    return "Hello, authenticated user!"

mcp.add_middleware(PermitMcpMiddleware(
    permit_pdp_url="http://localhost:7766",
    permit_api_key="your-permit-api-key"
))

if __name__ == "__main__":
    mcp.run(transport="http")
```

<Tip>
  For detailed policy configuration, custom authentication, and advanced
  deployment patterns, visit the [Permit.io FastMCP Middleware
  repository][permit-fastmcp-github]. For troubleshooting common issues, see [Troubleshooting](https://github.com/permitio/permit-fastmcp/blob/main/docs/troubleshooting.md).
</Tip>


[permit-github]: https://github.com/permitio
[permit-fastmcp-github]: https://github.com/permitio/permit-fastmcp
[fastmcp-middleware]: /servers/middleware

---

### Integrations Propelauth (`docs/integrations/propelauth.mdx`)

---
title: PropelAuth 🤝 FastMCP
sidebarTitle: PropelAuth
description: Secure your FastMCP server with PropelAuth
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx";

<VersionBadge version="3.1.0" />

This guide shows you how to secure your FastMCP server using [**PropelAuth**](https://www.propelauth.com), a complete authentication and user management solution. This integration uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern, where PropelAuth handles user login, consent management, and your FastMCP server validates the tokens.

## Configuration

### Prerequisites

Before you begin, you will need:

1. A [PropelAuth](https://www.propelauth.com) account
2. Your FastMCP server's base URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Configure PropelAuth

<Steps>
<Step title="Enable MCP Authentication">
    Navigate to the **MCP** section in your PropelAuth dashboard, click **Enable MCP**, and choose which environments to enable it for (Test, Staging, Prod).
</Step>

<Step title="Configure Allowed MCP Clients">
    Under **MCP > Allowed MCP Clients**, add redirect URIs for each MCP client you want to allow. PropelAuth provides templates for popular clients like Claude, Cursor, and ChatGPT.
</Step>

<Step title="Configure Scopes">
    Under **MCP > Scopes**, define the permissions available to MCP clients (e.g., `read:user_data`).
</Step>

<Step title="Choose How Users Create OAuth Clients">
    Under **MCP > Settings > How Do Users Create OAuth Clients?**, you can optionally enable:
    - **Dynamic Client Registration** — clients self-register automatically via the DCR protocol
    - **Manually via Hosted Pages** — PropelAuth creates a UI for your users to register OAuth clients

    You can enable neither, one, or both. If you enable neither, you'll manage OAuth client creation yourself.
</Step>

<Step title="Generate Introspection Credentials">
    Go to **MCP > Request Validation** and click **Create Credentials**. Note the **Client ID** and **Client Secret** - you'll need these to validate tokens.
</Step>

<Step title="Note Your Auth URL">
    Find your Auth URL in the **Backend Integration** section of the dashboard (e.g., `https://auth.yourdomain.com`).
</Step>
</Steps>

For more details, see the [PropelAuth MCP documentation](https://docs.propelauth.com/mcp-authentication/overview).

### Step 2: Environment Setup

Create a `.env` file with your PropelAuth configuration:

```bash
PROPELAUTH_AUTH_URL=https://auth.yourdomain.com          # From Backend Integration page
PROPELAUTH_INTROSPECTION_CLIENT_ID=your-client-id        # From MCP > Request Validation
PROPELAUTH_INTROSPECTION_CLIENT_SECRET=your-client-secret # From MCP > Request Validation
SERVER_URL=http://localhost:8000                          # Your server's base URL
```

### Step 3: FastMCP Configuration

Create your FastMCP server file and use the PropelAuthProvider to handle all the OAuth integration automatically:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.propelauth import PropelAuthProvider

auth_provider = PropelAuthProvider(
    auth_url=os.environ["PROPELAUTH_AUTH_URL"],
    introspection_client_id=os.environ["PROPELAUTH_INTROSPECTION_CLIENT_ID"],
    introspection_client_secret=os.environ["PROPELAUTH_INTROSPECTION_CLIENT_SECRET"],
    base_url=os.environ["SERVER_URL"],
    required_scopes=["read:user_data"],                          # Optional scope enforcement
)

mcp = FastMCP(name="My PropelAuth Protected Server", auth=auth_provider)
```

## Testing

With your `.env` loaded, start the server:

```bash
fastmcp run server.py --transport http --port 8000
```

Then use a FastMCP client to verify authentication works:

```python
from fastmcp import Client
import asyncio

async def main():
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        tools = await client.list_tools()
        print(f"Authenticated. Server exposes {len(tools)} tools.")

if __name__ == "__main__":
    asyncio.run(main())
```

## Accessing User Information

You can use `get_access_token()` inside your tools to identify the authenticated user:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.propelauth import PropelAuthProvider
from fastmcp.server.dependencies import get_access_token

auth = PropelAuthProvider(
    auth_url=os.environ["PROPELAUTH_AUTH_URL"],
    introspection_client_id=os.environ["PROPELAUTH_INTROSPECTION_CLIENT_ID"],
    introspection_client_secret=os.environ["PROPELAUTH_INTROSPECTION_CLIENT_SECRET"],
    base_url=os.environ["SERVER_URL"],
    required_scopes=["read:user_data"],
)

mcp = FastMCP(name="My PropelAuth Protected Server", auth=auth)

@mcp.tool
def whoami() -> dict:
    """Return the authenticated user's ID."""
    token = get_access_token()
    if token is None:
        return {"error": "Not authenticated"}
    user_id = token.claims.get("sub")
    return {"user_id": user_id}
```

## Advanced Configuration

The `PropelAuthProvider` supports optional overrides for token introspection behavior, including caching and request timeouts:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.propelauth import PropelAuthProvider

auth = PropelAuthProvider(
    auth_url=os.environ["PROPELAUTH_AUTH_URL"],
    introspection_client_id=os.environ["PROPELAUTH_INTROSPECTION_CLIENT_ID"],
    introspection_client_secret=os.environ["PROPELAUTH_INTROSPECTION_CLIENT_SECRET"],
    base_url=os.environ["SERVER_URL"],
    required_scopes=["read:user_data"],
    resource="https://your-server.com/mcp",              # Restrict to tokens intended for this server (RFC 8707)
    token_introspection_overrides={
        "cache_ttl_seconds": 300,       # Cache introspection results for 5 minutes
        "max_cache_size": 1000,         # Maximum cached tokens
        "timeout_seconds": 15,          # HTTP request timeout
    },
)

mcp = FastMCP(name="My PropelAuth Protected Server", auth=auth)
```

---

### Integrations Pydantic Ai (`docs/integrations/pydantic-ai.mdx`)

---
title: Pydantic AI 🤝 FastMCP
sidebarTitle: Pydantic AI
description: Connect FastMCP servers to Pydantic AI agents with MCPToolset
icon: message-code
---

[Pydantic AI](https://pydantic.dev/docs/ai/)'s [`MCPToolset`](https://pydantic.dev/docs/ai/mcp/client/) is built on the [FastMCP Client](/clients/client), so an agent can use any MCP server over any FastMCP [transport](/clients/transports). It covers tools, resources, prompts, and elicitation. This page shows how to point it at a FastMCP server; for the full API, see the [Pydantic AI docs](https://pydantic.dev/docs/ai/mcp/client/).

## Install

```bash
pip install "pydantic-ai-slim[mcp]>=2.45"
```

The `mcp` extra installs the client-only `fastmcp-slim[client]`. Add `fastmcp` if the same environment also runs a FastMCP server.

<Note>
With FastMCP 4, use `pydantic-ai-slim` 2.45 or newer. Releases 2.32 through 2.44 import `httpx` without depending on it, and FastMCP 4 no longer installs `httpx`, so `import pydantic_ai.mcp` fails.
</Note>

## Create a Server

```python server.py
import random
from fastmcp import FastMCP

mcp = FastMCP(name="Dice Roller")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

## Connect an Agent

Pass `MCPToolset` anything the FastMCP Client accepts. It infers the transport the same way the client does.

```python
from pathlib import Path
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPToolset

from server import mcp

in_memory = MCPToolset(mcp)  # a FastMCP instance in the same process
http = MCPToolset("http://localhost:8000/mcp")  # Streamable HTTP; a /sse URL uses SSE
stdio = MCPToolset(Path("server.py"))  # launches the script over STDIO

agent = Agent("openai:gpt-5", toolsets=[http])
result = agent.run_sync("Roll 3 dice!")
```

Pass a FastMCP [transport](/clients/transports) such as `StdioTransport` for control over the command, arguments, or environment, or a configured `fastmcp.Client` for full control.

## Authentication

For a bearer token, pass `headers`. For [OAuth](/clients/auth/oauth), pass `auth="oauth"` or build the `Client` yourself.

```python
from pydantic_ai.mcp import MCPToolset

toolset = MCPToolset(
    "https://your-server-url.com/mcp",
    headers={"Authorization": "Bearer your-access-token"},
)
```

For server-side token verification, see [Token Verification](/servers/auth/token-verification).

## Multiple Servers

`load_mcp_toolsets` reads an [MCP configuration](/integrations/mcp-json-configuration) file and returns one toolset per server. Tool names are prefixed with the server's key.

```json mcp_config.json
{
  "mcpServers": {
    "dice": {"command": "python", "args": ["server.py"]},
    "weather": {"url": "https://weather.example.com/mcp"}
  }
}
```

```python
from pydantic_ai import Agent
from pydantic_ai.mcp import load_mcp_toolsets

agent = Agent("openai:gpt-5", toolsets=load_mcp_toolsets("mcp_config.json"))
```

## Elicitation

Pass an `elicitation_handler` to answer a server's [elicitation](/servers/elicitation) requests. It has the same signature as the FastMCP Client's [elicitation handler](/clients/elicitation).

```python
from pydantic_ai.mcp import MCPToolset


async def approve(message, response_type, params, context):
    return {"approved": True}

toolset = MCPToolset("http://localhost:8000/mcp", elicitation_handler=approve)
```

On 2026-07-28 connections, Pydantic AI may warn that `elicitation_handler` will never be called. The FastMCP Client still calls it for [input-required results](/servers/elicitation#elicitation-on-the-modern-protocol).

---

### Integrations Scalekit (`docs/integrations/scalekit.mdx`)

---
title: Scalekit 🤝 FastMCP
sidebarTitle: Scalekit
description: Secure your FastMCP server with Scalekit
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.13.0" />

This guide shows you how to secure your FastMCP server with [Scalekit](https://scalekit.com) using the [Remote OAuth](/servers/auth/remote-oauth) pattern: Scalekit handles user authentication, and your FastMCP server validates the tokens it issues.

## Configuration

### Prerequisites

Before you begin, you will need:

1. Get a [Scalekit account](https://app.scalekit.com/) and grab your **Environment URL** from _Dashboard > Settings_.
2. Have your FastMCP server's base URL ready (can be localhost for development, e.g., `http://localhost:8000/`)

### Step 1: Configure MCP server in Scalekit environment

<Steps>
<Step title="Register MCP server and set environment">

In your Scalekit dashboard:
    1. Open the **MCP Servers** section, then select **Create new server**
    2. Enter server details: a name, a resource identifier, and the desired MCP client authentication settings
    3. Save, then copy the **Resource ID** (for example, res_92015146095)

Record these values in a `.env` file in your FastMCP project:

```sh .env
SCALEKIT_ENVIRONMENT_URL=https://your-env.scalekit.com
SCALEKIT_RESOURCE_ID=res_926EXAMPLE5878
BASE_URL=http://localhost:8000
```

</Step>
</Steps>

### Step 2: Add auth to FastMCP server

Create your FastMCP server file and use the ScalekitProvider to handle all the OAuth integration automatically. Nothing reads `.env` automatically, so load it explicitly with [python-dotenv](https://pypi.org/project/python-dotenv/) (`pip install python-dotenv`) before constructing the provider.

<Warning>
The legacy `mcp_url` and `client_id` parameters are deprecated and will be removed in a future release. Use `base_url` instead of `mcp_url` and remove `client_id` from your configuration.
</Warning>

```python server.py
import os

from dotenv import load_dotenv
from fastmcp import FastMCP
from fastmcp.server.auth.providers.scalekit import ScalekitProvider

load_dotenv()

# Discovers Scalekit endpoints and sets up JWT token validation
auth_provider = ScalekitProvider(
    environment_url=os.environ["SCALEKIT_ENVIRONMENT_URL"],  # Scalekit environment URL
    resource_id=os.environ["SCALEKIT_RESOURCE_ID"],          # Resource server ID
    base_url=os.environ.get("BASE_URL", "http://localhost:8000"),
    required_scopes=["read"],                                # Optional scope enforcement
)

# Create FastMCP server with auth
mcp = FastMCP(name="My Scalekit Protected Server", auth=auth_provider)

@mcp.tool
def auth_status() -> dict:
    """Show Scalekit authentication status."""
    return {
        "message": "This tool requires authentication via Scalekit",
        "authenticated": True,
        "provider": "Scalekit"
    }
```

<Tip>
Set `required_scopes` when you need tokens to carry specific permissions. Leave it unset to allow any token issued for the resource.
</Tip>

## Testing

### Start the MCP server

```bash
fastmcp run server.py --transport http --port 8000
```

Use any MCP client (for example, mcp-inspector, Claude, VS Code, or Windsurf) to connect to the running server. Verify that authentication succeeds and requests are authorized as expected.

## Production Configuration

For production deployments, load configuration from environment variables:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.scalekit import ScalekitProvider

# Load configuration from environment variables
auth = ScalekitProvider(
    environment_url=os.environ["SCALEKIT_ENVIRONMENT_URL"],
    resource_id=os.environ["SCALEKIT_RESOURCE_ID"],
    base_url=os.environ.get("BASE_URL", "https://your-server.com")
)

mcp = FastMCP(name="My Scalekit Protected Server", auth=auth)

@mcp.tool
def protected_action() -> str:
    """A tool that requires authentication."""
    return "Access granted via Scalekit!"
```

## Capabilities

Scalekit supports OAuth 2.1 with Dynamic Client Registration for MCP clients and enterprise SSO, and provides built‑in JWT validation and security controls.

**OAuth 2.1/DCR**: clients self‑register, use PKCE, and work with the Remote OAuth pattern without pre‑provisioned credentials.

**Validation and SSO**: tokens are verified (keys, RS256, issuer, audience, expiry), and SAML, OIDC, OAuth 2.0, ADFS, Azure AD, and Google Workspace are supported; use HTTPS in production and review auth logs as needed.

## Debugging

FastMCP's loggers do not propagate to the root logger, so `logging.basicConfig` will not surface them. Set `FASTMCP_LOG_LEVEL` to see token validation and metadata forwarding details:

```bash
FASTMCP_LOG_LEVEL=DEBUG fastmcp run server.py --transport http --port 8000
```

### Token inspection

You can inspect JWT tokens in your tools to understand the user context:

```python
import os

from fastmcp import FastMCP
from fastmcp.server.auth.providers.scalekit import ScalekitProvider
from fastmcp.server.dependencies import get_access_token

auth = ScalekitProvider(
    environment_url=os.environ["SCALEKIT_ENVIRONMENT_URL"],
    resource_id=os.environ["SCALEKIT_RESOURCE_ID"],
    base_url=os.environ.get("BASE_URL", "http://localhost:8000"),
)

mcp = FastMCP(name="My Scalekit Protected Server", auth=auth)

@mcp.tool
def inspect_token() -> dict:
    """Inspect the current JWT token claims."""
    token = get_access_token()
    if token is None:
        return {"error": "No token found"}

    # Claims were already verified by the auth provider.
    return token.claims
```

---

### Integrations Supabase (`docs/integrations/supabase.mdx`)

---
title: Supabase 🤝 FastMCP
sidebarTitle: Supabase
description: Secure your FastMCP server with Supabase Auth
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.13.0" />

This guide shows you how to secure your FastMCP server using **Supabase Auth**. This integration uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern, where Supabase handles user authentication and your FastMCP server validates the tokens.

<Warning>
Supabase Auth does not currently support [RFC 8707](https://www.rfc-editor.org/rfc/rfc8707.html) resource indicators, so FastMCP cannot validate that tokens were issued for the specific resource server.
</Warning>

## Consent UI Requirement

Supabase's OAuth Server delegates the user consent screen to your application. When an MCP client initiates authorization, Supabase authenticates the user and then redirects to your application at a configured callback URL (e.g., `https://your-app.com/oauth/callback?authorization_id=...`). Your application must host a page that calls Supabase's `approveAuthorization()` or `denyAuthorization()` APIs to complete the flow.

`SupabaseProvider` handles the resource server side (token verification and metadata), but you are responsible for building and hosting the consent UI separately. See [Supabase's OAuth Server documentation](https://supabase.com/docs/guides/auth/oauth-server/getting-started) for details on implementing the authorization page.

## Configuration

### Prerequisites

Before you begin, you will need:
1. A **[Supabase Account](https://supabase.com/)** with a project or a self-hosted **Supabase Auth** instance
2. **OAuth Server enabled** in your Supabase Dashboard (Authentication → OAuth Server)
3. **Dynamic Client Registration enabled** in the same settings
4. A **consent UI** hosted at your configured authorization path (see above)
5. Your Supabase Auth JWT signing algorithm. `SupabaseProvider` defaults to `ES256`; set `algorithm="RS256"` if your project is configured for RSA signing.
6. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Enable Supabase OAuth Server

In your Supabase Dashboard:
1. Go to **Authentication → OAuth Server**
2. Enable the **OAuth Server**
3. Set your **Site URL** to where your consent UI is hosted
4. Set the **Authorization Path** (e.g., `/oauth/callback`)
5. Enable **Allow Dynamic OAuth Apps** for MCP client registration

### Step 2: Get Supabase Project URL

In your Supabase Dashboard:
1. Go to **Project Settings**
2. Copy your **Project URL** (e.g., `https://abc123.supabase.co`)

### Step 3: FastMCP Configuration

Create your FastMCP server using the `SupabaseProvider`. It verifies tokens against the JWKS published under `{project_url}/auth/v1`; pass `auth_route` if a self-hosted Supabase Auth instance serves a different path.

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.supabase import SupabaseProvider

auth = SupabaseProvider(
    project_url="https://abc123.supabase.co",
    base_url="http://localhost:8000",
    algorithm="ES256",  # Match your Supabase Auth JWT signing algorithm
)

mcp = FastMCP("Supabase Protected Server", auth=auth)

@mcp.tool
def protected_tool(message: str) -> str:
    """This tool requires authentication."""
    return f"Authenticated user says: {message}"

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

### Testing with a Client

Create a test client that authenticates with your Supabase-protected server:

```python client.py
from fastmcp import Client
import asyncio

async def main():
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        print("Authenticated with Supabase!")

        result = await client.call_tool("protected_tool", {"message": "Hello!"})
        print(result)

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to Supabase's authorization endpoint
2. After authenticating, Supabase redirects to your consent UI
3. After you approve, the client receives the token and can make authenticated requests

## Production Configuration

For production deployments, load configuration from environment variables:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.supabase import SupabaseProvider

auth = SupabaseProvider(
    project_url=os.environ["SUPABASE_PROJECT_URL"],
    base_url=os.environ.get("BASE_URL", "https://your-server.com"),
    algorithm=os.environ.get("SUPABASE_JWT_ALGORITHM", "ES256"),
)

mcp = FastMCP(name="Supabase Secured App", auth=auth)
```

---

### Integrations Workos (`docs/integrations/workos.mdx`)

---
title: WorkOS 🤝 FastMCP
sidebarTitle: WorkOS
description: Authenticate FastMCP servers with WorkOS Connect
icon: shield-check
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.12.0" />

Secure your FastMCP server with WorkOS Connect authentication. This integration uses the OAuth Proxy pattern to handle authentication through WorkOS Connect while maintaining compatibility with MCP clients.

<Note>
This guide covers WorkOS Connect applications. For Dynamic Client Registration (DCR) with AuthKit, see the [AuthKit integration](/integrations/authkit) instead.
</Note>

## Configuration

### Prerequisites

Before you begin, you will need:
1. A **[WorkOS Account](https://workos.com/)** with access to create OAuth Apps
2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`)

### Step 1: Create a WorkOS OAuth App

Create an OAuth App in your WorkOS dashboard to get the credentials needed for authentication:

<Steps>
<Step title="Create OAuth Application">
In your WorkOS dashboard:
1. Navigate to **Applications**
2. Click **Create Application**
3. Select **OAuth Application**
4. Name your application
</Step>

<Step title="Get Credentials">
In your OAuth application settings:
1. Copy your **Client ID** (starts with `client_`)
2. Click **Generate Client Secret** and save it securely
3. Copy your **AuthKit Domain** (e.g., `https://your-app.authkit.app`)
</Step>

<Step title="Configure Redirect URI">
In the **Redirect URIs** section:
- Add: `http://localhost:8000/auth/callback` (for development)
- For production, add your server's public URL + `/auth/callback`

<Warning>
The callback URL must match exactly. The default path is `/auth/callback`, but you can customize it using the `redirect_path` parameter.
</Warning>
</Step>
</Steps>

### Step 2: FastMCP Configuration

Create your FastMCP server using the `WorkOSProvider`:

```python server.py
from fastmcp import FastMCP
from fastmcp.server.auth.providers.workos import WorkOSProvider

# Configure WorkOS OAuth
auth = WorkOSProvider(
    client_id="client_YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    authkit_domain="https://your-app.authkit.app",
    base_url="http://localhost:8000",
    required_scopes=["openid", "profile", "email"]
)

mcp = FastMCP("WorkOS Protected Server", auth=auth)

@mcp.tool
def protected_tool(message: str) -> str:
    """This tool requires authentication."""
    return f"Authenticated user says: {message}"

if __name__ == "__main__":
    mcp.run(transport="http", port=8000)
```

## Testing

### Running the Server

Start your FastMCP server with HTTP transport to enable OAuth flows:

```bash
fastmcp run server.py --transport http --port 8000
```

Your server is now running and protected by WorkOS OAuth authentication.

### Testing with a Client

Create a test client that authenticates with your WorkOS-protected server:

```python client.py
from fastmcp import Client
import asyncio

async def main():
    # The client will automatically handle WorkOS OAuth
    async with Client("http://localhost:8000/mcp", auth="oauth") as client:
        # First-time connection will open WorkOS login in your browser
        print("✓ Authenticated with WorkOS!")

        # Test the protected tool
        result = await client.call_tool("protected_tool", {"message": "Hello!"})
        print(result)

if __name__ == "__main__":
    asyncio.run(main())
```

When you run the client for the first time:
1. Your browser will open to WorkOS's authorization page
2. After you authorize the app, you'll be redirected back
3. The client receives the token and can make authenticated requests

<Info>
The client caches tokens locally, so you won't need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.
</Info>

## Production Configuration

<VersionBadge version="2.13.0" />

For production deployments with persistent token management across server restarts, configure `jwt_signing_key` and `client_storage`:

```python server.py
import os
from fastmcp import FastMCP
from fastmcp.server.auth.providers.workos import WorkOSProvider
from key_value.aio.stores.redis import RedisStore
from key_value.aio.wrappers.encryption import FernetEncryptionWrapper
from cryptography.fernet import Fernet

# Production setup with encrypted persistent token storage
auth = WorkOSProvider(
    client_id="client_YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    authkit_domain="https://your-app.authkit.app",
    base_url="https://your-production-domain.com",
    required_scopes=["openid", "profile", "email"],

    # Production token management
    jwt_signing_key=os.environ["JWT_SIGNING_KEY"],
    client_storage=FernetEncryptionWrapper(
        key_value=RedisStore(
            host=os.environ["REDIS_HOST"],
            port=int(os.environ["REDIS_PORT"])
        ),
        fernet=Fernet(os.environ["STORAGE_ENCRYPTION_KEY"])
    )
)

mcp = FastMCP(name="Production WorkOS App", auth=auth)
```

<Note>
Parameters (`jwt_signing_key` and `client_storage`) work together to ensure tokens and client registrations survive server restarts. **Wrap your storage in `FernetEncryptionWrapper` to encrypt sensitive OAuth tokens at rest** - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.

For complete details on these parameters, see the [OAuth Proxy documentation](/servers/auth/oauth-proxy#configuration-parameters).
</Note>

## Configuration Options

<Card>
<ParamField path="client_id" required>
WorkOS OAuth application client ID
</ParamField>

<ParamField path="client_secret" required>
WorkOS OAuth application client secret
</ParamField>

<ParamField path="authkit_domain" required>
Your WorkOS AuthKit domain URL (e.g., `https://your-app.authkit.app`)
</ParamField>

<ParamField path="base_url" required>
Your FastMCP server's public URL
</ParamField>

<ParamField path="required_scopes" default="[]">
OAuth scopes every token must carry. These are also the scopes advertised to clients unless you set `valid_scopes`.
</ParamField>

<ParamField path="redirect_path" default="/auth/callback">
OAuth callback path
</ParamField>

<ParamField path="timeout_seconds" default="10">
API request timeout
</ParamField>
</Card>

---

### More Faq (`docs/more/faq.mdx`)

---
title: FAQ
description: Direct answers to the questions that come up most often about FastMCP 4, the protocol eras, and installation
icon: circle-question
---

## Do I need to change my server code for FastMCP 4?

Most servers run untouched. The defining change in FastMCP 4 is its engine — the MCP Python SDK v2 — and FastMCP absorbs nearly all of it for you, including the wire-wide rename from camelCase to snake_case, which is bridged so your existing reads keep working.

Most of what does reach your code fails loudly at import or call time, and the fix is mechanical: `McpError(ErrorData(...))` becomes `McpError(code=..., message=...)`, custom `httpx` clients handed to a transport become `httpx2`, and `ctx.sample()` and `ctx.list_roots()` are gone.

One change is silent, so go looking for it: an `except httpx.ConnectError:` around a FastMCP call still imports and still type-checks, because `httpx` usually remains installed through some other dependency — but FastMCP now raises the `httpx2` exception, so the handler simply stops matching and your fallback quietly never runs. Grep for `except httpx.` and move those to `httpx2`. [Upgrading from FastMCP 3](/getting-started/upgrading/from-fastmcp-3) covers each one and ends with a checklist.

## Why does my client connect with a different protocol version than before?

`fastmcp.Client` defaults to `mode="auto"` as of FastMCP 4, so it negotiates the newest era both sides speak rather than pinning the handshake. Over streamable HTTP or stdio to a FastMCP server that means the sessionless `2026-07-28` protocol, where FastMCP 3 connected at `2025-11-25`.

SSE is the transport exception: it predates the sessionless era and cannot carry it. Under `mode="auto"` the client recognizes SSE and settles on the handshake without probing, so seeing `2025-11-25` there is correct rather than a negotiation failure. A multi-server `MCPConfigTransport` resolves one era for the entire aggregate: all-modern backends negotiate `2026-07-28`, while any legacy backend moves the composite and every backend leg to the handshake era. Pinning a mode applies it to every backend in the configuration. All-modern configurations follow normal modern semantics; applications that rely on handshake-era server-initiated sampling or elicitation should pin `mode="legacy"`.

The client probes `server/discover` and adopts the modern protocol when the server answers, falling back to the `initialize` handshake for anything that is not positive evidence of a modern peer — so a mixed fleet of servers still connects. Pin the old behavior per client with `Client(url, mode="legacy")`. See [Protocol negotiation](/clients/client#protocol-negotiation).

## What are the two protocol eras, and which one does my server speak?

Both. A FastMCP 4 server supports the handshake revisions `2024-11-05`, `2025-03-26`, `2025-06-18`, and `2025-11-25`, plus the modern `2026-07-28` protocol. It serves all of them from one deployment and one URL, and the SDK negotiates per connection — the client picks, not the server.

The *handshake* era (`2025-11-25` and earlier) opens each connection with `initialize` and holds a session, which gives the server a back-channel it can push requests down. The *modern* era (`2026-07-28`) is sessionless: the client learns what the server offers through `server/discover`, every request stands alone, and there is no back-channel. Inside a tool, `ctx.request_context.protocol_version` tells you which era the current call arrived on; on the client, `client.protocol_version` reports it after connecting.

A protocol version establishes the wire format, while capabilities describe which optional operations a particular server provides. The capabilities returned by `server/discover` or `initialize` are therefore the authoritative way for a client to determine what is available.

## Can FastMCP 4 talk to older clients and servers?

Yes, in both directions, with no configuration. A FastMCP 4 server answers a handshake-era client and a modern one from the same process: the old client sends `initialize` and gets a session id, the modern client discovers and stays stateless.

A FastMCP 4 client is equally happy against an old server, because `mode="auto"` falls back to the handshake when discovery finds no modern peer. The client-side handlers for server-initiated capabilities are all still there too — passing `sampling_handler=` or `roots=` answers a legacy server's requests exactly as before, which is what a modern client needs in order to interoperate. See [client sampling](/clients/sampling) and [client roots](/clients/roots).

## How does FastMCP verify protocol conformance?

FastMCP runs the [official MCP conformance suite](https://github.com/modelcontextprotocol/conformance) in CI against a pinned suite release. A failing scenario for a released capability that FastMCP advertises as supported is treated as a regression.

The suite's `all` mode also exercises draft, pending, retired, and deliberately unsupported capabilities, so its raw pass count is broader than FastMCP's support contract. Known exceptions are recorded in [`expected-failures.yml`](https://github.com/PrefectHQ/fastmcp/blob/main/tests/conformance/expected-failures.yml) with their rationale, and new upstream scenarios arrive through deliberate suite-version updates rather than silently changing CI.

## When should I pin `mode="legacy"`?

Pin it when your code depends on the session the handshake creates: `client.ping()` and `transport.get_session_id()` have no modern equivalent, since a sessionless connection has neither a live back-channel to ping nor an id to hold. It is also the escape hatch when a server misbehaves under discovery or you need the classic `initialize` result object.

You do not need to pin it just because you registered a `sampling_handler`, `roots=`, or an `elicitation_handler`. None of the three require the handshake on their own: `mode="auto"` reaches whichever era the connection negotiates, and on a modern connection a tool can still exercise any of them through the guard pattern — it manually returns an `InputRequiredResult` embedding the request, and the same handler you already registered answers it. [Roots](/clients/roots) and [elicitation](/clients/elicitation) document this pattern directly; [sampling](/clients/sampling) works through the identical mechanism, though calling an LLM directly from the server is the recommended path there rather than a round trip for it.

Pinning is per client, not a deployment setting: `Client(url, mode="legacy")`. The trade runs the other way as well — [background tasks](/clients/tasks) are modern-only, so a legacy client never triggers one and a task-enabled tool simply runs synchronously.

## Why did my `ctx.sample()` code stop working?

`ctx.sample()` and `ctx.sample_step()` are not part of FastMCP 4. Calling either raises `AttributeError` on every protocol era, and `FastMCP(sampling_handler=...)` raises `TypeError` naming the migration.

Sampling was a server-to-client *request*: the server sent `sampling/createMessage` and blocked until an answer came back down the session. The modern protocol has no server-to-client request direction at all, so the pushed form has nowhere to go.

The asking survives in a different shape. A tool can return an `InputRequiredResult` carrying a `CreateMessageRequest`; the client answers it through the same `sampling_handler` it already registers, and your tool runs again with the completion. Reach for that when using *the caller's* model is the point. Otherwise put generation in your server — hold a provider API key and call the model directly, which has the side benefit that your tool behaves identically for every client, including the many that never implemented sampling. [Sampling](/servers/sampling) shows both.

## What happened to `ctx.list_roots()`?

Removed, for the same reason as sampling: `roots/list` was a server-to-client request, and the modern protocol has no channel to send one.

Take the paths you need as ordinary tool arguments. The agent already knows which directory it is working in, and an explicit argument is visible in the tool's schema instead of hidden in a protocol round-trip. When the caller genuinely has to be asked mid-run, the [guard pattern](/servers/elicitation#elicitation-on-the-modern-protocol) carries a roots request in its `input_requests` map alongside elicitation, and `fastmcp.Client` answers it from the `roots=` you already configured.

## Why does `ctx.info()` still work when sampling doesn't?

Because logging is a *notification* and sampling was a *request*. A notification is fire-and-forget: your server emits it down the response stream the caller already opened, and nothing has to be held open on the server's behalf. A request needs an answer to come back the other way, which requires a live connection the server can reach into.

The modern protocol kept every server notification — `notifications/message`, `notifications/progress`, and the list-changed family — and removed the server-to-client request direction entirely. So `ctx.info()`, `ctx.debug()`, and `ctx.report_progress()` reach the client mid-call on every era, while sampling and roots have no era-agnostic form and were dropped. [Sampling](/servers/sampling#the-removed-methods) works through the distinction in full.

You may see an `MCPDeprecationWarning` from the SDK about the logging capability being deprecated as of `2026-07-28`. It refers to the capability declaration, not to the notification, and delivery is unaffected.

## Why can't I call `client.set_logging_level()` anymore?

On a modern connection it raises, because `logging/setLevel` is not in the `2026-07-28` protocol. The method asked the server to remember a level for the rest of the session, and a sessionless protocol has nowhere to keep that.

The messages themselves are unaffected — the server still sends whatever its own configuration allows. Filter on the receiving side in your `log_handler`, which sees each message's `level` field. See [Client Logging](/clients/logging). On a handshake-era connection (`Client(url, mode="legacy")`) the call works as before.

Receiving-side filtering only narrows what already arrives. A server that sets `FastMCP(client_log_level="error")` drops anything below that threshold before it reaches the wire, and a modern client has no way to ask for the missing levels — the server operator has to lower `client_log_level` for them to be sent at all.

## What replaces elicitation on the modern protocol?

The guard pattern. Rather than pausing mid-execution to ask, a tool *returns* an `InputRequiredResult` describing what it needs. That round completes normally, the client collects the answer, and it calls the tool again with the answer attached. Any state you carry between rounds is sealed by the framework before it reaches the wire, so the client holds an opaque token it cannot read or forge.

`ctx.elicit()` still works on handshake-era connections and raises on modern ones, so a server that must serve both eras needs both paths. `fastmcp.Client` drives whichever the connection negotiated with no extra wiring on your side. See [Elicitation on the modern protocol](/servers/elicitation#elicitation-on-the-modern-protocol).

## Why doesn't my middleware's `on_initialize` hook run?

Because the modern protocol has no `initialize` request. The hook fires on handshake-era connections and never on modern ones, and since `Client` now defaults to `mode="auto"`, that is the common case against a FastMCP 4 server.

Work that must happen once per process belongs in the server [lifespan](/servers/lifespan). Per-request work such as an auth check belongs in `on_request` or a specific operation hook, both of which run on every era — on a modern connection `on_request` sees `server/discover` where a handshake connection sees `initialize`. See [Middleware](/servers/middleware).

## Why doesn't state I set in one tool call show up in the next?

On a modern connection every request is a fresh connection, so `ctx.set_state` lives only for the duration of the call that wrote it. The same code persists state across calls on a handshake-era connection, which is why it appears to break the moment a client negotiates `2026-07-28`.

[Session state](/servers/sessions) is the durable answer, following MCP's own decision to move session semantics up into the application. Declare a `UserSession` parameter and FastMCP injects one bucket of stored state keyed to the authenticated user, with nothing to pass around. Declare a `SessionId` argument when a single user needs several independent sessions, and the caller mints an id with `create_session` and supplies it on each call — register `mcp.add_provider(SessionProvider())` first, since `create_session` doesn't exist until a `SessionProvider` contributes it. Both store server-side and key to the authenticated caller's identity, so a handle is inert in anyone else's hands.

That isolation comes from authentication, not from the id. On an unauthenticated server there is no principal to key on, so every session shares one anonymous namespace and a `SessionId` becomes a bearer capability — anyone holding it can read and write that state. Treat unauthenticated sessions as single-tenant or trusted-network only; `UserSession` sidesteps the question by requiring an authenticated principal outright.

## How do I run background tasks now?

The same way, plus one registration. `@mcp.tool(task=True)` is still the authoring surface and [Docket](https://github.com/chrisguidry/docket) still runs the work. What changed is underneath: tasks left the core MCP spec and returned as the `io.modelcontextprotocol/tasks` extension (SEP-2663), which FastMCP implements in the optional `fastmcp-tasks` package.

Install `fastmcp[tasks]` and register the extension on your server. A `task=True` tool on a server with no tasks extension refuses to start and names the fix, so a missing registration is impossible to ship by accident.

```python
from fastmcp import FastMCP
from fastmcp_tasks import TasksExtension

mcp = FastMCP("MyServer")
mcp.add_extension(TasksExtension())


@mcp.tool(task=True)
async def slow_computation(duration: int) -> str:
    return "done"
```

Tasks are modern-only: the capability is negotiated over `2026-07-28`, so a `mode="legacy"` client never triggers one. A tool marked `task=True` (equivalently `mode="optional"`) then just runs synchronously. A tool that sets `TaskConfig(mode="required")` has no synchronous form to fall back to, so the call fails with a missing-required-capability error instead. See [Background Tasks](/servers/tasks).

## `import fastmcp` stopped working after I upgraded with pip

This can happen when you upgrade to FastMCP 3.3 or later from FastMCP 3.2 or earlier with `pip`. The quick fix is `pip install --force-reinstall fastmcp`. See [Troubleshooting](/getting-started/installation#troubleshooting) for the clean-reinstall fallback and an explanation of why it happens.

## What's the difference between `fastmcp` and `fastmcp-slim`?

`fastmcp` is the full distribution. Installing it gives you the complete framework — server, client, CLI, and the common integrations — and is the right choice for most users:

```bash
pip install fastmcp
```

`fastmcp-slim` ships the same importable `fastmcp` package with a minimal set of required dependencies. You opt into the pieces you need through extras, which keeps environments lean when you only use part of the framework:

```bash
pip install "fastmcp-slim[client]"
```

Both distributions expose the same `import fastmcp`, so application code is identical regardless of which one you install.

---

### More Settings (`docs/more/settings.mdx`)

---
title: Settings
description: Configure FastMCP behavior through environment variables or a .env file.
icon: gear
---

FastMCP uses [pydantic-settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/) for configuration. Every setting is available as an environment variable with a `FASTMCP_` prefix. Settings are loaded from environment variables and from a `.env` file.

```bash
# Set via environment
export FASTMCP_LOG_LEVEL=DEBUG
export FASTMCP_PORT=3000

# Or use a .env file (loaded automatically)
echo "FASTMCP_LOG_LEVEL=DEBUG" >> .env
```

You can change which `.env` file is loaded by setting the `FASTMCP_ENV_FILE` environment variable (defaults to `.env`). Because this controls which file is loaded, it must be set as an environment variable — it cannot be set inside a `.env` file itself.

## Logging

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_LOG_LEVEL` | `Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]` | `INFO` | Log level for FastMCP's own logging output. Case-insensitive. |
| `FASTMCP_LOG_ENABLED` | `bool` | `true` | Enable or disable FastMCP logging entirely. |
| `FASTMCP_CLIENT_LOG_LEVEL` | `Literal["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]` | None | Default minimum log level for messages sent to MCP clients via `context.log()`. When set, messages below this level are suppressed. Handshake-era clients can override this per-session using the MCP `logging/setLevel` request; the modern protocol has no session to hold that level, so clients on it filter by level in their own log handler instead. |
| `FASTMCP_ENABLE_RICH_LOGGING` | `bool` | `true` | Use rich formatting for log output. Set to `false` for plain Python logging. |
| `FASTMCP_ENABLE_RICH_TRACEBACKS` | `bool` | `true` | Use rich tracebacks for errors. |
| `FASTMCP_DEPRECATION_WARNINGS` | `bool` | `true` | Show deprecation warnings. |
| `FASTMCP_MCP_CAMELCASE_COMPAT` | `bool` | `true` | Bridge legacy camelCase reads on MCP SDK objects (e.g. `tool.inputSchema`, `result.isError`) to their snake_case fields after the SDK v2 rename. Each bridged read emits a `FastMCPDeprecationWarning`. Set to `false` to disable the shims, in which case only the snake_case names resolve. |

To turn on debug logging from your own entry point, for example behind a `--debug` flag, pass `log_level` to `run()` instead of reconfiguring logging yourself. It applies to every transport for as long as the server runs:

```python
from fastmcp import FastMCP

mcp = FastMCP("my-server")

if __name__ == "__main__":
    mcp.run(log_level="DEBUG")
```

## Transport & HTTP

These control how the server listens when running with an HTTP transport.

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_TRANSPORT` | `Literal["stdio", "http", "sse", "streamable-http"]` | `stdio` | Default transport. |
| `FASTMCP_HOST` | `str` | `127.0.0.1` | Host to bind to. |
| `FASTMCP_PORT` | `int` | `8000` | Port to bind to. |
| `FASTMCP_SSE_PATH` | `str` | `/sse` | Path for SSE endpoint. |
| `FASTMCP_MESSAGE_PATH` | `str` | `/messages/` | Path for SSE message endpoint. |
| `FASTMCP_STREAMABLE_HTTP_PATH` | `str` | `/mcp` | Path for Streamable HTTP endpoint. |
| `FASTMCP_STATELESS_HTTP` | `bool` | `false` | Enable stateless HTTP mode (new transport per request). Useful for multi-worker deployments. |
| `FASTMCP_JSON_RESPONSE` | `bool` | `false` | Use JSON responses instead of SSE for Streamable HTTP. |
| `FASTMCP_HTTP_HOST_ORIGIN_PROTECTION` | `bool \| "auto"` | `false` | Validate `Host` and browser `Origin` headers for Streamable HTTP and SSE requests. `true` validates every request; `auto` protects localhost-bound servers and explicit host/origin allowlists. `false` disables this guard and FastMCP's DNS-rebinding protection for the endpoint. |
| `FASTMCP_HTTP_ALLOWED_HOSTS` | `list[str] \| null` | `null` | Additional trusted hostnames when Host and Origin protection is enabled. Use a JSON array, such as `["mcp.example.com"]`. |
| `FASTMCP_HTTP_ALLOWED_ORIGINS` | `list[str] \| null` | `null` | Browser origins trusted when Host and Origin protection is enabled. Configure CORS separately for cross-origin browser reads. Use a JSON array, such as `["https://app.example.com"]`. |
| `FASTMCP_HTTP_SESSION_IDLE_TIMEOUT` | `float \| "auto" \| "none"` | `"auto"` | Seconds a stateful Streamable HTTP session may remain idle before it is terminated. `"auto"` uses the MCP SDK's default: 1800 seconds (30 minutes) in SDK 2.2, no timeout in earlier versions. Set a positive number to override it, or `none` to disable it. |
| `FASTMCP_DEBUG` | `bool` | `false` | Pass `debug=True` to the Starlette app behind the Streamable HTTP and SSE transports, so unhandled errors in the HTTP layer return tracebacks in the response. It has no effect on stdio and does not change FastMCP's log level; use `FASTMCP_LOG_LEVEL=DEBUG` for debug logs. Don't enable it in production, since tracebacks can expose internals. |

MCP SDK 2.2 also limits concurrent stateful HTTP sessions to 10,000. Keeping
the default idle timeout lets abandoned sessions expire and frees capacity for
new connections. Disabling it means clients must explicitly close their sessions
to release that capacity. Stateless HTTP does not use the session pool.

## Error Handling

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_MASK_ERROR_DETAILS` | `bool` | `false` | Mask error details before sending to clients. When enabled, only messages from explicitly raised `ToolError`, `ResourceError`, or `PromptError` are included in responses. |
| `FASTMCP_STRICT_INPUT_VALIDATION` | `bool` | `false` | Strictly validate tool inputs against the JSON schema. When disabled, compatible inputs are coerced (e.g., the string `"10"` becomes the integer `10`). |
| `FASTMCP_MOUNTED_COMPONENTS_RAISE_ON_LOAD_ERROR` | `bool` | `false` | Raise errors when loading mounted components instead of logging warnings. |

## Client

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_CLIENT_INIT_TIMEOUT` | `float \| None` | None | Timeout in seconds for the client initialization handshake. Set to `0` or leave unset to disable. |
| `FASTMCP_CLIENT_DISCONNECT_TIMEOUT` | `float` | `5` | Maximum time in seconds to wait for a clean disconnect before giving up. |
| `FASTMCP_TASKS_CLIENT_POLL_INTERVAL` | `float` | `0.5` | Ceiling in seconds for the fallback poll backoff while waiting on a [background task](/servers/tasks). Requires the `fastmcp-tasks` package. Applies **only** when the server does not advertise its own `pollIntervalMs`: in that case `Task.wait()` starts polling fast (~20ms) and doubles up to this ceiling rather than polling at a fixed cadence. When the server advertises a `pollIntervalMs`, that interval is honored exactly and this setting is ignored. |
| `FASTMCP_CLIENT_RAISE_FIRST_EXCEPTIONGROUP_ERROR` | `bool` | `true` | When an `ExceptionGroup` is raised, re-raise the first error directly instead of the group. Simplifies debugging but may mask secondary errors. |

## CLI & Display

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_SHOW_SERVER_BANNER` | `bool` | `true` | Show the server banner on startup. Also controllable via `--no-banner` or `server.run(show_banner=False)`. |
| `FASTMCP_CHECK_FOR_UPDATES` | `Literal["stable", "prerelease", "off"]` | `stable` | Update checking when the server banner is shown and when `fastmcp version` runs. `stable` checks stable releases only, `prerelease` includes pre-releases, `off` disables checking. |
| `FASTMCP_OAUTH_ENCRYPTION_KEY` | `str \| None` | None | Fernet key for [encrypted CLI OAuth storage](/cli/overview#mcp-server-authentication). An unset or empty value uses memory only. |

## Telemetry

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_TELEMETRY_MODE` | `Literal["native", "propagation_only", "off"]` | `native` | Controls FastMCP's native [OpenTelemetry instrumentation](/servers/telemetry). `native` emits FastMCP's MCP spans and propagates trace context; because FastMCP uses only the OpenTelemetry API, this costs almost nothing unless an SDK and exporter are configured. `propagation_only` keeps `_meta` trace propagation and still parents downstream spans from the incoming context, but emits none of FastMCP's own spans, so another instrumentation layer can own the MCP span hierarchy. `off` is a full pass-through: no spans, and no trace context extracted or attached. |

## Tasks (Docket)

Task settings (the `FASTMCP_DOCKET_` and `FASTMCP_TASKS_` variables) live in the optional `fastmcp-tasks` package. See [server tasks](/servers/tasks) for configuration, including `FASTMCP_TASKS_ENCRYPTION_KEY` for [encrypting task snapshots at rest](/servers/tasks#credentials-at-rest).

## Security

These control FastMCP's SSRF protection for the outbound fetches it makes during authentication (OAuth client metadata and JWKS).

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_SSRF_TRUST_PROXY` | `bool` | `false` | Trust an outbound HTTP proxy for SSRF-protected fetches. When `false`, FastMCP resolves the target hostname itself and refuses to connect if it maps to a private, loopback, link-local, or reserved IP. When `true`, FastMCP routes auth metadata and JWKS fetches through the configured `HTTPS_PROXY`/`ALL_PROXY` and does not honor `NO_PROXY`; if no proxy is configured the fetch is refused. |

By default, FastMCP protects its OAuth and JWKS fetches against [SSRF](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery) by resolving the target hostname, rejecting any address that maps to a private, loopback, link-local, or reserved IP, and then pinning the connection to that validated IP.

This breaks when a corporate `CONNECT` proxy is the only egress path: the container often cannot resolve external DNS at all (only the proxy can), and even when it can, pinning to the IP makes TLS verification fail because public certificates list hostnames, not IP addresses.

Set `FASTMCP_SSRF_TRUST_PROXY=true` when a trusted proxy is your mandated egress. FastMCP then skips DNS resolution, the IP blocklist, and connection pinning, and makes a single request to the hostname URL through the proxy named by the standard `HTTPS_PROXY` / `ALL_PROXY` environment variables (checked in that order). The HTTPS-only and hostname checks still apply.

<Warning>
This setting shifts SSRF protection to the proxy. The IP blocklist cannot be enforced through a proxy, because the proxy does its own DNS, and FastMCP verifies that a proxy is configured but not what its policy allows. Enable it only when the proxy enforces equivalent destination restrictions.

FastMCP passes the proxy URL to the HTTP client explicitly, so the request goes through that proxy or fails. `NO_PROXY` is **not honored** in this mode: a host it would exclude still goes through the proxy instead of direct with no blocklist. If neither `HTTPS_PROXY` nor `ALL_PROXY` is set in the server process's environment (`HTTP_PROXY` alone never routes these HTTPS-only fetches), FastMCP refuses the fetch and raises `SSRFError`.
</Warning>

## Advanced

| Environment Variable | Type | Default | Description |
|---|---|---|---|
| `FASTMCP_HOME` | `Path` | Platform default | Data directory for FastMCP. Defaults to the platform-specific user data directory. |
| `FASTMCP_ENV_FILE` | `str` | `.env` | Path to the `.env` file to load settings from. Must be set as an environment variable (see above). |
| `FASTMCP_TEST_MODE` | `bool` | `false` | Lower the key-derivation cost FastMCP uses for JWT signing keys built from low-entropy secrets, so test suites run faster. Never enable it in production. |

---

### Patterns Contrib (`docs/patterns/contrib.mdx`)

---
title: "Contrib Modules"
description: "Community-contributed modules extending FastMCP"
icon: "cubes"
---

import { VersionBadge } from "/snippets/version-badge.mdx"

<VersionBadge version="2.2.1" />

FastMCP includes a `contrib` package that holds community-contributed modules. These modules extend FastMCP's functionality but aren't officially maintained by the core team.

Contrib modules provide additional features, integrations, or patterns that complement the core FastMCP library. They offer a way for the community to share useful extensions while keeping the core library focused and maintainable.

The available modules can be viewed in the [contrib directory](https://github.com/PrefectHQ/fastmcp/tree/main/fastmcp_slim/fastmcp/contrib).

## Usage

To use a contrib module, import it from its subpackage under `fastmcp.contrib`. For example, the `mcp_mixin` module:

```python
from fastmcp.contrib.mcp_mixin import MCPMixin, mcp_tool
```

## Important Considerations

- **Stability**: Modules in `contrib` may have different testing requirements or stability guarantees compared to the core library.
- **Compatibility**: Changes to core FastMCP might break modules in `contrib` without explicit warnings in the main changelog.
- **Dependencies**: Contrib modules may have additional dependencies not required by the core library. These dependencies are typically documented in the module's README or separate requirements files.

## Contributing

Contrib modules are accepted selectively. Before opening a PR, first open an issue with the problem, intended maintenance model, and why the pattern belongs in-repo instead of a standalone package. If maintainers agree it belongs in `contrib`, prepare the module with:

1. Create a new directory in `fastmcp_slim/fastmcp/contrib/` for your module
2. Add proper tests for your module in `tests/contrib/`
3. Include comprehensive documentation in a README.md file, including usage and examples, as well as any additional dependencies or installation instructions
4. Submit a focused pull request linked to the maintainer-approved issue

The ideal contrib module:
- Solves a specific use case or integration need
- Follows FastMCP coding standards
- Includes thorough documentation and examples
- Has comprehensive tests
- Specifies any additional dependencies

---

### Python Sdk Fastmcp Apps   Init   (`docs/python-sdk/fastmcp-apps-__init__.mdx`)

---
title: __init__
sidebarTitle: __init__
---

# `fastmcp.apps`


FastMCP Apps — interactive UIs for MCP tools.

This package contains the app-related components:

- ``FastMCPApp`` — composable provider for interactive apps with backend tools
- ``AppConfig`` — configuration for MCP App tools and resources
- ``ResourceCSP`` / ``ResourcePermissions`` — security configuration

---

### Python Sdk Fastmcp Apps App (`docs/python-sdk/fastmcp-apps-app.mdx`)

---
title: app
sidebarTitle: app
---

# `fastmcp.apps.app`


FastMCPApp — a Provider that represents a composable MCP application.

FastMCPApp binds entry-point tools (model calls these) together with backend
tools (the UI calls these via CallTool).  Backend tools are tagged with
``meta["fastmcp"]["app"]`` so they can be found through the provider chain
even when transforms (namespace, visibility, etc.) have renamed or hidden
them — the server sets a context var that tells ``Provider.get_tool`` to
fall back to a direct lookup for app-visible tools.

Usage::

    from fastmcp import FastMCP, FastMCPApp

    app = FastMCPApp("Dashboard")

    @app.ui()
    def show_dashboard() -> Component:
        return Column(...)

    @app.tool()
    def save_contact(name: str, email: str) -> str:
        return name

    server = FastMCP("Platform")
    server.add_provider(app)


## Classes

### `FastMCPApp` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L159" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


A Provider that represents an MCP application.

Binds together entry-point tools (``@app.ui``), backend tools
(``@app.tool``), and the Prefab renderer resource.  Backend tools
are tagged with ``meta["fastmcp"]["app"]`` so ``Provider.get_tool``
can find them by original name even when transforms have been applied.


**Methods:**

#### `tool` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L183" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
tool(self, name_or_fn: F) -> F
```

#### `tool` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L195" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
tool(self, name_or_fn: str | None = None) -> Callable[[F], F]
```

#### `tool` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L206" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
tool(self, name_or_fn: str | AnyFunction | None = None) -> Any
```

Register a backend tool that the UI calls via CallTool.

Backend tools default to ``visibility=["app"]``.  Pass ``model=True``
to also expose the tool to the model (``visibility=["app", "model"]``).

Names matching `__&lt;12 lowercase hex&gt;_&lt;name&gt;` are reserved for generated
tool addresses and raise `ValueError` at registration.

Supports multiple calling patterns::

    @app.tool
    def save(name: str): ...

    @app.tool()
    def save(name: str): ...

    @app.tool("custom_name")
    def save(name: str): ...


#### `ui` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L280" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
ui(self, name_or_fn: F) -> F
```

#### `ui` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L295" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
ui(self, name_or_fn: str | None = None) -> Callable[[F], F]
```

#### `ui` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L309" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
ui(self, name_or_fn: str | AnyFunction | None = None) -> Any
```

Register a UI entry-point tool that the model calls.

Entry-point tools default to ``visibility=["model"]`` and auto-wire
the Prefab renderer resource and CSP. They are tagged with the app
name so structured content includes ``_meta.fastmcp.app``.

Names matching `__&lt;12 lowercase hex&gt;_&lt;name&gt;` are reserved for generated
tool addresses and raise `ValueError` at registration.

Supports multiple calling patterns::

    @app.ui
    def dashboard() -> Component: ...

    @app.ui()
    def dashboard() -> Component: ...

    @app.ui("my_dashboard")
    def dashboard() -> Component: ...


#### `add_tool` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L391" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
add_tool(self, tool: Tool | Callable[..., Any]) -> Tool
```

Add a tool to this app programmatically.

The tool is tagged with this app's name for routing. Names matching
`__<12 lowercase hex>_<name>` are reserved for generated tool addresses
and raise `ValueError` at registration.


#### `lifespan` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L453" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
lifespan(self) -> AsyncGenerator[None, None]
```

#### `run` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/app.py#L461" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
run(self, transport: Literal['stdio', 'http', 'sse', 'streamable-http'] | None = None, **kwargs: Any) -> None
```

Create a temporary FastMCP server and run this app standalone.

---

### Python Sdk Fastmcp Apps Approval (`docs/python-sdk/fastmcp-apps-approval.mdx`)

---
title: approval
sidebarTitle: approval
---

# `fastmcp.apps.approval`


Approval — a Provider that adds human-in-the-loop approval to any server.

The LLM presents a summary of what it's about to do, and the user
approves or rejects via buttons. The result is sent back into the
conversation as a message, prompting the LLM's next turn.

Requires ``fastmcp[apps]`` (prefab-ui).

Usage::

    from fastmcp import FastMCP
    from fastmcp.apps.approval import Approval

    mcp = FastMCP("My Server")
    mcp.add_provider(Approval())


## Classes

### `Approval` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/approval.py#L49" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


A Provider that adds human-in-the-loop approval to a server.

The LLM calls the ``request_approval`` tool with a summary and
optional details. The user sees an approval card with Approve and
Reject buttons. Clicking either sends a message back into the
conversation (via ``SendMessage``), triggering the LLM's next turn.

The message appears as if the user sent it, so the LLM sees
something like ``'"Deploy v3.2 to production" is APPROVED'``.

Example::

    from fastmcp import FastMCP
    from fastmcp.apps.approval import Approval

    mcp = FastMCP("My Server")
    mcp.add_provider(Approval())

Customized::

    Approval(
        title="Deploy Gate",
        approve_text="Ship it",
        approve_variant="default",
        reject_text="Abort",
        reject_variant="destructive",
    )

---

### Python Sdk Fastmcp Apps Choice (`docs/python-sdk/fastmcp-apps-choice.mdx`)

---
title: choice
sidebarTitle: choice
---

# `fastmcp.apps.choice`


Choice — a Provider that lets the user pick from a set of options.

The LLM presents options, the user clicks one, and the selection
flows back into the conversation as a message.

Requires ``fastmcp[apps]`` (prefab-ui).

Usage::

    from fastmcp import FastMCP
    from fastmcp.apps.choice import Choice

    mcp = FastMCP("My Server")
    mcp.add_provider(Choice())


## Classes

### `Choice` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/choice.py#L46" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


A Provider that lets the user choose from a set of options.

The LLM calls ``choose`` with a prompt and a list of options.
The user sees a card with one button per option. Clicking a button
sends the selection back into the conversation via ``SendMessage``,
triggering the LLM's next turn.

Example::

    from fastmcp import FastMCP
    from fastmcp.apps.choice import Choice

    mcp = FastMCP("My Server")
    mcp.add_provider(Choice())

---

### Python Sdk Fastmcp Apps Config (`docs/python-sdk/fastmcp-apps-config.mdx`)

---
title: config
sidebarTitle: config
---

# `fastmcp.apps.config`


MCP Apps support — extension negotiation and typed UI metadata models.

Provides constants and Pydantic models for the MCP Apps extension
(io.modelcontextprotocol/ui), enabling tools and resources to carry
UI metadata for clients that support interactive app rendering.


## Functions

### `app_config_to_meta_dict` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/config.py#L190" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
app_config_to_meta_dict(app: AppConfig | dict[str, Any]) -> dict[str, Any]
```


Convert an AppConfig or dict to the wire-format dict for ``meta["ui"]``.


### `is_model_visible` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/config.py#L197" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
is_model_visible(component: FastMCPComponent) -> bool
```


Whether a component belongs on model-facing discovery and proxy surfaces.

This is audience filtering, not authorization. Direct MCP calls do not
use this predicate and cannot identify model versus app callers.

Visibility is a declaration, and the MCP Apps spec puts the filtering on
the host — so ``tools/list`` carries app-only tools and the host keeps
them from the model. That division only works where a host stands between
the server and the model.

It does not hold for surfaces a server drives itself. A search result or
a code-mode catalog reaches the model as ordinary tool output, and a
call-tool proxy invokes on a name the model supplies; nothing downstream
can filter either. Those surfaces have to apply the declaration here.

A component with no ``visibility`` is visible: the field marks the
exception, and the spec's default is both audiences.


## Classes

### `ResourceCSP` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/config.py#L21" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Content Security Policy for MCP App resources.

Declares which external origins the app is allowed to connect to or
load resources from.  Hosts use these declarations to build the
``Content-Security-Policy`` header for the sandboxed iframe.


### `ResourcePermissions` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/config.py#L57" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Iframe sandbox permissions for MCP App resources.

Each field, when set (typically to ``{}``), requests that the host
grant the corresponding Permission Policy feature to the sandboxed
iframe.  Hosts MAY honour these; apps should use JS feature detection
as a fallback.


### `AppConfig` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/config.py#L85" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Configuration for MCP App tools and resources.

Controls how a tool or resource participates in the MCP Apps extension.
On tools, ``resource_uri`` and ``visibility`` specify which UI resource
to render and where the tool appears.  On resources, those fields must
be left unset (the resource itself is the UI).

`visibility` declares the intended audience; it is not a security boundary.
Direct MCP calls remain subject to authentication and authorization,
regardless of visibility. The server cannot distinguish model and app
callers on the same connection.

All fields use ``exclude_none`` serialization so only explicitly-set
values appear on the wire.  Aliases match the MCP Apps wire format
(camelCase).


### `PrefabAppConfig` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/config.py#L134" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


App configuration for Prefab tools with sensible defaults.

Like ``app=True`` but customizable. Auto-wires the Prefab renderer
URI and merges the renderer's CSP with any additional domains you
specify.  The renderer resource is registered automatically.

Example::

    @mcp.tool(app=PrefabAppConfig())  # same as app=True

    @mcp.tool(app=PrefabAppConfig(
        csp=ResourceCSP(frame_domains=["https://example.com"]),
    ))


**Methods:**

#### `model_post_init` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/config.py#L150" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
model_post_init(self, __context: Any) -> None
```

---

### Python Sdk Fastmcp Apps File Upload (`docs/python-sdk/fastmcp-apps-file_upload.mdx`)

---
title: file_upload
sidebarTitle: file_upload
---

# `fastmcp.apps.file_upload`


FileUpload — a Provider that adds drag-and-drop file upload to any server.

Lets users upload files directly to the server through an interactive UI,
bypassing the LLM context window entirely. The LLM can then read and work
with uploaded files through model-visible tools.

Requires ``fastmcp[apps]`` (prefab-ui).

Usage::

    from fastmcp import FastMCP
    from fastmcp.apps import FileUpload

    mcp = FastMCP("My Server")
    mcp.add_provider(FileUpload())

For custom persistence, override the storage methods::

    class S3Upload(FileUpload):
        def on_store(self, files, ctx):
            # write to S3, return summaries
            ...

        def on_list(self, ctx):
            # list from S3
            ...

        def on_read(self, name, ctx):
            # read from S3
            ...


## Classes

### `FileUpload` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/file_upload.py#L106" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


A Provider that adds file upload capabilities to a server.

Registers a drag-and-drop UI tool, a backend storage tool, and
model-visible tools for listing and reading uploaded files.

Files are scoped by MCP session and stored in memory by default.
Set `max_total_size` to limit decoded file bytes across all scopes or
`file_ttl_seconds` to expire files by age since upload. Both default to
None. Expired files are removed on storage operations, without a timer.
These options apply to the default in-memory storage methods.
Override ``on_store``, ``on_list``, and ``on_read`` for custom
persistence (filesystem, S3, database, etc.). Each method receives
the current ``Context``, giving access to session ID, auth tokens,
and request metadata for partitioning and authorization.

**Session scoping:** The default storage isolates files by MCP session
on handshake-era connections. MCP 2026-07-28 connections have no
session, so files are scoped to the authenticated user instead, or
shared by the server process on stdio. Unauthenticated 2026-07-28 HTTP
requests carry no client identity, so the default storage rejects them.
In **stateless HTTP** mode, each request creates a new session, so
files won't persist across requests. For stateless deployments,
override the storage methods to partition by a stable identifier from
the auth context::

    class UserScopedUpload(FileUpload):
        def on_store(self, files, ctx):
            user_id = ctx.access_token["sub"]
            ...

Example::

    from fastmcp import FastMCP
    from fastmcp.apps.file_upload import FileUpload

    mcp = FastMCP("My Server")
    mcp.add_provider(FileUpload())


**Methods:**

#### `on_store` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/file_upload.py#L228" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
on_store(self, files: list[dict[str, Any]], ctx: Context) -> list[dict[str, Any]]
```

Store uploaded files and return summaries.

**Args:**
- `files`: List of file dicts, each with ``name``, ``size``,
``type``, and ``data`` (base64-encoded content).
- `ctx`: The current request context. Use for session ID,
auth tokens, or any metadata needed for partitioning.

Override this method for custom persistence. The default
implementation stores files in memory, scoped by
``_get_scope_key(ctx)``. The optional `max_total_size` applies to
decoded file bytes across every scope. An entire batch is rejected
when its final contents would exceed the limit, including replacements.

**Returns:**
- List of file summary dicts (``name``, ``type``, ``size``,
- ``size_display``, ``uploaded_at``).


#### `on_list` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/file_upload.py#L294" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
on_list(self, ctx: Context) -> list[dict[str, Any]]
```

List all stored files.

**Args:**
- `ctx`: The current request context.

Override this method for custom persistence. The default
implementation returns files from the current scope.

**Returns:**
- List of file summary dicts.


#### `on_read` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/file_upload.py#L312" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
on_read(self, name: str, ctx: Context) -> dict[str, Any]
```

Read a file's contents by name.

**Args:**
- `name`: The filename to read.
- `ctx`: The current request context.

Override this method for custom persistence. The default
implementation reads from the current scope's in-memory store.
Text files are decoded from base64; binary files return a
truncated base64 preview.

**Returns:**
- Dict with file metadata and ``content`` (text) or
- ``content_base64`` (binary preview).

**Raises:**
- `ValueError`: If the file is not found.

---

### Python Sdk Fastmcp Apps Form (`docs/python-sdk/fastmcp-apps-form.mdx`)

---
title: form
sidebarTitle: form
---

# `fastmcp.apps.form`


FormInput — a Provider that collects structured input from the user.

Define a Pydantic model for the data you need, and ``FormInput``
generates a form UI. The user fills it out, the submission is
validated, and an optional callback processes the result.

Requires ``fastmcp[apps]`` (prefab-ui).

Usage::

    from pydantic import BaseModel
    from fastmcp import FastMCP
    from fastmcp.apps.form import FormInput

    class ShippingAddress(BaseModel):
        street: str
        city: str
        state: str
        zip_code: str

    mcp = FastMCP("My Server")
    mcp.add_provider(FormInput(model=ShippingAddress))


## Classes

### `FormInput` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/form.py#L88" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


A Provider that collects structured input via a Pydantic model.

Define a model for the data you need, and ``FormInput`` generates
a form from it using ``Form.from_model()``. Field types, labels,
descriptions, and validation are all derived from the model.

Optionally provide an ``on_submit`` callback to process the
validated data. The callback receives a model instance and returns
a string that goes back to the LLM. Without a callback, the
validated JSON is sent directly.

Example::

    from pydantic import BaseModel
    from fastmcp import FastMCP
    from fastmcp.apps.form import FormInput

    class Contact(BaseModel):
        name: str
        email: str

    mcp = FastMCP("My Server")
    mcp.add_provider(FormInput(model=Contact))

With a callback::

    def save_contact(contact: Contact) -> str:
        db.insert(contact.model_dump())
        return f"Saved {contact.name}"

    mcp.add_provider(FormInput(model=Contact, on_submit=save_contact))

---

### Python Sdk Fastmcp Apps Generative (`docs/python-sdk/fastmcp-apps-generative.mdx`)

---
title: generative
sidebarTitle: generative
---

# `fastmcp.apps.generative`


GenerativeUI — a Provider that adds LLM-generated UI capabilities.

Registers tools and resources from ``prefab_ui.generative`` so that an
LLM can write Prefab Python code, execute it in a sandbox, and render
the result as a streaming interactive UI.

Requires ``fastmcp[apps]`` (prefab-ui).

Usage::

    from fastmcp import FastMCP
    from fastmcp.apps.generative import GenerativeUI

    mcp = FastMCP("My Server")
    mcp.add_provider(GenerativeUI())


## Classes

### `GenerativeUI` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/generative.py#L53" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


A Provider that adds generative UI capabilities to a server.

Registers:

- A ``generate_ui`` tool that accepts Prefab Python code, executes
  it in a Pyodide sandbox, and returns the rendered PrefabApp.
  Supports streaming via ``ontoolinputpartial``.
- A ``components`` tool that searches the Prefab component library.
- The generative renderer resource with CSP for Pyodide CDN access.

Example::

    from fastmcp import FastMCP
    from fastmcp.apps.generative import GenerativeUI

    mcp = FastMCP("My Server")
    mcp.add_provider(GenerativeUI())


**Methods:**

#### `lifespan` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/apps/generative.py#L197" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
lifespan(self) -> AsyncGenerator[None, None]
```

---

### Python Sdk Fastmcp Cli   Init   (`docs/python-sdk/fastmcp-cli-__init__.mdx`)

---
title: __init__
sidebarTitle: __init__
---

# `fastmcp.cli`


FastMCP CLI package.

---

### Python Sdk Fastmcp Cli Apps Dev (`docs/python-sdk/fastmcp-cli-apps_dev.mdx`)

---
title: apps_dev
sidebarTitle: apps_dev
---

# `fastmcp.cli.apps_dev`


Dev server for previewing FastMCPApp UIs locally.

Starts the user's MCP server on a configurable port, then starts a lightweight
Starlette dev server that:

  - Serves a Prefab-based tool picker at GET /
  - Proxies /mcp to the user's server (avoids browser CORS restrictions)
  - Serves the AppBridge host page at GET /launch

The host page uses @modelcontextprotocol/ext-apps to connect to the MCP server
and render the selected UI tool inside an iframe.

Startup sequence
----------------
1. Download ext-apps app-bridge.js from npm and patch its bare
   ``@modelcontextprotocol/sdk/…`` imports to use concrete esm.sh URLs.
2. Detect the exact Zod v4 module URL that esm.sh serves for that SDK version
   and build an import-map entry that redirects the broken ``v4.mjs`` (which
   only re-exports ``{z, default}``) to ``v4/classic/index.mjs`` (which
   correctly exports every named Zod v4 function).  Import maps apply to the
   full module graph in the document, including cross-origin esm.sh modules.
3. Serve both the patched JS and the import-map JSON from the dev server.


## Functions

### `run_dev_apps` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/cli/apps_dev.py#L1768" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
run_dev_apps(server_spec: str) -> None
```


Start the full dev environment for a FastMCPApp server.

Starts the user's MCP server on *mcp_port*, starts the Prefab dev UI
on *dev_port* (with an /mcp proxy to the user's server), then opens
the browser.

---

### Python Sdk Fastmcp Cli Apps Dev Security (`docs/python-sdk/fastmcp-cli-apps_dev_security.mdx`)

---
title: apps_dev_security
sidebarTitle: apps_dev_security
---

# `fastmcp.cli.apps_dev_security`


Browser session, Host, and Origin checks for the `fastmcp dev apps` host.

## Classes

### `DevSessionMiddleware` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/cli/apps_dev_security.py#L38" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Require a browser session started from the private startup URL.

`GET /?token=...` with the startup token sets an HttpOnly, SameSite=Strict
cookie and redirects to `/`. Every other request needs that cookie. The
cookie holds a separate session secret: browsers send cookies to every
port on the host, and the startup token must not reach other services. Every
request must also name this server in its Host header, and browser
requests must come from this origin: cookies do not distinguish ports on
the same host, so the Origin and Fetch Metadata headers are checked too.

---

--- METRICS ---
- Files Extracted: 100
- Estimated Token Budget: ~371135 tokens
- Canonical Reference: https://codewiki.google/github.com/jlowin/fastmcp
