Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 28 additions & 75 deletions README.md

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions crates/imcp2-core/src/compliance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ const DISALLOWED_CANISTER_METHODS: &[(&str, &str, &str)] = &[
// The cycles ledger's value movement beyond ICRC-1/-2 (which group one
// already covers): withdrawals and the canister-creation spends. The
// creation refusal points the user at running the operation themselves
// with the icp CLI; icp_create_canister is instructions-only (it prints
// those steps and executes nothing), so naming it does not offer an
// executing route (per review).
// with the icp CLI directly (the dedicated instructions-only creation
// tool is deferred from this version's served surface).
(CYCLES_LEDGER, "withdraw", "a cycles-ledger withdrawal"),
(CYCLES_LEDGER, "withdraw_from", "a cycles-ledger delegated withdrawal"),
(CYCLES_LEDGER, "create_canister", "a cycles-ledger spend (canister creation)"),
Expand Down Expand Up @@ -125,9 +124,9 @@ pub fn disallowed_update_method(canister_id: &Principal, method: &str) -> Option
// wallet or frontend in the user's own browser.
let instead = if method.starts_with("create_canister") {
"Recommend that the user creates and funds canisters themselves with \
the icp CLI in their own terminal — the icp_create_canister tool \
prints the exact steps (it executes nothing and moves no funds), and \
the icp-cli and cycles-management skills (icp_get_skill) carry the \
the icp CLI in their own terminal (install with `npm install -g \
@icp-sdk/icp-cli`, or see https://github.com/dfinity/icp-cli); the \
skill://icp-cli and skill://cycles-management resources carry the \
full guide."
} else {
"Recommend that the user performs this operation themselves, in a wallet \
Expand Down Expand Up @@ -219,16 +218,17 @@ mod tests {

// The cycles ledger's canister-creation spends are refused on the generic
// route, and their refusal points the user at running creation themselves
// with the icp CLI. icp_create_canister may be named because it is
// instructions-only — the refusal must say so, and must not point at a
// wallet (the wrong venue for creation).
// with the icp CLI (install pointer included) — never at a wallet (the
// wrong venue for creation) and never at a connector tool (the dedicated
// instructions-only creation tool is deferred from this version).
#[test]
fn refuses_cycles_ledger_creation_spends_with_cli_redirect() {
for method in ["create_canister", "create_canister_from"] {
let msg = disallowed_update_method(&cycles_ledger(), method)
.unwrap_or_else(|| panic!("{method} must be refused"));
assert!(msg.contains("icp CLI"), "{msg}");
assert!(msg.contains("executes nothing"), "{msg}");
assert!(msg.contains("npm install -g @icp-sdk/icp-cli"), "{msg}");
assert!(!msg.contains("icp_create_canister"), "no connector-tool redirect: {msg}");
assert!(!msg.contains("oisy.com"), "a wallet is the wrong venue for creation: {msg}");
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/imcp2-core/src/identities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ pub struct AccountsOutput {
#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct ResolveAppArgs {
/// The application's URL, e.g. "https://oisy.com". Must be a URL you actually
/// have — given by the user, returned by `icp_find_app_by_name`, or found by a
/// web search of the app's official site. NEVER a domain guessed from an app's
/// name (guessed lookalike domains are unrelated or squatted sites and are
/// refused).
/// have — given by the user, shown by `open_app` for a well-known app name, or
/// found by a web search of the app's official site. NEVER a domain guessed
/// from an app's name (guessed lookalike domains are unrelated or squatted
/// sites and are refused).
pub app_url: String,
}

Expand Down
14 changes: 8 additions & 6 deletions crates/imcp2-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
//! imcp2-core — the transport/OAuth-agnostic components of the IMCP2 Internet
//! Computer MCP server, from which a serving binary is composed:
//!
//! * [`tools::IcTools`] — the complete MCP tool surface, composed from
//! [`tools::IcCanisterTools`] and [`tools::IcProtocolTools`] (canister reads and
//! writes in textual Candid, app/canister discovery, OQL, canister
//! management, IC skills), an [`rmcp`] `ServerHandler` ready to serve over
//! whichever transport the binary picks (streamable-HTTP in the hosted
//! `imcp2` server, stdio in a local one).
//! * [`tools::IcTools`] — the served MCP tool surface: [`tools::IcCanisterTools`]
//! (canister reads and writes in textual Candid, app/canister discovery,
//! OQL), an [`rmcp`] `ServerHandler` ready to serve over whichever
//! transport the binary picks (streamable-HTTP in the hosted `imcp2`
//! server, stdio in a local one). The protocol/meta half
//! ([`tools::IcProtocolTools`] — dashboard lookups, the IC skills tools,
//! canister management) is deferred from the default composition; we
//! anticipate it will come in a future version.
//! * [`identities`] — the Internet Identity session engine: the per-connection
//! session-key grant (registered with II via `mcp_register_v2`) and the
//! short-lived per-app account delegations minted from it on demand.
Expand Down
2 changes: 1 addition & 1 deletion crates/imcp2-core/src/skills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl SkillsCatalog {
let entry = skills.iter().find(|s| s.name.eq_ignore_ascii_case(name));
if entry.is_none() {
return Err(format!(
"no skill named `{name}` — call icp_list_skills to see the available skills"
"no skill named `{name}` — list the `skill://` resources to see the available skills"
));
}
// Use the manifest's markdown URL only when it stays on the configured
Expand Down
Loading
Loading