Conversation
Rewrites the upgrade guide with educational context for each breaking change, adds an LLM migration prompt users can copy into any AI assistant, and covers previously missing items (removed constructor kwargs, module path deprecations, import_server deprecation).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7910d62241
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - Transport settings: host, port, log_level, debug, sse_path, message_path, streamable_http_path, json_response, stateless_http | ||
| Fix: pass to run() or run_http_async() instead, e.g. mcp.run(transport="http", host="0.0.0.0", port=8080) |
There was a problem hiding this comment.
Route
message_path migration to env var, not run kwargs
This guidance groups message_path with kwargs that should be passed to run()/run_http_async(), but run_http_async does not accept a message_path parameter (src/fastmcp/server/mixins/transport.py, signature at run_http_async), and the library’s own removal hint for constructor message_path says to set FASTMCP_MESSAGE_PATH (src/fastmcp/server/server.py, _REMOVED_KWARGS). For users migrating v2 SSE servers with a custom message path, following this text will raise TypeError instead of preserving behavior.
Useful? React with 👍 / 👎.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReplaces Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Split message_path from other transport kwargs (env-var only, not a run() kwarg), move decorator change to breaking changes in the LLM prompt since accessing component attributes will crash, and add DiskStore/OAuth storage change to the prompt's numbered list.
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/development/upgrade-guide.mdx (1)
196-207:⚠️ Potential issue | 🟡 Minor"After" block is missing required imports.
httpxandOpenAPIProviderare used but never imported, making the example non-runnable. The import path forOpenAPIProvidershould also match the new module location introduced in the deprecations section (fastmcp.server.providers.openapi). As per coding guidelines, code examples must include all necessary imports for full runnable blocks.✏️ Proposed fix
# After +import httpx +from fastmcp.server.providers.openapi import OpenAPIProvider + client = httpx.AsyncClient(base_url="https://api.example.com", timeout=60) provider = OpenAPIProvider(spec, client)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/development/upgrade-guide.mdx` around lines 196 - 207, The code example is missing imports; update the "After" block to include importing httpx and OpenAPIProvider from its new module path (fastmcp.server.providers.openapi) so the snippet is runnable: add an import for httpx (or httpx.AsyncClient) and an import for OpenAPIProvider (from fastmcp.server.providers.openapi) before creating the client and provider, and ensure the example uses those imported symbols (httpx.AsyncClient and OpenAPIProvider).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/development/upgrade-guide.mdx`:
- Around line 192-194: Add a concrete before-and-after code example showing how
to migrate from WSTransport to StreamableHttpTransport: insert a runnable
snippet that imports WSTransport and demonstrates creating the old transport
(e.g., WSTransport("ws://localhost:8000/ws")), then the corresponding "After"
snippet that imports StreamableHttpTransport and constructs it (e.g.,
StreamableHttpTransport("http://localhost:8000/mcp")), ensuring the example is
complete and consistent with the surrounding MDX code style and fenced code
block formatting so readers can copy and run it directly; reference the symbols
WSTransport and StreamableHttpTransport when editing the docs.
- Around line 100-102: Wrap the sentence that warns about re-introducing the
vulnerable diskcache package (the line mentioning opting into DiskStore via "pip
install 'py-key-value-aio[disk]'" and the note that it "re-introduces the
vulnerable `diskcache` package") inside the MDX <Warning> callout component;
specifically locate the mention of DiskStore and FileTreeStore and replace the
inline prose with a <Warning> block that clearly states this is a
security-sensitive action and the CVE risk, preserving the existing text "pip
install 'py-key-value-aio[disk]'" and references to DiskStore/FileTreeStore so
readers and link targets remain unchanged.
- Around line 265-279: The docs note that FastMCPOpenAPI is deprecated but lack
a concrete migration example; add a before/after runnable code block
demonstrating how callers of FastMCPOpenAPI(spec, client, name=...) should
migrate to using FastMCP with an OpenAPIProvider: show the deprecated import and
instantiation of FastMCPOpenAPI for the "Before" snippet, and in the "After"
snippet import OpenAPIProvider and FastMCP, create an OpenAPIProvider(spec,
httpx.AsyncClient(...)) (or equivalent client), and pass it into FastMCP(name,
providers=[provider]) so readers can copy a complete working pattern; reference
the symbols FastMCPOpenAPI, OpenAPIProvider, and FastMCP in the example and
ensure it's runnable (includes creating the HTTP client) and placed immediately
after the existing note about deprecation.
- Around line 15-69: Replace the undefined <Prompt> callout with a standard
Mintlify callout like <Note> for the block (lines ~15–69) so the component
renders; update the ToolTransform example to use the correct constructor shape
by importing ToolTransform and ToolTransformConfig and calling
mcp.add_transform(ToolTransform({ "my_tool": ToolTransformConfig(...) }))
instead of the invalid ToolTransform({"name": config}) pattern; add a concise
before/after code snippet showing removal of WSTransport and the recommended
replacement StreamableHttpTransport (referencing WSTransport and
StreamableHttpTransport) in the WSTransport section; add the missing imports and
usage for httpx.AsyncClient and OpenAPIProvider (import httpx and from
fastmcp.server.providers.openapi import OpenAPIProvider and pass the AsyncClient
to OpenAPIProvider) in the OpenAPI timeout example; and append a visible warning
callout next to the OAuth STORAGE disk cache note when suggesting pip install
'py-key-value-aio[disk]' and reference DiskStore and FileTreeStore so readers
see the security implication and the safer default.
---
Outside diff comments:
In `@docs/development/upgrade-guide.mdx`:
- Around line 196-207: The code example is missing imports; update the "After"
block to include importing httpx and OpenAPIProvider from its new module path
(fastmcp.server.providers.openapi) so the snippet is runnable: add an import for
httpx (or httpx.AsyncClient) and an import for OpenAPIProvider (from
fastmcp.server.providers.openapi) before creating the client and provider, and
ensure the example uses those imported symbols (httpx.AsyncClient and
OpenAPIProvider).
| <Prompt description="Copy this prompt into any LLM along with your server code to get automated migration guidance."> | ||
| You are migrating a FastMCP v2 server to FastMCP v3.0. Analyze the provided code and identify every change needed. The full upgrade guide is at https://gofastmcp.com/development/upgrade-guide — fetch it for complete context. | ||
|
|
||
| #### OAuth Storage Backend Changed (diskcache CVE) | ||
| BREAKING CHANGES (will crash at import or runtime): | ||
|
|
||
| The default OAuth storage has moved from `DiskStore` to `FileTreeStore` to address a pickle deserialization vulnerability in diskcache ([CVE-2025-69872](https://github.com/jlowin/fastmcp/issues/3166)). | ||
| 1. IMPORT: "from mcp.server.fastmcp import FastMCP" must become "from fastmcp import FastMCP" | ||
|
|
||
| If you were using the default storage (i.e., not passing an explicit `client_storage`), clients will need to re-register on their first connection after upgrading. This happens automatically — no user action required, and it's the same flow that already occurs whenever a server restarts with in-memory storage. No code changes needed. | ||
| 2. CONSTRUCTOR KWARGS REMOVED: FastMCP() no longer accepts these kwargs (raises TypeError): | ||
| - Transport settings: host, port, log_level, debug, sse_path, streamable_http_path, json_response, stateless_http | ||
| Fix: pass to run() or run_http_async() instead, e.g. mcp.run(transport="http", host="0.0.0.0", port=8080) | ||
| - message_path: set via environment variable FASTMCP_MESSAGE_PATH only (not a run() kwarg) | ||
| - Duplicate handling: on_duplicate_tools, on_duplicate_resources, on_duplicate_prompts | ||
| Fix: use unified on_duplicate= parameter | ||
| - Tool settings: tool_serializer, include_tags, exclude_tags, tool_transformations | ||
| Fix: use ToolResult returns, server.enable()/disable(), server.add_transform() | ||
|
|
||
| If you were passing a `DiskStore` explicitly, you have two options: | ||
| 3. COMPONENT METHODS REMOVED: | ||
| - tool.enable()/disable() raises NotImplementedError | ||
| Fix: server.disable(names={"tool_name"}, components={"tool"}) or server.disable(tags={"tag"}) | ||
| - get_tools()/get_resources()/get_prompts()/get_resource_templates() removed | ||
| Fix: use list_tools()/list_resources()/list_prompts()/list_resource_templates() — these return lists, not dicts | ||
|
|
||
| 1. **Keep using DiskStore** by adding the dependency yourself. This re-introduces the vulnerable `diskcache` package into your dependency tree: | ||
| 4. ASYNC STATE: ctx.set_state() and ctx.get_state() are now async (must be awaited). | ||
| State values must be JSON-serializable unless serializable=False is passed. | ||
|
|
||
| ```bash | ||
| pip install 'py-key-value-aio[disk]' | ||
| ``` | ||
| 5. PROMPTS: mcp.types.PromptMessage replaced by fastmcp.prompts.Message. | ||
| Before: PromptMessage(role="user", content=TextContent(type="text", text="Hello")) | ||
| After: Message("Hello") # role defaults to "user", accepts plain strings | ||
|
|
||
| 2. **Switch to FileTreeStore** (recommended) or any other [storage backend](/servers/storage-backends): | ||
| 6. AUTH PROVIDERS: No longer auto-load from env vars. Pass client_id, client_secret explicitly via os.environ. | ||
|
|
||
| ```python | ||
| from pathlib import Path | ||
| from key_value.aio.stores.filetree import ( | ||
| FileTreeStore, | ||
| FileTreeV1KeySanitizationStrategy, | ||
| FileTreeV1CollectionSanitizationStrategy, | ||
| ) | ||
| 7. WSTRANSPORT: Removed. Use StreamableHttpTransport. | ||
|
|
||
| storage_dir = Path("/var/lib/fastmcp/oauth") | ||
| store = FileTreeStore( | ||
| data_directory=storage_dir, | ||
| key_sanitization_strategy=FileTreeV1KeySanitizationStrategy(storage_dir), | ||
| collection_sanitization_strategy=FileTreeV1CollectionSanitizationStrategy(storage_dir), | ||
| ) | ||
| ``` | ||
| 8. OPENAPI: timeout parameter removed from OpenAPIProvider. Set timeout on the httpx.AsyncClient instead. | ||
|
|
||
| 9. METADATA: Namespace changed from "_fastmcp" to "fastmcp" in tool.meta. The include_fastmcp_meta parameter is removed (always included). | ||
|
|
||
| #### WSTransport Removed | ||
| 10. ENV VAR: FASTMCP_SHOW_CLI_BANNER renamed to FASTMCP_SHOW_SERVER_BANNER. | ||
|
|
||
| Use `StreamableHttpTransport` instead. | ||
| 11. DECORATORS: @mcp.tool, @mcp.resource, @mcp.prompt now return the original function, not a component object. Code that accesses .name, .description, or other component attributes on the decorated result will crash with AttributeError. | ||
| Fix: set FASTMCP_DECORATOR_MODE=object for v2 compat (itself deprecated). | ||
|
|
||
| 12. OAUTH STORAGE: Default OAuth client storage changed from DiskStore to FileTreeStore due to pickle deserialization vulnerability in diskcache (CVE-2025-69872). Clients using default storage will re-register automatically on first connection. If using DiskStore explicitly, switch to FileTreeStore or add pip install 'py-key-value-aio[disk]'. | ||
|
|
||
| DEPRECATIONS (still work but emit warnings): | ||
|
|
||
| - mount(prefix="x") -> mount(namespace="x") | ||
| - import_server(sub) -> mount(sub) | ||
| - FastMCP.as_proxy(url) -> from fastmcp.server import create_proxy; create_proxy(url) | ||
| - from fastmcp.server.proxy -> from fastmcp.server.providers.proxy | ||
| - from fastmcp.server.openapi import FastMCPOpenAPI -> from fastmcp.server.providers.openapi import OpenAPIProvider; use FastMCP("name", providers=[OpenAPIProvider(...)]) | ||
| - mcp.add_tool_transformation(name, cfg) -> from fastmcp.server.transforms import ToolTransform; mcp.add_transform(ToolTransform(...)) | ||
|
|
||
| For each issue found, show the original line, explain why it breaks, and provide the corrected code. | ||
| </Prompt> |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check for Prompt component definition and examine the actual file
echo "=== Checking for custom component definitions ==="
find docs -type f \( -name "*.json" -o -name "*.ts" -o -name "*.tsx" -o -name "*.js" \) | head -20 | xargs grep -l "Prompt" 2>/dev/null || echo "No component defs found"
echo ""
echo "=== Checking docs configuration files ==="
find docs -maxdepth 2 \( -name "*.json" -o -name "*.config.*" \) -exec ls -la {} \;
echo ""
echo "=== Reading the upgrade-guide.mdx file ==="
wc -l docs/development/upgrade-guide.mdx
head -80 docs/development/upgrade-guide.mdxRepository: jlowin/fastmcp
Length of output: 5068
🏁 Script executed:
#!/bin/bash
# Search for Prompt usage and component files in the project
echo "=== All MDX files in docs ==="
find docs -name "*.mdx" -o -name "*.md" | head -20
echo ""
echo "=== Search for Prompt component usage ==="
rg '<Prompt' --include="*.mdx" --include="*.md" -n
echo ""
echo "=== Check for custom component registration ==="
rg -n 'components\|Prompt\|<' docs -t json | head -30
echo ""
echo "=== Check ToolTransform usage in source ==="
fd -t f -e py | xargs rg 'ToolTransform' -A 3 2>/dev/null | head -50Repository: jlowin/fastmcp
Length of output: 4756
🏁 Script executed:
#!/bin/bash
# Extract specific lines from the upgrade guide to verify code examples
echo "=== Lines 192-210 (WSTransport and OpenAPI sections) ==="
sed -n '192,210p' docs/development/upgrade-guide.mdx
echo ""
echo "=== Lines 280-295 (ToolTransform section) ==="
sed -n '280,295p' docs/development/upgrade-guide.mdx
echo ""
echo "=== Lines 98-110 (CVE-2025-69872 reference) ==="
sed -n '98,110p' docs/development/upgrade-guide.mdxRepository: jlowin/fastmcp
Length of output: 2349
🏁 Script executed:
#!/bin/bash
# Find ToolTransform and ToolTransformConfig definitions
echo "=== Search for ToolTransform class definition ==="
fd -t f -e py | xargs grep -l 'class ToolTransform' | head -5
echo ""
echo "=== Extract ToolTransform constructor ==="
fd -t f -e py | xargs grep -A 10 'class ToolTransform' 2>/dev/null | head -30
echo ""
echo "=== Search for ToolTransformConfig ==="
fd -t f -e py | xargs grep -l 'class ToolTransformConfig' | head -5
echo ""
echo "=== Extract ToolTransformConfig constructor ==="
fd -t f -e py | xargs grep -A 10 'class ToolTransformConfig' 2>/dev/null | head -40Repository: jlowin/fastmcp
Length of output: 2853
🏁 Script executed:
#!/bin/bash
# Check docs configuration and component definitions
echo "=== Read docs.json for configuration ==="
head -100 docs/docs.json
echo ""
echo "=== Search for any custom component files ==="
find docs -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.jsx" -o -name "*.js" \)
echo ""
echo "=== Check if Prompt is defined as HTML/React component ==="
fd -t f \( -name "*.mdx" -o -name "*.tsx" -o -name "*.jsx" \) | xargs grep -l 'export.*Prompt\|function.*Prompt\|const.*Prompt' 2>/dev/nullRepository: jlowin/fastmcp
Length of output: 2863
🏁 Script executed:
#!/bin/bash
# Verify the imports needed for OpenAPI and ToolTransform examples
echo "=== Check imports in fastmcp server module ==="
fd -t f -e py -path "*/fastmcp/server*" | xargs grep -n 'from.*ToolTransform\|import.*ToolTransform' 2>/dev/null | head -20
echo ""
echo "=== Check OpenAPIProvider imports ==="
fd -t f -e py | xargs grep -l 'class OpenAPIProvider' | head -3
echo ""
echo "=== Check imports/exports in __init__ files ==="
fd -t f -name "__init__.py" -path "*/fastmcp/server*" -exec cat {} \;Repository: jlowin/fastmcp
Length of output: 658
🏁 Script executed:
#!/bin/bash
# Get full ToolTransform constructor signature
echo "=== Full ToolTransform class definition ==="
sed -n '/^class ToolTransform/,/^class /p' src/fastmcp/server/transforms/tool_transform.py | head -40
echo ""
echo "=== Look for __init__ method ==="
grep -A 20 'def __init__' src/fastmcp/server/transforms/tool_transform.py
echo ""
echo "=== Check OpenAPIProvider location and imports ==="
cat src/fastmcp/server/providers/openapi/provider.py | head -50
echo ""
echo "=== Look for standard Mintlify callout components in docs ==="
grep -r '<Note\|<Warning\|<Info\|<Tip\|<Check\|<Callout' docs --include="*.mdx" | head -10Repository: jlowin/fastmcp
Length of output: 4343
🏁 Script executed:
#!/bin/bash
# Check what components are actually used in the upgrade guide
echo "=== All components used in upgrade-guide.mdx ==="
grep -o '<[A-Z][a-zA-Z]*' docs/development/upgrade-guide.mdx | sort | uniq -c
echo ""
echo "=== Check Mintlify documentation for available components ==="
web_search "Mintlify components list official documentation"Repository: jlowin/fastmcp
Length of output: 253
🏁 Script executed:
#!/bin/bash
# Examine the actual section with ToolTransform in the upgrade guide
echo "=== Full Deprecations section with ToolTransform ==="
sed -n '270,300p' docs/development/upgrade-guide.mdx
echo ""
echo "=== Check what add_transform expects ==="
fd -t f -e py -path "*/fastmcp/server*" | xargs grep -B 2 -A 10 'def add_transform' 2>/dev/null | head -50
echo ""
echo "=== Verify httpx and OpenAPIProvider are imported in the codebase ==="
head -30 src/fastmcp/server/providers/openapi/provider.pyRepository: jlowin/fastmcp
Length of output: 1999
🏁 Script executed:
#!/bin/bash
# Final verification: check if <Prompt> is registered anywhere in the project
echo "=== Search for Prompt component registration in entire docs ==="
grep -r 'Prompt' docs --include="*.json" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" 2>/dev/null | grep -v node_modules | head -20
echo ""
echo "=== Check all MDX files that use Prompt ==="
grep -r '<Prompt' docs --include="*.mdx" | head -20Repository: jlowin/fastmcp
Length of output: 319
🌐 Web query:
Mintlify custom components guide documentation
💡 Result:
Key Mintlify docs for custom components (React/JSX in MDX):
- React components in MDX (how to write components directly in an
.mdxpage, plus rules around importing reusable components from thesnippets/folder). [1] - Reusable snippets / JSX snippets (how to create reusable
.mdxsnippets and reusable.jsx“JSX snippets” insnippets/, then import and render them in pages). [2] - Built-in component library overview (what you can use without custom code: Tabs, Steps, Cards, Callouts, etc.). [3]
- Custom scripts (custom CSS/JS + Tailwind styling notes) (how to add site-wide styling and scripts; Tailwind v3 classes; when to use
styleprop). [4]
Typical pattern: put reusable React components in snippets/*.jsx, export them, then import { MyComponent } from '/snippets/MyComponent.jsx' and render <MyComponent /> in your MDX page. [1][2]
Sources: [1][2][3][4]
Replace <Prompt> with a standard callout component (e.g., <Note> or <Info>), verify ToolTransform API usage, and add missing imports and code examples.
The <Prompt> component used on line 15 is not defined in the Mintlify component registry or anywhere in the project. It will fail to build or render as unstyled text, causing lines 15–69 to display incorrectly. Use a standard Mintlify callout like <Note> instead.
The add_tool_transformation() → add_transform() deprecation code is incorrect. The example shows ToolTransform({"name": config}) but the actual constructor signature is ToolTransform(transforms: dict[str, ToolTransformConfig]), where keys are original tool names and values are ToolTransformConfig objects. Correct it to:
# New
from fastmcp.server.transforms import ToolTransform
from fastmcp.tools.tool_transform import ToolTransformConfig
mcp.add_transform(ToolTransform({
"my_tool": ToolTransformConfig(name="renamed_tool")
}))The WSTransport removed section (lines 192–194) provides only text description with no code example. Add a before/after block showing the removal.
The OpenAPI timeout parameter removed code example (lines 200–207) uses httpx.AsyncClient and OpenAPIProvider without importing them. Add imports at the top:
import httpx
from fastmcp.server.providers.openapi import OpenAPIProvider
# After
client = httpx.AsyncClient(base_url="https://api.example.com", timeout=60)
provider = OpenAPIProvider(spec, client)Add a warning callout in the OAUTH STORAGE section (line 102) when mentioning pip install 'py-key-value-aio[disk]' to re-introduce the vulnerable diskcache package.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/development/upgrade-guide.mdx` around lines 15 - 69, Replace the
undefined <Prompt> callout with a standard Mintlify callout like <Note> for the
block (lines ~15–69) so the component renders; update the ToolTransform example
to use the correct constructor shape by importing ToolTransform and
ToolTransformConfig and calling mcp.add_transform(ToolTransform({ "my_tool":
ToolTransformConfig(...) })) instead of the invalid ToolTransform({"name":
config}) pattern; add a concise before/after code snippet showing removal of
WSTransport and the recommended replacement StreamableHttpTransport (referencing
WSTransport and StreamableHttpTransport) in the WSTransport section; add the
missing imports and usage for httpx.AsyncClient and OpenAPIProvider (import
httpx and from fastmcp.server.providers.openapi import OpenAPIProvider and pass
the AsyncClient to OpenAPIProvider) in the OpenAPI timeout example; and append a
visible warning callout next to the OAuth STORAGE disk cache note when
suggesting pip install 'py-key-value-aio[disk]' and reference DiskStore and
FileTreeStore so readers see the security implication and the safer default.
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@docs/development/upgrade-guide.mdx`:
- Around line 214-221: The "After" example is missing imports for httpx and
OpenAPIProvider which makes the snippet non-runnable; add imports for httpx and
for OpenAPIProvider (e.g., from fastmcp.server.providers.openapi import
OpenAPIProvider) at the top of the code block so the used symbols
httpx.AsyncClient and OpenAPIProvider(spec, client) are defined alongside the
existing spec and client variables.
- Around line 15-69: The MDX uses a custom JSX component <Prompt> but there is
no import or definition for Prompt, which will break the build or render as
plain text; fix by either creating and exporting a Prompt component (e.g.,
export default or named export Prompt in your snippets file) or import the
existing component at the top of the MDX (e.g., add an import like import {
Prompt } from '/snippets/Prompt.jsx' or the correct snippet path), and ensure
any usages of <Prompt> match the exported name (Prompt) so the component is
resolvable during build.
- Around line 306-315: The example for the ToolTransform migration is ambiguous
and non-runnable: replace the placeholder usage of "name" and undefined config
with a concrete ToolTransformConfig import and a real config object, e.g. import
ToolTransform and ToolTransformConfig, then call
mcp.add_transform(ToolTransform({"my_tool":
ToolTransformConfig(name="renamed_tool")})) so the example includes all
necessary imports and a clear tool key; update the code snippet to import
ToolTransform from fastmcp.server.transforms and ToolTransformConfig from its
module and show mcp.add_transform usage instead of add_tool_transformation.
The upgrade guide was missing some significant v3 breaking changes and read like a sparse changelog rather than something that helps people actually migrate. This rewrites it to be educational and complete.
What changed:
FastMCP("server", host="0.0.0.0", port=8080)was probably the most common v2 HTTP patternimport_server(), module path changes for proxy/openapi,FastMCPOpenAPIclassTypeErrors (include_tags,exclude_tags,tool_serializer)components=["tool"]→components={"tool"}to match actual type annotationinclude_fastmcp_metaremoval means metadata can no longer be suppressedLLM migration prompt:
Added a
<Prompt>component (Mintlify's copyable prompt widget) at the top of the v3 section. Users can copy it into any LLM alongside their server code for automated migration guidance. The prompt is self-contained with numbered categories, inline fix instructions, and a link to the full guide for edge cases.Summary by CodeRabbit