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/// Cookbook recipes for this lib, embedded at build time.
60pub static RECIPES: sim_cookbook::EmbeddedDir =
61    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
62
63#[cfg(test)]
64mod tests;
65#[cfg(test)]
66mod tools_call_tests;
67#[cfg(test)]
68mod tools_list_tests;
69
70#[cfg(feature = "cassette")]
71pub use cassette::{
72    McpAuditEntry, McpCassette, McpCassetteEntry, mcp_audit_entry_class_symbol,
73    mcp_cassette_class_symbol, mcp_cassette_entry_class_symbol,
74};
75#[cfg(feature = "client")]
76pub use client::{
77    McpClient, McpClientAllowPolicy, McpClientCassettePeer, McpClientPeer, McpClientTransport,
78    RouterMcpPeer, mcp_client_capability,
79};
80pub use exec::{
81    mcp_prompts_get_capability, mcp_resources_read_capability, mcp_tools_call_capability,
82};
83#[cfg(feature = "http")]
84pub use http::{McpHttpAdapter, mcp_http_capability};
85pub use install::install_mcp_lib;
86pub use manifest::{McpLib, manifest_name};
87pub use native::{
88    McpExportFacet, McpNativeCard, NativeFacet, mcp_export_facet_name, mcp_export_operation_symbol,
89    native_surface_rows,
90};
91pub use ops::{
92    McpFunction, call_symbol, get_prompt_symbol, handle_symbol, health_symbol, initialize_symbol,
93    mcp_exports, prompts_symbol, read_symbol, resources_symbol, tools_symbol,
94};
95pub use profile::McpProfile;
96pub use router::{McpRouter, RouterReply};
97#[cfg(feature = "sampling")]
98pub use sampling::{
99    FixtureSamplingHost, McpSamplingHost, McpSamplingRunner, McpSamplingRunnerValue,
100    mcp_sampling_capability, mcp_sampling_data_kind, mcp_sampling_runner_symbol,
101    sampling_runner_value,
102};
103pub use schema::shape_to_json_schema;
104#[cfg(feature = "serve")]
105pub use serve::{
106    CliOptions, McpServeLib, Transport, configure_mcp_bootloader, mcp_bootloader,
107    mcp_serve_entrypoint_symbol,
108};
109pub use session::McpSession;
110#[cfg(feature = "skill")]
111pub use skill::{project_skill_surface, skill_surface_rows};
112#[cfg(feature = "stream")]
113pub use stream::{
114    mcp_cancelled_data_kind, mcp_failed_diagnostic_kind, mcp_overflowed_diagnostic_kind,
115    mcp_progress_data_kind, mcp_truncated_diagnostic_kind,
116};
117pub use surface::{
118    McpAnnotation, McpAnnotationVisibility, McpStreamPolicy, McpSurfaceCard, McpSurfaceRole,
119    McpSurfaceSource, project_mcp_surface, project_native_surface, project_surface_rows,
120    stable_mcp_name,
121};
122
123/// Stable identifier under which this library registers in the runtime.
124pub const MCP_LIB_ID: &str = "mcp";