Mina Mcp Server

io.github.MinaProtocol由 GitHub 帳號 MinaProtocol 發布v0.7.3更新於 Oct 24, 2026

Query Mina Protocol: accounts, blocks, transactions, zkApp events/actions, archive SQL, Rosetta.

已驗證STDIO僅桌面資料庫金融開發者工具

概覽

AI 產生的概覽

針對 Mina Protocol 區塊鏈的 MCP 伺服器,讓助理查詢帳戶、區塊、交易、zkApp 事件與封存 SQL,並可選擇性地發送測試網交易。

可以做什麼
查詢即時鏈上狀態:從 Mina 守護程序取得帳戶、區塊、最佳鏈、記憶池、交易狀態、同步狀態、創世常數與網路 ID,並讀取封存節點的事件、操作與區塊,以及一次性的 describe_state 概覽。查詢封存資料庫:唯讀 SQL、資料表結構檢視、區塊與交易檢索、質押帳本與封存統計。在網路提供 Rosetta 端點時,使用標準 Rosetta Data API 工具查詢網路狀態、帳戶餘額、區塊與記憶池。教學模式下從水龍頭取得並歸還預先儲值的測試帳戶、發送付款與委託,並可暫停週期性鏈重置。即時寫入模式下列出已載入錢包並簽章、提交付款或委託。
適用情境
當你希望助理以對話方式探索 Mina 區塊鏈資料時使用:無需本機環境即可查詢公開 devnet 或 mainnet,或針對本機 lightnet 做示範與測試,或針對凍結的封存傾印做 SQL 探索。即時寫入模式適合 devnet 或 mesa 上的臨時測試錢包,不適合生產資金。
執行需求
透過 npx 在本機執行,需要 Node.js 20.18 或更新版本;即時模式無需本機基礎設施,只需選擇網路(devnet、mainnet、mesa)。教學與快照模式需要 Docker 及本機服務:PostgreSQL 封存資料庫、Mina 守護程序 GraphQL、封存節點 API 與帳戶管理器,需用 compose 檔案啟動,而這些檔案未包含在 npm 套件中。即時寫入模式需透過 --wallets 或 MINA_MCP_WALLETS 指定 wallets.json 路徑,向 mainnet 發送還需 --allow-mainnet-writes 或 MINA_MCP_ALLOW_MAINNET_WRITES。
安裝前請注意
即時寫入模式會從磁碟以未加密形式把錢包私鑰載入行程記憶體;README 警告這不適合生產金鑰,涉及真實資產時應使用硬體錢包或離線簽章器。發送付款與委託會轉移真實價值且不可撤銷;每個錢包的上限與 dry-run 可降低風險但不能消除。mainnet 寫入受 --allow-mainnet-writes 限制。教學模式會寫入本機 lightnet 並佔用共享測試帳戶。公開端點採盡力而為、無 SLA,URL 可能變更。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mina Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mina-mcp-server

[npm version] [license] [MCP]

MCP (Model Context Protocol) server for the Mina Protocol blockchain. Exposes Mina blockchain data and operations through MCP-compatible tools that can be used by AI assistants and other MCP clients.

New here? Jump to Which mode do I want? → Connect your MCP client → Verify it works. For copy-paste prompts, see the prompt cookbook.

Status: beta / preview. Live mode talks to public Mina networks (devnet / mainnet / mesa) and needs no local infrastructure — run npx @o1-labs/mina-mcp-server --mode live --network devnet, or point your client at the hosted sandbox. Snapshot and tutorial modes are thin MCP layers over backing services (PostgreSQL, and for tutorial a local Mina lightnet) that you must stand up yourself first — see Prerequisites. A bundled SQLite snapshot for zero-infra snapshot mode is planned (#28).

Features

  • 40+ MCP tools for querying accounts, blocks, transactions, zkApp events/actions, network/sync status, Rosetta, and archive SQL.
  • Three operating modes:
    • Live — read-only proxy to a public Mina network (devnet/mainnet/mesa). No local infra — the zero-setup default.
    • Tutorial — full read/write against a local Mina lightnet (daemon, archive, test-account faucet).
    • Snapshot — schema-only SQL access (query_archive_sql, get_archive_schema) against a frozen archive Postgres dump.
  • Standardized Rosetta Data API tools (live mode) alongside the native GraphQL ones.
  • Safe SQL access — read-only queries against the archive DB with timeout protection.
  • Test-account faucet — acquire/release pre-funded accounts (tutorial mode).
  • Prompt cookbook — copy-paste prompts that drive end-to-end tool sequences.

Which mode do I want?

You want to…ModeInfra needed
Query a public network (balances, blocks, zkApp events, Rosetta)liveNone — just npx. Start here.
Send transactions on a public network with your own keyslive + --walletsNone (keys signed in-process)
Develop against a controllable chain (faucet, reset, write)tutorialLocal Mina lightnet (Prerequisites)
Run analytics SQL over a historical archive dumpsnapshotA Postgres archive dump (Prerequisites)

Most people want live — it needs nothing installed beyond Node.

Connect your MCP client

Local (recommended), via npx — no clone, no infra:

json
{  "mcpServers": {    "mina": {      "command": "npx",      "args": ["-y", "@o1-labs/mina-mcp-server", "--mode", "live", "--network", "devnet"]    }  }}

Swap devnet for mainnet or mesa. For other modes, change --mode (and drop --network); see Configuration.

Hosted sandbox (zero install) — point your client at the URL:

json
{ "mcpServers": { "mina": { "url": "https://mina-mcp-sandbox.fly.dev/mcp" } } }

The hosted sandbox runs tutorial mode against a shared lightnet (best-effort, no SLA). Use local live mode for real networks.

Where the config lives, per client:

ClientConfigNotes
Claude Desktopclaude_desktop_config.json (Settings → Developer)command/args shape above
Claude Code.mcp.json in the project, or claude mcp addsame shape
Cursor~/.cursor/mcp.json (or Settings → MCP)same shape
Cline / Roothe extension's MCP settings JSONsame shape
Windsurf~/.codeium/windsurf/mcp_config.jsonsame shape
Continue~/.continue/config.json under mcpServerssame shape
Zedsettings.json under context_serversZed uses "command": { "path": "npx", "args": [...] }

All clients except Zed take the same { command, args } object; only the file location differs. Hosted-URL configs work in any client that supports a remote/streamable-HTTP MCP server.

Verify it works

After wiring it up, ask your assistant:

"Describe the current Mina network state."

It should call describe_state and return a snapshot with syncStatus (e.g. SYNCED), the network name, and mempool size. That's your green light. (On mesa, expect a PREFLIGHT caveat in the hints.)

Configuration

All flags have environment-variable equivalents; run npx @o1-labs/mina-mcp-server --help for the full surface.

$ mina-mcp-server --helpUSAGE  mina-mcp-server [--mode <mode>] [options]
MODES  live        Read-only proxy to a public network. No local infra. (use --network)  tutorial    Read+write against a local Mina lightnet (daemon + archive + faucet).  snapshot    Schema-only SQL access against a frozen archive Postgres dump. (default)
FlagEnv varValues (default)
--modeMINA_MCP_MODElive / tutorial / snapshot (snapshot)
--networkMINA_MCP_NETWORKdevnet / mainnet / mesa / mesa-mut (live only)
--transportMINA_MCP_TRANSPORTstdio / http (stdio)
--walletsMINA_MCP_WALLETSpath to wallets.json (live-write)
--allow-mainnet-writesMINA_MCP_ALLOW_MAINNET_WRITES=1opt-in gate for mainnet sends
(http only)MINA_MCP_HTTP_PORTport for --transport http (3000)
--help, --version—print help / version and exit

Troubleshooting

SymptomFix
npx fails / "Unsupported engine"Needs Node ≥ 20.18. Check node --version.
Tools return "not reachable" in tutorial/snapshotThe server does not start infra — bring up the lightnet/Postgres first (Prerequisites).
Port already in use (tutorial lightnet)Another lightnet/daemon is bound to 3085/8282/5432; stop it or remap ports.
Changes not taking effect after editing sourceRe-run npm run build (the client runs dist/, not src/).
Hosted server: "Missing/!Unknown session id"Your client must echo the Mcp-Session-Id header from initialize on every request — use a client that supports streamable-HTTP MCP.
mesa data looks unstablemesa is a preflight network — it can reset/rename without notice. Treat its data as ephemeral.

Prerequisites

Only needed for tutorial and snapshot modes. live mode needs none of this.

Common:

  • Node.js >= 20.18
  • Docker & Docker Compose (to run the backing services below)

Snapshot mode additionally requires:

ComponentPurposeDefault endpoint
PostgreSQL with Mina archive schema + dataSource of all read querieslocalhost:5432

You can bring this up with docker-compose.snapshot.yml (ships in the repo). A snapshot dump under ./snapshots/devnet-latest — or downloaded via the compose download profile — is required.

Tutorial mode additionally requires a full local lightnet:

ComponentPurposeDefault endpoint
Mina Daemon GraphQLLive chain queries, sending paymentshttp://localhost:3085/graphql
Archive-Node-APIzkApp events/actions, archive blockshttp://localhost:8282
Accounts ManagerTest account faucethttp://localhost:8181
PostgreSQL (archive DB)Read querieslocalhost:5432

All four are brought up by docker-compose.tutorial.yml. Expect ~1–2 minutes for the network to sync before tools respond correctly.

Note: if you install from npm (npx @o1-labs/mina-mcp-server), the docker-compose files are not included in the tarball — you will need to clone this repo, or copy the docker-compose.*.yml files out of it, to start the infra.

Quick Start

bash
# Install dependenciesnpm install
# Buildnpm run build
# Start infrastructure (pick one):
# Option A: Snapshot mode (read-only, from local dump)SNAPSHOT_DIR=./snapshots/devnet-latest docker compose -f docker-compose.snapshot.yml up -d
# Option B: Snapshot mode (download latest dump from GCS — devnet by default)docker compose -f docker-compose.snapshot.yml --profile download up -d#   See "Snapshot mode against other public networks" below for mainnet/mesa.
# Option C: Tutorial mode (full lightnet)docker compose -f docker-compose.tutorial.yml up -d# Wait ~1-2 min for the network to sync
# Option D: Live mode (read-only, talks to a public Mina network — no local infra)#   Picks a network with --network (devnet, mainnet, mesa). Nothing else to start.
# Run the MCP serverMINA_MCP_MODE=snapshot npm start                              # orMINA_MCP_MODE=tutorial npm start                              # ornpm start -- --mode live --network devnet                     # no Postgres / lightnet needed

Live mode against a public Mina network

Live mode is a thin read-only proxy that turns MCP tool calls into GraphQL/HTTP requests against the o1Labs-hosted public endpoints. There is nothing to host — run it locally next to your MCP client:

bash
npm start -- --mode live --network devnet     # or mainnet, mesa# equivalently:MINA_MCP_MODE=live MINA_MCP_NETWORK=devnet npm start

Endpoints are best-effort services without SLAs and URLs are subject to change. Networks are classified by stability tier:

NetworkStabilityWhat it means
devnetstableLong-lived dev network. Expected to stick around.
mainnetstableProduction. Expected to stick around.
mesapreflightPreview/staging network. May be reset, renamed, or retired without notice. Endpoints, archive-dump filenames, and even the network identity itself are not guaranteed stable.
mesa-mutpreflightMesa Upgrade Test — a fork of mainnet state for rehearsing the Mesa hardfork. Tied to the upgrade rehearsal; will be reset/retired without notice. Genesis is a mainnet-state fork, but the daemon reports networkID mina:testnet (testnet signature schema). No Rosetta endpoint, no faucet, and no published archive dump (snapshot mode unavailable).

When a LiveProvider is constructed against a preflight network, the server emits a [WARN] Network '<name>' is a PREFLIGHT network… line at startup and prepends a PREFLIGHT hint to describe_state's hints[] — so any LLM consuming the output sees the caveat before reasoning about the data. If you build downstream automation against a preflight network, treat any data you gather as ephemeral and have a fallback to a stable network.

Rosetta Data API (live mode)

When a live-mode network has a Rosetta endpoint configured (devnet, mainnet, and mesa do today; mesa-mut does not), the server registers five Rosetta Data API tools alongside the daemon/archive ones. On a network without a Rosetta endpoint the rosetta_* tools are not registered at all, so the advertised tool list reflects what the network can actually do. These return responses in standardized Rosetta format — useful for LLMs and integrations that already speak Rosetta:

ToolRosetta endpointUse
rosetta_statusPOST /network/statusCurrent / genesis / oldest block, sync state
rosetta_accountPOST /account/balanceBalance for an address, optionally at a specific block
rosetta_blockPOST /blockFull block (with operations) by index or hash
rosetta_mempoolPOST /mempoolPending transaction identifiers
rosetta_mempool_transactionPOST /mempool/transactionA single pending tx with operations

Construction API (offline signing flow) is intentionally not included in this set; it's a follow-up with its own tool-shape design (macro-vs-literal).

Each network also carries optional pointers that the MCP server doesn't proxy itself but surfaces via describe_state.hints[] so an LLM can hand them to a human or a Rosetta-aware client:

Mesa hardfork upgrade tracking (mesa-mut)

mesa-mut rehearses the Mesa hardfork upgrade. On --network mesa-mut the server registers an extra tool, get_upgrade_status, which joins the upgrade tracker (status.json) with the live daemon's current global slot to report the phase: current slot vs stopTransactionSlot / stopNetworkSlot, slots/minutes remaining, the Mesa genesis timestamp, and a transactionsOpen boolean with phase-aware hints[]. Check transactionsOpen before submitting a send — transactions sent after stopTransactionSlot are dropped.

For agent workflows, a companion Claude skill — .claude/skills/mesa-upgrade — wraps this tool with a per-phase operator runbook (what to do / not do before, during, and after the fork).

Live write mode (experimental — client-side signing)

Live mode can be promoted from read-only to read+write by handing the server one or more wallet keys. Sends are signed in this process with mina-signer and submitted as pre-signed transactions to the daemon. No daemon-side wallet, no faucet on devnet/mainnet, no key material on the wire.

bash
npm start -- --mode live --network devnet --wallets ./wallets.json# equivalently:MINA_MCP_MODE=live MINA_MCP_NETWORK=devnet MINA_MCP_WALLETS=./wallets.json npm start

EXPERIMENTAL — read this before pointing it at real value. Wallet private keys are loaded unencrypted from disk into this process's memory. That's fine for ephemeral test wallets on devnet/mesa; it's not fine for production keys. Either:

  • only load wallets containing money you can afford to lose, or
  • don't use this mode for mainnet at all — use a hardware wallet or an offline signer for anything material.

Pointing this at mainnet additionally requires --allow-mainnet-writes (or MINA_MCP_ALLOW_MAINNET_WRITES=1) as a deliberate speedbump against config typos.

wallets.json schema

json
{  "wallets": {    "warm": {      "keyPath": "/home/me/.mina/keys/warm.key",      "publicKey": "B62q…",      "caps": { "maxFeeNanomina": "100000000", "maxAmountNanomina": "5000000000" }    },    "demo": { "keyPath": "/home/me/.mina/keys/demo.key", "publicKey": "B62q…" }  },  "defaultWallet": "warm"}
  • keyPath files must contain exactly one EK… base58check private key (one line, no other content). Encrypted JSON key files are not supported in this revision.
  • keyPath files must be chmod 600; the loader refuses to start otherwise.
  • publicKey is verified at startup against the loaded key — catches "wrong key for this alias" mistakes before any tool runs.
  • caps (optional, per wallet) bound a single transaction: maxFeeNanomina and maxAmountNanomina (decimal nanomina, 1 MINA = 1e9). A send exceeding a cap is refused before signing — a guardrail against a runaway/adversarial LLM draining a wallet. Memos are always capped at 32 bytes.
  • defaultWallet is optional; if omitted, every send_payment/send_delegation call must pass from_alias or from.
  • Paths may be relative to the config file's directory (so the whole bundle is portable).

Tool surface added in live-write mode (on top of the live-mode read tools):

ToolDescription
list_walletsLoaded aliases + publicKeys + balances + nonces. Never returns private keys.
send_paymentSign + submit a MINA payment. Use from_alias, or from (publicKey), or rely on the default. Pass dry_run: true to inspect the signed payload without submitting.
send_delegationSame shape, for stake delegation.

describe_state in live-write mode adds a wallets[] block (aliases, publicKeys, balances — never keys) and prepends a Live-WRITE mode… hint, so an LLM picks up the new capabilities on the first orient.

Safety guarantees (enforced, not just documented):

  • Permission gate. Any key file with mode wider than 0600 fails startup loudly.
  • Mainnet writes opt-in. --allow-mainnet-writes is a hard requirement for --network mainnet --wallets ….
  • Nonce cache. max(daemon_nonce, last_submitted+1) — survives archive-lag races without burning a nonce on failed submits.
  • Dry-run. send_payment(dry_run: true) returns the signed payload + computed hash without hitting the daemon.
  • Automated redaction sweep. test/mcp/wallets-redaction.test.ts fires every registered tool with bogus args and asserts the server's loaded private key never appears in any response.

Snapshot mode against other public networks

The --profile download path of docker-compose.snapshot.yml fetches dumps from the public bucket https://storage.googleapis.com/mina-archive-dumps. The URL layout is <prefix>-<YYYY-MM-DD>_<HOUR>.sql.tar.gz. To target a different network, override ARCHIVE_DUMP_PREFIX:

NetworkPrefixCadenceRecent size
devnet (default)devnet-archive-dumpdaily, _0000 UTC~370 MB compressed
mainnetmainnet-archive-dumpdaily, _0000 UTC~1.5 GB compressed
mesa (preflight)hetzner-pre-mesa-1-archive-dumptwice daily, _0000 + _1200 UTC~32 MB compressed
bash
# Mainnet snapshotARCHIVE_DUMP_PREFIX=mainnet-archive-dump \  docker compose -f docker-compose.snapshot.yml --profile download up -d
# Mesa snapshot (preflight — see warning below)ARCHIVE_DUMP_PREFIX=hetzner-pre-mesa-1-archive-dump ARCHIVE_DUMP_HOUR=1200 \  docker compose -f docker-compose.snapshot.yml --profile download up -d

Mesa is a preflight network. The dump prefix above is internal ops naming and is not a stable convention — it may change or stop being published without notice when mesa graduates or is retired. Treat snapshot data from mesa as ephemeral.

In live mode the server hides every tool that would need infra it doesn't have:

  • no archive Postgres → no query_archive_sql, get_archive_schema, list_blocks, search_transactions, get_transaction, get_staking_ledger, get_archive_stats;
  • no accounts-manager / faucet → no faucet, return_account, reset_session;
  • no reset janitor → no freeze_reset, unfreeze_reset, freeze_status;
  • public daemons don't sign for you → no send_payment, send_delegation, get_tracked_accounts.

get_block requires a stateHash in live mode — use get_archive_blocks (Archive-Node-API) to discover one first.

Demo: end-to-end payment in tutorial mode

The point of running this server is that a single natural-language prompt can drive a multi-step on-chain flow that would otherwise need half a dozen separate GraphQL calls. Once the lightnet is up and your MCP client is connected, this prompt:

Grab two funded test accounts from the faucet. Send 10 MINA from the first to the second, then poll until it lands in a block — show me the mempool state right after submission and the block height it gets included in. Once confirmed, check both balances and return both accounts.

drives the following tool sequence (excerpted from a real tutorial-mode run):

StepToolKey output
1faucet ×2Two accounts, 1550 MINA each
2send_payment (10 MINA, 0.1 fee)Tx hash 5JtVaGBj…6Tto
3get_mempool filtered by senderCaptures the pending tx
4get_transaction_statusINCLUDED
5get_transaction → get_block(height=175)In block 175 (3NKErr14…YHpm), status applied
6get_account ×2Sender 1539.9 MINA, Receiver 1560 MINA — sender −10 payment −0.1 fee, receiver +10 ✓
7return_account ×2Both released back to the pool

End-to-end wall-clock was a few seconds on a synced lightnet. The flow exercises every tutorial-only tool family in one go — faucet/return, payment submission, mempool, status polling, block/account lookup — making it a useful smoke check after deploy.

Infrastructure configuration (tutorial / snapshot)

These configure where the backing services live; live mode doesn't use them. Copy .env.example to .env and adjust as needed:

bash
cp .env.example .env

Key variables:

VariableDefaultDescription
MINA_MCP_MODEsnapshotServer mode: snapshot, tutorial, or live
MINA_MCP_NETWORK(unset)Required in live mode: devnet, mainnet, or mesa
ARCHIVE_DB_HOSTlocalhostArchive PostgreSQL host
ARCHIVE_DB_PORT5432Archive PostgreSQL port
MINA_GRAPHQL_ENDPOINThttp://localhost:3085/graphqlMina daemon GraphQL (tutorial mode)
ARCHIVE_API_ENDPOINThttp://localhost:8282Archive-Node-API GraphQL (tutorial mode)
ACCOUNTS_MANAGER_ENDPOINThttp://localhost:8181Test accounts manager (tutorial mode)

MCP Tools

Tool registration is mode-aware — tools whose backing infra isn't available in a given mode aren't registered at all (so they don't show up in tools/list, and an LLM never reasons about them).

Snapshot mode (schema explorer)

ToolDescription
query_archive_sqlExecute read-only SQL against the local archive Postgres
get_archive_schemaInspect archive DB table/column metadata
get_sync_statusDB connectivity probe + basic archive stats
list_examples / get_exampleDiscover canned SQL workflows (e.g. custom_sql)

Tutorial mode (live lightnet — superset of snapshot)

All snapshot tools, plus:

ToolDescription
get_account / get_blockLive state from the daemon, with archive-DB fallback
get_staking_ledger / list_blocks / get_transaction / search_transactionsArchive-DB reads
get_archive_statsTally of blocks / commands / accounts in the archive
get_best_chain / get_mempool / get_transaction_statusLive daemon queries
get_genesis_constants / get_network_id / get_tracked_accountsDaemon metadata
get_events / get_actions / get_archive_blocks / get_network_stateArchive-Node-API
faucet / return_account / reset_sessionPre-funded test account pool (1550 MINA each)
send_payment / send_delegationDaemon-signed transactions
freeze_reset / unfreeze_reset / freeze_statusPause the periodic chain reset for human demos
describe_stateOne-shot snapshot of chain + mempool + accounts + reset state

Live mode (public Mina network — read-only)

ToolDescription
get_account / get_block / get_best_chain / get_mempool / get_transaction_statusLive daemon queries
get_sync_status / get_genesis_constants / get_network_idDaemon metadata
get_events / get_actions / get_archive_blocks / get_network_stateArchive-Node-API
rosetta_status / rosetta_account / rosetta_block / rosetta_mempool / rosetta_mempool_transactionMina-Rosetta Data API (Coinbase spec)
describe_stateLive snapshot incl. preflight + Rosetta + faucet hints
list_examples / get_exampleLive-mode-applicable workflows

Development

Build

bash
npm run build          # compile TypeScriptnpm run dev            # compile in watch mode

Running Tests

bash
# All unit + MCP tests (no infrastructure needed)npm run test:unitnpm run test:mcp
# All tests (unit + MCP)npm test
# Watch modenpm run test:watch
# Integration tests (requires running lightnet)docker compose -f docker-compose.tutorial.yml up -dnpm run test:integration

Test Structure

test/  unit/                    # Unit tests - mock all external dependencies    accounts-manager.test.ts    archive-db.test.ts    example-library.test.ts    live-provider.test.ts    networks.test.ts    reset-controller.test.ts    schemas.test.ts    session-tracker.test.ts    shape.test.ts    snapshot-provider.test.ts    tutorial-provider.test.ts    wallet-caps.test.ts    wallets-loader.test.ts  mcp/                     # MCP protocol tests - InMemoryTransport + Client    helpers.ts             # Shared setup: mock providers, transport wiring    snapshot.test.ts       # Snapshot mode    tutorial.test.ts       # Tutorial mode: live tools, zkApp, faucet    live.test.ts           # Live mode: read-only against public networks    live-write.test.ts     # Live-write mode: wallet loading + signed sends    http-transport.test.ts # HTTP transport: rate-limiting, /health, /metrics    wallets-redaction.test.ts # Sweep: no private key leaks any tool response  integration/             # Integration tests - require live lightnet    lightnet.test.ts    tutorial.test.ts

The MCP tests use @modelcontextprotocol/sdk's InMemoryTransport to create a linked client-server pair in-process. This tests the full MCP protocol layer (tool registration, schema validation, request/response) without needing any network or database.

Project Structure

src/  index.ts                 # Entry point — CLI args, mode wiring, transport  server-factory.ts        # Centralized tool registration per mode  db/archive.ts            # PostgreSQL archive database client  graphql/    client.ts              # createMinaClient factory (wraps @o1-labs/mina-sdk MinaClient)    accounts-manager.ts    # Tutorial-mode test accounts REST API client  providers/    snapshot.ts            # Read-only provider (archive DB only; no daemon)    tutorial.ts            # Tutorial provider (daemon + archive + accounts mgr)    live.ts                # Live provider (public network daemon, read-only)    live-write.ts          # Live-write provider (wallet-backed signed sends)  tools/    accounts.ts            # Account tools (get_account, get_staking_ledger)    blocks.ts              # Block tools (get_block, list_blocks, get_best_chain)    transactions.ts        # Transaction tools (send_payment, search, mempool, status)    network.ts             # Network tools (sync status, genesis, archive stats)    schema.ts              # Archive SQL (query_archive_sql, get_archive_schema)    zkapps.ts              # Archive-Node-API tools (events, actions, blocks)    test-accounts.ts       # Faucet tools (acquire/release tutorial accounts)    state.ts               # describe_state aggregator    admin.ts               # Reset controls (freeze/unfreeze)    rosetta.ts             # Rosetta Data API tools (live mode)    wallets.ts             # list_wallets (live-write mode)    examples.ts            # Cookbook tools (list_examples, get_example)    shape.ts               # Response shapers (lite / transactions / full)  transports/    http.ts                # HTTP transport (Streamable + rate limiting + /metrics)  wallets/    loader.ts              # Wallet config + key file loader (live-write mode)    types.ts               # WalletRegistry / LoadedWallet types  session/tracker.ts       # Per-MCP-session account tracking (auto-release)  reset/controller.ts      # Reset-window controller (freeze/unfreeze chain resets)  snapshots/capture.ts     # CLI: capture archive DB snapshot  examples/library.ts      # Cookbook workflow library (drives examples tools)  networks.ts              # Public network configs (devnet/mainnet/mesa)

Daemon GraphQL access goes through @o1-labs/mina-sdk's MinaClient — typed methods (getAccount, getBestChain, getBlock, sendPayment, …) own the query strings, response shapes, and retry/timeout policy. mcp-server is deliberately a thin adapter: it adds tutorial-mode test-account orchestration and the MCP tool registration layer on top of the SDK.

Tutorial Mode Services

When running in tutorial mode with docker-compose.tutorial.yml, the following services are available:

ServiceURLDescription
Mina Daemonhttp://localhost:3085/graphqlDirect daemon GraphQL
NGINX Proxyhttp://localhost:8080/graphqlDaemon GraphQL with CORS
Explorer UIhttp://localhost:8080/Lightweight block explorer
Accounts Managerhttp://localhost:8181/Test account REST API
Archive-Node-APIhttp://localhost:8282/Archive GraphQL (events/actions)
PostgreSQLlocalhost:5432Archive database

Using with tutorial / snapshot mode

Client config is the same { command, args } shown in Connect your MCP client — just change --mode to tutorial or snapshot (and drop --network). The difference is the infrastructure: these modes talk to local services, so bring those up first (see Prerequisites and Quick Start).

The MCP server will not start the infrastructure for you. If Postgres / daemon / archive-node-api / accounts-manager are not reachable, tools return connection errors — that's expected, not a bug.

Deploying on Fly.io

The repo ships a Dockerfile and fly.toml that bundle the MCP server with the lightnet image into a single Fly machine. The MCP server runs in HTTP/SSE mode behind Fly's TLS terminator; the lightnet's Explorer UI + GraphQL playground are exposed on a second port for humans.

bash
# First-time setup (creates the app and provisions a machine)flyctl launch --no-deploy --copy-config
# Or, if app already exists:flyctl deploy

After deploy:

URLAudienceWhat's there
https://mina-mcp-sandbox.fly.dev/mcpAI clientsMCP streamable-HTTP endpoint
https://mina-mcp-sandbox.fly.dev/healthopsLiveness probe + active session count
https://mina-mcp-sandbox.fly.dev:8080/humansLightweight Mina Explorer UI
https://mina-mcp-sandbox.fly.dev:8080/graphqlhumansGraphQL playground (CORS-enabled NGINX proxy)

Rename the app to your own subdomain with flyctl apps rename or attach a custom domain via flyctl certs add mcp.your-domain.com (CNAME the domain to mina-mcp-sandbox.fly.dev).

Connecting an MCP client to the hosted server

Claude Desktop / Claude Code config (.mcp.json):

json
{  "mcpServers": {    "mina": {      "url": "https://mina-mcp-sandbox.fly.dev/mcp"    }  }}

The first session call returns a Mcp-Session-Id header that the client must echo on every subsequent request. When the session disconnects, every test account it acquired via faucet is automatically released.

Operational notes

  • auto_stop_machines = "stop" + min_machines_running = 0 lets the machine scale to zero when idle. First request after idle pays a ~60–120s cold-start while the lightnet syncs.
  • The chain-reset janitor (planned) reads provider.resetController.isFrozen(); admins / demo presenters can pause it via the freeze_reset MCP tool.
  • See deploy/start.sh for the in-container boot order: lightnet first, MCP server last.

Roadmap

Tracked in GitHub issues. Highlights:

  • Bundled SQLite snapshot (#28) — ship a SQLite archive snapshot inside the package so npx @o1-labs/mina-mcp-server --mode snapshot runs with zero infra, the same zero-setup story live mode already has.
  • Rosetta Construction API — the offline signing flow (derive → preprocess → metadata → payloads → sign → combine → submit). The read-only Rosetta Data API tools already ship today.

Shipped recently: live mode against public networks (devnet / mainnet / mesa), a hosted Fly.io sandbox, live-write mode (in-process signing), and adoption of the published @o1-labs/mina-* SDKs as the transport layer. Tutorial mode stays infrastructure-dependent (local lightnet) by design — it's for development against a controllable network.

Contributing

See CONTRIBUTING.md for dev setup, testing, and PR conventions. Found a vulnerability? See SECURITY.md.

License

Apache-2.0

來源:README.md,提交 2404419

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.7.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分