The MCP servers we connect the agent require to Authorization headers (that are internally forwarded on to other API backends behind them). This allows a user to pass Basic / Bearer etc authentication/tokens in a header out of band to authenticate requests.
The key here is that for authorization, this needs to be "per user" and collected in the browser rather than something hard-coded into custom Pydantic AI agent configuration.
It would be great if ai-chat-ui supported an optional "login" prompt that would allow setting common authentication headers (e.g, Basic Auth and Bearer Auth) that would be sent to HTTP MCPToolsets.
Existing Art
Codex
Codex supports adding headers to queries to HTTP MCP servers
OpenCode
OpenCode supports adding headers to MCP server requests
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"my-remote-mcp": {
"type": "remote",
"url": "https://my-mcp-server.com",
"enabled": true,
"headers": {
"Authorization": "Bearer MY_API_KEY"
}
}
}
Swagger UI
This is similar to how Swagger UI exposed authentication options in its user-friendly REST API development pages.

The MCP servers we connect the agent require to
Authorizationheaders (that are internally forwarded on to other API backends behind them). This allows a user to passBasic/Beareretc authentication/tokens in a header out of band to authenticate requests.The key here is that for authorization, this needs to be "per user" and collected in the browser rather than something hard-coded into custom Pydantic AI agent configuration.
It would be great if
ai-chat-uisupported an optional "login" prompt that would allow setting common authentication headers (e.g, Basic Auth and Bearer Auth) that would be sent to HTTPMCPToolsets.Existing Art
Codex
Codex supports adding headers to queries to HTTP MCP servers
OpenCode
OpenCode supports adding headers to MCP server requests
{ "$schema": "https://opencode.ai/config.json", "mcp": { "my-remote-mcp": { "type": "remote", "url": "https://my-mcp-server.com", "enabled": true, "headers": { "Authorization": "Bearer MY_API_KEY" } } }Swagger UI
This is similar to how Swagger UI exposed authentication options in its user-friendly REST API development pages.