|
54 | 54 | - [Development Mode](#development-mode) |
55 | 55 | - [Claude Desktop Integration](#claude-desktop-integration) |
56 | 56 | - [Direct Execution](#direct-execution) |
| 57 | + - [CLI Reference](#cli-reference) |
57 | 58 | - [Streamable HTTP Transport](#streamable-http-transport) |
58 | 59 | - [CORS Configuration for Browser-Based Clients](#cors-configuration-for-browser-based-clients) |
59 | 60 | - [Mounting to an Existing ASGI Server](#mounting-to-an-existing-asgi-server) |
@@ -1232,6 +1233,43 @@ uv run mcp run servers/direct_execution.py |
1232 | 1233 |
|
1233 | 1234 | Note that `uv run mcp run` or `uv run mcp dev` only supports server using MCPServer and not the low-level server variant. |
1234 | 1235 |
|
| 1236 | +### CLI Reference |
| 1237 | + |
| 1238 | +A complete reference for all `mcp` CLI commands and their flags. |
| 1239 | + |
| 1240 | +#### `mcp dev <file_spec>` |
| 1241 | + |
| 1242 | +Run an MCP server with the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) for interactive testing and debugging. |
| 1243 | + |
| 1244 | +| Flag | Short | Type | Description | |
| 1245 | +| -------------------- | ----- | ------ | ----------------------------------------------------------------- | |
| 1246 | +| `--with-editable` | `-e` | `PATH` | Directory containing `pyproject.toml` to install in editable mode | |
| 1247 | +| `--with` | | `TEXT` | Additional packages to install (repeatable) | |
| 1248 | + |
| 1249 | +#### `mcp run <file_spec>` |
| 1250 | + |
| 1251 | +Run an MCP server directly. The server can be specified as a module (`server.py`) or with an explicit object path (`server.py:app`). |
| 1252 | + |
| 1253 | +| Flag | Short | Type | Description | |
| 1254 | +| --------------- | ----- | ------------- | -------------------------------------------- | |
| 1255 | +| `--transport` | `-t` | `stdio\|sse` | Transport protocol to use (default: `stdio`) | |
| 1256 | + |
| 1257 | +#### `mcp install <file_spec>` |
| 1258 | + |
| 1259 | +Install an MCP server in the Claude Desktop app. Environment variables are preserved once set and only updated when new values are explicitly provided. |
| 1260 | + |
| 1261 | +| Flag | Short | Type | Description | |
| 1262 | +| -------------------- | ----- | ----------- | ----------------------------------------------------------------- | |
| 1263 | +| `--name` | `-n` | `TEXT` | Custom name for the server (defaults to file name) | |
| 1264 | +| `--with-editable` | `-e` | `PATH` | Directory containing `pyproject.toml` to install in editable mode | |
| 1265 | +| `--with` | | `TEXT` | Additional packages to install (repeatable) | |
| 1266 | +| `--env-var` | `-v` | `KEY=VALUE` | Environment variables in `KEY=VALUE` format (repeatable) | |
| 1267 | +| `--env-file` | `-f` | `PATH` | Load environment variables from a `.env` file | |
| 1268 | + |
| 1269 | +#### `mcp version` |
| 1270 | + |
| 1271 | +Print the installed MCP SDK version. |
| 1272 | + |
1235 | 1273 | ### Streamable HTTP Transport |
1236 | 1274 |
|
1237 | 1275 | > **Note**: Streamable HTTP transport is the recommended transport for production deployments. Use `stateless_http=True` and `json_response=True` for optimal scalability. |
|
0 commit comments