MCP Server Config Setup Guide - Model Context Protocol for Claude Desktop & AI Agents
Published May 3, 2026
MCP (Model Context Protocol) is an open protocol that connects AI agents to external tools and data sources. If you use Claude Desktop, Cursor, or any MCP-compatible AI coding agent, you need a properly formatted mcp-config.json or claude_desktop_config.json file to connect servers.
This guide walks through everything you need: from basic config structure to real-world examples. Use our MCP Server Config Generator to skip the manual setup.
What is MCP Server Config?
An MCP server config is a JSON file that tells your AI agent which servers to connect to, how to find them, and what environment variables they need. Each server provides specific tools - file system access, database queries, web searches, or custom APIs.
The config structure looks like this:
{
"mcpServers": {
"server-name": {
"command": "node",
"args": ["/path/to/server.mjs"],
"env": {
"API_KEY": "your-key-here"
}
}
}
}
Where Does the Config Live?
Location depends on your AI agent:
- Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows) - Cursor: Configured through Cursor settings → MCP Servers tab
- VS Code with Continue:
.continuum/config.jsonin your project root - Custom agents: Loaded programmatically via the MCP SDK
Example Configs for Common Servers
Filesystem Server
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects"
]
}
}
}
GitHub MCP Server
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
Database (PostgreSQL)
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@anthropic/server-postgres",
"postgresql://user:pass@localhost:5432/mydb"
]
}
}
}
Common Mistakes & Troubleshooting
- Wrong paths: Always use absolute paths for server scripts. Relative paths break when the agent runs from a different directory.
- Missing env vars: Servers that need API keys or tokens will fail silently. Check your
envblock carefully. - Permission errors: The filesystem server can only access directories you explicitly allow. Add all needed paths.
- Version mismatches: Run
npx @modelcontextprotocol/server-name --versionto verify server compatibility. - JSON syntax: Trailing commas in JSON will break the config. Use a validator if unsure.
Why Use a Config Generator?
Writing MCP config by hand is error-prone. A single misplaced comma or wrong path breaks the entire setup. Our MCP Config Generator handles all formatting and validation automatically:
- Pick from common server templates
- Auto-generates valid JSON with no syntax errors
- Supports environment variables
- Copy-paste ready for Claude Desktop, Cursor, or VS Code
Related Tools
Check out these related tools on EasyTool.me:
- AI Prompt Helper - Optimize your ChatGPT and Claude prompts
- JSON Formatter & Validator - Validate and beautify your config files
Last updated: May 3, 2026