Overview

@ankarachain/mcp is a Model Context Protocol server that exposes Ankara Chain’s deploy and management operations as tools an AI assistant can call directly — deploy a token, mint to an address, check status, or drive an escrow’s milestone lifecycle, all from a natural-language conversation instead of the CLI’s interactive prompts. It wraps the same @ankarachain/sdk classes (TokenFactory, EVMAdapter, EscrowManager, RampManager) used by the CLI, so every tool call goes through the SDK rather than constructing raw contract calls.

Running the server

Register it with an MCP-compatible client (Claude Desktop, Claude Code, etc.) by adding it to the client’s MCP server config:
The server communicates over stdio — there’s no separate network port to configure. Every tool call takes its own rpcUrl and, for write operations, privateKey as arguments, so a single server instance can operate against any network or wallet the caller specifies per-call.
Tool calls that require privateKey send it as a plain argument in the tool call. Only run this server in a trusted local environment, and prefer a dedicated deployer key with limited funds rather than a primary wallet key.

Tools

Deploy

Escrow lifecycle

On-ramp / off-ramp

The off-chain half of every ramp tool uses ManualRampProvider — a reference implementation for dev/testing. Swap in a real provider adapter (Yellow Card, Flutterwave, Transak, etc.) for production. See On-Ramp / Off-Ramp for the full design.

Token management

Every tool’s full input schema (required fields, types) is discoverable via the standard MCP tools/list request — an AI client introspects this automatically rather than needing hardcoded knowledge of the parameters.

Design notes

  • All 24 tools dispatch through a single exported callTool(name, args) function, which wraps every handler in a try/catch and returns { content, isError: true } on failure instead of throwing — so a bad tool call surfaces as a readable error to the AI client rather than crashing the server.
  • The stdio server only starts when the module is run directly (node dist/index.js / npx @ankarachain/mcp), not when imported — this lets the tool definitions and dispatch logic be unit tested without spinning up a real MCP transport.
  • Read-only tools (get_escrow_status, get_token_status, list_deployments, get_ramp_status) don’t require a privateKey, only an rpcUrl, and construct a plain ethers.JsonRpcProvider rather than a signer. get_ramp_quote needs neither, since ManualRampProvider computes quotes locally.

Why an MCP server

The rest of the SDK targets developers writing code. The MCP server targets a different integration path entirely: an AI assistant deploying and operating Ankara Chain contracts on a user’s behalf, driven by conversation rather than a script. It’s the same underlying contracts and SDK — just a different front door.