1. cheat-sheets
  2. /mcp config

MCP Config Cheat Sheet

Client-side MCP configuration: how to wire servers into Cursor, Claude Code, and other MCP hosts.

Last reviewed: June 2026

Config file location and field names vary by client. Verify in your IDE's MCP settings. Full guide: MCP Security · Building MCP Servers

File locations

ClientConfig path
Cursor (project).cursor/mcp.json
Cursor (global)~/.cursor/mcp.json
Claude Code~/.claude/settings.jsonmcpServers (same shape)
VS Code MCP extensionsExtension-specific; often .vscode/mcp.json

Project config overrides global for that repo.

Minimal config

{
  "mcpServers": {
    "my-dev-tools": {
      "command": "node",
      "args": ["./mcp-server/dist/index.js"]
    }
  }
}

Field reference

FieldTypePurpose
commandstringExecutable: node, python3, uv, npx, docker
argsstring[]Arguments after command — path to entry file
envobjectEnvironment variables for the spawned process
cwdstringWorking directory (some clients support)
disabledbooleanTemporarily disable without removing entry

Environment variables

{
  "mcpServers": {
    "staging-db": {
      "command": "node",
      "args": ["./mcp-server/dist/index.js"],
      "env": {
        "DATABASE_URL": "${env:DATABASE_URL}",
        "LOG_LEVEL": "info"
      }
    }
  }
}
PatternUse
${env:VAR}Read from host shell environment
Literal "info"Non-secret config
Never sk-... in JSONUse env vars; rotate on leak

Launch patterns

Node (built TypeScript)

{
  "command": "node",
  "args": ["./mcp-server/dist/index.js"]
}

Build first: cd mcp-server && npm run build

npx (no local install)

{
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
}

Restrict filesystem paths — never mount repo root with secrets.

Python (uv)

{
  "command": "uv",
  "args": ["run", "mcp-server/main.py"]
}

Python (venv)

{
  "command": "/path/to/venv/bin/python",
  "args": ["mcp-server/main.py"]
}

Docker

{
  "command": "docker",
  "args": ["run", "-i", "--rm", "-e", "DATABASE_URL", "myorg/mcp-staging:1.2.0"]
}

Pin image digest in production; pass secrets via -e, not in the image.

Multiple servers

{
  "mcpServers": {
    "internal-docs": {
      "command": "node",
      "args": ["./servers/docs/dist/index.js"]
    },
    "staging-db": {
      "command": "uv",
      "args": ["run", "servers/db/main.py"],
      "env": { "DATABASE_URL": "${env:STAGING_DATABASE_URL}" }
    }
  }
}

Each key is the server name shown in the IDE MCP panel.

Remote / SSE servers

Some clients support HTTP-based MCP (no local spawn):

{
  "mcpServers": {
    "remote-api": {
      "url": "https://mcp.internal.example.com/sse",
      "headers": {
        "Authorization": "Bearer ${env:MCP_TOKEN}"
      }
    }
  }
}

Verify OAuth vs static token support in your client version. See MCP Security.

Troubleshooting

SymptomFix
Server not listedValidate JSON (trailing commas break parse); restart IDE
Red / disconnectedRun command + args manually in terminal
command not foundUse absolute path to node/python/uv
Env var emptyExport in shell before launching IDE, or use .env loader
Tool never invokedImprove tool description; name tool explicitly in prompt
Works in terminal, not IDECheck cwd; relative paths resolve from project root
TimeoutReturn less data; add pagination to tools

Test workflow

# 1. Build server
cd mcp-server && npm run build

# 2. Run MCP Inspector
npx @modelcontextprotocol/inspector node ./mcp-server/dist/index.js

# 3. Edit mcp.json, restart IDE

# 4. Ask mode smoke test
# "Use lookup_user to find [email protected]"

Security checklist

  • [ ] No secrets in committed mcp.json
  • [ ] Read-only DB credentials for dev tools
  • [ ] PR review on config changes
  • [ ] .cursorignore covers .env*