MCP servers for AI agents

Two Model Context Protocol servers put both chains in front of an agent. @odatano/core-mcp reads Cardano, queries the indexer with OData, builds unsigned transactions and submits signed CBOR. @odatano/nightgate-mcp anchors documents on Midnight, proves zero-knowledge claims over hidden fields, swaps and mints shielded tokens, and verifies against live contract state. Both carry the ANALYTICS tools for their chain.

Neither server gets operator rights. HSM signing, server wallets, contract deployment and every admin operation are not exposed. On Cardano every build comes back unsigned and a human or a CIP-30 wallet signs. On Midnight the server builds, proves and signs locally with the agent’s own seed, and a sponsor pays the fee. The agent holds no NIGHT.

Set-up

One oda_… key from the API page configures both servers. Needs Node.js 20 or newer; npx fetches the servers.

{
  "mcpServers": {
    "odatano": {
      "command": "npx",
      "args": ["-y", "@odatano/core-mcp"],
      "env": { "ODATANO_ACCESS_KEY": "oda_..." }
    },
    "nightgate": {
      "command": "npx",
      "args": ["-y", "@odatano/nightgate-mcp"],
      "env": { "ODATANO_ACCESS_KEY": "oda_..." }
    }
  }
}

With Claude Code:

claude mcp add odatano   --env ODATANO_ACCESS_KEY=oda_... -- npx -y @odatano/core-mcp
claude mcp add nightgate --env ODATANO_ACCESS_KEY=oda_... -- npx -y @odatano/nightgate-mcp

The hosted API is the default URL. It meters the key per call and answers a 402 with the top-up hint when calls run out.

Shared configuration

VariableDefaultPurpose
ODATANO_ACCESS_KEYthe oda_… key. Against a direct instance: an odat_… or ngat_… agent grant, or any other bearer
ODATANO_ACCESS_URLhttps://api.preprod.odatano.devthe API, or your own instance, e.g. http://localhost:4004
ODATANO_ACCESS_USER, ODATANO_ACCESS_PASSWORDbasic auth against a dev instance with CAP mocked auth
ODATANO_ANALYTICS_URL<ODATANO_ACCESS_URL>/odata/v4/analyticswhere ANALYTICS answers; the analytics_* tools register when it does

Per-server variables (timeouts, row caps, service paths, the Midnight seed and network) are in the READMEs linked below.

ODATANO-MCP (Cardano)

34 tools, plus 10 analytics tools when the host serves ANALYTICS. The set is what an API key may call; operator tools are not part of it.

GroupToolsWhat
Readget_network_info, get_latest_block, get_block, get_epoch, get_protocol_parameters, get_transaction, get_transaction_metadata, parse_transaction_cbor, get_address, get_utxos, get_address_assets, get_address_transactions, get_asset_info, get_asset_history, get_account, get_pool, get_drepchain, address, asset, staking and governance lookups. A miss returns { found: false }, never an error
Queryquery_entityOData V4 over the 20 chain entity sets of the read service: $filter, $select, $expand, $orderby, $top, $skip, $count. Questions no fixed action covers become one call
Buildbuild_ada_transfer, build_metadata_transaction, build_multi_asset_transfer, build_mint_transaction, build_plutus_spend, set_collateral, get_build_details, derive_script_address, extract_payment_key_hashevery build returns { id, unsignedTxCbor, fee }. Nothing is signed
Sign and submitcreate_signing_request, get_signing_request, verify_signature, verify_data_signature, submit_signed_transaction, submit_verified_transaction, get_submission_statushand-off to a human or wallet, verification, submission of signed CBOR
Analyticsanalytics_overview, analytics_key_figures, analytics_daily, analytics_top, analytics_epochs, analytics_metrics, analytics_metric, analytics_series, analytics_compare, analytics_anomaliesANALYTICS for Cardano, one call each

A typical flow:

get_network_info → get_utxos(address) → build_ada_transfer(...)   nothing moved
parse_transaction_cbor                                            show the human what they sign
create_signing_request                                            instructions + cardano-cli command
… human or CIP-30 wallet signs …
verify_signature → submit_signed_transaction → get_submission_status

NIGHTGATE-MCP (Midnight)

28 tools, plus 9 analytics tools when the host serves ANALYTICS. Every write is built, proven and signed in the server with the agent’s seed, a sponsor pays the fee, and the tool waits until the transaction settled. Reads of contract state are free and answer verified: false when nothing is there, never an error.

GroupToolsWhat
Verifyverify_attestation, verify_predicatea record or a zero-knowledge claim against live contract state. Free
Anchor and proveprepare_document_proof, prepare_membership_set, anchor_document, submit_vault_callsalted content tree, set root, an anchor in one call; any vault call: claims over a hidden field, claims across two documents, disclosure
Sponsoringbuild_sponsorable_transaction, get_attester_identity, sponsor_unbound_transaction, sponsor_finalized_transactionbuild a vault call and keep the bytes for a sponsor elsewhere, or hand bytes built elsewhere to a sponsor
Swapsget_swap_wallet, read_swap_offer, build_swap_offer, take_swap_offer, revert_swap_offer, sponsor_swapone half of a shielded swap built locally, taken, released or sponsored
Offer boardpost_swap_offer, list_swap_offers, retire_swap_offer, get_swap_offer, my_swap_offers, get_board_statuspost a maker half, find open offers, follow fills. The board counts need no credentials
Tokens and contractsmint_token, burn_token, send_token, call_contract, derive_token_typemint a shielded token on a token factory with the seed as issuer, burn, pay another address, call a circuit of an installed contract package
Usageget_usagewhat the key has left and what each call cost. Free
Analyticsanalytics_overview, analytics_key_figures, analytics_daily, analytics_top_block_producers, analytics_metrics, analytics_metric, analytics_series, analytics_compare, analytics_anomaliesANALYTICS for Midnight, one call each

With only ODATANO_ACCESS_KEY set, vault tools use the shared sandbox vault of the network. The first write creates the seed file ~/.nightgate-mcp/seed. It is the agent’s identity on Midnight: keep it and back it up.

A first anchor, and a claim over a hidden field:

anchor_document(sha256)             → status, attesterId, txHash, check   about a minute
verify_attestation(check)           → verified: true                      free

prepare_document_proof              → payloadHash, contentRoot, opening   keep opening
anchor_document(payloadHash, contentRoot, schemaId)
submit_vault_call("proveFieldPredicate", merkleProof)  e.g. carbon_footprint ≤ 80
verify_predicate(check)             → verified: true                      free

Each MCP release names the NIGHTGATE version it needs. The configuration page on GitHub lists them.

Your own instance

Set ODATANO_ACCESS_URL to your ODATANO or NIGHTGATE host. For a local cds watch with mocked auth, ODATANO_ACCESS_USER=alice is enough. For anything else, create a scoped agent grant once as the operator and hand the returned odat_… or ngat_… token to the agent as ODATANO_ACCESS_KEY. The write tools are then limited to the grant’s allow list and budget.

The Docker images are the fastest way to an own instance: ghcr.io/odatano/odatano and ghcr.io/odatano/nightgate. See ODATANO and NIGHTGATE.

Errors

Upstream errors reach the agent as { httpStatus, code, message }, so it can react instead of failing blind: 401 means credentials, 400 means fix the arguments, 429 means back off, 402 means top up. A Midnight write that fails with CHAIN_EXECUTION_FAILED landed on chain but did not apply: run the tool again, it builds against the new state. A write that was cut off or came back pending picks up its own job when called again with the same arguments, so nothing is paid twice.

On GitHub