fastmcp.cli.cli
FastMCP CLI tools using Cyclopts.
Functions
with_argv 
version 
dev 
server_spec: Python file to run, optionally with :object suffix, or None to auto-detect fastmcp.json
run 
- Module approach: “server.py” - runs the module directly, looking for an object named ‘mcp’, ‘server’, or ‘app’
 - Import approach: “server.py:app” - imports and runs the specified server object
 - URL approach: “http://server-url” - connects to a remote server and creates a proxy
 - MCPConfig file: “mcp.json” - runs as a proxy server for the MCP Servers in the MCPConfig file
 - FastMCP config: “fastmcp.json” - runs server using FastMCP configuration
 - No argument: looks for fastmcp.json in current directory
 
server_spec: Python file, object specification (file:obj), config file, URL, or None to auto-detect
inspect 
Show text summary
fastmcp inspect server.pyOutput FastMCP format JSON to stdout
fastmcp inspect server.py —format fastmcpSave MCP protocol format to file (format required with -o)
fastmcp inspect server.py —format mcp -o manifest.jsonInspect from fastmcp.json configuration
fastmcp inspect fastmcp.json fastmcp inspect # auto-detect fastmcp.json Args:server_spec: Python file to inspect, optionally with :object suffix, or fastmcp.json
prepare 
- Creates a pyproject.toml with dependencies from the config
 - Installs all Python packages into a .venv
 - Prepares the source (git clone, download, etc.) unless —skip-source
 
- CI/CD pipelines with separate build and run stages
 - Docker images where you prepare during build
 - Production deployments where you want fast startup times
 

