Claude Code MCP Servers: How to Set Up 8 Servers in 2026

Last updated: April 15, 2026

Claude Code MCP Servers

Quick answer

MCP (Model Context Protocol) is an open standard that gives Claude access to external tools and data. Configure MCP servers in .claude/settings.json under the mcpServers key. Two transport types exist: stdio (subprocess) and HTTP (remote URL). The most useful servers for most developers are Filesystem, GitHub, Postgres, Puppeteer, Sequential Thinking, Fetch, Memory, and Slack.

What MCP is

MCP is a protocol that defines how an AI client talks to an external tool server. The client (Claude Code) sends tool listings, resource listings, and tool-call requests; the server replies with results. Because the protocol is standardized, the same MCP server works with Claude Desktop, Claude Code, Cursor, and any other MCP-aware client.

Without MCP, giving Claude access to a new data source means building a custom integration. With MCP, you point at a published server and the tools show up inside the session.

How Claude Code connects

Claude Code reads mcpServers from settings.json at session start and launches each server. Once running, the server's tools appear alongside built-in tools in the session. Claude decides when to call them based on the prompt, the same way it decides when to call Read or Bash.

You can confirm which servers loaded successfully by running /status. Servers that crashed during startup show an error.

Two transport types

stdio

Most common. Claude Code spawns the server as a subprocess and speaks the MCP protocol over stdin and stdout. Config:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allow"]
    }
  }
}

command plus args is the exec line. env is optional for environment variables.

HTTP

For remote servers (server-sent events). Config:

{
  "mcpServers": {
    "remote": {
      "url": "https://mcp.example.com/sse",
      "headers": { "Authorization": "Bearer $API_KEY" }
    }
  }
}

HTTP is right when the server runs elsewhere or shares state across many clients. stdio is right for local development tools.

A complete mcpServers config

Here is a realistic setup attaching five servers at once:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_TOKEN" }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "$DATABASE_URL"]
    },
    "sequential-thinking": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
    },
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"]
    }
  }
}

Each server exposes one or more tools that Claude can call as if they were built in.

The 8 most useful MCP servers

1. Filesystem

Gives Claude read and write access to specific directories beyond the current working directory. Useful for pulling in shared code libraries, template repos, or documentation stored elsewhere.

{
  "filesystem": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/shared"]
  }
}

Pass multiple directories as additional args. Claude can only access paths that were explicitly allowed.

2. Puppeteer (Browser)

Full browser control: navigate URLs, click, type, take screenshots, run JavaScript. Good for web scraping, UI testing, and automation of browser-based workflows.

{
  "puppeteer": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-puppeteer"]
  }
}

First run downloads a Chromium binary (about 170 MB). Subsequent runs reuse it.

3. Postgres

Query a Postgres database directly. Claude can list tables, inspect schemas, run SELECT queries, and (if configured) write.

{
  "postgres": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pw@localhost:5432/mydb"]
  }
}

Point at a read-only replica or a dedicated analyst role if Claude should not write to production.

4. GitHub

List issues, list PRs, read file contents, create/update files, post comments, and more via the GitHub REST API. Requires a personal access token.

{
  "github": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-github"],
    "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_TOKEN" }
  }
}

Scope the token carefully. repo scope alone covers most uses; avoid admin:org unless Claude genuinely needs to manage org settings.

5. Sequential Thinking

Adds a structured multi-step reasoning tool. Claude can break a hard problem into numbered steps, checkpoint progress, and revise earlier steps when new information arrives. No external dependency; the server is pure logic.

{
  "sequential-thinking": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
  }
}

Works best on planning tasks, debugging, and code review, where linear thought beats one-shot answers.

6. Fetch

HTTP requests from inside a Claude session. Useful for hitting internal APIs, reading public data, or testing endpoints without leaving the CLI.

{
  "fetch": {
    "command": "uvx",
    "args": ["mcp-server-fetch"]
  }
}

uvx is the Python package runner; install uv first with pip install uv. The fetch server respects robots.txt by default.

7. Memory

Persistent key-value store across sessions, backed by a local SQLite database. Claude can store facts, retrieve them in future sessions, and build up a project-specific knowledge base over time.

{
  "memory": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-memory"]
  }
}

This is separate from the built-in /memory command, which stores personal facts in a flat file. Memory MCP is project-scoped and queryable.

8. Slack

Read channel messages, post messages, react to messages via the Slack API. Requires a bot token and the channels scoped in the Slack app.

{
  "slack": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-slack"],
    "env": {
      "SLACK_BOT_TOKEN": "$SLACK_BOT_TOKEN",
      "SLACK_TEAM_ID": "$SLACK_TEAM_ID"
    }
  }
}

Common pattern: have Claude summarize a long thread, draft a reply, then post it after human review.

Building a custom MCP server

A 20-line Python MCP server that exposes a single tool:

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("weather")

@mcp.tool()
def get_temperature(city: str) -> str:
    """Return the current temperature for the named city."""
    import requests
    r = requests.get(f"https://wttr.in/{city}?format=%t")
    return r.text.strip()

if __name__ == "__main__":
    mcp.run()

Save as weather_mcp.py. Register in settings.json:

{
  "weather": {
    "command": "python",
    "args": ["/path/to/weather_mcp.py"]
  }
}

Install the SDK with pip install mcp. The same pattern in TypeScript uses the @modelcontextprotocol/sdk package.

Tool descriptions matter: Claude picks tools based on their names and descriptions. A vague description means the tool gets skipped even when it would have been the right call.

Security

MCP servers run as subprocesses with your shell's permissions. An MCP server with a malicious tool can read files, make network calls, and execute arbitrary code. Before adding a new server:

  • Check the repo's README and license.
  • Read the list of tools it exposes.
  • Check what external services it contacts and what credentials it needs.
  • Look at the download count or issue tracker for signs of abandonment.
  • Prefer servers published under @modelcontextprotocol/ on npm (the official org) when available.

For remote HTTP MCP servers, trust the operator the same way you would trust any third-party API.

Debugging MCP connections

Common failure patterns:

  1. Server fails to start. Run /status to see the error; usually a missing npm package or Python dependency. Test the command manually in a terminal to reproduce.
  2. Tools do not appear in the session. Check that the server is listed in /status. Also verify tool definitions have clear descriptions; Claude only uses tools it understands.
  3. Environment variable not expanded. $VAR syntax only works if VAR is set in the shell that launched Claude Code. For per-project vars, use direnv or export in your shell profile.
  4. Slow session startup. Each MCP server adds 200-800 ms to launch time. Trim servers you no longer need.

When in doubt, start the server manually outside Claude Code. It should print an MCP protocol handshake on stdout. If it errors instead, fix that first.

Practical picking strategy

Most new Claude Code users over-install MCP servers in the first week and then spend the next month removing them because sessions start slowly and the / menu fills with tools Claude rarely picks; a saner pattern is to install one server, use it for a week, confirm that the workflow it enables is worth the startup cost, and only then add the next one. Short.

For solo developers building a web app, the order that tends to stick is Filesystem first, then GitHub, then Puppeteer, in that order. For data and analytics teams, the order is often Postgres, Fetch, then Sequential Thinking. Ops and SRE teams usually start with Slack, GitHub, and a custom internal server before touching the others.

Where to find more servers

The official registry lives at modelcontextprotocol.io. Community servers are listed at github.com/modelcontextprotocol/servers and linked from the registry. Search npm for @modelcontextprotocol/server-* to browse official ones.

MCP vs hooks

Both add capability, but they work at different layers:

  • Hooks: intercept Claude's existing tool calls (Bash, Edit, Write).
  • MCP servers: add new tools Claude can call.

A hook cannot give Claude new abilities. An MCP server cannot block or modify Claude's use of Bash. Use hooks for policy and MCP for capability. They compose well: add a GitHub MCP server for capability, add a PreToolUse hook to audit every GitHub mutation.

Frequently asked questions

Where can I find MCP servers to use with Claude Code?

The official registry is at modelcontextprotocol.io, and community servers live at github.com/modelcontextprotocol/servers. Search npm for `@modelcontextprotocol/server-*` to browse packages published by the official organization.

How do I configure multiple MCP servers?

Add an entry per server to the `mcpServers` object in settings.json. Each entry needs a `command` plus `args` array for stdio, or a `url` for HTTP transport. Environment variables referenced as `$VAR` expand at session start.

What happens if an MCP server crashes at startup?

Claude Code continues the session without that server's tools and shows the error in `/status`. Fix the underlying issue (missing dependency, wrong command path, expired credentials) and restart the session.

Is it safe to use third-party MCP servers?

Treat them like any third-party dependency. Read the source, check the license, review which credentials and network calls they need, and prefer official `@modelcontextprotocol/` packages when available. Remote HTTP servers require trusting the operator.

Should I build my own MCP server or use an existing one?

Use an existing server when one exists for your need. Build your own when the workflow is specific to your org or internal systems. A 20-line Python server with the MCP SDK is enough for most internal APIs.

How are MCP servers different from hooks?

MCP servers add new tools Claude can call (GitHub, Postgres, Slack). Hooks intercept Claude's existing tool calls to enforce policy or trigger side effects. MCP is for capability, hooks are for policy.