
cardano-tools
io.github.wutzebaer/cardano-tools
Cardano mainnet data: staking check, stake pools, governance votes, tokens and transactions.
Documentation
Cardano Tools is a Next.js dApp: every transaction is built in the browser and signed by the user's CIP-30 wallet. Chain data comes from cardano-db-sync-api.
Besides the pages the server does a few things of its own:
/api/tx/<hash>/confirmedtells a page whether its transaction is on-chain./api/statscounts page views and transactions sent from the site, without cookies. The counts are kept instats.jsoninALERTS_DIRand are served to Prometheus inside the server's network only./api/sync-statusfeeds the banner that says when the chain data is catching up or being rebuilt. It asks Prometheus and the Pushgateway of the pool./api/mcpis an MCP server for AI agents (Streamable HTTP, stateless,app/mcp): staking check, pools, governance, tokens and transactions for free, with a limit per IP. The staking rewards report of a year is paid per call in ADA with x402 (@x402/mcp,@x402/cardano, schemeexact). The agent hands over a signed, unsent payment; the server checks it, makes the report and only then sends the payment, so a failed report costs nothing. The pool's own x402 facilitator atX402_FACILITATOR_URLchecks and sends the payments. Transactions that paid for a report are kept inmcp-payments.jsoninALERTS_DIR, so one payment buys one report. WithoutMCP_PAY_TOandX402_FACILITATOR_URLthe paid tool is not offered./mcp/test(not linked) pays for one report with a browser wallet, for an end-to-end test. The server is listed in the official MCP Registry asio.github.wutzebaer/cardano-tools; after a release set the version inserver.jsonand runmcp-publisher login githubandmcp-publisher publish./pool-post/<kind>/<epoch>draws the pictures for the posts about the pool.- The Telegram alert bot (
app/alerts): withTELEGRAM_BOT_TOKENset, the server process polls the bot for subscriptions and checks the subscribed stake addresses once an hour, by the rules of the staking check, and their timelocks every minute. Subscriptions (chat id, stake address, alerts already sent) are kept inalerts.jsoninALERTS_DIR,/databy default, which should be a volume. WithTELEGRAM_POOL_CHAT_IDset it also posts the plan and the result of every epoch and each block of the pool to that chat. Run only one instance with the token.
Pages
| Route | What it does |
|---|---|
/ | Start page: every tool in short, the staking check and the pool behind the site |
/wrapped | Cardano Wrapped: the year of an address in one shareable picture (rewards, transactions, pool, vote), without balances |
/check | Staking check of any address: pool status and fees, governance vote, rewards, with a shareable page per address |
/votes | Open and recent governance actions in plain words, with the votes of an address's DRep and pool (/governance/ is taken by the static rationale files) |
/browse | Latest tokens, search by policy id, fingerprint or $handle, token details with policy lock status |
/my | Tokens of the connected wallet or any address |
/mint | Mint CIP-68 NFTs and fungible tokens, one or many per transaction, with additional files and a JSON editor for the metadata |
/drop | NFT drops: tokens that are minted by a contract when they are bought (contracts/drop). A drop is created on the mint page, /drop lists the own ones and /drop/<policy id> sells one |
/burn | Burn tokens of own policies, including their CIP-68 reference NFT |
/timelock | Lock ADA and tokens at a native script until a date and take them back afterwards |
/close | Empty a wallet into a new address, tokens included, in as many transactions as it takes, optionally deregistering the stake key |
/rewards | Distribute ADA and tokens to the delegators of a pool |
/statement | Wallet statement with fiat values and CSV export |
/tax | Staking rewards per epoch with their value on the payout day, totals per year, CSV and print view |
/guides | Short guides to common questions (withdrawing rewards, taxes, minting), each leading to its tool |
/pool | The Cardano Tools pool [TOOLS] and delegation |
/koios | Documentation of the public Koios API the pool serves, with every endpoint to try (public/specs/koios.yaml, written by scripts/koios-spec.sh) |
/mcp | The MCP server for AI agents: address, how to add it to Claude, ChatGPT, Cursor and VS Code, its tools and prices |
/legal | Imprint, privacy and terms |
Policies
A new policy is all [sig <wallet payment key>, before <slot>], so the wallet signs for it and nothing secret has to be stored. Policies are found again through the wallet's mints on-chain; until the first mint they are kept in the browser's local storage.
Policies of the previous Cardano Tools had their key generated on the server. They can be imported on the mint page with script and signing key, which then stay in local storage and sign next to the wallet.
Getting Started
npm install
npm run dev
Open http://localhost:3333. The home page lists the tools, the token feed is at /browse.
Configuration in .env:
| Variable | Purpose |
|---|---|
CARDANO_DBSYNC_API_URL | Base URL of cardano-db-sync-api, e.g. http://localhost:8080/cardanoDbSyncApi |
NEXT_PUBLIC_CARDANO_NETWORK | mainnet (default), preprod or preview. Sets slot and epoch arithmetic, the network the wallet has to be on and the explorer links. The API has to serve a db-sync of the same network |
IPFS_API_URL | IPFS node API used to upload and pin files while minting, e.g. http://localhost:5001 |
IPFS_UPLOAD_FILES_PER_DAY | Optional. Files one visitor may store on IPFS within a day, 25000 if not set |
IPFS_UPLOAD_GB_PER_DAY | Optional. GB one visitor may store on IPFS within a day, 20 if not set |
IPFS_UPLOAD_TOTAL_GB_PER_DAY | Optional. GB all visitors together may store on IPFS within a day, 100 if not set |
NEXT_PUBLIC_SITE_URL | Optional. Public address of the site for links in previews and bot messages, https://cardano-tools.io if not set |
ALERTS_DIR | Optional. Folder for alerts.json, stats.json and mcp-payments.json, /data if not set |
MCP_PAY_TO | Optional. Address the paid MCP tools are paid to; without it they are not offered |
X402_FACILITATOR_URL | Optional. x402 facilitator that checks and sends the payments, https://x402.cardano-tools.io live |
MCP_REPORT_PRICE_LOVELACE | Optional. Price of the rewards report in lovelace; 1000000 (1 ADA, about the smallest output Cardano takes) if not set or lower |
TELEGRAM_BOT_TOKEN | Optional. Token of the Telegram bot; without it the bot does not run |
TELEGRAM_POOL_CHAT_ID | Optional. Id of the chat the posts about the pool go to; without it nothing is posted |
PROMETHEUS_URL | Optional. Prometheus that scrapes db-sync, for the sync banner, http://prometheus:9090 if not set |
PUSHGATEWAY_URL | Optional. Pushgateway with the numbers of the leaderlog job and the rebuild notice, http://prometheus-pushgateway:9091 if not set |
Refresh the OpenAPI types after API changes:
npm run update-schema
Checks
npm run lint
npm test # the logic that needs neither a wallet nor the chain, one file per area in tests/
npm run build
Docker
docker build -t wutzebaer/cardano-tools2 .
docker run -p 3000:3000 -e CARDANO_DBSYNC_API_URL=http://cardano-db-sync-api:8080/cardanoDbSyncApi -e IPFS_API_URL=http://ipfs:5001 wutzebaer/cardano-tools2
The network is compiled in, a testnet image needs --build-arg NEXT_PUBLIC_CARDANO_NETWORK=preview. The build does not need the API.
Releases
Images are tagged with the version from package.json, which the sidebar also shows. scripts/release.sh raises it (patch by default, or minor / major), tags the commit as v1.2.3, then builds and pushes wutzebaer/cardano-tools2:1.2.3.
External services
Besides cardano-db-sync-api the app talks to the wallet, the IPFS node, Kraken's public market data (prices for the wallet statement), the Anvil API (collection names), and with the bot running to Telegram. Signed transactions are submitted by the wallet alone.
No installation packages available.