Skip to main content

Global Options

-g, --global
boolean
Install globally (user-level) instead of project-level.When this flag is set, the MCP server is installed to the user’s home directory configuration rather than the current project directory.Default: false (project-level installation)Example:
npx add-mcp https://mcp.example.com/mcp -g
-a, --agent
string
Specify agents to install to. This option can be repeated to target multiple agents.Valid agent values: cursor, claude-code, vscode, opencode, codex, claude-desktop, gemini-cli, goose, github-copilot-cli, zedExample:
# Single agent
npx add-mcp https://mcp.example.com/mcp -a cursor

# Multiple agents
npx add-mcp https://mcp.example.com/mcp -a cursor -a claude-code
-n, --name
string
Server name to use in the configuration.If not provided, the name is auto-inferred from the target (URL or package name).Example:
npx add-mcp @modelcontextprotocol/server-postgres --name postgres
-t, --transport
string
Transport type for remote servers.Valid values: http, sseDefault: http (for remote servers)Note: Local servers (npm packages, commands) always use stdio transport.Example:
npx add-mcp https://mcp.example.com/sse --transport sse
--type
string
Alias for --transport.Valid values: http, sseExample:
npx add-mcp https://mcp.example.com/mcp --type http
--header
string
HTTP header for remote servers. This option can be repeated for multiple headers.Format: Key: ValueNote: Only applicable for remote server URLs.Example:
# Single header
npx add-mcp https://mcp.example.com/mcp --header "Authorization: Bearer $TOKEN"

# Multiple headers
npx add-mcp https://mcp.example.com/mcp \
  --header "Authorization: Bearer $TOKEN" \
  --header "X-Custom-Header: value"
-y, --yes
boolean
Skip confirmation prompts and proceed with installation automatically.Default: false (prompts for confirmation)Example:
npx add-mcp https://mcp.example.com/mcp -y
--all
boolean
Install to all agents.When this flag is set, the MCP server is installed to all supported agents. The CLI will skip agents that don’t support the required transport type with a warning.Example:
# Install to all agents, globally, without prompts
npx add-mcp mcp-server-github --all -g -y
--gitignore
boolean
Add generated project config files to .gitignore.Note: Only supported for project-scoped installations (not with -g).Example:
npx add-mcp https://mcp.example.com/mcp -a cursor -y --gitignore

Installation Scope

ScopeFlagLocationUse Case
Project(default).cursor/mcp.json etc.Committed with your project, shared with team
Global-g~/.cursor/mcp.jsonAvailable across all projects

Transport Types

TransportFlagDescription
HTTP--transport httpStreamable HTTP (default)
SSE--transport sseServer-Sent Events (deprecated by MCP but still used)
Local servers (npm packages, commands) always use stdio transport.

Build docs developers (and LLMs) love