@odatano/nightgate-mcp
Official<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/nightgate-mcp-logo-on-dark.svg">
<img src="docs/assets/nightgate-mcp-logo.svg" alt="NIGHTGATE MCP" height="110">
</picture>
</p>
# @odatano/nightgate-mcp
[](https://www.npmjs.com/package/@odatano/nightgate-mcp)
[](https://www.npmjs.com/package/@odatano/nightgate)
[](https://modelcontextprotocol.io/)
[](LICENSE)
MCP server for [NIGHTGATE](https://github.com/ODATANO/NIGHTGATE) on Midnight.
Anchors documents, proves zero-knowledge claims over hidden fields, grants
disclosure, and verifies records and claims against live contract state;
swaps shielded tokens over an offer board and mints them on a token factory.
Transactions are sponsored, the agent holds no NIGHT. The chain is read through the
[ODATANO API](https://api.odatano.dev), and the wallet syncs its coins through
the gateway's indexer lane: no indexer, no node.
## Quick start
Get an `oda_…` key at [api.odatano.dev](https://api.odatano.dev) (Cardano
wallet sign-in, a redeem code, or tADA over x402), then:
```json
{
"mcpServers": {
"nightgate": {
"command": "npx",
"args": ["-y", "@odatano/nightgate-mcp"],
"env": { "ODATANO_ACCESS_KEY": "oda_..." }
}
}
}
```
Claude Code: `claude mcp add nightgate --env ODATANO_ACCESS_KEY=oda_... -- npx -y @odatano/nightgate-mcp`
The hosted gateway is the default (Midnight preprod). The same key works for
`@odatano/core-mcp` (Cardano). Node.js >= 20.
That is all the setup. `anchor_document` with the sha256 of a document anchors
it in the shared sandbox vault and answers once it landed, with the free
`verify_attestation` call that shows it on-chain. The first write creates your
seed in `~/.nightgate-mcp/seed` and says so; keep that file, it is your
identity on Midnight. Servers on one machine share it unless each sets its
own `NIGHTGATE_SEED_HEX`. `get_usage` shows the units left on the key.
## Tools
[docs/tools.md](docs/tools.md) lists every tool, what a write returns, the
sandbox vaults, the seed, field claims and shielded swaps. Every write is
built and proven here, a sponsor pays, and the tool waits for the result.
Errors carry the server's HTTP status and `code`.
## Configuration
[docs/configuration.md](docs/configuration.md): every variable, an own
NIGHTGATE instance, version requirements. Needs NIGHTGATE >= 0.43.1 on a ledger 9
network; a network before its fork stays on MCP 0.21.0. `build_sponsorable_transaction`
builds on contracts deployed after ledger 9. A contract deployed before keeps its ledger 8
verifier keys; `call_contract` builds on it with the package version compiled for ledger 8,
installed under its own name (npm tag `ledger8`). `get_board_status` names the version a server runs.
## Development
```bash
npm install && npm run test:unit && npm run integration
```
Live lanes:
```bash
NIGHTGATE_LIVE=1 NIGHTGATE_TEST_CONTRACT=<vault> NIGHTGATE_TEST_PAYLOAD_HASH=<64 hex> npm run integration
NIGHTGATE_SEED_HEX=<hex> NIGHTGATE_VAULT=<vault> npm run live:sponsor-unbound
```
## License
Apache-2.0
TDQS
Scored across 28 tools
The workflow families are mostly distinguishable, but several boundaries blur: get_swap_offer vs read_swap_offer, sponsor_finalized_transaction vs sponsor_unbound_transaction, anchor_document vs submit_vault_call, and retire_swap_offer vs revert_swap_offer. The verbose descriptions help, but the large surface still requires domain knowledge to select correctly.
Almost all tools use snake_case with a verb_noun shape, and the sponsor/swap/attestation families are consistently named. Minor deviations like my_swap_offers and mixed retrieval verbs such as get/read/list for offer lookups keep it from being perfect.
At 28 tools, this is above the 25-tool threshold for a heavy tool surface. The domain is broad, but many offer-board, swap, sponsor, and attestation tools could be consolidated or expressed as resource-plus-action calls.
Coverage is strong across wallet identity/balances, send, mint/burn, swap and offer-board lifecycle, attestation proof preparation/submission/verification, sponsorship, and contract calls. Minor gaps remain, such as no generic read-only contract-state query or standalone job-status endpoint, though the rerun-with-same-args pattern covers some of that.