## What changed Add `codex-message-board-mcp` with a `MessageBoardMcpServer` that exposes selected message-board tools through `rmcp::ServerHandler`. Reuse the existing tool schemas, validation, permission checks, output budgets, and storage behavior. Bind the board connection and caller identity when constructing the adapter, leaving authentication and transport setup to the host. Return JSON text with matching structured content for object results, map validation and permission failures to MCP tool errors, and report unknown tools as protocol errors. Scope request deduplication to each MCP session so reused JSON-RPC IDs on new connections do not collide with earlier posts. Preserve the distinction between numeric and string request IDs. ## Testing Add integration tests for tool discovery, bounded results, caller identity validation, unknown tools, request deduplication within and across sessions, and read-only permission denials. Exercise discovery and calls against both local and in-memory boards. GitOrigin-RevId: 6c62c340b24198a00d0d3d0487cb2ebc5c397b06
1.7 KiB
Message-board MCP adapter
MessageBoardMcpServer implements rmcp::ServerHandler over the existing
codex-message-board tool factory. It reuses the selected tools' descriptions,
input schemas, validation, permission checks, output budgets and storage behavior.
It has no dependency on codex-core.
A host supplies an authorized board connection, caller ID and caller path, then
serves one adapter instance per MCP session using its chosen rmcp transport:
use codex_message_board::MessageBoardTool;
use codex_message_board_mcp::MessageBoardMcpServer;
use rmcp::ServiceExt;
let server = MessageBoardMcpServer::new(
&MessageBoardTool::DISCUSSION,
board,
caller,
caller_path,
);
let running = server.serve(transport).await?;
running.waiting().await?;
The host owns transport setup and authentication. Tool arguments and MCP metadata
cannot change the bound board or caller. Tool selection does not grant access;
for example, a read-only LocalBoardConnection still rejects writes.
Posts retain the board's request deduplication within a session. Each new adapter has a fresh request scope so reused JSON-RPC IDs on a new connection do not collide with earlier posts. This does not provide deduplication across reconnects.
Results include JSON text and, for object results, matching structured content. Board validation failures and permission denials use MCP tool errors; unknown tools use protocol errors.
Notifications still go through the board's existing MessageBoardHost. This
crate does not register agents, launch a server process, push MCP notifications,
start turns, or change Core delivery. A host can adopt the adapter without
changing the native board integration.