Skip to main content
The Model Context Protocol (MCP) is an open standard that lets AI assistants like Claude call external tools in a structured, type-safe way. The @ankarachain/mcp package implements an MCP server that exposes the entire Ankara Chain SDK — token deployment, escrow management, fiat ramp flows, and on-chain queries — as a set of callable tools. Once connected, you describe what you want in plain language and Claude handles the transaction construction, signing, and submission for you.

Installation

Connecting to Claude Desktop

Add the following block to your claude_desktop_config.json file (usually found at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, or %APPDATA%\Claude\claude_desktop_config.json on Windows):
Restart Claude Desktop after saving. You will see ankara-chain listed under active MCP servers in the Claude interface.
Keep your claude_desktop_config.json private. If you pass privateKey directly in tool calls (see below), those values appear in Claude’s context window and in your conversation history. Use a dedicated deployer wallet with only the funds needed for gas — never a wallet that holds significant assets.

Available Tools

Networks and keys

The server works on EVM networks and on Stellar. Each tool call carries its own connection arguments, so one running server can target any network or wallet. Read-only tools need no key. The MCP server exposes 42 tools, organised below by function. On EVM, tools that submit on-chain transactions require rpcUrl and privateKey, and read-only chain queries require only rpcUrl. On Stellar, pass network and stellarSecretKey instead. Ramp provider tools (get_ramp_quote, initiate_onramp) interact with the off-chain ramp provider only and require neither field.

Token Deployment

deploy_token

Deploys an ERC-20 RWA token through your TokenFactory contract. Returns: { contractAddress, txHash }
For full metadata prompts (area, soil type, valuation, etc.), use the interactive ankara deploy CLI command. The MCP deploy_token tool deploys with minimal placeholder metadata — update it on-chain afterwards.

deploy_nft

Deploys an ERC-721 NFT asset record contract via the NFTFactory. Returns: { contractAddress, txHash }

deploy_batch_token

Deploys a CommodityBatchToken (ERC-1155) warehouse receipt contract. Returns: { contractAddress, txHash }

deploy_pool_vault

Deploys a PoolVault — a multi-asset ERC-20 fund — via the MultiTokenFactory. Returns: { contractAddress, txHash }

Token Operations

mint_tokens

Mints ERC-20 RWA tokens to a recipient address. Returns: { txHash, to, amount }

get_token_status

Reads the name, symbol, total supply, and lifecycle status of an Ankara Chain token. Read-only. Returns: { name, symbol, totalSupply, status, statusLabel } where statusLabel is one of DRAFT, ACTIVE, SUSPENDED, REDEEMED, EXPIRED.

set_asset_status

Sets the lifecycle status of an Ankara Chain token. Returns: { txHash, newStatus }

list_deployments

Lists all token contracts deployed by a given address through the TokenFactory. Read-only. Returns: { deployer, tokens: string[], count }

Escrow

deploy_escrow

Deploys a MilestoneEscrow contract for tranche-based diaspora payments. Returns: { escrowAddress, txHash, totalAmount }

fund_escrow

Approves the ERC-20 allowance and deposits the full agreed amount into the escrow. Payer only. Returns: { txHash, fundedAmount }

mark_milestone_delivered

Marks a milestone as delivered. Payee only. Returns: { txHash, milestoneId }

approve_milestone

Approves a delivered milestone and releases its funds to the payee. Payer only. Returns: { txHash, milestoneId }

raise_dispute

Raises a dispute on a delivered milestone. Payer or payee only. Returns: { txHash, milestoneId }

resolve_dispute

Resolves a disputed milestone. Arbiter only. Returns: { txHash, milestoneId, releaseToPayee }

claim_timelock_release

Force-releases a delivered milestone after the timelock has elapsed with no dispute. Callable by any address. Returns: { txHash, milestoneId }

get_escrow_status

Reads the full state of an escrow — parties, balances, and per-milestone status. Read-only. Returns: { payer, payee, arbiter, token, totalAmount, funded, cancelled, remainingBalance, milestones[] }

Fiat Ramp

deploy_ramp_settlement

Deploys a RampSettlement contract — the on-chain custody layer for fiat off-ramp flows. Returns: { settlementAddress, txHash }

get_ramp_quote

Returns a fiat-to-token or token-to-fiat exchange quote via ManualRampProvider. Returns: { direction, fiatAmount, fiatCurrency, tokenAmount, tokenSymbol, exchangeRate, feeFiat, expiresAt }

initiate_onramp

Starts an on-ramp session (fiat → tokens). Returns a session ID and payment URL. Does not mint tokens. Returns: { sessionId, status, paymentUrl }

record_onramp_settlement

Records an on-chain attestation that an on-ramp mint occurred. Call this after minting the recipient’s tokens. Returns: { txHash }

initiate_offramp

Deposits tokens into RampSettlement custody and starts a fiat payout session with the provider. Returns: { reference, txHash }

confirm_offramp_settlement

Confirms a fiat payout, releasing custodied tokens to the treasury. Requires SETTLER_ROLE. Returns: { txHash }

refund_offramp

Refunds custodied tokens to the depositor when a fiat payout fails. Requires MANAGER_ROLE. Returns: { txHash }

get_ramp_status

Reads the on-chain off-ramp deposit or on-ramp record for a given reference. Read-only. Returns: { treasury, offRamp: { depositor, token, amount, status } | null, onRamp: { recipient, token, amount, status } | null }

More tools

These tools cover the rest of the SDK. Call tools/list from your MCP client for the full input schema of each one.

Tokens and assets

Multi-token, pools and oracle

Collateral vault (Stellar)

Escrow and indexer

For which SDK methods the MCP server and CLI can and can’t reach yet, see packages/mcp/COVERAGE.md.

Example: Deploying a Token with Claude

With the MCP server connected, you can issue plain-language instructions in Claude and it will call the appropriate tools on your behalf. You say to Claude:
“Deploy a farmland RWA token called ‘Volta Basin Farmland’ with the symbol VBF on Polygon Amoy. Use asset ID FARMLAND-GH-001 and country code GH. The factory is at 0xA1b2C3…, the RPC is https://rpc-amoy.polygon.technology, and my private key is 0xMyDeployerKey.”
Claude calls deploy_token and responds:
You then say:
“Mint 10,000 VBF tokens to 0xRecipientAddress on the contract you just deployed.”
Claude calls mint_tokens using the address from the previous response. You can chain entire workflows — deploy an escrow, fund it, mark milestones delivered, and approve releases — all in a single conversation without leaving your IDE or touching the CLI.
Every tool call that requires privateKey sends that key through Claude’s tool-use protocol. Never use a wallet that holds significant funds. Create a dedicated deployer wallet, fund it with just enough gas, and rotate it regularly. The private key you provide is used only for that specific tool call — it is not stored by the MCP server — but it does appear in Claude’s context window for the duration of the conversation.