Skip to content

Commit 0f9e229

Browse files
committed
docs: add CLI command flags reference to README
Document all available flags for `mcp run`, `mcp dev`, and `mcp install` subcommands, including the `-t/--transport` flag for `mcp run` which was previously undocumented. Fixes #457
1 parent 62575ed commit 0f9e229

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

README.v2.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,52 @@ uv run mcp run servers/direct_execution.py
12371237

12381238
Note that `uv run mcp run` or `uv run mcp dev` only supports server using MCPServer and not the low-level server variant.
12391239

1240+
### CLI Command Flags
1241+
1242+
Each `mcp` subcommand accepts specific flags:
1243+
1244+
**`mcp run`** — Run an MCP server directly:
1245+
1246+
| Flag | Short | Description |
1247+
|------|-------|-------------|
1248+
| `--transport` | `-t` | Transport protocol to use (`stdio`, `sse`, or `streamable-http`) |
1249+
1250+
```bash
1251+
# Run with default transport (stdio)
1252+
uv run mcp run server.py
1253+
1254+
# Run with streamable HTTP transport
1255+
uv run mcp run server.py -t streamable-http
1256+
```
1257+
1258+
**`mcp dev`** — Run with the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) for testing:
1259+
1260+
| Flag | Short | Description |
1261+
|------|-------|-------------|
1262+
| `--with-editable` | `-e` | Directory containing `pyproject.toml` to install in editable mode |
1263+
| `--with` | | Additional packages to install (can be repeated) |
1264+
1265+
```bash
1266+
uv run mcp dev server.py --with pandas --with numpy
1267+
uv run mcp dev server.py --with-editable .
1268+
```
1269+
1270+
**`mcp install`** — Install an MCP server in the Claude desktop app:
1271+
1272+
| Flag | Short | Description |
1273+
|------|-------|-------------|
1274+
| `--name` | `-n` | Custom name for the server |
1275+
| `--with-editable` | `-e` | Directory containing `pyproject.toml` to install in editable mode |
1276+
| `--with` | | Additional packages to install (can be repeated) |
1277+
| `--env-var` | `-v` | Environment variables in `KEY=VALUE` format (can be repeated) |
1278+
| `--env-file` | `-f` | Load environment variables from a `.env` file |
1279+
1280+
```bash
1281+
uv run mcp install server.py --name "My Server" -v API_KEY=abc123 -f .env
1282+
```
1283+
1284+
All commands accept a file spec in the form `server.py` or `server.py:app` (to specify the server object to import).
1285+
12401286
### Streamable HTTP Transport
12411287

12421288
> **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

Comments
 (0)