MCP Configuration Reference¶
Complete reference for MCP server configuration files.
Configuration File Locations¶
| Application | Location |
|---|---|
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Claude Desktop (Linux) | ~/.config/Claude/claude_desktop_config.json |
| Claude Code (Project) | .mcp.json in project root |
| Claude Code (Global) | ~/.claude/mcp.json |
| OpenCode (Project) | opencode.json or opencode.jsonc in project root |
| OpenCode (Global) | ~/.config/opencode/opencode.json |
| VS Code (Cline) | Cline extension settings |
| VS Code (Continue) | ~/.continue/config.json |
| Cursor | Cursor settings or .cursor/mcp.json |
OpenCode Configuration Differences
OpenCode uses a different schema than Claude Desktop/Code:
- Top-level key:
"mcp"(not"mcpServers") - Command format:
"command": ["npx", "package"](array, not separate command/args) - Environment:
"environment"(not"env") - Requires:
"type": "local"for stdio servers
See OpenCode Setup for examples.
Configuration Schema¶
{
"mcpServers": {
"<server-name>": {
"command": "<executable>",
"args": ["<arg1>", "<arg2>"],
"env": {
"<VAR_NAME>": "<value>"
},
"cwd": "<working-directory>",
"envFile": "<path-to-env-file>"
}
}
}
Field Reference¶
command (required)¶
The executable to run. Examples:
"npx"- Run via npx"node"- Run with Node.js directly"docker"- Run in Docker container"/usr/local/bin/node"- Absolute path to Node.js
args (required)¶
Array of command-line arguments:
For Docker:
env (optional)¶
Environment variables passed to the server:
{
"env": {
"F5XC_API_URL": "https://tenant.console.ves.volterra.io",
"F5XC_API_TOKEN": "token-value",
"LOG_LEVEL": "debug"
}
}
cwd (optional)¶
Working directory for the server process:
envFile (optional)¶
Path to environment file:
Complete Examples¶
Minimal (Documentation Mode)¶
With API Token¶
{
"mcpServers": {
"f5xc-api": {
"command": "npx",
"args": ["@robinmordasiewicz/f5xc-api-mcp"],
"env": {
"F5XC_API_URL": "https://your-tenant.console.ves.volterra.io",
"F5XC_API_TOKEN": "your-api-token"
}
}
}
}
With API Token (Using Environment Variables)¶
For better security, reference environment variables instead of hardcoding:
{
"mcpServers": {
"f5xc-api": {
"command": "npx",
"args": ["@robinmordasiewicz/f5xc-api-mcp"],
"env": {
"F5XC_API_URL": "${env:F5XC_API_URL}",
"F5XC_API_TOKEN": "${env:F5XC_API_TOKEN}"
}
}
}
}
The values will be resolved from your system environment variables:
export F5XC_API_URL="https://your-tenant.console.ves.volterra.io"
export F5XC_API_TOKEN="your-api-token"
With P12 Certificate¶
{
"mcpServers": {
"f5xc-api": {
"command": "npx",
"args": ["@robinmordasiewicz/f5xc-api-mcp"],
"env": {
"F5XC_API_URL": "https://your-tenant.console.ves.volterra.io",
"F5XC_P12_BUNDLE": "/Users/username/certs/f5xc.p12",
"F5XC_P12_PASSWORD": "certificate-password"
}
}
}
}
With P12 Certificate (Using Environment Variables)¶
For better security with certificates:
{
"mcpServers": {
"f5xc-api": {
"command": "npx",
"args": ["@robinmordasiewicz/f5xc-api-mcp"],
"env": {
"F5XC_API_URL": "${env:F5XC_API_URL}",
"F5XC_P12_BUNDLE": "${env:F5XC_P12_BUNDLE}",
"F5XC_P12_PASSWORD": "${env:F5XC_P12_PASSWORD}"
}
}
}
}
With environment variables set:
export F5XC_API_URL="https://your-tenant.console.ves.volterra.io"
export F5XC_P12_BUNDLE="/Users/username/certs/f5xc.p12"
export F5XC_P12_PASSWORD="certificate-password"
Docker with Volume Mount¶
{
"mcpServers": {
"f5xc-api": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "F5XC_API_URL",
"-e", "F5XC_API_TOKEN",
"-v", "/Users/username/certs:/certs:ro",
"ghcr.io/robinmordasiewicz/f5xc-api-mcp"
],
"env": {
"F5XC_API_URL": "https://your-tenant.console.ves.volterra.io",
"F5XC_API_TOKEN": "your-api-token"
}
}
}
}
Using Environment File¶
{
"mcpServers": {
"f5xc-api": {
"command": "npx",
"args": ["@robinmordasiewicz/f5xc-api-mcp"],
"envFile": "${workspaceFolder}/.env.f5xc"
}
}
}
With .env.f5xc:
F5XC_API_URL=https://your-tenant.console.ves.volterra.io
F5XC_API_TOKEN=your-api-token
LOG_LEVEL=info
Multiple MCP Servers¶
{
"mcpServers": {
"f5xc-api": {
"command": "npx",
"args": ["@robinmordasiewicz/f5xc-api-mcp"]
},
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/allowed/path"]
},
"github": {
"command": "npx",
"args": ["@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_xxxx"
}
}
}
}
Variable Substitution¶
Some clients support variable substitution:
| Variable | Description |
|---|---|
${workspaceFolder} | Current workspace root |
${env:VAR_NAME} | System environment variable |
${userHome} | User's home directory |
Example:
Validation¶
JSON Syntax¶
Use a JSON validator or editor with JSON support. Common issues:
- Trailing commas (not allowed in JSON)
- Missing quotes around strings
- Unescaped special characters in values
Path Validation¶
- Use absolute paths for
F5XC_P12_FILE - Verify files exist and are readable
- Check permissions on certificate files
Troubleshooting¶
Configuration Not Loading¶
- Validate JSON syntax
- Check file location matches your application
- Restart the application after changes
Server Not Starting¶
- Test command manually:
npx @robinmordasiewicz/f5xc-api-mcp - Check Node.js version:
node --version - Verify npx is available:
which npx
Environment Variables Not Set¶
- Check for typos in variable names
- Ensure values don't contain unescaped characters
- Try hardcoding values temporarily to test