from mcp.server.fastmcp import FastMCP, you’re using FastMCP 1.0 — the version bundled with v1 of the mcp package. Upgrading to the standalone FastMCP framework is easy. For most servers, it’s a single import change.
@mcp.tool, @mcp.resource, and @mcp.prompt decorators, your mcp.run() call, and the rest of your server code all work as-is.
Install
mcp package as a dependency, so you don’t lose access to anything. Update your import, run your server, and if your tools work, you’re done.
Copy this prompt into any LLM along with your server code to get automated upgrade guidance.
What Might Need Updating
Most servers need nothing beyond the import change. Skim the sections below to see if any apply.Constructor Settings
If you passed transport settings likehost or port directly to FastMCP(), those now belong on run(). This keeps your server definition independent of how it’s deployed:
TypeError with a migration hint.
Prompts
If your prompt functions returnmcp.types.PromptMessage objects, you can upgrade to FastMCP’s simpler Message class. Or just return a plain string — it’s automatically wrapped as a user message:
Other mcp.* Imports
If your server imports directly from the mcp package — like import mcp.types or from mcp.server.stdio import stdio_server — those still work. FastMCP includes mcp as a dependency, so nothing breaks.
Where FastMCP provides its own API for the same thing, it’s worth switching over:
| mcp Package | FastMCP Equivalent |
|---|---|
mcp.types.TextContent(type="text", text=str(x)) | Just return x from your tool |
mcp.types.ImageContent(...) | from fastmcp.utilities.types import Image |
mcp.types.PromptMessage(...) | from fastmcp.prompts import Message |
from mcp.server.stdio import stdio_server | Not needed — mcp.run() handles transport |
mcp.* import is fine to keep.
Decorated Functions
In FastMCP 1.0,@mcp.tool returned a FunctionTool object. Now decorators return your original function unchanged — so decorated functions stay callable for testing, reuse, and composition:
.name, .description, or other attributes on the decorated result, that will need updating. This is uncommon — most servers don’t interact with the tool object directly. If you need the old behavior temporarily, set FASTMCP_DECORATOR_MODE=object to restore it (this compatibility setting is itself deprecated and will be removed in a future release).

