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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
646b9a7226
commit
d1ff23990e
9 files changed
+1184
No files matched your search
@@ -0,0 +1,21 @@
|
||||
//! 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;
|
||||
Reference in new issue
Block a user