π The fast, Pythonic way to build MCP servers and clients.
docs: refresh sidebar tags and fix audit findings across servers/clients pages (#4965)
nate nowack62ef226b62c7
diff --git a/docs/apps/fastmcp-app.mdx b/docs/apps/fastmcp-app.mdxindex b3facd212..7e769eee0 100644--- a/docs/apps/fastmcp-app.mdx+++ b/docs/apps/fastmcp-app.mdx@@ -3,7 +3,6 @@ title: FastMCPAppsidebarTitle: FastMCPAppdescription: Wire an interactive UI to backend tools with managed visibility and composition safety.icon: puzzle-piece-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/apps/generative.mdx b/docs/apps/generative.mdxindex b6293d32b..acb0e3270 100644--- a/docs/apps/generative.mdx+++ b/docs/apps/generative.mdx@@ -3,7 +3,6 @@ title: Generative UIsidebarTitle: Generative UIdescription: Let the LLM build custom Prefab UIs on the fly.icon: wand-magic-sparkles-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/apps/prefab.mdx b/docs/apps/prefab.mdxindex e6ff7070f..87a595e17 100644--- a/docs/apps/prefab.mdx+++ b/docs/apps/prefab.mdx@@ -3,7 +3,6 @@ title: Interactive ToolssidebarTitle: Interactive Toolsdescription: Turn your tools into interactive UIs with charts, tables, and dashboards.icon: palette-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/apps/providers/approval.mdx b/docs/apps/providers/approval.mdxindex 8ac7b8dd1..8f848d07c 100644--- a/docs/apps/providers/approval.mdx+++ b/docs/apps/providers/approval.mdx@@ -3,7 +3,6 @@ title: ApprovalsidebarTitle: Approvaldescription: Human-in-the-loop approval gates for agent actionsicon: shield-check-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/apps/providers/choice.mdx b/docs/apps/providers/choice.mdxindex c29c1b2bc..692ae921d 100644--- a/docs/apps/providers/choice.mdx+++ b/docs/apps/providers/choice.mdx@@ -3,7 +3,6 @@ title: ChoicesidebarTitle: Choicedescription: Present clickable options instead of free-text responsesicon: list-check-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/apps/providers/file-upload.mdx b/docs/apps/providers/file-upload.mdxindex f10ef0da7..f28b99fec 100644--- a/docs/apps/providers/file-upload.mdx+++ b/docs/apps/providers/file-upload.mdx@@ -3,7 +3,6 @@ title: File UploadsidebarTitle: File Uploaddescription: Drag-and-drop file upload for any MCP servericon: upload-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/apps/providers/form.mdx b/docs/apps/providers/form.mdxindex e61dc0ce0..1a28b9963 100644--- a/docs/apps/providers/form.mdx+++ b/docs/apps/providers/form.mdx@@ -3,7 +3,6 @@ title: Form InputsidebarTitle: Form Inputdescription: Collect structured data from users via Pydantic modelsicon: rectangle-list-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/apps/quickstart.mdx b/docs/apps/quickstart.mdxindex 2221b9de9..5aed17c4b 100644--- a/docs/apps/quickstart.mdx+++ b/docs/apps/quickstart.mdx@@ -3,7 +3,6 @@ title: QuickstartsidebarTitle: Quickstartdescription: Build your first FastMCP app in under a minute.icon: rocket-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/clients/auth/cimd.mdx b/docs/clients/auth/cimd.mdxindex 5b1a6b934..5c8904bc6 100644--- a/docs/clients/auth/cimd.mdx+++ b/docs/clients/auth/cimd.mdx@@ -3,7 +3,6 @@ title: CIMD AuthenticationsidebarTitle: CIMDdescription: Use Client ID Metadata Documents for verifiable, domain-based client identity.icon: id-badge-tag: NEW---import { VersionBadge } from "/snippets/version-badge.mdx"diff --git a/docs/clients/client-groups.mdx b/docs/clients/client-groups.mdxindex 0ffa6a321..22864f458 100644--- a/docs/clients/client-groups.mdx+++ b/docs/clients/client-groups.mdx@@ -2,6 +2,7 @@title: Client GroupssidebarTitle: Client Groupsicon: layer-group+tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/clients/client.mdx b/docs/clients/client.mdxindex 21b4d9032..142e56013 100644--- a/docs/clients/client.mdx+++ b/docs/clients/client.mdx@@ -347,6 +347,8 @@ The client supports callback handlers for advanced server interactions. These leSampling, 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 Clientfrom fastmcp.client.logging import LogMessage@@ -361,7 +363,7 @@ async def sampling_handler(messages, params, context):return "Generated response"client = Client(- "my_mcp_server.py",+ Path("my_mcp_server.py"),log_handler=log_handler,progress_handler=progress_handler,sampling_handler=sampling_handler,diff --git a/docs/clients/notifications.mdx b/docs/clients/notifications.mdxindex a2b36d36b..67c59b6f7 100644--- a/docs/clients/notifications.mdx+++ b/docs/clients/notifications.mdx@@ -18,6 +18,8 @@ MCP servers can send notifications to inform clients about state changes. The meThe 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 Clientasync def message_handler(message):@@ -35,7 +37,7 @@ async def message_handler(message):print("A resource was updated")client = Client(- "my_mcp_server.py",+ Path("my_mcp_server.py"),message_handler=message_handler,)```@@ -45,6 +47,8 @@ client = Client(For fine-grained targeting, subclass `MessageHandler` to use specific hooks:```python+from pathlib import Path+from fastmcp import Clientfrom fastmcp.client.messages import MessageHandlerimport mcp.types@@ -69,7 +73,7 @@ class MyMessageHandler(MessageHandler):print("Prompt list changed")client = Client(- "my_mcp_server.py",+ Path("my_mcp_server.py"),message_handler=MyMessageHandler(),)```diff --git a/docs/clients/transports.mdx b/docs/clients/transports.mdxindex 586969a7a..52b93f050 100644--- a/docs/clients/transports.mdx+++ b/docs/clients/transports.mdx@@ -34,7 +34,7 @@ transport = StdioTransport(client = Client(transport)```-For convenience, the client can infer STDIO transport from file paths, though this limits configuration options:+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:```pythonfrom pathlib import Pathdiff --git a/docs/deployment/http.mdx b/docs/deployment/http.mdxindex f057efe4c..2b0cec239 100644--- a/docs/deployment/http.mdx+++ b/docs/deployment/http.mdx@@ -792,7 +792,7 @@ This automatic approach is convenient for development but not suitable for produProduction 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-3. **Persistent network-accessible storage** for upstream tokens (wrapped in `FernetEncryptionWrapper` to encrypt sensitive data at rest)+2. **Persistent network-accessible storage** for upstream tokens (wrapped in `FernetEncryptionWrapper` to encrypt sensitive data at rest)**Configuration:**diff --git a/docs/deployment/running-server.mdx b/docs/deployment/running-server.mdxindex 9bb8e544c..3a7c8ab97 100644--- a/docs/deployment/running-server.mdx+++ b/docs/deployment/running-server.mdx@@ -180,7 +180,7 @@ 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, some bidirectional features like elicitation are not available during reload mode.+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.diff --git a/docs/integrations/keycloak.mdx b/docs/integrations/keycloak.mdxindex 22d61f132..71797e607 100644--- a/docs/integrations/keycloak.mdx+++ b/docs/integrations/keycloak.mdx@@ -3,7 +3,6 @@ title: Keycloak OAuth π€ FastMCPsidebarTitle: Keycloakdescription: Secure your FastMCP server with Keycloak OAuthicon: shield-check-tag: NEW---import { VersionBadge } from "/snippets/version-badge.mdx"diff --git a/docs/servers/authorization.mdx b/docs/servers/authorization.mdxindex 1ba9a3b0e..823ba8ff0 100644--- a/docs/servers/authorization.mdx+++ b/docs/servers/authorization.mdx@@ -3,7 +3,6 @@ title: AuthorizationsidebarTitle: Authorizationdescription: Control access to components using callable-based authorization checks that filter visibility and enforce permissions.icon: shield-halved-tag: NEW---import { VersionBadge } from "/snippets/version-badge.mdx"diff --git a/docs/servers/context.mdx b/docs/servers/context.mdxindex 667ce9764..f34fbce35 100644--- a/docs/servers/context.mdx+++ b/docs/servers/context.mdx@@ -3,7 +3,6 @@ title: MCP ContextsidebarTitle: Contextdescription: Access MCP capabilities like logging, progress, and resources within your MCP objects.icon: rectangle-code-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/dependency-injection.mdx b/docs/servers/dependency-injection.mdxindex 0a3770532..f419afc16 100644--- a/docs/servers/dependency-injection.mdx+++ b/docs/servers/dependency-injection.mdx@@ -3,7 +3,6 @@ title: Dependency InjectionsidebarTitle: Dependenciesdescription: Inject runtime values like HTTP requests, access tokens, and custom dependencies into your MCP components.icon: syringe-tag: NEW---import { VersionBadge } from "/snippets/version-badge.mdx";diff --git a/docs/servers/lifespan.mdx b/docs/servers/lifespan.mdxindex 822e4f8a1..c87774065 100644--- a/docs/servers/lifespan.mdx+++ b/docs/servers/lifespan.mdx@@ -3,7 +3,6 @@ title: LifespanssidebarTitle: Lifespandescription: Server-level setup and teardown with composable lifespansicon: heart-pulse-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/middleware.mdx b/docs/servers/middleware.mdxindex 114f69262..1617be564 100644--- a/docs/servers/middleware.mdx+++ b/docs/servers/middleware.mdx@@ -484,7 +484,7 @@ mcp.add_middleware(ResponseCachingMiddleware(See [Storage Backends](/servers/storage-backends) for complete options.<Note>-Cache keys are based on the operation name and arguments only β they do not include user or session identity. If your tools return user-specific data derived from auth context (e.g., headers or session state) rather than from the request arguments, you should either disable caching for those tools or ensure user identity is part of the tool arguments.+Cache keys include the method name, arguments, the requested component version, and the caller's access token β entries are partitioned per token, so responses cannot leak across users with different permissions. Unauthenticated callers (including STDIO) share a single anonymous partition. Data derived from request context *other than* the auth token β custom HTTP headers, session state β is not part of the key, so disable caching for tools whose results depend on it.</Note>### Rate Limitingdiff --git a/docs/servers/pagination.mdx b/docs/servers/pagination.mdxindex b78f09bb1..0ea47dd22 100644--- a/docs/servers/pagination.mdx+++ b/docs/servers/pagination.mdx@@ -3,7 +3,6 @@ title: PaginationsidebarTitle: Paginationdescription: Control how servers return large lists of components to clients.icon: page-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/providers/custom.mdx b/docs/servers/providers/custom.mdxindex 73d244ff7..14257a22b 100644--- a/docs/servers/providers/custom.mdx+++ b/docs/servers/providers/custom.mdx@@ -3,7 +3,6 @@ title: Custom ProviderssidebarTitle: Customdescription: Build providers that source components from any data sourceicon: code-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/providers/filesystem.mdx b/docs/servers/providers/filesystem.mdxindex 353a671d5..97e9ef791 100644--- a/docs/servers/providers/filesystem.mdx+++ b/docs/servers/providers/filesystem.mdx@@ -3,7 +3,6 @@ title: Filesystem ProvidersidebarTitle: Filesystemdescription: Automatic component discovery from Python filesicon: folder-tree-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/providers/local.mdx b/docs/servers/providers/local.mdxindex 147ef7e59..e04f51598 100644--- a/docs/servers/providers/local.mdx+++ b/docs/servers/providers/local.mdx@@ -3,7 +3,6 @@ title: Local ProvidersidebarTitle: Localdescription: The default provider for decorator-registered componentsicon: house-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/providers/overview.mdx b/docs/servers/providers/overview.mdxindex 2f23f76a5..625eba50e 100644--- a/docs/servers/providers/overview.mdx+++ b/docs/servers/providers/overview.mdx@@ -3,7 +3,6 @@ title: ProviderssidebarTitle: Overviewdescription: How FastMCP sources tools, resources, and promptsicon: layer-group-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/providers/proxy.mdx b/docs/servers/providers/proxy.mdxindex ed3b2cb78..c961f9afa 100644--- a/docs/servers/providers/proxy.mdx+++ b/docs/servers/providers/proxy.mdx@@ -163,10 +163,12 @@ proxy = create_proxy(Path("advanced_backend.py"))Selectively disable forwarding:```python+from pathlib import Path+from fastmcp.server.providers.proxy import ProxyClientbackend = ProxyClient(- "backend_server.py",+ Path("backend_server.py"),sampling_handler=None, # Disable LLM samplinglog_handler=None # Disable log forwarding)diff --git a/docs/servers/providers/skills.mdx b/docs/servers/providers/skills.mdxindex 01214d3d4..58792fb69 100644--- a/docs/servers/providers/skills.mdx+++ b/docs/servers/providers/skills.mdx@@ -3,7 +3,6 @@ title: Skills ProvidersidebarTitle: Skillsdescription: Expose agent skills as MCP resourcesicon: wand-magic-sparkles-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/storage-backends.mdx b/docs/servers/storage-backends.mdxindex 32e6530eb..2c30f3ec1 100644--- a/docs/servers/storage-backends.mdx+++ b/docs/servers/storage-backends.mdx@@ -3,7 +3,6 @@ title: Storage BackendssidebarTitle: Storage Backendsdescription: Configure persistent and distributed storage for caching and OAuth state managementicon: database-tag: NEW---import { VersionBadge } from "/snippets/version-badge.mdx"diff --git a/docs/servers/tasks.mdx b/docs/servers/tasks.mdxindex 7b374473d..77c1b4ae1 100644--- a/docs/servers/tasks.mdx+++ b/docs/servers/tasks.mdx@@ -293,8 +293,10 @@ The `Progress` dependency lets you report progress back to clients. Inject it as```pythonfrom fastmcp import FastMCPfrom fastmcp.dependencies import Progress+from fastmcp_tasks import TasksExtensionmcp = FastMCP("MyServer")+mcp.add_extension(TasksExtension())@mcp.tool(task=True)async def process_files(files: list[str], progress: Progress = Progress()) -> str:@@ -323,9 +325,11 @@ FastMCP exposes Docket's full dependency injection system within your task-enablfrom docket import Docket, Workerfrom fastmcp import FastMCPfrom fastmcp.dependencies import Progress+from fastmcp_tasks import TasksExtensionfrom fastmcp_tasks.dependencies import CurrentDocket, CurrentWorkermcp = FastMCP("MyServer")+mcp.add_extension(TasksExtension())@mcp.tool(task=True)async def my_task(diff --git a/docs/servers/transforms/code-mode.mdx b/docs/servers/transforms/code-mode.mdxindex 0e7e4f50d..487e0c14c 100644--- a/docs/servers/transforms/code-mode.mdx+++ b/docs/servers/transforms/code-mode.mdx@@ -3,7 +3,6 @@ title: Code ModesidebarTitle: Code Modedescription: Let LLMs write Python to orchestrate tools in a sandboxicon: flask-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/transforms/prompts-as-tools.mdx b/docs/servers/transforms/prompts-as-tools.mdxindex 6a9ab1b47..4960ecbe0 100644--- a/docs/servers/transforms/prompts-as-tools.mdx+++ b/docs/servers/transforms/prompts-as-tools.mdx@@ -3,7 +3,6 @@ title: Prompts as ToolssidebarTitle: Prompts as Toolsdescription: Expose prompts to tool-only clientsicon: message-lines-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/transforms/resources-as-tools.mdx b/docs/servers/transforms/resources-as-tools.mdxindex b79980dcc..7b4f9834d 100644--- a/docs/servers/transforms/resources-as-tools.mdx+++ b/docs/servers/transforms/resources-as-tools.mdx@@ -3,7 +3,6 @@ title: Resources as ToolssidebarTitle: Resources as Toolsdescription: Expose resources to tool-only clientsicon: toolbox-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/transforms/tool-search.mdx b/docs/servers/transforms/tool-search.mdxindex c3f44a3cf..5c50e9e61 100644--- a/docs/servers/transforms/tool-search.mdx+++ b/docs/servers/transforms/tool-search.mdx@@ -3,7 +3,6 @@ title: Tool SearchsidebarTitle: Tool Searchdescription: Replace large tool catalogs with on-demand searchicon: magnifying-glass-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'diff --git a/docs/servers/versioning.mdx b/docs/servers/versioning.mdxindex 0dfa0bc69..cdda9fcf1 100644--- a/docs/servers/versioning.mdx+++ b/docs/servers/versioning.mdx@@ -3,7 +3,6 @@ title: VersioningsidebarTitle: Versioningdescription: Serve multiple API versions from a single codebaseicon: code-branch-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'@@ -289,13 +288,14 @@ def add(x: int, y: int) -> int:def add(x: int, y: int) -> int:return x + y + 100 # Different behavior-# Get highest version (default)-tool = await mcp.get_tool("add")-print(tool.version) # "2.0"+async def main():+ # Get highest version (default)+ tool = await mcp.get_tool("add")+ print(tool.version) # "2.0"-# Get specific version-tool_v1 = await mcp.get_tool("add", version="1.0")-print(tool_v1.version) # "1.0"+ # Get specific version+ tool_v1 = await mcp.get_tool("add", version="1.0")+ print(tool_v1.version) # "1.0"```If the requested version doesn't exist, a `NotFoundError` is raised.diff --git a/docs/servers/visibility.mdx b/docs/servers/visibility.mdxindex edd3127d4..6b013257b 100644--- a/docs/servers/visibility.mdx+++ b/docs/servers/visibility.mdx@@ -3,7 +3,6 @@ title: Component VisibilitysidebarTitle: Visibilitydescription: Control which components are available to clientsicon: toggle-on-tag: NEW---import { VersionBadge } from '/snippets/version-badge.mdx'@@ -241,6 +240,7 @@ Server-level visibility state applies to all components from all providers. Whenfrom fastmcp import FastMCPmain = FastMCP("Main")+sub_server = FastMCP("Sub")main.mount(sub_server, namespace="api")@main.tool(tags={"internal"})