optional-skills/mcp/fastmcp/references/fastmcp-cli.md
Use this file when the task needs exact FastMCP CLI workflows rather than the higher-level guidance in SKILL.md.
pip install fastmcp
fastmcp version
FastMCP documents pip install fastmcp and fastmcp version as the baseline installation and verification path.
Run a server object from a Python file:
fastmcp run server.py:mcp
Run the same server over HTTP:
fastmcp run server.py:mcp --transport http --host 127.0.0.1 --port 8000
Inspect what FastMCP will expose:
fastmcp inspect server.py:mcp
This is also the check FastMCP recommends before deploying to Prefect Horizon.
List tools from a Python file:
fastmcp list server.py --json
List tools from an HTTP endpoint:
fastmcp list http://127.0.0.1:8000/mcp --json
Call a tool with key-value arguments:
fastmcp call server.py search_resources query=router limit=5 --json
Call a tool with a full JSON input payload:
fastmcp call server.py create_item '{"name": "Widget", "tags": ["sale"]}' --json
Find named servers already configured in local MCP-aware tools:
fastmcp discover
FastMCP documents name-based resolution for Claude Desktop, Claude Code, Cursor, Gemini, Goose, and ./mcp.json.
Register a server with common clients:
fastmcp install claude-code server.py
fastmcp install claude-desktop server.py
fastmcp install cursor server.py -e .
FastMCP notes that client installs run in isolated environments, so declare dependencies explicitly when needed with flags such as --with, --env-file, or editable installs.
Before pushing to Horizon:
fastmcp inspect server.py:mcp
FastMCP’s Horizon docs expect:
requirements.txt or pyproject.tomlmain.py:mcpBefore shipping to any other host:
fastmcp list against the local /mcp URL.fastmcp call.