Skip to main content

Documentation 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.

When you run add-mcp without specifying an agent, it doesn’t ask you to pick from a blank list — it scans your environment first. This smart detection step finds which AI coding agents are active in your current directory (or on your machine globally) and pre-selects them in the interactive prompt, so the right agents are already checked before you press Enter.

How detection works

Detection logic differs based on whether you are installing in project scope (the default) or global scope (-g).
add-mcp scans the current directory for agent config markers. Each agent has a set of paths it looks for — for example, Cursor is detected when .cursor/ exists, Claude Code when .mcp.json or .claude/ is present, and VS Code / GitHub Copilot CLI when .vscode/ exists.Detected agents appear at the top of the multi-select list with a project hint and are pre-checked. You can deselect them or add others before confirming.Detected project markers by agent:
AgentDetection paths
Claude Code.mcp.json, .claude/
Codex.codex/
Cursor.cursor/
Gemini CLI.gemini/
GitHub Copilot CLI.vscode/
MCPorterconfig/mcporter.json
OpenCodeopencode.json, .opencode/
VS Code.vscode/
Zed.zed/
Agents that are global-only (Antigravity, Cline, Cline CLI, Claude Desktop, Goose, Windsurf) are never detected in project mode but still appear in the list so you can select them manually.

Last-selection memory

add-mcp remembers the agents you chose the last time you ran an install. This selection is persisted to ~/.config/add-mcp/config.json (respecting $XDG_CONFIG_HOME) and used as the default pre-selection the next time no agents are detected. In the multi-select prompt, previously chosen agents that were not detected in the current environment appear below detected agents with a · selected last time hint, making it easy to spot them.
The last-selection memory is used as a fallback only when no agents are detected. Detected agents always take priority and are pre-selected regardless of the saved state.

Bypassing detection explicitly

If you already know which agents you want, pass -a one or more times. This skips detection and the interactive prompt entirely:
# Bypass detection — install directly to Cursor and Claude Code
npx add-mcp https://mcp.example.com/mcp -a cursor -a claude-code

# Same, globally, non-interactive
npx add-mcp https://mcp.example.com/mcp -a cursor -a claude-code -g -y

The --all flag

--all installs to every supported agent at once, completely bypassing both detection and the interactive prompt:
# Install to all agents, project scope where supported
npx add-mcp mcp-server-github --all

# Install to all agents, globally, no prompts
npx add-mcp mcp-server-github --all -g -y
Use --all --gitignore when you want a broad install across all project-capable agents without committing any of the generated config files to version control.
npx add-mcp https://mcp.example.com/mcp --all --gitignore -y

Detection in the programmatic API

You can run the same detection logic from your own tooling using the exported functions:
import { detectProjectAgents, detectGlobalAgents } from "add-mcp";

// Returns AgentType[] of agents with project config in /my/project
const projectAgents = detectProjectAgents("/my/project");

// Returns AgentType[] of globally installed agents
const globalAgents = await detectGlobalAgents();
Both functions return an array of AgentType strings (e.g. ["cursor", "claude-code"]) that you can pass directly to upsertServer or use for any other purpose in your own CLI integrations.

Build docs developers (and LLMs) love