Crate icarus_canister

Crate icarus_canister 

Source
Expand description

ICP canister integration for Icarus MCP servers

This crate provides the canister implementation details for running MCP servers on the Internet Computer.

Re-exports§

pub use auth::add_user;
pub use auth::authenticate;
pub use auth::get_auth_audit;
pub use auth::get_auth_status;
pub use auth::get_authorized_users;
pub use auth::get_user;
pub use auth::init_auth;
pub use auth::list_users;
pub use auth::remove_user;
pub use auth::require_any_of_roles;
pub use auth::require_exact_role;
pub use auth::require_none_of_roles;
pub use auth::require_role_or_higher;
pub use auth::update_user_role;
pub use auth::AuthAction;
pub use auth::AuthAuditEntry;
pub use auth::AuthInfo;
pub use auth::AuthRole;
pub use auth::User;
pub use endpoints::get_owner as get_canister_owner;
pub use endpoints::http_request;
pub use endpoints::icarus_metadata;
pub use endpoints::HttpRequest;
pub use endpoints::HttpResponse;
pub use lifecycle::init;
pub use lifecycle::init_with_caller;
pub use lifecycle::post_upgrade;
pub use lifecycle::pre_upgrade;
pub use stable_ext::StableBTreeMapExt;
pub use stable_ext::StableCellExt;
pub use state::assert_owner;
pub use state::get_owner;
pub use state::is_owner;
pub use state::IcarusCanisterState;
pub use storage::StableCounter;
pub use storage::StableMap;

Modules§

auth
Authentication and authorization system for Icarus canisters
auth_tools
Authentication tool wrappers module
easy_storage
Simplified storage patterns for common use cases
endpoints
Canister endpoints for tool metadata discovery
http
HTTP Outcalls Module
lifecycle
Canister lifecycle hooks
macros
Macros for reducing boilerplate in ICP canisters
memory
Memory management for ICP stable storage
prelude
Comprehensive prelude for Icarus canister development
result
Common result types and error handling for Icarus canisters
stable_ext
Extension traits for stable structures
state
Canister state management
storage
Simplified stable storage utilities
timers
Timer Module for Autonomous Operations
tools
Tool registry and dispatch system

Macros§

http_get
Macro for simple GET requests
http_post_json
Macro for POST requests with JSON
icarus_metadata
Macro to generate canister metadata function with auto-discovery syntax
icarus_storage
A simplified storage pattern that reduces boilerplate
id_generator
Helper macro to generate ID sequences
init_memory
Macro to initialize canister memory management
memory_id
Helper function to create a memory from a memory ID Use this in init_memory! macro for StableBTreeMap initialization
register_tools
Macro to generate tool registration code
require_admin
require_auth
require_owner
stable_storage
Simplified macro to declare stable storage
stable_with
Helper macro to work with thread-local stable storage
timer_once
Macro for scheduling one-time tasks
timer_periodic
Macro for scheduling periodic tasks
tool_metadata
Macro to generate tool metadata function

Attribute Macros§

icarus_canister
Crate-level attribute macro that scans for all icarus_tool functions and generates the list_tools query function automatically.
icarus_module
Module-level attribute macro that collects all icarus_tool functions and generates the list_tools query function automatically.
icarus_tool
Attribute macro for individual tool methods Usage: #[icarus_tool(“Tool description”)]

Derive Macros§

IcarusStorable
Derive macro for ICP storable types
IcarusStorage
Derive macro for simplified storage declaration
IcarusType
Derive macro for common Icarus type patterns