This guide walks you through installing an MCP server into your AI coding agent from scratch. By the end you will have a working MCP server registered in your agent’s config and understand the core options available to you. The whole process takes under two minutes.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.
Install a remote MCP server by URL
Run This installs the Context7 MCP server, which provides up-to-date library documentation to your agent. The URL format signals to
npx add-mcp followed by the server URL. No global install is needed — npx fetches and runs add-mcp automatically.add-mcp that this is a remote streamable HTTP server. For SSE transports, append --transport sse.add-mcp detects your agents
After parsing the source,
add-mcp scans your current directory for known agent config files and builds a list of detected agents:- Project mode (default): looks for files like
.cursor/mcp.json,.mcp.json,.vscode/mcp.json,opencode.json,.gemini/settings.json, and others relative to your working directory. Detected agents are pre-selected. - Global mode (
-g): checks for globally installed agents (Claude Desktop, Codex, Zed, and others) on your system. Detected agents are pre-selected.
add-mcp presents an interactive checklist so you can confirm or adjust the selection before anything is written to disk. If no agents are detected, the CLI falls back to showing all supported agents and remembers your last selection for next time.Confirm and complete the installation
The CLI displays an installation summary — server name, transport type, scope, and target agents — and asks for confirmation before writing any files.To skip all prompts in CI or scripting contexts, add the On completion,
-y flag:add-mcp prints the path of every config file it wrote:Some agents require a restart or a manual toggle to load newly registered servers. Claude Code needs a restart; Cursor requires you to open MCP Settings and enable the server.
Verify and explore next steps
Open your agent and confirm the server appears in its MCP settings panel. For Cursor, go to Settings → MCP and look for
context7 in the server list. For Claude Code, run /mcp inside a conversation to list active servers.From here you can:- Run
npx add-mcp listto see every MCP server installed across all detected agents. - Run
npx add-mcp find <keyword>to search the curated registry and install servers by name. - Run
npx add-mcp syncto propagate server configs consistently across all your agents. - Run
npx add-mcp remove <name>to uninstall a server from agent configs.
Installing an npm package server
Pass an npm package name instead of a URL to install a local stdio-based MCP server.add-mcp generates the correct npx-based command and writes it to each agent’s config:
server-postgres). Override it with --name:
Common usage patterns
Scope: project vs. global
- Project (default)
- Global (-g)
By default,
add-mcp writes to project-level config files in your current directory (e.g. .cursor/mcp.json, .mcp.json). These files can be committed to version control so every team member gets the same MCP server configuration automatically.For a full list of flags, transport options, environment variable support, and advanced examples, see the Add Command reference.