--- title: cli sidebarTitle: cli --- # `fastmcp.cli.cli` FastMCP CLI tools using Cyclopts. ## Functions ### `version` ```python version() ``` Display version information and platform details. ### `dev` ```python dev(server_spec: str) -> None ``` Run an MCP server with the MCP Inspector for development. **Args:** - `server_spec`: Python file to run, optionally with \:object suffix ### `run` ```python run(server_spec: str) -> None ``` Run an MCP server or connect to a remote one. The server can be specified in three ways: 1. Module approach: server.py - runs the module directly, looking for an object named 'mcp', 'server', or 'app' 2. Import approach: server.py:app - imports and runs the specified server object 3. URL approach: http://server-url - connects to a remote server and creates a proxy Server arguments can be passed after -- : fastmcp run server.py -- --config config.json --debug **Args:** - `server_spec`: Python file, object specification (file\:obj), or URL ### `inspect` ```python inspect(server_spec: str) -> None ``` Inspect an MCP server and generate a JSON report. This command analyzes an MCP server and generates a comprehensive JSON report containing information about the server's name, instructions, version, tools, prompts, resources, templates, and capabilities. **Examples:** fastmcp inspect server.py fastmcp inspect server.py -o report.json fastmcp inspect server.py:mcp -o analysis.json fastmcp inspect path/to/server.py:app -o /tmp/server-info.json **Args:** - `server_spec`: Python file to inspect, optionally with \:object suffix