Skip to main content

sim_lib_mcp/
lib.rs

1//! Library-only MCP surface projection for SIM.
2//!
3//! This crate projects native browse Cards and optional `SkillCard` records
4//! into redacted `McpSurfaceCard` rows. Routing, transport, and callable
5//! execution are implemented by later MCP layers.
6
7#![forbid(unsafe_code)]
8#![deny(missing_docs)]
9
10#[cfg(feature = "cassette")]
11mod cassette;
12#[cfg(feature = "client")]
13mod client;
14mod content;
15mod exec;
16#[cfg(feature = "http")]
17mod http;
18mod install;
19mod manifest;
20mod methods;
21mod native;
22mod ops;
23mod profile;
24mod router;
25#[cfg(feature = "sampling")]
26mod sampling;
27mod schema;
28#[cfg(feature = "serve")]
29mod serve;
30mod session;
31#[cfg(feature = "skill")]
32mod skill;
33/// Line-delimited MCP transport over standard input and output.
34#[cfg(feature = "stdio")]
35pub mod stdio;
36#[cfg(all(test, feature = "stdio"))]
37mod stdio_tests;
38#[cfg(feature = "stream")]
39mod stream;
40mod surface;
41mod uri;
42
43#[cfg(all(test, feature = "cassette"))]
44mod cassette_tests;
45#[cfg(all(test, feature = "client"))]
46mod client_tests;
47#[cfg(all(test, feature = "skill"))]
48mod coexistence_tests;
49#[cfg(all(test, feature = "http"))]
50mod http_tests;
51#[cfg(test)]
52mod prompts_tests;
53#[cfg(test)]
54mod resources_tests;
55#[cfg(all(test, feature = "sampling"))]
56mod sampling_tests;
57#[cfg(all(test, feature = "stream", feature = "progress"))]
58mod stream_tests;
59#[cfg(test)]
60mod tests;
61#[cfg(test)]
62mod tools_call_tests;
63#[cfg(test)]
64mod tools_list_tests;
65
66#[cfg(feature = "cassette")]
67pub use cassette::{
68    McpAuditEntry, McpCassette, McpCassetteEntry, mcp_audit_entry_class_symbol,
69    mcp_cassette_class_symbol, mcp_cassette_entry_class_symbol,
70};
71#[cfg(feature = "client")]
72pub use client::{
73    McpClient, McpClientAllowPolicy, McpClientCassettePeer, McpClientPeer, McpClientTransport,
74    RouterMcpPeer, mcp_client_capability,
75};
76pub use exec::{
77    mcp_prompts_get_capability, mcp_resources_read_capability, mcp_tools_call_capability,
78};
79#[cfg(feature = "http")]
80pub use http::{McpHttpAdapter, mcp_http_capability};
81pub use install::install_mcp_lib;
82pub use manifest::{McpLib, manifest_name};
83pub use native::{
84    McpExportFacet, McpNativeCard, NativeFacet, mcp_export_facet_name, mcp_export_operation_symbol,
85    native_surface_rows,
86};
87pub use ops::{
88    McpFunction, call_symbol, get_prompt_symbol, handle_symbol, health_symbol, initialize_symbol,
89    mcp_exports, prompts_symbol, read_symbol, resources_symbol, tools_symbol,
90};
91pub use profile::McpProfile;
92pub use router::{McpRouter, RouterReply};
93#[cfg(feature = "sampling")]
94pub use sampling::{
95    FixtureSamplingHost, McpSamplingHost, McpSamplingRunner, McpSamplingRunnerValue,
96    mcp_sampling_capability, mcp_sampling_data_kind, mcp_sampling_runner_symbol,
97    sampling_runner_value,
98};
99pub use schema::shape_to_json_schema;
100#[cfg(feature = "serve")]
101pub use serve::{
102    CliOptions, McpServeLib, Transport, configure_mcp_bootloader, mcp_bootloader,
103    mcp_serve_entrypoint_symbol,
104};
105pub use session::McpSession;
106#[cfg(feature = "skill")]
107pub use skill::{project_skill_surface, skill_surface_rows};
108#[cfg(feature = "stream")]
109pub use stream::{
110    mcp_cancelled_data_kind, mcp_failed_diagnostic_kind, mcp_overflowed_diagnostic_kind,
111    mcp_progress_data_kind, mcp_truncated_diagnostic_kind,
112};
113pub use surface::{
114    McpAnnotation, McpAnnotationVisibility, McpStreamPolicy, McpSurfaceCard, McpSurfaceRole,
115    McpSurfaceSource, project_mcp_surface, project_native_surface, project_surface_rows,
116    stable_mcp_name,
117};
118
119/// Stable identifier under which this library registers in the runtime.
120pub const MCP_LIB_ID: &str = "mcp";