Skip to content

How to add an MCP server to Claude Code

Level 3: Connect AI to your tools. About 7 min. Checked on 19 November 2026.
Stage 3 of 4: Connect AI to your tools

In this lesson you'll add remote and local MCP servers to Claude Code, pick the right scope and check their status with /mcp.

You're deep in a refactor and Claude Code keeps guessing at a library's API from memory. Or you want it to read the failing test run, or the ticket, instead of you pasting them in. One command fixes that: claude mcp add connects Claude Code to an MCP server, and from then on it can look things up for itself.

The same command handles both kinds of server: a URL on the internet, or a program on your machine.

Pick a servera publisher you trustAdd it in Claude Codeclaude mcp addSign in or restartso tools loadTry, approveone small task
Adding a server, step by step. Pick a server you trust, add it to your app (a URL or a command), sign in or restart, then try a small task and approve the first tool call.

Add a remote server

The pattern is:

claude mcp add --transport http <name> <url>

For example, Context7 serves version-specific library documentation and code examples from a public URL. This is its exact command, built from its registry record:

Context7 in Claude Code. Run in a terminal:

claude mcp add --transport http context7 https://mcp.context7.com/mcp

Built from the server's registry entry, the same config as on its listing page.

If the server takes a token in a header instead of a sign-in, add --header:

claude mcp add --transport http my-api https://api.example.com/mcp \
  --header "Authorization: Bearer your-token"

Some older servers only speak SSE. Claude Code's docs call SSE deprecated and, as of 19 November 2026, say that version 2.1.265 and later tries HTTP first and falls back to SSE by itself. On earlier versions, use --transport sse.

Add a local server

Everything after -- is the command that starts the server:

claude mcp add [options] <name> -- <command> [args...]

Here is Microsoft's Playwright server, which lets Claude open and test web pages:

Playwright MCP in Claude Code. Run in a terminal:

claude mcp add playwright-mcp -- npx -y @playwright/mcp

Built from the server's registry entry, the same config as on its listing page.

Pass keys with --env KEY=value, once per key. Put another option, such as --transport stdio, between the last --env and the server name, or Claude Code reads the name as one more key:

claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable -- npx -y airtable-mcp-server

Choose who gets the server

Every server is saved in a scope. Pick one with --scope (or -s):

Just for you

  • local (the default): you, in this project only. Saved in ~/.claude.json.
  • user: you, in every project. Also in ~/.claude.json.

For your whole team

  • project: everyone who works in this repository.
  • Saved in .mcp.json at the project root, so you commit it with the code.
  • Claude Code asks each person to approve it the first time.
claude mcp add --transport http shared-server --scope project https://example.com/mcp

A project's .mcp.json can read secrets from environment variables, so no one commits a key:

{
  "mcpServers": {
    "api-server": {
      "type": "http",
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${API_KEY}"
      }
    }
  }
}

To be asked about a project's servers again, run claude mcp reset-project-choices.

Check, sign in and tidy up

  • claude mcp list shows your servers, claude mcp get <name> shows one, claude mcp remove <name> deletes it.
  • Inside Claude Code, /mcp shows each server's status and finishes an OAuth sign-in in your browser. The same menu has Clear authentication.

Servers developers use

Popular servers for development work, from the directory:

MCP servers for developer tools from the directory, most popular first.

More for developer tools
  1. Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    • Remote
    • Open source
    • 34.6K GitHub stars
    • Developer tools
  2. Python framework for building MCP servers, clients and interactive apps

    Not checked yet
    • Open source
    • 28.7K GitHub stars
    • Developer tools
  3. Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.8K GitHub stars
    • Knowledge and memory
  4. Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  5. CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 468K GitHub stars
    • Developer tools

In short

  • Remote: claude mcp add --transport http <name> <url>.
  • Local: claude mcp add <name> -- <command> [args].
  • --scope project writes .mcp.json for the team; /mcp shows status and handles sign-in.

What to try next

Share this lesson

Lesson 2 of 13 in this path

Words used in this lesson

Sources

Official documentation, checked on 19 November 2026. Products change: if a step differs, the source has the current version.

Get the next lesson

New Academy lessons are announced in the weekly AI-Powered email.