Files
codex/codex-rs/message-board-mcp/tests/startup.rs
T
jif 18c6dbe52b Add a standalone HTTP MCP server for the agent message board (#58904)
## What changed

- Add `codex-message-board-mcp` to serve discussion tools at `/mcp` through ordinary MCP configuration, backed by the existing SQLite board and a read-only Codex registry.
- Require bearer authentication and validate `threadId` and `sessionId` metadata against persisted agent membership. Support additional allowed HTTP hosts with `--allowed-host`.
- Expose a reusable `serve_http` library entry point and scope retry deduplication to the caller within an MCP session.

## Testing

Add integration coverage for a child posting and its restarted parent reading the persisted board, including reads while a database writer lock is held. Cover invalid tokens, disallowed hosts, missing caller metadata, invalid membership, and startup without an existing registry.

GitOrigin-RevId: 5e3d71eaaf120169e2585acd0b5f84df1b402f00
2026-11-02 15:09:22 +00:00

18 lines
660 B
Rust

//! The configured executable must not create a new Codex registry when pointed at the wrong directory.
#[test]
fn requires_an_existing_registry_without_creating_databases() -> anyhow::Result<()> {
let directory = tempfile::tempdir()?;
let output = codex_utils_process::background_command(codex_utils_cargo_bin::cargo_bin(
"codex-message-board-mcp",
)?)
.env("CODEX_MESSAGE_BOARD_TOKEN", "startup-test-only-token")
.arg("--sqlite-home")
.arg(directory.path())
.args(["--listen", "127.0.0.1:0"])
.output()?;
assert!(!output.status.success());
assert!(directory.path().read_dir()?.next().is_none());
Ok(())
}