Added --header CLI args support

This can include ${ENV_VAR} strings that are replaced with the values in process.env
This commit is contained in:
Glen Maddern 2025-04-10 11:27:25 +10:00
parent 84b87375fb
commit a3b4906afd
5 changed files with 72 additions and 13 deletions

View file

@ -32,6 +32,29 @@ All the most popular MCP clients (Claude Desktop, Cursor & Windsurf) use the fol
}
```
### Custom Headers
To bypass authentication, or to emit custom headers on all requests to your remote server, pass `--header` CLI arguments:
```json
{
"mcpServers": {
"remote-example": {
"command": "npx",
"args": [
"mcp-remote",
"https://remote.mcp.server/sse",
"--header",
"Authorization: Bearer ${AUTH_TOKEN}"
]
},
"env": {
"AUTH_TOKEN": "..."
}
}
}
```
### Flags
* If `npx` is producing errors, consider adding `-y` as the first argument to auto-accept the installation of the `mcp-remote` package.