Modexia

Modexia

This server allows your AI agents (like Claude, LangChain bots, or custom swarms) to seamlessly execute secure cryptocurrency transactions (USDC) and zero-fee micro-payments straight from their system prompts.

Category
访问服务器

README

<div align="center"> <img src="assets/modexialogo.png" alt="Modexia Logo" width="120" style="border-radius: 20px; margin-bottom: 20px;" /> <h1>Modexia AgentPay MCP Server</h1> <p><b>The official Model Context Protocol (MCP) server for autonomous AI Agents to interact with Modexia's crypto infrastructure.</b></p>

PyPI version License: MIT </div>

<br />

Welcome to the Modexia AgentPay MCP Server (modexia-mcp). This server bridges the gap between Large Language Models and the real-world digital economy.

By integrating this standard Model Context Protocol (MCP) server into your AI stack (Claude Desktop, LobeChat, Dify, or custom multi-agent swarms), you instantly equip your AI Agents with a programmatic Smart Contract Wallet.

Instead of your agents hitting 402 Payment Required errors and failing, they can now autonomously negotiate paywalls, purchase premium data, execute zero-gas microtransactions via Circle Gateway, and trade compute resources with other agents in high-frequency vault channels.

Modexia gives your AI a bank account, and MCP gives it the tools to use it.


What's New in v0.4.1

Circle Gateway Nanopayments (x402) This release brings full agentic support for gas-free, sub-cent microtransactions directly to the MCP level.

  • nanopay — Fetch an x402-protected URL and automatically negotiate the payment using EIP-3009 offline signatures. Includes inline auto-refill logic.
  • nanopay_activate — One-time activation for the agent.
  • nanopay_deposit / nanopay_withdraw — Manage gateway funds directly from the main wallet.
  • nanopay_balance — Track the True Available Balance (Gateway deposits minus pending/unsettled signatures).
  • Structured Error Handling — The MCP tools now pass back structured ModexiaPaymentError codes (e.g., INSUFFICIENT_MAIN_BALANCE) so the LLM can reason about failures and take corrective action.

Previous: What's New in v0.3.0 (Intent-to-Pay)

Intent-Based Payments (v2) Execute standard USDC payments through a strict compliance pipeline with rich feedback.

  • submit_intent — Create a signed intent, validate against policies, and execute on-chain.
  • get_intent / list_intents — Audit trail and tracking.

Features

  • Circle Gateway Integration: Direct programmatic access to Circle's USDC nanopayment infrastructure.
  • Gas-Free Microtransactions: Send payments as low as $0.000001 with zero blockchain fees.
  • EIP-3009 Offline Signatures: Secure, off-chain payment authorizations that prevent double-spending.
  • Intent-Based Routing: Strict policy enforcement, daily spend limits, and cryptographic audit trails.
  • Automated Paywall Negotiation: Automatically detect 402 Payment Required headers and fulfill them inline.
  • Smart Auto-Refill: Seamlessly top-up gateway balances from the main wallet when funds run low.

Exposed MCP Components

Tools

Tool Name Description
nanopay Auto-negotiate and pay for 402 Payment Required URLs using EIP-3009 offline signatures.
nanopay_activate One-time activation command to enable Circle Gateway nanopayments for the agent.
nanopay_deposit Deposit funds from the main agent wallet to the nanopayment Gateway.
nanopay_withdraw Withdraw unused funds from the Gateway back to the main wallet.
nanopay_balance Check the True Available Balance (Gateway deposits minus pending signatures).
submit_intent Execute a standard USDC payment with compliance and policy enforcement.
get_intent Retrieve the status and compliance metadata of a previously submitted payment intent.
list_intents Fetch recent payment intents for audit trail review.
open_channel Lock funds into a smart contract for high-frequency micro-transactions.
consume_channel Execute instant, gas-free micro-payments inside an open channel.
settle_channel Close the vault and distribute funds on-chain.
get_channel Check the current capacity and state of a specific payment channel.
list_channels List all payment channels associated with the agent's wallet.
get_balance Retrieve the current USDC balance of the agent's primary Smart Contract Wallet.
get_history Fetch the recent transaction history for the agent.
transfer Execute a standard synchronous USDC transfer (v1).
cross_chain_transfer Execute a cross-chain CCTP payment via Squid Router (e.g., Ethereum -> Akash).
smart_fetch Legacy HTTP auto-negotiation for HTTP-based Paywalls.

Prompts

Prompt Name Description
nanopay_usage_instruction Best practices for funding the gateway and executing nanopay operations.
create_intent_payment_instruction Rules for structuring compliant payments, adding memos, and handling policy rejections.
setup_microtransactions_instruction Step-by-step guide on opening, consuming, and settling vault channels.
create_payment_instruction Standard rules for legacy idempotency-based transfers.

Resources

Resource URI Description
modexia://docs/llms_context The complete Modexia Developer Protocol Guide with overarching economic rules for swarms.

Configuration & Setup

This server requires a Modexia API Key to function. You can obtain one by creating a developer account at modexia.software.

Variable Description
MODEXIA_API_KEY Required. Your Modexia developer key (e.g. mx_test_...)
MODEXIA_BASE_URL Optional. Overrides the API endpoint. Defaults to the Sandbox Environment.

Using uvx (Recommended)

You can run this server directly in any MCP client that supports standard executable commands:

uvx modexia-mcp

Claude Desktop

To use Modexia with Claude Desktop, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "modexia": {
      "command": "uvx",
      "args": ["modexia-mcp"],
      "env": {
        "MODEXIA_API_KEY": "mx_test_YourApiKeyHere"
      }
    }
  }
}

Contributing to Open Source

We actively welcome community contributions to make this MCP server even better. Because it acts as the primary interface for autonomous AI agents, we heavily prioritize stability and strict prompt engineering.

  1. Clone the Repo: git clone https://github.com/Modexia/modexia-mcp.git
  2. Install Dependencies: pip install -e .
  3. Run Locally: You can run the server in stdio mode for local testing via python -m modexia_mcp
  4. Submit PRs: Open a Pull Request targeting the main branch.

Security Model

The Modexia MCP Server never exposes your private keys to the LLM context. The AI only has permission to trigger explicitly configured MCP tools. Policy limits (e.g., maximum daily spend, hourly caps) are enforced automatically on the Modexia backend. Even a hallucinating AI cannot drain your wallet above your predefined guards.

License & Support

modexia-mcp is an open-source tool governed by the MIT License.

Need help scaling your agent swarm or configuring your API keys? Access your developer dashboard and explore the docs at modexia.software.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选