MCP
Claude Code
2026

How to Set Up MCP in Claude Code

Configure MCP servers in Anthropic's terminal-based AI coder for maximum productivity

March 2, 20267 min read

Why Claude Code + MCP Is the Ultimate Combo

Claude Code is Anthropic's agentic AI coding tool that runs directly in your terminal. Since Anthropic created both Claude Code and the MCP protocol, they work together seamlessly. Claude Code can use MCP servers to interact with GitHub, databases, APIs, and more — all through natural language commands in your terminal.

Configuration Methods

Claude Code supports MCP configuration at three levels:

1. Project-level: .claude.json

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "ghp_xxx" }
    },
    "postgres": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-postgres", "postgresql://localhost:5432/mydb"]
    }
  }
}

2. User-level: ~/.claude.json

Same format, applies to all projects. Great for universal tools like GitHub and web search.

3. Via CLI: claude mcp add

# Add GitHub MCP server
claude mcp add github npx @modelcontextprotocol/server-github

# Add with environment variables
claude mcp add supabase npx supabase-mcp-server \
  --env SUPABASE_URL=https://xxx.supabase.co \
  --env SUPABASE_SERVICE_ROLE_KEY=eyJxxx

Essential MCP Servers for Claude Code

GitHub

Manage repos, issues, PRs from terminal

@modelcontextprotocol/server-github

Filesystem

Controlled file and directory access

@modelcontextprotocol/server-filesystem

PostgreSQL

Query and manage databases with AI

@modelcontextprotocol/server-postgres

Memory

Persistent knowledge across sessions

@modelcontextprotocol/server-memory

Brave Search

Real-time web research

@modelcontextprotocol/server-brave-search

Sequential Thinking

Better reasoning for complex tasks

@modelcontextprotocol/server-sequentialthinking

Using MCP + Skills Together in Claude Code

Claude Code also supports SKILL.md files — reusable instruction sets that teach Claude how to follow your coding standards. When combined with MCP servers, Skills tell Claude how to use the tools correctly:

# .claude/skills/SKILL.md
---
name: database-workflow
description: How to interact with our PostgreSQL database
---
# Database Workflow
- Always use read-only queries unless explicitly asked to modify
- Format results as markdown tables
- Include row counts in query results
- Never expose sensitive data in query outputs

This way, the PostgreSQL MCP server gives Claude access to your database, while the Skill tells it how to behave safely and consistently when querying it.

Find More MCP Servers for Claude Code

Browse our directory of verified MCP servers and AI Skills