FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: add CLI command flags reference to README by Br1an67 · Pull Request #2192 · modelcontextprotocol/python-sdk · GitHub

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
46 changes: 46 additions & 0 deletions README.v2.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,52 @@ uv run mcp run servers/direct_execution.py

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

### CLI Command Flags

Each `mcp` subcommand accepts specific flags:

**`mcp run`** — Run an MCP server directly:

| Flag | Short | Description |
|------|-------|-------------|
| `--transport` | `-t` | Transport protocol to use (`stdio`, `sse`, or `streamable-http`) |

```bash
# Run with default transport (stdio)
uv run mcp run server.py

# Run with streamable HTTP transport
uv run mcp run server.py -t streamable-http
```

**`mcp dev`** — Run with the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) for testing:

| Flag | Short | Description |
|------|-------|-------------|
| `--with-editable` | `-e` | Directory containing `pyproject.toml` to install in editable mode |
| `--with` | | Additional packages to install (can be repeated) |

```bash
uv run mcp dev server.py --with pandas --with numpy
uv run mcp dev server.py --with-editable .
```

**`mcp install`** — Install an MCP server in the Claude desktop app:

| Flag | Short | Description |
|------|-------|-------------|
| `--name` | `-n` | Custom name for the server |
| `--with-editable` | `-e` | Directory containing `pyproject.toml` to install in editable mode |
| `--with` | | Additional packages to install (can be repeated) |
| `--env-var` | `-v` | Environment variables in `KEY=VALUE` format (can be repeated) |
| `--env-file` | `-f` | Load environment variables from a `.env` file |

```bash
uv run mcp install server.py --name "My Server" -v API_KEY=abc123 -f .env
```

All commands accept a file spec in the form `server.py` or `server.py:app` (to specify the server object to import).

### Streamable HTTP Transport

> **Note**: Streamable HTTP transport is the recommended transport for production deployments. Use `stateless_http=True` and `json_response=True` for optimal scalability.
Expand Down

Back | FazBrowse Home | New Git URL