icarus_core/
lib.rs

1// Copyright (c) 2025 Icarus Team. All Rights Reserved.
2// Licensed under BSL-1.1. See LICENSE and NOTICE files.
3// Signature verification and telemetry must remain intact.
4
5// #![warn(missing_docs)] // TODO: Enable after adding all documentation
6
7//! Core abstractions for building MCP servers on ICP
8//!
9//! This crate provides the fundamental traits and types for creating
10//! Model Context Protocol servers that run as Internet Computer canisters.
11
12pub mod compatibility;
13pub mod error;
14pub mod lifecycle;
15pub mod persistent;
16pub mod protocol;
17pub mod registry;
18pub mod response;
19pub mod server;
20pub mod session;
21pub mod state;
22pub mod tool;
23
24pub use compatibility::{
25    IcarusParam, IcarusReturn, IcarusTool as IcarusToolCompatible, ToolResult,
26};
27pub use error::{IcarusError, Result, ToolError};
28pub use response::{tool_ok, tool_success, ToolStatus, ToolSuccess};
29pub use server::IcarusServer;
30pub use tool::IcarusTool;
31
32/// Prelude module for convenient imports
33///
34/// Import everything you need with:
35/// ```
36/// use icarus_core::prelude::*;
37/// ```
38pub mod prelude {
39    pub use crate::{
40        error::{IcarusError, Result, ToolError},
41        lifecycle::IcarusServerLifecycle,
42        persistent::{IcarusPersistentState, TypedPersistentState},
43        registry::IcarusToolRegistry,
44        response::{tool_ok, tool_success, ToolStatus, ToolSuccess},
45        server::IcarusServer,
46        tool::IcarusTool,
47    };
48}