Expand description
MCP (Model Context Protocol) server exposing the same operations as the CLI, over stdio.
Tool inputs and outputs are the same serde/schemars types the CLI uses, so an agent
sees one schema whichever way it calls us.
MCP is the protocol AI assistants (Claude, Cursor, VS Code, …) use to call local tools.
The server offers one tool per operation (openreadout_info, openreadout_stats,
openreadout_peaks, openreadout_export, …), named like the CLI commands and taking the
CLI flags’ names as arguments, resources (openreadout://formats,
openreadout://file/{path}) and prompts; book/src/reference/mcp.md in the repository lists them.
§Cargo features
| feature | default | what it adds |
|---|---|---|
http | no | serve_http and HttpOptions: MCP over Streamable HTTP on a loopback address (optional bearer token). Off by default so that the stdio server contains no networking code. |
§Example
use openreadout_core::Registry;
/// The readers the server may use; called once per request so that every call gets fresh
/// readers. Real servers register the format crates' readers here.
fn registry() -> Registry {
Registry::new()
}
// Serve on stdin/stdout until the client disconnects.
openreadout_mcp::serve_stdio(registry)?;Structs§
- Http
Options - Options of
serve_http. - Instrument
Server - The server. Holds a registry factory so each call gets fresh readers.
Constants§
- ERROR_
META_ KEY - Result
_metakey of a failed call:{code, exit_code, hint}. - INSTRUCTIONS
- Server instructions sent at initialization.
- PREVIEW_
BUDGET - Byte budget of a preview returned inline (tool image content or resource blob).
Functions§
- serve_
http - Serve MCP over Streamable HTTP until the process is stopped.
- serve_
stdio - Serve over stdio until the client disconnects.