| Crates.io | icarus |
| lib.rs | icarus |
| version | 0.5.8 |
| created_at | 2025-09-01 14:43:07.134329+00 |
| updated_at | 2025-09-09 04:39:17.199011+00 |
| description | Build MCP (Model Context Protocol) servers that run as Internet Computer canisters |
| homepage | https://github.com/galenoshea/icarus-sdk |
| repository | https://github.com/galenoshea/icarus-sdk |
| max_upload_size | |
| id | 1819752 |
| size | 275,560 |
Build persistent AI tools that run forever on the blockchain
Quick Start • Docs • Examples • Contributing
Traditional MCP servers are ephemeral - they lose state when restarted. Icarus changes that.
By combining the Model Context Protocol (MCP) with the Internet Computer Protocol (ICP), Icarus enables you to build AI tools that:
| Feature | Traditional MCP | Icarus MCP |
|---|---|---|
| State Persistence | ❌ Lost on restart | ✅ Permanent storage |
| Deployment | Manual server management | One command to ICP |
| Global Access | Requires hosting setup | Built-in global CDN |
| Cost Model | Pay for hosting | Pay per computation |
| Authentication | Build your own | Internet Identity built-in |
# Install the CLI
cargo install icarus-cli
# Create a new project
icarus new my-ai-tool
cd my-ai-tool
# Deploy to ICP
icarus deploy
[dependencies]
# Recommended: Simple, includes everything for canister development
icarus = "0.5.8"
# Or specify features explicitly
icarus = { version = "0.5.8", features = ["canister"] }
# Other required dependencies for canister development
ic-cdk = "0.16"
candid = "0.10"
serde = { version = "1.0", features = ["derive"] }
use icarus::prelude::*;
#[icarus_module]
mod tools {
// This memory persists forever on the blockchain
stable_storage! {
MEMORIES: StableBTreeMap<String, String, Memory> = memory_id!(0);
}
#[update]
#[icarus_tool("Store a memory that lasts forever")]
pub fn remember(key: String, value: String) -> Result<String, String> {
MEMORIES.with(|m| m.borrow_mut().insert(key, value));
Ok("Memory stored permanently! 🎉".to_string())
}
#[query]
#[icarus_tool("Recall a memory from any session")]
pub fn recall(key: String) -> Result<String, String> {
MEMORIES.with(|m|
m.borrow()
.get(&key)
.ok_or_else(|| "Memory not found".to_string())
)
}
}
# Add your deployed canister to Claude
icarus bridge add <your-canister-id>
# Now Claude has persistent memory! 🧠
icarus/
├── 🧩 icarus-core # Core MCP protocol implementation
├── 🔮 icarus-derive # Procedural macros for less boilerplate
├── 📦 icarus-canister # ICP canister integration
├── 🛠️ icarus-cli # Command-line tools
└── 📚 examples/ # Ready-to-deploy examples
use icarus::prelude::*;
// Fetch any external API with one line
let data = http::get("https://api.example.com/data").await?;
// POST JSON with automatic serialization
let response = http::post_json(url, json!({
"user": "alice",
"action": "subscribe"
})).await?;
// Built-in retry logic and error handling
let config = HttpConfig {
max_retries: 5,
timeout_seconds: 30,
..Default::default()
};
let result = http::get_with_config(url, config).await?;
use icarus::prelude::*;
// Schedule one-time tasks
let cleanup = timers::schedule_once(3600, "hourly-cleanup", || {
// This runs after 1 hour
cleanup_old_data();
})?;
// Create recurring tasks
let heartbeat = timers::schedule_periodic(300, "health-check", || {
// This runs every 5 minutes forever
check_system_health();
})?;
// Manage timers dynamically
timers::cancel_timer(cleanup)?;
let active = timers::list_active_timers();
// Your data structures
#[derive(IcarusStorable)]
struct UserProfile {
id: String,
preferences: HashMap<String, String>,
created_at: u64,
}
// Automatic persistence with stable storage
stable_storage! {
USERS: StableBTreeMap<String, UserProfile, Memory> = memory_id!(0);
SETTINGS: StableVec<Settings, Memory> = memory_id!(1);
}
Check out our examples directory for complete, deployable projects:
# Project Management
icarus new <name> # Create a new project
icarus deploy # Deploy to ICP (builds automatically)
icarus test # Run tests
# Bridge Commands (Claude Desktop integration)
icarus bridge add <id> # Add canister to Claude
icarus bridge list # List connected canisters
icarus bridge remove <id> # Remove a canister
# Development
icarus dev # Start local development
icarus logs <id> # View canister logs
New Features: HTTP outcalls and timers are now built-in! No breaking changes.
To upgrade:
icarus = "0.5.8"icarus deploy (builds automatically)The bridge will automatically use the new list_tools() endpoint. No code changes needed unless you were directly calling get_metadata().
We welcome contributions! See our Contributing Guide for details.
# Clone the repository
git clone https://github.com/galenoshea/icarus-sdk
cd icarus-sdk
# Install dependencies
./scripts/install-deps.sh
# Run tests
cargo test
# Build everything
cargo build --all
When you modify your tool functions in an Icarus project, you need to update the Candid interface (.did file) to reflect the changes:
# Install the generate-did tool (one-time setup)
cargo install candid-extractor
cargo install generate-did
# After modifying your tools, rebuild and update the .did file
cargo build --target wasm32-unknown-unknown --release
generate-did .
# The .did file is automatically updated with all your tool functions
The #[icarus_module] macro automatically generates all the necessary endpoints, and ic_cdk::export_candid!() embeds the interface in your WASM for extraction.
Icarus SDK is licensed under the Business Source License 1.1 (BSL). See LICENSE for details.
The BSL allows you to use Icarus SDK for developing and deploying MCP tools to the Icarus Marketplace.