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
@@ -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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs: add CLI command flags reference to README #2192
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
docs: add CLI command flags reference to README #2192
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing