1.7 KiB
1.7 KiB
MCP Configuration Guide
Configuration File Structure
MCP servers are configured in .claude/.mcp.json:
{
"mcpServers": {
"server-name": {
"command": "executable",
"args": ["arg1", "arg2"],
"env": {
"API_KEY": "value"
}
}
}
}
Common Server Configurations
Memory Server
Store and retrieve key-value data:
{
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
Filesystem Server
File operations with restricted access:
{
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/allowed/path"
]
}
}
Brave Search Server
Web search capabilities:
{
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "${BRAVE_API_KEY}"
}
}
}
Puppeteer Server
Browser automation:
{
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
Environment Variables
Reference env vars with ${VAR_NAME} syntax:
{
"api-server": {
"command": "node",
"args": ["server.js"],
"env": {
"API_KEY": "${MY_API_KEY}",
"BASE_URL": "${API_BASE_URL}"
}
}
}
Configuration Loading Order
Scripts check for config in this order:
process.env(runtime environment).claude/skills/mcp-management/.env.claude/skills/.env.claude/.env
Validation
Config must:
- Be valid JSON
- Include
mcpServersobject - Each server must have
commandandargs envis optional but must be object if present