Files
OneCAD/crates/mcp/src/lib.rs
T
bherbruckandClaude Opus 5.5 d1ff23990e MCP: server and tools
crates/mcp (L5, engine only): JSON-RPC 2.0 over stdio with protocol version negotiation, a
headless Session backend and a bridge to the app's control port, 14 tools (list_commands,
execute, batch with rollback, inspect_design, measure, body_topology, set_parameter,
screenshot as an image block, export, undo/redo, new_design/open/save) and tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
2026-10-07 19:25:27 +00:00

22 lines
888 B
Rust

//! SolveCraft MCP server.
//!
//! JSON-RPC 2.0 over stdio (newline-delimited), implementing the MCP lifecycle, tools and
//! resources. Tools map onto the control-channel methods (`engine.execute`, `document.inspect`,
//! `ui.render`…, see `docs/control-protocol.md`), served either by an in-process headless
//! [`Headless`] session or by a running app through its loopback control port ([`Remote`]), so a
//! person can watch the agent model. Every modelling step is an engine command; tools never open
//! dialogs.
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
#![forbid(unsafe_code)]
mod backend;
mod server;
mod tools;
pub use backend::{Backend, Headless, Remote};
pub use server::{PROTOCOL_VERSION, SUPPORTED_VERSIONS, Server};
pub use tools::{call_tool, tool_definitions};
#[cfg(test)]
mod tests;