Expand description
TruthLinked on-chain MCP primitives for agent-native blockchain execution.
This is not a server wrapping the chain. MCP tools, resources, and prompts are smart cells deployed on TruthLinked.
Architecture:
McpRegistry cell - the chain’s MCP namespace. Stores all registered tool resource prompt cell ids. The agent’s tools list is a read of this cell’s storage.
McpTool cell - each tool is a deployed Axiom cell with storage[“schema”] = json schema bytes storage[“name”] = tool name bytes storage[“version”] = semver bytes calling the tool is a CallCell on that cell. the tool’s Axiom bytecode is the tool’s logic.
McpResource cell - a cell whose storage is the resource data. reading a resource reads cell storage slots. the resource is versioned by manifest_version.
McpPrompt cell - a cell storing prompt templates in storage. validators approve prompts via the name registry. prompt provenance is provable: who deployed it, which block, what manifest hash.
AgentPolicy cell - a Axiom cell that enforces what calls an agent is permitted to make. Called before every tool call via CallCellChain. Reverts the chain if policy is violated, the chain enforces it, not middleware.
AgentRegistry cell - maps agent_id to policy_cell_id. owner sets this. Agent cannot change it. stored on chain. Immutable once the owner locks it.
New TransactionIntents:
RegisterMcpTool - deploys a tool cell and registers in McpRegistry RegisterMcpResource - deploys a resource cell and registers in McpRegistry RegisterMcpPrompt - deploys a prompt cell and validator approves name RegisterAgent - binds agent_id to policy_cell_id in AgentRegistry UpdateAgentPolicy - owner calls policy cell to change permissions SuspendAgent - owner sets agent status to Suspended in AgentRegistry McpToolCall - agent calls a tool with policy check and execution, all atomic in one CallCellChain transaction
The MCP protocol transport (websocket json-rpc) is a thin adapter that translates MCP wire messages into TruthLinked transactions and reads. Every tool call produces a transaction. Every resource read reads cell storage. The chain is the MCP server. The transport is just protocol glue.
Modules§
- agent_
reg_ keys - Canonical storage keys for the AgentRegistry cell
- policy_
keys - Canonical storage keys for an AgentPolicy cell
- private_
balance - Agent Private Balance v2 - Full Confidential System
- prompt_
keys - Canonical storage keys for a McpPrompt cell
- protocol_
addresses - Canonical MCP protocol cell addresses (well-known, deterministic)
- registry_
keys - Canonical storage keys for the McpRegistry cell
- resource_
keys - Canonical storage keys for a McpResource cell
- tool_
keys - Canonical storage keys for a McpTool cell
- zk_
transfer - Complete ZK circuit for confidential transfers.
Structs§
- Policy
Update - Policy fields an owner may update
Enums§
- McpIntent
- 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.
Traits§
Functions§
- compile_
tool_ call_ to_ chain - Compile McpToolCall into a CallCellChain intent.
- deploy_
mcp_ genesis_ cells - Deploy all MCP protocol cells at genesis. This is called from genesis.rs during chain initialization.
- diff_
register_ agent - Compute the StateDiff for RegisterAgent. Binds agent_id -> (policy_cell_id, owner_id) in the AgentRegistry.
- diff_
register_ prompt - Compute the StateDiff for RegisterMcpPrompt. Deploys a prompt cell and registers it in the McpRegistry. Prompts go through the validator name registry for on-chain approval.
- diff_
register_ resource - Compute the StateDiff for RegisterMcpResource. Deploys a resource cell and registers it in the McpRegistry.
- diff_
register_ tool - Compute the StateDiff for RegisterMcpTool.
- diff_
set_ agent_ status - Compute the StateDiff for SuspendAgent / ReinstateAgent.
- enumerate_
prompts - enumerate_
resources - enumerate_
tools - get_
prompt - mcp_
conflict_ domain - Extract conflict domain for MCP intents. This is the extension point for compiler_aware.rs.
- read_
resource