🔌 MCP Configuration Guide
Model Context Protocol configuration tutorial and popular servers
🖥️ Claude Desktop Configuration
Configuration file location:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Configuration example:
{
"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"
}
}
}
}
⌨️ 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.
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
}
can also be added via the 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": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/yourname/projects"] }
"github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxx" } }
"git": { "command": "uvx", "args": ["mcp-server-git", "--repository", "/path/to/repo"] }
"fetch": { "command": "uvx", "args": ["mcp-server-fetch"] }
"memory": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"] }
"time": { "command": "uvx", "args": ["mcp-server-time", "--local-timezone", "Asia/Shanghai"] }
"sqlite": { "command": "uvx", "args": ["mcp-server-sqlite", "--db-path", "/path/to/database.db"] }
"postgres": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgres://user:pass@localhost/db"] }
"puppeteer": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-puppeteer"] }
"brave-search": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-brave-search"], "env": { "BRAVE_API_KEY": "your_api_key" } }
"slack": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-slack"], "env": { "SLACK_BOT_TOKEN": "xoxb-xxxx", "SLACK_TEAM_ID": "T0xxxx" } }
"gdrive": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-gdrive"] }
📚 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