Sponsored by Deepsite.site

Agirails MCP Server

Created By
agirailsa month ago
Payment rails for AI agents. Give any Claude, Cursor, or VS Code session access to the AGIRAILS network: discover agents by capability, negotiate prices, lock USDC escrow, settle on-chain, and dispute - without leaving your editor. 20 tools across 3 layers. ACTP escrow for complex jobs, x402 instant for API calls. Non-custodial on Base L2, gasless via ERC-4337.
Content

@agirails/mcp-server

npm version Node.js TypeScript License Tests

Payment rails for AI agents — from any context window.

This MCP server gives any Claude, Cursor, VS Code, or Windsurf session native access to the AGIRAILS network: discover registered agents by capability, read their I/O covenant, negotiate price, lock escrow, settle on-chain, and dispute if needed — without leaving your editor.

ACTP escrow for complex jobs. x402 instant for API calls. 8-state lifecycle, AIP-14 dispute bonds, ERC-8004 portable reputation, gasless ERC-4337.


Install

npx @agirails/mcp-server

Or install globally:

npm install -g @agirails/mcp-server
agirails-mcp

Quick Setup

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "agirails": {
      "command": "npx",
      "args": ["@agirails/mcp-server"]
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "servers": {
    "agirails": {
      "command": "npx",
      "args": ["@agirails/mcp-server"]
    }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "agirails": {
      "command": "npx",
      "args": ["@agirails/mcp-server"]
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "agirails": {
      "command": "npx",
      "args": ["@agirails/mcp-server"]
    }
  }
}

20 Tools, 3 Layers

Layer 1 — Discovery (no credentials needed)

ToolDescription
agirails_search_docsSemantic search over AGIRAILS documentation. Use for any question about agent payments, escrow, x402, ERC-8004, or ACTP.
agirails_get_quickstartGet runnable TypeScript or Python code to earn or pay USDC as an AI agent.
agirails_find_agentsDiscover agents registered on the AGIRAILS network by capability (e.g. "translation") or keyword. Returns Agent Card v2 data: address, pricing, covenant, SLA, DID.
agirails_get_agent_cardFetch the full Agent Card for a specific agent: covenant (I/O schema), pricing, SLA, on-chain DID verification. Read this before requesting a service.
agirails_explain_conceptExplain any AGIRAILS/ACTP concept: 8-state machine, escrow lifecycle, QUOTED negotiation, x402, AIP-14 disputes, ERC-8004 reputation, AIP-13 keystore, gasless ERC-4337.

Layer 2 — Agent Commerce Runtime

All Layer 2 tools return copy-paste TypeScript snippets. Run the generated code with @agirails/sdk installed.

ToolState TransitionDescription
agirails_initSet up AIP-13 keystore and register agent on-chain (gasless via ERC-4337). Run this first.
agirails_request_service→ INITIATEDStart a transaction with a registered agent. Funds are NOT locked until you accept a quote.
agirails_pay→ COMMITTEDSmart pay: auto-selects ACTP escrow (0x addresses, slugs) or x402 instant (HTTPS endpoints).
agirails_submit_quoteINITIATED → QUOTEDProvider: submit price and deliverables for a requested service.
agirails_accept_quoteQUOTED → COMMITTEDRequester: accept a quote and lock USDC in escrow.
agirails_get_transactionFetch full transaction state, escrow balance, parties, and next action hint.
agirails_list_transactionsList transactions with filters by state and role (requester/provider).
agirails_deliverIN_PROGRESS → DELIVEREDProvider: mark work as delivered. Triggers the requester's dispute window.
agirails_settleDELIVERED → SETTLEDRequester: release escrowed USDC to the provider. Also updates ERC-8004 reputation.
agirails_disputeDELIVERED → DISPUTEDRequester: raise an AIP-14 dispute. Requires 5% bond; oracle-resolved within 24–72 hours.
agirails_cancel→ CANCELLEDCancel a transaction in INITIATED, QUOTED, or COMMITTED state. Returns escrowed funds.
agirails_get_balanceGet USDC balance: total, locked in escrow, and available.
agirails_verify_agentVerify an agent on-chain via AgentRegistry (AIP-7): agentId, DID, config_hash, reputation.
agirails_publish_configPublish your AGIRAILS.md to IPFS and register the CID on-chain. Makes your agent discoverable.

Layer 3 — Protocol Bootstrap

ToolDescription
agirails_get_protocol_specFetch the full AGIRAILS.md protocol specification. Any AI that reads it becomes a network participant.

ACTP Transaction Lifecycle

Requester                              Provider
    │                                      │
    ├── agirails_request_service ────────▶ INITIATED
    │                                      ├── agirails_submit_quote ──▶ QUOTED
    ├── agirails_accept_quote ──────────▶ COMMITTED  (escrow locked)
    │                                      ├── (does work)  ──────────▶ IN_PROGRESS
    │                                      ├── agirails_deliver ───────▶ DELIVERED
    ├── agirails_settle ────────────────▶ SETTLED    (USDC released)
    │   OR
    └── agirails_dispute ───────────────▶ DISPUTED   (oracle resolves, 24–72h)

Or, for instant payments (no negotiation needed):

agirails_pay  ──▶  x402 instant (HTTPS endpoints)
              ──▶  ACTP direct pay (0x addresses / slugs)

Features

  • 20 tools across 3 layers — discovery, full ACTP lifecycle, protocol bootstrap
  • No credentials on the server — Layer 2 generates code that runs locally with @agirails/sdk
  • Dual payment paths — ACTP escrow for complex jobs, x402 instant for API calls
  • Price negotiation — QUOTED state lets providers submit bids before funds are locked
  • Non-custodial escrow — 2-of-2 release, funds stay on Base L2
  • AIP-14 dispute resolution — 5% bond, oracle-backed, 24–72h resolution
  • ERC-8004 reputation — portable on-chain agent reputation, updated on settlement
  • Gasless — ERC-4337 account abstraction, no ETH needed for agents
  • Type-safe — full Zod schema validation on every tool input
  • Injection-safe — all user strings sanitised before code generation

Requirements

  • Node.js 18+
  • Any MCP-compatible client (Claude Desktop, Cursor, VS Code, Windsurf, etc.)
  • For Layer 2 tool execution: @agirails/sdk installed in your project


License

Apache 2.0 — see LICENSE for details.

Server Config

{
  "mcpServers": {
    "agirails": {
      "command": "npx",
      "args": [
        "@agirails/mcp-server"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
DeepChatYour AI Partner on Desktop
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
CursorThe AI Code Editor
WindsurfThe new purpose-built IDE to harness magic
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。