diff options
| author | Adam Spiers <[email protected]> | 2025-06-30 01:09:08 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-30 00:09:08 +0000 |
| commit | 0fd602eb43eea7abca980dc2ae3fd7bf2ba76a2a (patch) | |
| tree | b181996faa4e7ee66926ce68e2aeac2d823a91ed /docs/tools | |
| parent | d1eb86581ce800778e5a093039ce237ec6da6118 (diff) | |
feat: add support to remote MCP servers for custom HTTP headers (#2477)
Diffstat (limited to 'docs/tools')
| -rw-r--r-- | docs/tools/mcp-server.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/tools/mcp-server.md b/docs/tools/mcp-server.md index ebce6160..0be9a34b 100644 --- a/docs/tools/mcp-server.md +++ b/docs/tools/mcp-server.md @@ -87,6 +87,7 @@ Each server configuration supports the following properties: #### Optional - **`args`** (string[]): Command-line arguments for Stdio transport +- **`headers`** (object): Custom HTTP headers when using `httpUrl` - **`env`** (object): Environment variables for the server process. Values can reference environment variables using `$VAR_NAME` or `${VAR_NAME}` syntax - **`cwd`** (string): Working directory for Stdio transport - **`timeout`** (number): Request timeout in milliseconds (default: 600,000ms = 10 minutes) @@ -166,6 +167,24 @@ Each server configuration supports the following properties: } ``` +#### HTTP-based MCP Server with Custom Headers + +```json +{ + "mcpServers": { + "httpServerWithAuth": { + "httpUrl": "http://localhost:3000/mcp", + "headers": { + "Authorization": "Bearer your-api-token", + "X-Custom-Header": "custom-value", + "Content-Type": "application/json" + }, + "timeout": 5000 + } + } +} +``` + ## Discovery Process Deep Dive When the Gemini CLI starts, it performs MCP server discovery through the following detailed process: |
