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. Both servers read it from ODATANO_ACCESS_KEY.
  • Node20 or newer. npx fetches the servers, nothing else to install for reading.
  • NetworkODATANO_ACCESS_URL picks the host. This one serves preprod.
  • Costa tool call costs the API calls it makes, mostly one. The agent holds no ADA and no NIGHT for reading.
.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"
    }
  }
} }

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 person signs. On Midnight the agent builds and proves locally and a sponsor pays, see below.
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 \
  -- 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

  • Installthe server builds and proves locally, so it needs @odatano/nightgate-tx next to it. Install both into one folder and start the server from there.
  • SeedNIGHTGATE_SEED_HEX, 128 hex characters. It is the agent's attester identity, never a tool argument and never sent.
  • Vaultthe shared sandbox vault … takes anchors from every key on this network
  • Flowbuild_sponsorable_transaction proves the call, sponsor_unbound_transaction hands it to the sponsor, get_job_status waits until it lands, verify_attestation checks it
  • Detailswhat the steps do and what fails: Midnight quickstart
shellmkdir nightgate-agent && cd nightgate-agent
npm i @odatano/nightgate-mcp @odatano/nightgate-tx \
  @midnight-ntwrk/compact-runtime
.mcp.json"nightgate": {
  "command": "node",
  "args": ["/path/to/nightgate-agent/node_modules/
    @odatano/nightgate-mcp/dist/index.js"],
  "env": {
    "ODATANO_ACCESS_KEY": "oda_…",
    "ODATANO_ACCESS_URL": "https://api.preprod.odatano.dev",
    "NIGHTGATE_NETWORK": "preprod",
    "NIGHTGATE_SEED_HEX": "<128 hex>"
  }
}

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