You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: README.v2.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1237,6 +1237,52 @@ uv run mcp run servers/direct_execution.py
1237
1237
1238
1238
Note that `uv run mcp run` or `uv run mcp dev` only supports server using MCPServer and not the low-level server variant.
1239
1239
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
+
1240
1286
### Streamable HTTP Transport
1241
1287
1242
1288
> **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