# MCP Config Examples

### Configuration Examples <a href="#configuration-examples" id="configuration-examples"></a>

#### Local MCP Server (Stdio Transport) <a href="#local-mcp-server-stdio-transport" id="local-mcp-server-stdio-transport"></a>

**Detected by**: Presence of `command` field

```json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/Documents"
      ],
      "env": {
        "NODE_ENV": "production",
        "DEBUG": "mcp:*"
      },
      "cwd": "/Users/username/workspace"
    }
  }
}
```

**Properties**:

* `command` (required): The executable to run
* `args` (optional): Array of command-line arguments
* `env` (optional): Environment variables for the process
* `cwd` (optional): Working directory for the process

#### Remote MCP Server with JWT Authentication <a href="#remote-mcp-server-with-jwt-authentication" id="remote-mcp-server-with-jwt-authentication"></a>

**Detected by**: Presence of `url` field (defaults to Streamable HTTP)

```json
{
  "mcpServers": {
    "my-api": {
      "url": "https://api.example.com/mcp",
      "requestInit": {
        "headers": {
          "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
          "Content-Type": "application/json"
        }
      }
    }
  }
}
```

**Properties**:

* `url` (required): The MCP endpoint URL
* `requestInit` (optional): Standard Fetch API RequestInit object
  * `headers`: HTTP headers to include in all requests
* `sessionId` (optional): Session identifier for the connection

#### Remote MCP Server with API Key (multiple headers) <a href="#remote-mcp-server-with-api-key" id="remote-mcp-server-with-api-key"></a>

This example shows how various authorizations might appear in the `mcp_servers.json` file.

```json
{
  "mcpServers": {
    "weather-service": {
      "url": "https://weather-mcp.example.com/mcp",
      "requestInit": {
        "headers": {
          "Authorization": "Bearer token",
          "X-API-Key": "api-key",
          "X-Client-ID": "client-id",
          "X-Environment": "production"
          "X-Session-Token": "session-token-value"
        }
      }
    }
  }
}
```

#### Legacy SSE Server <a href="#legacy-sse-server" id="legacy-sse-server"></a>

**Detected by**: Explicit `transport: "sse"` field

```json
{
  "mcpServers": {
    "legacy-api": {
      "transport": "sse",
      "url": "https://old-api.example.com/sse",
      "requestInit": {
        "headers": {
          "Authorization": "Bearer legacy-token-123"
        }
      },
      "eventSourceInit": {
        "withCredentials": true
      }
    }
  }
}
```

**Properties**:

* `transport` (required): Must be `"sse"`
* `url` (required): The SSE endpoint URL
* `requestInit` (optional): Request configuration
* `eventSourceInit` (optional): EventSource-specific options
* `authProvider` (optional): OAuth client provider (advanced)
