Skip to content

feat(extensions): support Unix domain socket transport for StreamableHttp MCP#7860

Merged
wpfleger96 merged 5 commits intomainfrom
wpfleger/socket-support-upstream
Apr 17, 2026
Merged

feat(extensions): support Unix domain socket transport for StreamableHttp MCP#7860
wpfleger96 merged 5 commits intomainfrom
wpfleger/socket-support-upstream

Conversation

@wpfleger96
Copy link
Copy Markdown
Collaborator

@wpfleger96 wpfleger96 commented Mar 13, 2026

Summary

  • Add socket: Option<String> field to StreamableHttp extension config, enabling MCP connections routed through Unix domain sockets (e.g. Envoy sidecars in K8s where outbound HTTP must go through the proxy's UDS)
  • Wire up rmcp::transport::UnixSocketHttpClient in extension_manager.rs — when socket is set, HTTP is physically routed through the socket while uri serves as the Host header and path
  • Apply substitute_env_vars to the socket field at connection time so env-backed paths like $ENVOY_SOCK resolve correctly
  • Skip OAuth retry for UDS connections — oauth_flow() uses a standard reqwest::Client over TCP, which can't reach authorization servers through a Unix socket. Log a clear warning instead of letting it fail with a confusing DNS error.

Background

This builds on the rmcp 1.5.0 upgrade (#8618) and IconTheme schema fix (#8621), both already merged.

Supersedes #7631, which implemented UDS support directly in goose. That local implementation (~420 lines of hyper-based code) is replaced by the upstream rmcp feature flag transport-streamable-http-client-unix-socket.

@wpfleger96 wpfleger96 marked this pull request as ready for review March 13, 2026 15:35
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c8f30ab3c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Cargo.toml Outdated
@wpfleger96 wpfleger96 force-pushed the wpfleger/socket-support-upstream branch from 3c8f30a to 3052674 Compare March 16, 2026 23:01
@DOsinga DOsinga added the needs_human label to set when a robot looks at a PR and can't handle it label Mar 20, 2026
@wpfleger96 wpfleger96 force-pushed the wpfleger/socket-support-upstream branch from 8c46f1f to 745aa62 Compare March 26, 2026 22:36
@wpfleger96 wpfleger96 changed the title refactor(extensions): use upstream rmcp UnixSocketHttpClient feat(extensions): support Unix domain socket transport for StreamableHttp MCP Mar 26, 2026
@wpfleger96 wpfleger96 changed the base branch from wpfleger/socket-support to main March 26, 2026 22:36
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Recipe Security Scan Results

⚠️ Status: SCAN FAILED - Technical issues during scanning

📊 Scan Summary:

  • Total recipes scanned: 1
  • Failed scans: 1

📋 Individual Recipe Results:
❓ Recipe 1: UNKNOWN (UNKNOWN risk)

🔗 View detailed scan results in the workflow artifacts.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4bf5ba15c6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/agents/extension.rs Outdated
@wpfleger96 wpfleger96 force-pushed the wpfleger/socket-support-upstream branch from 4bf5ba1 to bcb0978 Compare March 27, 2026 19:46
@wpfleger96 wpfleger96 force-pushed the wpfleger/socket-support-upstream branch from bcb0978 to c4e688d Compare April 15, 2026 23:24
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4e688db97

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/agents/extension.rs
@wpfleger96 wpfleger96 force-pushed the wpfleger/socket-support-upstream branch from c4e688d to 9cabdce Compare April 16, 2026 14:39
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9cabdce081

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/agents/extension.rs
@wpfleger96
Copy link
Copy Markdown
Collaborator Author

wpfleger96 commented Apr 16, 2026

I'm currently unable to regenerate the frontend API code locally because of: hey-api/openapi-ts#3783

turns out this was actually an issue in goose itself, fixed here: 44ec31c27fd

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89e3183b7a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/agents/extension_manager.rs
…sport

Adds `socket: Option<String>` to `ExtensionConfig::StreamableHttp` to
support HTTP-over-Unix-domain-socket routing (e.g. K8s Envoy sidecars).
The transport wiring using rmcp's `UnixSocketHttpClient` will follow
once rmcp 1.5.0 is released on crates.io.
Bump rmcp to 1.5.0 and wire UnixSocketHttpClient into the extension
manager for HTTP-over-UDS transport. When `socket` is set on a
StreamableHttp extension, connections route through the Unix socket
while `uri` provides the Host header and path.

Also migrates all rmcp struct literals to constructor/builder APIs
required by the 1.3.0+ #[non_exhaustive] sweep: StoredCredentials,
CreateElicitationResult, StreamableHttpClientTransportConfig,
AuthRequiredError, DynamicTransportError, and McpFixtureServer.
oauth_flow() uses a standard reqwest::Client over TCP, so it can't
reach authorization servers through a Unix domain socket. Replace
the doomed retry with a clear warning log, which also removes the
duplicated header construction that the retry path required.
@wpfleger96 wpfleger96 force-pushed the wpfleger/socket-support-upstream branch from 89e3183 to 7ff6bc9 Compare April 17, 2026 15:46
@wpfleger96
Copy link
Copy Markdown
Collaborator Author

👋 hey @alexhancock @jamadeo this is now tested and working with the upstream rmcp changes (and I closed out #7631) if you wouldn't minding reviewing this one whenever you get a chance!

Comment thread crates/goose/src/agents/extension.rs Outdated
Drop socket serde round-trip tests per review feedback — they only
exercise serde_json's well-established Option/default behavior.
Keep the Display impl tests which cover our custom formatting logic.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20f87d1986

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/agents/extension.rs
substitute_env_vars was applied to uri and headers but not socket,
so the restart-suppression equality check in add_extension would
miss socket path rotation when using env-backed values like
$ENVOY_SOCK.
@wpfleger96 wpfleger96 enabled auto-merge April 17, 2026 19:12
@wpfleger96 wpfleger96 added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit 7fa662b Apr 17, 2026
21 checks passed
@wpfleger96 wpfleger96 deleted the wpfleger/socket-support-upstream branch April 17, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_human label to set when a robot looks at a PR and can't handle it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants