Skip to main content

Quickstart

This guide will walk you through installing your first MCP server using add-mcp. You’ll learn the basic workflow and see how easy it is to extend your coding agent’s capabilities.

Install a remote MCP server

Let’s install the Context7 MCP server, which provides context and knowledge management capabilities.
1

Run the installation command

Execute the following command in your terminal:
npx add-mcp https://mcp.context7.com/mcp
The CLI will:
  • Parse the server URL
  • Detect installed coding agents on your system
  • Show you a summary of what will be installed
2

Select target agents

add-mcp will automatically detect your installed agents. You’ll see a prompt like:
? Select agents to install to
❯ ◉ Cursor (project)
  ◉ Claude Code (project)
  ◯ VS Code
  ◯ OpenCode
Use arrow keys to navigate and space to select/deselect agents. Press Enter to continue.
Detected agents (with “project” or “global” hints) are pre-selected by default. These have existing configuration in your current directory or home directory.
3

Choose installation scope

If you selected any project-capable agents, you’ll be asked where to install:
? Installation scope
❯ Project (Install in current directory - committed with your project)
  Global (Install in home directory - available across all projects)
  • Project: Config files like .cursor/mcp.json are created in your current directory
  • Global: Config files are created in your home directory (e.g., ~/.cursor/mcp.json)
Project-level installation is recommended for team projects. Global installation is better for personal tools you want available everywhere.
4

Confirm installation

Review the installation summary:
┌ Installation Summary

│ Server: context7
│ Type: remote
│ Scope: Project
│ Agents: Cursor, Claude Code



? Proceed with installation? (Y/n)
Press Enter or type y to continue.
5

Installation complete

You’ll see a success message showing where the server was installed:
┌ Installed to 2 agents

│ ✓ Cursor: .cursor/mcp.json
│ ✓ Claude Code: .mcp.json



◆ Done!
The MCP server is now configured and ready to use!

Install an npm package

Many MCP servers are distributed as npm packages. Here’s how to install one:
npx add-mcp @modelcontextprotocol/server-postgres
This installs the PostgreSQL MCP server, which will be run via npx when your coding agent starts.
npm package servers use the stdio transport and run as local processes, unlike remote servers which use HTTP or SSE.

Non-interactive installation

For automation or CI/CD pipelines, you can skip all prompts:
npx add-mcp https://mcp.example.com/mcp -y
The -y flag will:
  • Auto-select all detected agents
  • Use default installation scope (project)
  • Skip confirmation prompts

Install to specific agents

You can target specific agents without interactive selection:
npx add-mcp https://mcp.example.com/mcp -a cursor -a claude-code
Install globally to specific agents:
npx add-mcp https://mcp.example.com/mcp -g -a cursor -a claude-code -y

Advanced examples

Remote server with authentication

Pass custom headers for authenticated servers:
npx add-mcp https://mcp.example.com/mcp --header "Authorization: Bearer $TOKEN"

Remote server with SSE transport

Some servers use Server-Sent Events instead of HTTP:
npx add-mcp https://mcp.example.com/sse --transport sse

Custom server name

Override the auto-inferred server name:
npx add-mcp @modelcontextprotocol/server-postgres --name postgres

Full command with arguments

Install a server that requires specific arguments:
npx add-mcp "npx -y @org/mcp-server --flag value"

Node.js script

Install a custom Node.js script as an MCP server:
npx add-mcp "node /path/to/server.js --port 3000"

Add to .gitignore

Automatically add generated config files to .gitignore:
npx add-mcp https://mcp.example.com/mcp -a cursor -y --gitignore
The --gitignore flag only works for project-scoped installations. It has no effect with the -g (global) flag.

What’s next?

You’ve successfully installed your first MCP server! Here are some next steps:

Command reference

Explore all available commands and options

Supported agents

Learn about configuration for each coding agent

Transport types

Understand HTTP, SSE, and stdio transports

Troubleshooting

Solutions for common issues

Build docs developers (and LLMs) love