Skip to main content
Idem exposes its agentic execution layer over the Model Context Protocol as well as REST. Any MCP-compatible agent — Claude Desktop, Claude Code, or a custom runtime — can post transactions, query balances, list entries, reconcile settlements, and roll back workflows without a custom API integration. Every tool call goes through the same stack as a REST request: scope-checked authentication, PolicyGuard evaluation before any write, and an HMAC-signed, append-only audit entry recorded before execution.
MCP tool calls are subject to the same policy rules and scopes as REST requests. An agent key that can postTransaction is not automatically permitted to rollbackWorkflow — see Required scopes below.

How a tool call flows through Idem

Connect over SSE

The MCP server exposes two endpoints on your Idem instance: Authenticate the same way you would for REST — an X-API-Key header or Authorization: Bearer — on the initial GET /sse request. You don’t need to resend the key on each POST /mcp/messages call; Idem associates your session with your authenticated tenant for the lifetime of the SSE connection.

Required scopes

Most tools require AGENTS_EXECUTE. Rolling back a workflow and reading the audit log each require their own separate scope — an agent authorized to execute transactions cannot roll them back or read the audit trail unless explicitly granted those scopes too. See Scopes for the full scope reference and how to issue a least-privilege agent key.

Tools

postTransaction

Posts a balanced double-entry transaction as an AI agent.
Each entry in entries:
PolicyGuard evaluates the effective policy rules for your tenant and agent key prefix before the transaction commits. If no rules are configured for an agent, the default is deny-all — configure at least one permissive rule before an agent can post a debit.

getBalance

Returns the current balance for an account, optionally as of a point in time.
onChainBalances is a per-token breakdown of on-chain entries posted to the account, net across all chains for that token. Each OnChainBalanceItem is { token, amount }. It is never combined with the fiat amount above — a token amount and a fiat amount are not fungible units. An account with only fiat entries returns onChainBalances: [].

listEntries

Lists journal entries for an account, newest first, with time-range filtering and cursor-based pagination.
Each EntryItem includes id, transactionId, entryType, amount, currency (ISO 4217 for fiat, token symbol for on-chain), description, and createdAt.

describeAccount

Returns account metadata and current balance in a single call.

reconcileBatch

Runs a reconciliation sweep over on-chain settlements within a time window, matching unmatched chain entries against pending journal lines by amount.
Matching is exact by default. tolerancePercent allows a bounded amount difference for that call. Entries with no matching candidate within tolerance are reported in exceptions and left unsettled.

rollbackWorkflow

Rolls back a committed or executing workflow using compensating transactions (the saga pattern) — each executed step is reversed in reverse order.
Each CompensatedStepItem includes stepOrder, description, and compensatingTransactionId where applicable.
rollbackWorkflow requires the separate AGENTS_ROLLBACK scope — it is never granted implicitly by AGENTS_EXECUTE. Compensating transactions bypass PolicyGuard by design, since a rollback is a corrective action rather than a new agent-initiated debit. Grant AGENTS_ROLLBACK only to admin-tier keys or agents whose role is specifically to reverse workflows.

getAgentAuditLog

Retrieves HMAC-signed audit events for agent actions, filterable by session and time range.
Each AuditEventItem includes id, workflowPlanId, agentId, sessionId, eventType, intentPayload, status, occurredAt, completedAt, and hmacSignature. Every mutating tool call writes a PENDING audit event before execution and a COMPLETED or FAILED event after — the audit log is append-only, and each event’s hmacSignature can be independently re-verified against your tenant’s audit HMAC secret.

Connect Claude Desktop

1

Expose your Idem instance

If you’re self-hosting locally, tunnel your instance so Claude Desktop can reach it (for example with ngrok http 8081). Skip this step if you’re on the managed cloud tier.
2

Create an agent-scoped API key

Using an ADMIN-scoped key, create a key carrying AGENTS_EXECUTE (and any other scopes the agent needs):
Copy the rawKey value from the response — it’s shown exactly once. See Scopes for the full reference.
3

Configure Claude Desktop

Add an entry to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/) using mcp-remote:
4

Restart Claude Desktop

The seven Idem tools appear in Claude’s tool list, scoped to whatever the key you configured is authorized to do.

Connect Claude Code

Self-hosting: multi-replica deployments

If you self-host Idem across multiple replicas, configure sticky sessions at your load balancer so that a given MCP session’s GET /sse and subsequent POST /mcp/messages calls reach the same instance. Session state is held in-process per replica, not shared across a cluster.