pub enum McpIntent {
RegisterMcpTool {
tool_id: AccountId,
bytecode: Vec<u8>,
name: String,
input_schema_json: Vec<u8>,
category: u8,
declared_reads: Vec<[u8; 32]>,
declared_writes: Vec<[u8; 32]>,
commutative_keys: Vec<[u8; 32]>,
oracle_schema_ids: Vec<[u8; 32]>,
registry_id: AccountId,
},
RegisterMcpResource {
resource_id: AccountId,
bytecode: Vec<u8>,
name: String,
uri_scheme: String,
mime_type: String,
initial_data: Vec<(Vec<u8>, Vec<u8>)>,
declared_reads: Vec<[u8; 32]>,
declared_writes: Vec<[u8; 32]>,
oracle_schema_ids: Vec<[u8; 32]>,
registry_id: AccountId,
},
RegisterMcpPrompt {
prompt_id: AccountId,
name: String,
template_bytes: Vec<u8>,
arguments: Vec<(String, String, bool)>,
registry_id: AccountId,
},
RegisterAgent {
agent_id: AccountId,
policy_cell_id: AccountId,
agent_registry_id: AccountId,
},
UpdateAgentPolicy {
policy_cell_id: AccountId,
updates: PolicyUpdate,
},
SuspendAgent {
agent_id: AccountId,
agent_registry_id: AccountId,
reason: String,
},
ReinstateAgent {
agent_id: AccountId,
agent_registry_id: AccountId,
},
McpToolCall {
agent_id: AccountId,
tool_id: AccountId,
tool_calldata: Vec<u8>,
value: u128,
gas_limit: u64,
policy_cell_id: AccountId,
action_log_id: Option<AccountId>,
timestamp: u64,
},
}Expand description
All new MCP-related intent variants to be added to TransactionIntent. Design rule: every intent maps to deterministic state transitions. The parallel executor’s conflict domain extracts their storage keys.
Variants§
RegisterMcpTool
Deploy a tool cell and register it in the McpRegistry. The tool’s Axiom bytecode is its implementation. Schema lives in storage. Anyone can deploy a tool. The registry is permissionless.
Fields
input_schema_json: Vec<u8>Full JSON schema (stored as blake3 hash on-chain, full bytes in calldata)
RegisterMcpResource
Deploy a resource cell. Its storage IS the resource data. Agents read resources by calling get_cell_storage on specific slots.
Fields
RegisterMcpPrompt
Deploy a prompt template cell. Prompt templates go through the validator name registry for approval. An approved prompt has a validator-certified name on-chain.
Fields
RegisterAgent
Bind an agent’s public key to a policy cell. Only the owner_id account can call this. The agent cannot register itself.
UpdateAgentPolicy
Owner updates agent’s policy by calling the policy cell directly. This IS a CallCell transaction on the policy cell. Listed here for clarity - the diff handler routes it as CallCell.
SuspendAgent
Owner suspends an agent immediately. Stored in AgentRegistry.
ReinstateAgent
Owner reinstates a suspended agent.
McpToolCall
The core MCP tool call intent.
This compiles into a CallCellChain:
- Call policy_cell with (agent_id, tool_id, calldata_hash) - reverts if blocked
- Call tool_cell with agent_calldata - executes the tool
- (Optional) Call action_log_cell with (tool_id, result_hash) - appends log entry
The ENTIRE chain is atomic. If policy rejects, nothing is written. If the tool fails, the policy gate’s side effects are also rolled back. The action log entry only lands if the tool succeeded.