Replies: 1 comment
|
I checked the current CLI and source: you're not missing a flag. Arbitrary headers are supported by the MCP client and config, but Bearer auth can be configured entirely from the CLI: codex mcp add my-server \
--url https://example.com/mcp \
--bearer-token-env-var MY_MCP_TOKENFor a custom header name, add the server and then put this in [mcp_servers.my-server]
url = "https://example.com/mcp"
[mcp_servers.my-server.env_http_headers]
X-My-Header = "MY_MCP_HEADER"
One gotcha: |
Uh oh!
There was an error while loading. Please reload this page.
Why we can only set headers by going in the .toml itself and cant simply pass --header X-My-Header=XXXX like in claude cli ? It seems like a deliberate choice but really complicating our users onboarding.
All reactions