Back to blog

April 16, 2026

MCP Servers

Claude Code MCP Servers Guide: Complete Setup Walkthrough (2026)

Claude Code talks to GitHub, Postgres, Figma, Sentry, Linear, and hundreds of other tools through MCP. This guide covers every transport, scope, and command you need to wire them up without blowing your context window.

The Short Answer

MCP servers are local or remote processes that expose tools, resources, and prompts to Claude Code over a JSON-RPC protocol. Add one with claude mcp add, pick the right scope and transport, and Claude Code gains the ability to read and act on that system directly.

TRANSPORT

stdio, HTTP, SSE

stdio for local tools, HTTP for remote services. SSE is deprecated.

SCOPE

local, project, user

Private to you, shared with teammates via .mcp.json, or global across all projects.

CONTEXT

Tool Search

Lazy-loads tool definitions on demand. Cuts MCP context cost by 85-95%.

What MCP Servers Actually Do

The Model Context Protocol is an open standard from Anthropic for AI-tool integrations. Without MCP, Claude Code only sees what you paste into chat. With MCP, it reaches into GitHub, databases, monitoring dashboards, design files, and internal APIs the same way a senior engineer would.

Connect a server the moment you catch yourself copying something from another tool into a Claude Code prompt. That copy-paste friction is the exact signal an MCP integration will pay off.

Real Tasks MCP Unlocks

  • Implement tickets end-to-end. "Build the feature described in ENG-4521 and open a PR on GitHub." One prompt, two MCP servers, full delivery loop.
  • Query production data. "Find emails of 10 random users who used feature ENG-4521, based on our Postgres database." No SQL copy-paste.
  • Integrate designs automatically. "Update the email template based on the new Figma designs posted in Slack." Pull designs, edit code, open PR.
  • React to external events. MCP servers can act as channels that push messages into your session, so Claude reacts to Telegram pings, Discord chats, or webhook events while you are away.

Three Ways to Install: Transports Compared

Every MCP server uses one of three transport protocols. Pick the wrong one and the server either cannot reach your system or cannot reach the internet. Here is the decision matrix.

TransportWhere It RunsBest ForStatus
stdioLocal process on your machineFilesystem, databases, CLIs, scriptsStable
HTTPRemote server over the networkCloud SaaS, team-shared serversRecommended
SSERemote server over the networkLegacy remote servers onlyDeprecated

Install Commands by Transport

HTTP (remote, recommended)

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

For auth, pass a Bearer token: --header "Authorization: Bearer $TOKEN"

stdio (local process)

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

All flags go before the server name. The -- separates the name from the command args passed to the server.

SSE (legacy, deprecated)

claude mcp add --transport sse asana https://mcp.asana.com/sse

Only use SSE if the provider has not shipped an HTTP endpoint yet. Migrate as soon as they do.

Three Scopes: Local, Project, User

Scope controls where the MCP configuration is stored and who can see it. The default is local, which is almost never what you want for long-lived tools.

DEFAULT

local

Only available to you in the current project. Good for quick experiments and personal credentials you do not want committed. Previously called project in older Claude Code versions.

TEAM

project

Shared with everyone on the project via a .mcp.json file committed at the repo root. Use this for standard servers your whole team needs (GitHub, your database, your error tracker).

GLOBAL

user

Available across every project you touch. Best for your personal productivity servers: GitHub with your own token, Linear, Context7 for library docs. Previously called global.

Rule of thumb

Personal tools -> user. Team tools -> project. One-off experiments -> local. Never use local for anything you will still be using next month.

Step-by-Step: Connect GitHub to Claude Code

GitHub is the most useful first MCP server. It lets Claude Code open PRs, read issues, search code across repos, and review changes. Here is the complete install path.

1

Run the add command

claude mcp add github --scope user --transport http https://api.githubcopilot.com/mcp/

Scope is user because you want GitHub in every project, not just this one.

2

Launch Claude Code and authenticate

claude
/mcp

Select the github server from the list. Claude Code will open a browser window for OAuth. Sign in and approve the scopes.

3

Verify the connection

claude mcp list

The github server should show a green status. If it shows red, run claude mcp get github for details.

4

Test with a real prompt

Ask Claude Code: "List my 5 most recent open PRs across all repos." If the tool is invoked and returns results, the server is wired up correctly.

The complete playbook

Everything about Claude Code -- MCP, skills, subagents, memory, and cron -- in one production-tested guide.

This post covers MCP servers end-to-end. The full KaiShips Guide to Claude Code adds 6 more chapters: CLAUDE.md architecture, skill development, subagents, heartbeats, cost tuning, and deployment.

Get the KaiShips Guide to Claude Code -- $29

The .mcp.json File Explained

When you add a project-scoped server, Claude Code writes to a file called .mcp.json at the repo root. Commit it to git and every teammate gets the same setup automatically.

Minimal Example

{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "postgres": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "${DATABASE_URL}"
      }
    },
    "sentry": {
      "type": "http",
      "url": "https://mcp.sentry.dev/mcp"
    }
  }
}

Use ${ENV_VAR} interpolation for secrets so teammates supply their own keys. Never hardcode tokens in .mcp.json-- the file is committed to git.

Config File Locations

ScopeFile Path
project<repo>/.mcp.json
user~/.claude.json (mcpServers block)
local~/.claude/projects/<project>/settings.local.json

Tool Search: Why 2026 Changed the Context Game

Every MCP server you add used to bloat the system prompt. A single GitHub MCP alone exposed ~80 tools, each with schemas and descriptions. Load 5 servers and you burned 30,000+ tokens before the first user message.

Tool Search fixes this. Claude Code indexes every tool from every connected server and only loads the definitions that match the current task. Independent measurements put the context reduction at 85-95% compared to clients that dump every tool definition upfront.

What This Unlocks

  • Install everything. 10-15 MCP servers no longer cost tokens on every request. Connect the full stack.
  • Better model focus. Fewer irrelevant tools in context means the model picks the right action more reliably.
  • Faster sessions. Smaller prompts = smaller latency = snappier iteration loops.

10 Best MCP Servers for Claude Code in 2026

The MCP registry has hundreds of servers. These ten cover 90% of what an engineer actually needs day-to-day. Install them with user scope unless otherwise noted.

1

GitHub

Full repo management: PRs, issues, code search, branches, commits, releases. The single most useful MCP server.

claude mcp add github --scope user --transport http https://api.githubcopilot.com/mcp/
2

Context7

Fetches current library documentation. Offsets the training cutoff problem so Claude never guesses at API signatures.

claude mcp add context7 --scope user -- npx -y @upstash/context7-mcp
3

PostgreSQL

Natural language queries against any Postgres database. Claude writes the SQL, executes it, summarizes the results.

claude mcp add postgres --scope project --env DATABASE_URL=$DATABASE_URL -- npx -y @modelcontextprotocol/server-postgres
4

Playwright

Browser automation. Clicking, form filling, screenshots, and full end-to-end test execution.

claude mcp add playwright --scope user -- npx -y @playwright/mcp
5

Sentry

Query production errors, read stack traces, triage issues directly from the CLI.

claude mcp add sentry --scope user --transport http https://mcp.sentry.dev/mcp
6

Linear

Read and create issues, move tickets through workflows, post updates. Perfect for "implement ENG-4521" prompts.

claude mcp add linear --scope user --transport http https://mcp.linear.app/mcp
7

Figma

Read design file structure, component properties, and token values. Turns a Figma link into working components.

claude mcp add figma --scope user -- npx -y figma-developer-mcp
8

Supabase

Manage tables, RLS policies, edge functions, and auth users in any Supabase project.

claude mcp add supabase --scope user -- npx -y @supabase/mcp-server-supabase
9

Brave Search

Live web search without a Google API key. Covers knowledge gaps, current events, and stack-specific guides.

claude mcp add brave-search --scope user -- npx -y @brave/brave-search-mcp-server
10

Filesystem

Safer, scoped access to directories outside the current project. Useful when Claude Code needs to read notes or configs kept elsewhere on disk.

claude mcp add fs --scope user -- npx -y @modelcontextprotocol/server-filesystem /Users/you/notes

Security: Audit Before You Install

MCP servers run code. Anthropic explicitly warns that it has not verified third-party servers. Treat every community server with the same scrutiny you give any npm dependency -- maybe more, because the model calls it autonomously.

DO
  • ● Read the source before installing
  • ● Prefer official org-published packages
  • ● Scope tokens to least privilege
  • ● Use HTTP servers over stdio when possible
  • ● Set tight output caps per server
DON'T
  • ● Install servers with <100 npm downloads
  • ● Let servers fetch untrusted web content
  • ● Commit tokens into .mcp.json
  • ● Use admin tokens where read-only works
  • ● Skip the audit just because it works

Prompt injection is the biggest real-world risk. If an MCP server fetches web pages, emails, or Slack messages, attacker content inside those payloads can instruct Claude Code to exfiltrate data via other tools. Sandbox anything that reads untrusted text.

Managing and Debugging MCP Servers

Three shell commands and one in-session slash command cover everything you will need.

List every configured server

claude mcp list

Inspect a specific server

claude mcp get github

Remove a server

claude mcp remove github

Check runtime status from inside a session

/mcp

Use this to re-authenticate OAuth servers or see which tools each server exposes.

Useful Environment Variables

  • MCP_TIMEOUT -- Server startup timeout in ms. Raise to 10000 for slow stdio servers.
  • MAX_MCP_OUTPUT_TOKENS -- Cap on tool output. Defaults to 10,000; raise to 50,000 for tools that return large payloads.

Plugin-Provided MCP Servers

Claude Code plugins can bundle their own MCP servers. When the plugin is enabled the servers start automatically -- no claude mcp add required.

Plugin MCP Config Example

{
  "mcpServers": {
    "database-tools": {
      "command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
      "args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"],
      "env": {
        "DB_URL": "${DB_URL}"
      }
    }
  }
}

Put this either in .mcp.json at the plugin root or inline under an mcpServers block in plugin.json. The ${CLAUDE_PLUGIN_ROOT} variable resolves to the plugin install path at runtime.

Common Mistakes That Break MCP Servers

Most MCP problems come down to five recurring mistakes. Fix these before opening a support issue.

  • Flags after the server name. All options (--transport, --env, --scope, --header) must come before the server name. The -- separator matters.
  • Windows without cmd /c. On native Windows (not WSL), stdio servers using npx require the cmd /c wrapper. Without it you get "Connection closed" errors.
  • Wrong scope for team tools. Adding a shared GitHub server with local scope means only you see it. Use project scope so .mcp.json ends up in git.
  • Hardcoded secrets. Never paste raw tokens into .mcp.json. Use ${ENV_VAR} interpolation and commit a sanitized version.
  • Ignoring SSE deprecation. New code should never depend on SSE transport. If the provider only offers SSE, push them to ship HTTP, or wait.

Frequently Asked Questions

What are MCP servers in Claude Code?

MCP (Model Context Protocol) servers are local or remote processes that expose tools, resources, and prompts to Claude Code via a JSON-RPC standard. They let Claude Code read and act on GitHub issues, PostgreSQL databases, Figma designs, Sentry errors, or any other system instead of forcing you to paste data into chat.

How do I add an MCP server to Claude Code?

Run `claude mcp add` from your terminal. For remote servers use `claude mcp add --transport http <name> <url>`. For local tools use `claude mcp add <name> -- npx -y <package>`. All flags must come before the server name, followed by `--` and then the command.

What is the difference between stdio, HTTP, and SSE transports?

Stdio runs a local process and pipes JSON-RPC over stdin/stdout, ideal for filesystem, databases, and CLI tools. HTTP connects to a remote server over the network and is the recommended transport for cloud services. SSE (Server-Sent Events) is deprecated as of 2026 -- use HTTP where available.

Where is the .mcp.json file stored?

Project-scoped servers live in `.mcp.json` at the root of your repository and get shared with the team. User-scoped servers live in `~/.claude.json` and apply across every project. Local-scoped servers are stored in project-specific settings and are private to you.

Are MCP servers safe to install?

MCP servers execute code on your machine or handle your data remotely. Anthropic has not verified third-party servers. Always audit the source code, check npm download counts, and avoid servers that fetch untrusted web content without sandboxing -- those are vulnerable to prompt injection attacks.

What is Tool Search in Claude Code?

Tool Search is a 2026 feature that loads MCP tool definitions on-demand rather than all at once. Claude Code searches a retrieval index for relevant tools based on the current task. Independent measurements put context reduction at 85-95% compared to clients that load every tool definition upfront.

Can I share MCP server configuration with my team?

Yes. Use `--scope project` when adding the server. Claude Code writes the configuration to `.mcp.json` at the repo root, which you commit to git. Every teammate who checks out the branch gets the same MCP servers on their next Claude Code launch.

Bottom Line

MCP servers are the difference between an AI that writes code in a vacuum and one that ships features against your real backlog, database, and monitoring stack.

Install GitHub first. Add Context7, your database, Sentry, and Linear next. Keep secrets out of .mcp.json. Audit before you connect anything unfamiliar. Tool Search will handle the context cost.

The full KaiShips Guide to Claude Code walks through every server in production detail, including our real setup for a one-agent SaaS business shipping code 24/7.

The complete playbook

Everything about Claude Code -- MCP, skills, subagents, memory, and cron -- in one production-tested guide.

This post covers MCP servers end-to-end. The full KaiShips Guide to Claude Code adds 6 more chapters: CLAUDE.md architecture, skill development, subagents, heartbeats, cost tuning, and deployment.

Get the KaiShips Guide to Claude Code -- $29

Related Reading