Installation Scopes
add-mcp supports two installation scopes: project and global. The scope determines where MCP server configurations are stored and how they’re shared.Overview
| Scope | Flag | Config Location | Use Case | Committed to Git |
|---|---|---|---|---|
| Project | (default) | .cursor/mcp.json, .vscode/mcp.json, etc. | Shared with team, project-specific servers | Yes (recommended) |
| Global | -g | ~/.cursor/mcp.json, ~/.config/opencode/opencode.json, etc. | Personal servers, available across all projects | No |
Project Scope (Default)
Project scope installs MCP servers to configuration files within your project directory.Characteristics
- Location: Config files in project directories (
.cursor/,.vscode/,.mcp.json, etc.) - Shared: Committed with your project to version control
- Use Case: Team collaboration, project-specific MCP servers
- Default Behavior: Automatically used when
-gflag is omitted
Example Project Paths
Installation
Smart Detection (Project Mode)
When you runadd-mcp without -g, the CLI automatically detects project-level agents:
- Scans the current directory for project config directories and files
- Detects agents with existing project configurations
- Pre-selects detected agents for installation
- Shows all project-capable agents for manual selection
.cursor/ and .vscode/ directories:
When to Use Project Scope
- Team Projects: Share MCP server configurations with your team
- Project-Specific Servers: MCP servers that are relevant to a specific project
- Version Control: Config should be committed and versioned
- Reproducibility: Ensure all team members have the same MCP setup
Global Scope (-g flag)
Global scope installs MCP servers to user-level configuration files in your home directory.
Characteristics
- Location: Config files in home directory (
~/,~/.config/, etc.) - Shared: Personal to your user account, not committed to Git
- Use Case: Personal MCP servers, available across all projects
- Activation: Use the
-gor--globalflag
Example Global Paths
Installation
Smart Detection (Global Mode)
When you runadd-mcp -g, the CLI automatically detects globally-installed agents:
- Scans your home directory for agent installation directories
- Detects all agents installed on your system (including global-only agents)
- Pre-selects detected agents for installation
- Shows all agents for manual selection
When to Use Global Scope
- Personal Servers: MCP servers you use across all projects
- Development Tools: Testing and development MCP servers
- Private Credentials: Servers requiring personal API keys or credentials
- Cross-Project Availability: Servers needed in every project
Global-Only Agents
Two agents only support global installation:Claude Desktop
- Global Path:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) - Project Support: None
- Note: Always installs globally, even without
-gflag
Goose
- Global Path:
~/.config/goose/config.yaml(Linux/macOS) or%APPDATA%\Block\goose\config\config.yaml(Windows) - Project Support: None
- Note: Always installs globally, even without
-gflag
Scope Selection
When you don’t specify-g and select agents that support project configuration, add-mcp will prompt you to choose the scope:
Skip the Prompt
Use-y to automatically use the default scope:
Mixed Scope Installations
When you select multiple agents, some may only support global config (like Claude Desktop and Goose), while others support both:Version Control Recommendations
Project Scope - Commit to Git
Project configurations should be committed to version control:Global Scope - Don’t Commit
Global configurations should NOT be committed to version control. They’re stored in your home directory and won’t be in your project..gitignore Support
Use the--gitignore flag to automatically add project config files to .gitignore if you don’t want to commit them:
--gitignore only works with project-scoped installations. It’s ignored when used with -g.
Detection Logic
The smart detection system uses different strategies based on scope:Project Detection
FromdetectProjectAgents() in agents.ts:381-397:
.cursordirectory → Cursor.vscodedirectory → VS Code, GitHub Copilot CLI.mcp.jsonfile → Claude Code.codexdirectory → Codex.geminidirectory → Gemini CLI.zeddirectory → Zedopencode.jsonor.opencode→ OpenCode
Global Detection
FromdetectAllGlobalAgents() in agents.ts:399-409:
~/.cursor→ Cursor~/Library/Application Support/Claude→ Claude Desktop (macOS)~/.codex→ Codex~/.gemini→ Gemini CLI~/.config/goose/config.yaml→ Goose~/.copilot→ GitHub Copilot CLI~/.config/opencode→ OpenCode~/Library/Application Support/Code/User→ VS Code (macOS)~/Library/Application Support/Zed→ Zed (macOS)- Platform-specific paths for Linux and Windows
Examples
Project Installation
Global Installation
Mixed Installation
Related Pages
- Agents - See which agents support project vs global config
- Transports - Learn about HTTP, SSE, and stdio transports