Skip to main content

Crate brainwires_mcp_server

Crate brainwires_mcp_server 

Source
Expand description

§Brainwires MCP Server

MCP server framework with middleware pipeline for the Brainwires Agent Framework.

Provides everything needed to build an MCP-compliant tool server:

  • McpServer — async event loop that reads JSON-RPC, runs middleware, dispatches to handler
  • McpHandler — trait defining how your server responds to initialize/list_tools/call_tool
  • McpToolRegistry — stores tool definitions + handlers, dispatches tool calls
  • MiddlewareChain — ordered middleware pipeline (auth, logging, rate-limiting, tool filtering)
  • ServerTransport — pluggable transport (stdio included)

Re-exports§

pub use connection::ClientInfo;
pub use connection::RequestContext;
pub use error::AgentNetworkError;
pub use handler::McpHandler;
pub use mcp_transport::ServerTransport;
pub use mcp_transport::StdioServerTransport;
pub use middleware::Middleware;
pub use middleware::MiddlewareChain;
pub use middleware::MiddlewareResult;
pub use registry::McpToolDef;
pub use registry::McpToolRegistry;
pub use registry::ToolHandler;
pub use server::McpServer;
pub use tasks::McpTask;
pub use tasks::McpTaskState;
pub use tasks::McpTaskStore;
pub use middleware::auth::AuthMiddleware;
pub use middleware::logging::LoggingMiddleware;
pub use middleware::rate_limit::RateLimitMiddleware;
pub use middleware::tool_filter::ToolFilterMiddleware;

Modules§

connection
WebSocket/HTTP connection types.
error
Error types for the MCP server.
handler
MCP request handler trait.
mcp_transport
MCP server transport (stdio).
middleware
Middleware pipeline (auth, logging, rate-limiting, tool filtering).
registry
MCP tool registry.
server
MCP server lifecycle.
tasks
MCP Tasks primitive (SEP-1686). MCP Tasks primitive (SEP-1686).