MCP Server Config Generator
Generate, validate, and customize Model Context Protocol (MCP) server configuration files (mcp_config.json) for Claude Desktop, Cursor AI, and custom LLM agent clients.
Ready to use MCP Server Config Generator?
Runs instantly in your browser sandbox. No sign-up required.
Generates valid JSON configurations for Claude Desktop and Cursor.
Configure stdio binary paths, arguments, and remote SSE server endpoints.
Securely template API tokens and environment paths.
What is an MCP Server Configuration?
The Model Context Protocol (MCP) requires host applications like Claude Desktop or Cursor IDE to load context servers defined in a local claude_desktop_config.json or mcp.json file.
Sample MCP Configuration
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/dev/projects"]
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost/db"]
}
}
} Best Practices for MCP Configurations
- Always use absolute executable paths or standard package runners like
npxoruvx. - Keep API secrets in the
envblock rather than hardcoding credentials inside command arguments. - Test server stdio responses independently using the official `@modelcontextprotocol/inspector` CLI tool.
Frequently Asked Questions
Where is the claude_desktop_config.json file located on Windows and macOS?
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows: %APPDATA%\Claude\claude_desktop_config.json.
How do I add environment variables to my MCP server configuration?
Inside your server declaration object in mcp_config.json, add an "env" key containing key-value strings (e.g. {"API_KEY": "secret_123"}).
Why does Claude Desktop fail to connect to my stdio MCP server?
The most common cause is standard output logging. If your MCP binary prints debug text via console.log to stdout, it corrupts the JSON-RPC message transport. Use console.error for logging.