← Return

🔌 MCP Configuration Guide

Model Context Protocol configuration tutorial and popular servers

💡 What is MCP?

MCP (Model Context Protocol) is an open source standard protocol developed by Anthropic for connecting AI applications and external systems. Through MCP, Claude can access external resources such as file systems, databases, and APIs, greatly expanding its capabilities.

Official documentation: modelcontextprotocol.io · GitHub: github.com/modelcontextprotocol

🖥️ Claude Desktop Configuration

Configuration file location:

macOS
~/Library/Application Support/Claude/claude_desktop_config.json
Windows
%APPDATA%\Claude\claude_desktop_config.json

Configuration example:

claude_desktop_config.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}
💡 Tips: After modifying the configuration, you need to restart Claude Desktop to take effect.

⌨️ Claude Code configuration

Claude Code use .mcp.json The file configures the MCP server and can be placed in the project root directory or user directory.

Project-level configuration: .mcp.json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    },
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"]
    }
  }
}

can also be added via the command line:

Command line
# 添加 MCP 服务器
claude mcp add memory -- npx -y @modelcontextprotocol/server-memory

# 查看已配置的服务器
claude mcp list

# 移除服务器
claude mcp remove memory

🌟 Popular MCP Servers

Commonly used MCP servers provided by the official and community:

📁
Filesystem
Secure file system access, supporting operations such as reading and writing files, creating directories, and searching for files.
Installation command
npx -y @modelcontextprotocol/server-filesystem /path/to/dir
Official File operations
🐙
GitHub
GitHub API integration supports warehouse management, Issue, PR, code search and other functions.
Installation command
npx -y @modelcontextprotocol/server-github
Official API
🔀
Git
Git warehouse operations, supporting cloning, submission, branch management, viewing history, etc.
Installation command
uvx mcp-server-git --repository /path/to/repo
Official Version Control
🌐
Fetch
Web page content capture, supports obtaining web page content and converting it into Markdown format.
Installation command
uvx mcp-server-fetch
Official Network
🧠
Memory
Knowledge graph memory system allows Claude to store and retrieve information persistently.
Installation command
npx -y @modelcontextprotocol/server-memory
Official Storage
🕐
Time
Time and time zone tool, obtain current time, time zone conversion and other functions.
Installation command
uvx mcp-server-time
Official Tools
🗄️
SQLite
SQLite database operation, supports querying and analyzing local database files.
Installation command
uvx mcp-server-sqlite --db-path /path/to/db.sqlite
Official Database
🐘
PostgreSQL
PostgreSQL database connection, supporting query and data analysis.
Installation command
npx -y @modelcontextprotocol/server-postgres postgres://...
Official Database
🎭
Puppeteer
Browser automation, supports web page screenshots, PDF generation, page interaction, etc.
Installation command
npx -y @modelcontextprotocol/server-puppeteer
Official Browser
🔍
Brave Search
Brave search API integration, supporting web search and local search.
Installation command
npx -y @modelcontextprotocol/server-brave-search
Official Search
💬
Slack
Slack workspace integration, supports sending messages, managing channels, etc.
Installation command
npx -y @modelcontextprotocol/server-slack
Official Communications
📁
Google Drive
Google Drive file access, supports searching and reading document content.
Installation command
npx -y @modelcontextprotocol/server-gdrive
Official Cloud Storage

📚 More resources

MCP client encyclopedia - MCP-enabled AI clients and development tools
Official server warehouse - All official MCP server source codes
Awesome MCP Servers - Community maintained list of MCP servers
mcp.so - MCP Server Search and Discovery Platform
AIbase MCP - Chinese platform containing 120,000+ MCP servers
MCP official document - Protocol Specification and Development Guide