Install and use FastMCP servers in Claude Code
uv
commands.server.py
.
New in 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.
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:
claude mcp add
command.
--with
flag to specify packages your server needs. You can use this flag multiple times:
requirements.txt
file with all your dependencies, use --with-requirements
to install them:
--with-editable
to install them in editable mode:
--python
to specify which Python version your server requires. This ensures compatibility when your server needs specific Python features:
--project
to run your server within a specific project context. This tells uv
to use the project’s configuration files and virtual environment:
.env
file:
~/.claude/local/claude
) and uses the claude mcp add
command to register servers.“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
.