MCP (Model Context Protocol) servers extend Claude Code with tools beyond its defaults. Each server exposes a set of capabilities — filesystem reads, web search, database access, or custom APIs — that Claude can call during a session.

How MCP works

MCP servers run as local processes that Claude Code connects to. Claude sees the server’s tools and can call them like any other built-in tool. The connection is configured in ~/.claude/settings.json (global) or .claude/settings.json (project-level).

Configuring an MCP server

{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ["-y", "@scope/mcp-package-name"],
      "env": {
        "API_KEY": "your-key"
      }
    }
  }
}
Each server needs:
  • command — the executable to run
  • args — arguments passed to the command (usually the package name)
  • env — optional environment variables for authentication

Useful MCP servers

Filesystem (extended)

Provides recursive directory reading and content search beyond Claude Code’s defaults:
"filesystem": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/wupxy/WORK"]
}
Scope the allowed path to your workspace — do not point it at / or your home directory. Real-time web search without leaving Claude Code:
"brave-search": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-brave-search"],
  "env": {
    "BRAVE_API_KEY": "your-brave-api-key"
  }
}
Get a free API key from brave.com/search/api.

GitHub

Read issues, PRs, and file contents from GitHub repos without cloning:
"github": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github"],
  "env": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": "your-pat"
  }
}

Memory (persistent notes)

Lets Claude maintain a persistent knowledge graph across sessions:
"memory": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-memory"]
}
Useful for long-running projects where context continuity matters.

Project-level vs global servers

  • Global (~/.claude/settings.json) — available in every Claude Code session on this machine
  • Project-level (.claude/settings.json in repo root) — only available when Claude Code is running in that repo
Prefer project-level for servers that are specific to a codebase (e.g. a database server for one project). Use global for general-purpose servers (search, filesystem, memory).

Checking active servers

In a Claude Code session:
/mcp
This lists connected servers and their status.

Security considerations

  • Each MCP server runs with the permissions of your user account
  • Filesystem servers can read any path you grant them — scope paths tightly
  • Never commit settings.json files containing API keys — use environment variables or secret management
  • Prefer read-only servers unless write access is required for the task
MCP servers run as local processes with access to whatever paths and credentials you configure. Review the source of any server package before installing, especially third-party packages.

AI Tools Overview

How Claude, OpenClaw, and Codex work together.