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

This commit is contained in:
Will Pfleger
2026-04-17 15:16:37 -04:00
committed by GitHub
parent 1a18c2748c
commit 7fa662bcac
16 changed files with 212 additions and 29 deletions
+5 -16
View File
@@ -9,8 +9,7 @@ use rmcp::transport::streamable_http_server::{
session::local::LocalSessionManager, StreamableHttpServerConfig, StreamableHttpService,
};
use rmcp::{
handler::server::router::tool::ToolRouter, tool, tool_handler, tool_router,
ErrorData as McpError, RoleServer, ServerHandler, Service,
tool, tool_handler, tool_router, ErrorData as McpError, RoleServer, ServerHandler, Service,
};
use std::sync::Arc;
use tokio::task::JoinHandle;
@@ -88,23 +87,13 @@ impl<S: Service<RoleServer>> Service<RoleServer> for ValidatingService<S> {
}
}
#[derive(Clone)]
pub struct McpFixtureServer {
tool_router: ToolRouter<McpFixtureServer>,
}
impl Default for McpFixtureServer {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Default)]
pub struct McpFixtureServer;
#[tool_router]
impl McpFixtureServer {
pub fn new() -> Self {
Self {
tool_router: Self::tool_router(),
}
Self
}
#[tool(description = "Get the code", annotations(read_only_hint = true))]
@@ -121,7 +110,7 @@ impl McpFixtureServer {
}
}
#[tool_handler(router = self.tool_router)]
#[tool_handler]
impl ServerHandler for McpFixtureServer {
fn get_info(&self) -> ServerInfo {
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())