Canton MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Canton MCP Server show me the active Iou contracts for Alice"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Canton MCP Server
A read-only Model Context Protocol server that gives AI agents the ability to query Canton Network ledger data — active contracts, transactions, parties, and network status.
Works with Claude Code, Claude Desktop, GPT, Cursor, and any MCP-compatible AI agent.
Why read-only?
This is a deliberate security decision. AI agents should not write to financial ledgers without explicit human approval. This server provides read-only access — no contract creation, no choice exercises, no writes of any kind.
Related MCP server: Cartesi Knowledge MCP Server
Install
npm install -g canton-mcp-serverOr run directly:
npx canton-mcp-serverConfiguration
The server reads these environment variables:
Variable | Default | Description |
|
| Canton participant node host |
|
| Canton Ledger API gRPC port |
|
| Default party for queries |
|
| Use mock data ( |
Add to Claude Code
Add to ~/.mcp.json:
{
"mcpServers": {
"canton": {
"command": "canton-mcp-server",
"env": {
"CANTON_USE_MOCK": "true"
}
}
}
}Add to Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"canton": {
"command": "npx",
"args": ["-y", "canton-mcp-server"],
"env": {
"CANTON_USE_MOCK": "true"
}
}
}
}Tools
canton_search_transactions
Search transactions by party, template ID, or time range.
Parameters: party, template_id, start_time, end_time, limit
> Search for all Iou transactions
{
"source": "mock",
"count": 2,
"transactions": [
{
"transactionId": "tx-001-abcdef1234",
"offset": "000000000000000010",
"effectiveAt": "2025-01-15T10:30:00Z",
"events": [...]
}
]
}canton_get_transaction
Get full details of a specific transaction.
Parameters: transaction_id (required)
> Get transaction tx-001-abcdef1234
{
"source": "mock",
"transaction": {
"transactionId": "tx-001-abcdef1234",
"events": [
{
"kind": "created",
"event": {
"contractId": "#1:0",
"templateId": { "moduleName": "Daml.Finance.Iou", "entityName": "Iou" },
"payload": { "issuer": "Bank::...", "owner": "Alice::...", "amount": "1000000.00" }
}
}
]
}
}canton_list_active_contracts
List active contracts with optional filters.
Parameters: party, template_id, limit
> List all active Account contracts
{
"source": "mock",
"count": 1,
"contracts": [
{
"contractId": "#3:0",
"templateId": { "moduleName": "Daml.Finance.Account", "entityName": "Account" },
"payload": { "owner": "Alice::...", "accountId": "ACC-001" }
}
]
}canton_get_contract
Get a specific contract by ID.
Parameters: contract_id (required)
> Get contract #1:0
{
"source": "mock",
"contract": {
"contractId": "#1:0",
"templateId": { "moduleName": "Daml.Finance.Iou", "entityName": "Iou" },
"payload": { "currency": "USD", "amount": "1000000.00" },
"signatories": ["Bank::...", "Alice::..."]
}
}canton_list_parties
List all known parties on the ledger.
Parameters: none
> List parties
{
"source": "mock",
"count": 3,
"parties": [
{ "partyId": "Alice::1220abc...", "displayName": "Alice", "isLocal": true },
{ "partyId": "Bob::1220fed...", "displayName": "Bob", "isLocal": true },
{ "partyId": "Bank::1220aab...", "displayName": "Global Bank", "isLocal": false }
]
}canton_network_status
Get network health information.
Parameters: none
> Check network status
{
"source": "mock",
"status": {
"participantId": "participant1::1220aabb",
"ledgerId": "canton-ledger-mock",
"healthy": true,
"activeContractCount": 4,
"knownPartyCount": 3,
"latestOffset": "000000000000000012"
}
}Connecting to a real Canton node
The server ships with a GrpcCantonClient stub in src/canton-client.ts. To connect to a real Canton participant node:
Install gRPC dependencies:
npm install @grpc/grpc-js @grpc/proto-loaderObtain Canton proto files from the Canton repository under
canton/community/ledger-api/src/main/protobuf/.Generate TypeScript bindings:
npx proto-loader-gen-types \ --longs=String --enums=String --defaults --oneofs \ --grpcLib=@grpc/grpc-js \ -O ./src/generated \ proto/com/daml/ledger/api/v2/*.protoImplement the methods in
GrpcCantonClient(see the class JSDoc for which Canton API services map to each method).Run with mock disabled:
CANTON_USE_MOCK=false CANTON_LEDGER_HOST=your-node CANTON_LEDGER_PORT=6865 canton-mcp-server
Data source indicator
Every response includes a source field:
"source": "mock"— data is from the built-in mock client"source": "live"— data is from a real Canton participant node
AI agents can use this to indicate confidence in their answers.
Development
npm install
npm run build
npm testRoadmap
This server is read-only by design. Planned additions:
Implement
GrpcCantonClientagainst a real Canton testnetAdd write tools (
canton_create_contract,canton_exercise_choice) behind an explicit opt-in flag, after testing against real nodesAdd streaming support for real-time transaction feeds
Publish to npm registry
License
Available Tools
6 toolscanton_get_contractA
Get a specific active contract by contract ID. Returns the full payload, signatories, observers, and metadata.
Inputs: contract_id (required).
canton_get_transactionB
Get details of a specific Canton transaction by ID. Returns the full event tree including created and archived events.
Inputs: transaction_id (required).
canton_list_active_contractsA
List active contracts on the Canton ledger, optionally filtered by template ID and/or party. Returns contract ID, template, payload, signatories, and observers.
Inputs: limit, party, template_id.
canton_list_partiesA
List known parties on the Canton ledger. Returns party ID, display name, and whether the party is local.
Inputs: no named parameters.
canton_network_statusA
Get Canton network health and status information. Returns participant ID, ledger ID, health status, counts, and latest offset.
Inputs: no named parameters.
canton_search_transactionsA
Search Canton ledger transactions by party, template ID, or time range. Returns transaction ID, offset, effective time, and events.
Inputs: limit, party, end_time, start_time, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct resource and action: searching transactions vs getting one transaction, listing contracts vs getting one contract, listing parties, and fetching network status. The boundaries are clear, and the descriptions reinforce the distinctions.
All tools use a consistent snake_case convention with the canton_ prefix. Most follow verb_noun, but canton_network_status is a noun phrase rather than a verb-led name, which is a minor deviation.
Six tools are well-scoped for a Canton ledger inspection server. Each tool earns its place by covering a distinct query or inspection need without obvious redundancy.
The server covers read-side inspection of transactions, contracts, parties, and network status. However, it lacks any mutation or lifecycle operations such as submitting commands, creating or exercising contracts, or party management, which are notable gaps for a Canton ledger server.
Maintenance
Related MCP Connectors
Provide AI agents and automation tools with contextual access to blockchain data including balance…
Read-only gateway for durable agent identity, consent, recognized work, and signed receipts.
Read verdicts, reasons and evidence for recorded agent actions. Draft and dry-run contracts.
Read-only smart-contract security intelligence for autonomous agents.
Related MCP Servers
FlicenseAqualityCmaintenanceA server that exposes blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol, enabling AI agents and tools to access and analyze blockchain information contextually.1847-- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query curated Cartesi developer resources, documentation, and repository metadata through the Model Context Protocol. Provides read-only knowledge access and host-side workflow guidance for building Cartesi blockchain applications via streamable HTTP.-
- AlicenseAqualityDmaintenanceEnables AI agents to query Fangorn subgraph schemas and conformant data from published data sources via the Model Context Protocol.132ISC
- AlicenseNot gradedqualityDmaintenanceEnables natural language queries to a company database through the Model Context Protocol, with read-only enforcement and agentic error recovery.MIT