ODATANOODATANOAPIpreprod
Quickstart · AI agents with MCP

Both chains as agent tools

Two MCP servers, one key. @odatano/core-mcp gives an agent Cardano, @odatano/nightgate-mcp gives it Midnight. They run in Claude Code, Claude Desktop, Cursor or any other MCP client.

Before you start

  • Keyan oda_… key: free with a wallet sign-in (300 calls), or bought with tADA or tNIGHT. Both servers read it from ODATANO_ACCESS_KEY.
  • Node20 or newer. npx fetches the servers, nothing else to install.
  • NetworkODATANO_ACCESS_URL picks the host. This one serves preprod.
  • Costa tool call costs the API calls it makes: a read one, a Midnight write about 10
.mcp.json{ "mcpServers": {
  "odatano": {
    "command": "npx",
    "args": ["-y", "@odatano/core-mcp"],
    "env": {
      "ODATANO_ACCESS_KEY": "oda_…",
      "ODATANO_ACCESS_URL": "https://api.preprod.odatano.dev"
    }
  },
  "nightgate": {
    "command": "npx",
    "args": ["-y", "@odatano/nightgate-mcp"],
    "env": {
      "ODATANO_ACCESS_KEY": "oda_…",
      "ODATANO_ACCESS_URL": "https://api.preprod.odatano.dev",
      "NIGHTGATE_NETWORK": "preprod"
    }
  }
} }

Three steps

  • 1Add the servers. Put the .mcp.json above in your project, or add them with claude mcp add. Restart the client.
  • 2Ask. The agent picks the tool. Reads and verifies work right away.
  • 3Let it write. On Cardano the agent builds and a wallet signs. On Midnight the agent builds and proves locally and a sponsor pays the fee.
claude codeURL=https://api.preprod.odatano.dev
claude mcp add odatano \
  --env ODATANO_ACCESS_KEY=oda_… \
  --env ODATANO_ACCESS_URL=$URL \
  -- npx -y @odatano/core-mcp
claude mcp add nightgate \
  --env ODATANO_ACCESS_KEY=oda_… \
  --env ODATANO_ACCESS_URL=$URL \
  --env NIGHTGATE_NETWORK=preprod \
  -- npx -y @odatano/nightgate-mcp

# then ask, for example
"What is in transaction <hash>?"
  → get_transaction
"Which UTxOs does <address> hold?"
  → get_utxos
"Is <hash> attested in vault <address>?"
  → verify_attestation
"How busy was Midnight this week?"
  → analytics_key_figures

Cardano writes

  • Buildbuild_ada_transfer, build_mint_transaction or build_plutus_spend return an unsigned transaction
  • Signcreate_signing_request hands it to a person or a CIP-30 wallet. The agent never holds a payment key.
  • Submitverify_signature checks the signed transaction, submit_signed_transaction sends it, get_submission_status follows it
flowbuild_ada_transfer         → unsigned tx, build id
create_signing_request     → request for the signer
                           a person signs in a wallet
verify_signature           → verified
submit_signed_transaction  → transaction hash
get_submission_status      → confirmed

Midnight writes

  • Seedthe first write creates one in ~/.nightgate-mcp/seed. It is the agent's identity on Midnight: keep the file. NIGHTGATE_SEED_HEX sets your own, 128 hex characters.
  • Vaultwithout a vault address the tools use the shared sandbox vault …, open to every key on this network
  • Flowanchor_document builds and proves the call, hands it to the sponsor and waits until it landed, about a minute. verify_attestation checks it, free.
  • Detailswhat the steps do and what fails: Midnight quickstart
flowanchor_document(sha256)   → status, attesterId, txHash
                          built, proven and sponsored in one call
verify_attestation        → verified: true

Next

  • Toolsevery tool of both servers: AI agents on the start page
  • Docsodatano.dev/docs/mcp: configuration, own instances, versions
  • ExampleAGENT_MS, an agent that anchors its reports and predictions on Midnight