mcp-anvil-api
v1.2.0
Published
MCP server for the Ada Anvil Cardano API — build transactions, mint NFTs, manage smart contracts, and interact with the Cardano blockchain
Maintainers
Readme
mcp-anvil
MCP server for the Ada Anvil Cardano API. Build transactions, mint NFTs, manage smart contracts, and interact with the Cardano blockchain from any MCP-compatible AI assistant.
Quick Start
Claude Code
claude mcp add mcp-anvil -e ANVIL_API_KEY=your_key -e ANVIL_NETWORK=mainnet -- npx mcp-anvil-apiClaude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"mcp-anvil": {
"command": "npx",
"args": ["mcp-anvil-api"],
"env": {
"ANVIL_API_KEY": "your_api_key",
"ANVIL_NETWORK": "mainnet"
}
}
}
}Project-level (.mcp.json)
Add to your project root so collaborators get it automatically:
{
"mcpServers": {
"mcp-anvil": {
"command": "npx",
"args": ["mcp-anvil-api"],
"env": {
"ANVIL_API_KEY": "",
"ANVIL_NETWORK": "mainnet"
}
}
}
}Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| ANVIL_API_KEY | Yes | — | Your Anvil API key (get one here) |
| ANVIL_NETWORK | No | preprod | Network: mainnet, preprod, or preview |
| ANVIL_API_KEY_MAINNET | No | — | Mainnet-specific key (overrides ANVIL_API_KEY on mainnet) |
| ANVIL_API_KEY_TESTNET | No | — | Testnet-specific key (overrides ANVIL_API_KEY on preprod/preview) |
Tools
Wallet
anvil_get_utxos— Fetch CBOR-encoded UTXOs for a Cardano addressanvil_get_balance— Get aggregated ADA and native asset balance
Transactions
anvil_build_tx— Build unsigned transactions (ADA sends, multi-output, native assets, metadata)anvil_submit_tx— Submit signed transactions to the network
Minting
anvil_mint_cip25— Mint NFTs/tokens with CIP-25 on-chain metadataanvil_mint_cip68— Mint with CIP-68 (reference + user token pair)
Native Scripts
anvil_create_policy— Create time-locked, signature-based, or multisig policiesanvil_parse_policy— Get policy ID from existing script CBOR
Smart Contracts
anvil_upload_blueprint— Upload CIP-57 Plutus blueprintsanvil_query_blueprints— Search uploaded blueprintsanvil_apply_blueprint_params— Parameterize Plutus validatorsanvil_script_interaction— Lock/unlock funds at script addresses
Delegation
anvil_delegate— Delegate stake to pools or DReps
Utilities
anvil_parse_address— Extract key hashes from bech32 addressesanvil_slot_to_time— Convert slot number to Unix timestampanvil_time_to_slot— Convert Unix timestamp to slot numberanvil_health— Check API connectivity
Resources
The server also exposes reference resources:
anvil://environments— API base URLs and auth infoanvil://fees— Fee schedule and rate limitsanvil://errors— Common error codes, signing errors, and troubleshootinganvil://workflow— Step-by-step transaction and minting guidesanvil://best-practices— Production-learned patterns: signing guide, UTXO management, CIP-68 gotchas, CIP-27 royalties, and scope of the Anvil API
Example Workflows
Send ADA
"Send 5 ADA from addr1... to addr1..."The AI will: get UTXOs → build tx → return CBOR for wallet signing → submit.
Mint an NFT
"Mint an NFT called 'My Art' with this IPFS image: ipfs://Qm..."The AI will: parse your address → create a time-locked policy → build the mint tx → return CBOR for signing.
Delegate Stake
"Delegate my stake to pool1..."The AI will: build a delegation tx → return CBOR for signing → submit.
Fees
| Operation | Fee | |-----------|-----| | Transaction | 0.15 ADA | | Minting | 1 ADA | | Smart contract interaction | 0.15 ADA | | Stake registration (first time) | 2 ADA deposit |
Fees are auto-deducted from the sender by the Anvil API.
Development
git clone https://github.com/jakubstefanik/mcp-anvil.git
cd mcp-anvil
npm install
npm run buildRun locally:
ANVIL_API_KEY=your_key node build/index.jsLicense
MIT
