Build Model Context Protocol server configuration with the right structure (transport type, command, arguments, and environment variables) for Claude Code or Claude Desktop.
Build a valid .mcp.json for Claude Code or Claude Desktop. Pick presets, edit inline, copy. No bad JSON, no missing fields.
{
"mcpServers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${REPO_ROOT}"
]
}
}
}$${GITHUB_TOKEN} and load real values from a vault, a .env, or your shell. Audit MCP servers quarterly. If a row has no clear business owner, remove it.Most MCP setup failures are one of three things. An absolute path is missing. The launcher does not inherit your shell PATH, so a bare command name frequently fails where the same line works in your terminal. The JSON has a trailing comma, which fails silently and looks like the server not existing. Or an environment variable the server needs was set in your shell profile and not in the config, so it launches and immediately errors.
On security: an MCP server runs with whatever access you grant it and can be invoked by the model. A server with filesystem write access or shell execution is a real capability handed to something a prompt injection could steer. Scope credentials narrowly and be deliberate about which servers get destructive tools.