TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/neon-solutions/add-mcp/llms.txt
Use this file to discover all available pages before exploring further.
add command is the default action of add-mcp — you run it simply by passing a target directly to npx add-mcp. It installs an MCP server (remote URL, npm package, or shell command) into the configuration files of your chosen AI coding agents, either at the project level or globally.
Usage
<target> can be a remote URL (HTTP or SSE), an npm package name, or a shell command (for stdio-based servers). When no target is supplied, the CLI displays the help banner and exits.
Options
Install to the user-level (global) config directory instead of the current project directory. Use this when you want the server available across all your projects.
Specify one or more agents to install to (e.g.
-a cursor -a claude-code). Run npx add-mcp list-agents for all valid values. Can be repeated. When omitted, the CLI auto-detects agents from your project or prompts for selection.Override the server name written to the config file. When not provided, the name is auto-inferred from the target (e.g.
context7 from https://mcp.context7.com/mcp).Transport type for remote servers. Accepts
http (default, streamable HTTP) or sse. Use --transport sse for servers that use the legacy Server-Sent Events protocol. Has no effect on local (stdio) targets.Alias for
--transport. Both flags are interchangeable.Add an HTTP header for remote servers, in
Key: Value format. Repeatable for multiple headers. Supports ${VAR} placeholders — interactive installs will prompt for each variable; use single quotes to prevent your shell from expanding them early (e.g. --header 'Authorization: Bearer ${TOKEN}'). Only applies to remote targets.Set an environment variable for stdio servers, in
KEY=VALUE format. Repeatable. Supports ${VAR} placeholders. Use single quotes to prevent shell expansion. Only applies to local (npm package or command) targets.Pass an additional argument to a stdio server. Repeatable. Supports
${VAR} placeholders. Only applies to local targets.Skip all interactive confirmation prompts. The CLI installs to auto-detected agents (or all project-capable agents if none are detected) without asking. Template variable placeholders are inserted as-is (e.g.
<your-value-here>).Install to all 15 supported agents at once. Agents that do not support the chosen transport are skipped with a warning rather than causing an error.
Automatically append the generated project-level config file paths (e.g.
.cursor/mcp.json) to your .gitignore. Ignored when --global is also set.Transport types
add-mcp supports all three MCP transport types. The transport is chosen automatically for local targets and can be controlled with --transport for remote targets.
| Transport | Flag | Description |
|---|---|---|
| HTTP | --transport http (default) | Streamable HTTP — the current MCP standard for remote servers |
| SSE | --transport sse | Server-Sent Events — deprecated by the MCP spec but still supported by many servers |
| stdio | (automatic) | Used for all npm packages and shell commands — no flag needed |
Most modern agents (Cursor, OpenCode, Claude Code, etc.) do not require the
type field to be written to their config. add-mcp handles the per-agent format differences automatically.Smart agent detection
When you don’t pass-a or --all, the CLI detects agents automatically:
- Project mode (default) — scans the current directory for config files (
.cursor/mcp.json,.mcp.json,.vscode/mcp.json, etc.) and pre-selects any it finds. - Global mode (
-g) — checks for globally installed agents (Claude Desktop, Codex, Zed, etc.) and pre-selects them. - No agents detected — in interactive mode, you are prompted to choose from all supported agents; with
-y, all project-capable agents are targeted automatically.