[MCP] Add support for streamable http servers with codex mcp add and replace bearer token handling (#4904)

1. You can now add streamable http servers via the CLI
2. As part of this, I'm also changing the existing bearer_token plain
text config field with ane env var

```
mcp add github --url https://api.githubcopilot.com/mcp/ --bearer-token-env-var=GITHUB_PAT
```
This commit is contained in:
Gabriel Peal
2025-10-07 20:21:37 -07:00
committed by GitHub
parent 496cb801e1
commit a43ae86b6c
7 changed files with 372 additions and 75 deletions

View File

@@ -232,7 +232,7 @@ async fn streamable_http_tool_call_round_trip() -> anyhow::Result<()> {
McpServerConfig {
transport: McpServerTransportConfig::StreamableHttp {
url: server_url,
bearer_token: None,
bearer_token_env_var: None,
},
startup_timeout_sec: Some(Duration::from_secs(10)),
tool_timeout_sec: None,
@@ -412,7 +412,7 @@ async fn streamable_http_with_oauth_round_trip() -> anyhow::Result<()> {
McpServerConfig {
transport: McpServerTransportConfig::StreamableHttp {
url: server_url,
bearer_token: None,
bearer_token_env_var: None,
},
startup_timeout_sec: Some(Duration::from_secs(10)),
tool_timeout_sec: None,