MCP Server Integration
Connect AI assistants to X402-enabled APIs using the AgnicPay MCP server
π MCP Server Integration
A hosted MCP server that gives AI assistants (Claude, n8n, etc.) the power to automatically discover, access, and pay for X402-enabled APIs using your AgnicPay wallet.
MCP Server Address
Use this URL when connecting to the AgnicPay MCP server from any MCP client.
What is This MCP Server?
The AgnicPay MCP server is a hosted remote service that connects your AI tools to the X402 payment protocol. Think of it as a bridge between your AI assistant and paid APIs.
X402 is a new HTTP status code (like 404 for "Not Found") that means "Payment Required". When an API responds with 402, our MCP server automatically:
- Detects the payment requirement and price
- Signs the payment using your AgnicPay wallet
- Retries the request with payment proof
- Returns the API response to your AI
No installation needed. No blockchain knowledge required. Just add the server URL and your API key.
How to Connect (3 Steps)
Step 1: Create AgnicPay Account & Get API Key
Sign up at pay.agnic.ai, add USDC to your wallet, then generate an API token from your dashboard.
Your API token will look like:
Step 2: Add MCP Server to Your AI Client
In your MCP client (n8n, Claude Desktop, etc.), add the AgnicPay MCP server with these details:
| Setting | Value |
|---|---|
| Server URL | https://mcp.agnic.ai/sse |
| Server Type | HTTP/SSE |
| Authentication | Bearer <your-api-token> |
Step 3: Start Using AI Tools
Your AI can now access X402 APIs automatically. The MCP server handles all payments in the background!
Available MCP Tools
Your AI assistant gets access to these 6 powerful tools when connected to our MCP server:
π make_x402_request
Automatically fetch data from any X402-enabled API. If payment is required, handles it seamlessly.
Parameters: url, method, headers, body
π° check_balance
Check your AgnicPay wallet balance across different networks (Base, Solana) before making payments.
Parameters: network (optional)
π get_payment_history
View complete payment history with timestamps, amounts, and transaction hashes for full transparency.
Parameters: limit, startDate, network
π discover_apis
Browse and search through available X402-enabled APIs. Check pricing, categories, and popularity.
Parameters: category, search, maxPrice, sort
π trade_tokens
Swap tokens on Base network. Trade USDC for ETH, or any supported token pair via DEX aggregation.
Parameters: sellToken, buyToken, sellAmount, slippagePercentage (optional)
πΈ fund_wallet
Get instructions on how to fund your AgnicPay wallet with USDC for API payments.
Parameters: network (optional)
Works with Any X402 API - These tools work with any API that supports the X402 protocol. Your AI can access weather data, market data, premium datasets, and moreβall with automatic payment.
Example: Connecting in n8n
In your n8n workflow, add an MCP Client node:
That's it! Your n8n workflow can now access paid APIs. The MCP server handles payment automatically.
Claude Desktop Configuration
Add AgnicPay to your Claude Desktop config (claude_desktop_config.json):
Perfect For
| Use Case | Description |
|---|---|
| π€ AI Agent Developers | Building autonomous agents that need to access APIs without human intervention |
| π n8n Workflow Creators | Creating automation workflows that consume multiple X402 APIs for data enrichment |
| πΌ Business Analysts | Using Claude or other AI assistants to gather data from premium sources automatically |
| π Data Scientists | Accessing paid datasets through AI without manual API key management |
Security Best Practices
- Use dedicated tokens - Create a token specifically for MCP use
- Set spending limits - Configure daily/monthly limits on your token
- Monitor usage - Check your payment history regularly
- Rotate tokens - Periodically rotate your MCP token