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
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.
Tools
Deploy
Escrow lifecycle
On-ramp / off-ramp
The off-chain half of every ramp tool usesManualRampProvider — 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 aprivateKey, only anrpcUrl, and construct a plainethers.JsonRpcProviderrather than a signer.get_ramp_quoteneeds neither, sinceManualRampProvidercomputes quotes locally.