Skip to main content

origin_mcp_core/
lib.rs

1//! The MCP boundary (ADR-0027).
2//!
3//! MCP makes an application **controllable by an external AI**. It is not an inference
4//! API — for inference the application performs itself, see `origin-ai`.
5//!
6//! ```text
7//!   the user's own AI  ──MCP──▶  this application  ──▶  application services
8//! ```
9//!
10//! The application therefore needs no model, no API key and no chat window of its own.
11//! It states what it can do and what an AI is allowed to do with it.
12//!
13//! An MCP server is a **driving adapter**, the same role as the Tauri host or a CLI —
14//! which is why nothing in this crate knows Tauri, and why a tool must be a service
15//! method rather than a command.
16//!
17//! # The caller is a language model
18//!
19//! It acts on content it read somewhere, and that content may be hostile. A tool call
20//! is therefore not a trusted request: the default grant is read and propose, never
21//! commit or delete (see [`AiPermission`]).
22
23mod permission;
24mod protocol;
25mod server;
26mod tool;
27
28pub use permission::{AiPermission, AiPermissions};
29pub use protocol::{
30    ClientInfo, InitializeParams, PROTOCOL_VERSION, Request, Response, ResponseError, ServerInfo,
31};
32pub use server::McpServer;
33pub use tool::{Tool, ToolDescriptor, ToolOutput};