Core MCP server implementing x402 payment protocol on Cronos blockchain
mcp is an early-stage TypeScript project in the AI payments / x402 ecosystem. It currently has 0 GitHub stars and 0 forks.
Core Model Context Protocol (MCP) server with authentication and x402 payment validation for Cronos blockchain.
Production URL: https://mcp.cronos402.dev
The Cronos402 MCP Server is the central service providing authenticated access to MCP tools with integrated payment validation. It combines Better Auth for user management with x402 payment protocol for monetizing tool access. Developers can register, generate API keys, and consume tools while the server handles payment verification and blockchain integration.
pnpm install
pnpm dev
Server runs on http://localhost:3005
pnpm build
pnpm start
DATABASE_URL=postgresql://user:password@localhost:5432/cronos402
BETTER_AUTH_SECRET=your-secret-key
BETTER_AUTH_URL=http://localhost:3005
# Cronos Network
CRONOS_NETWORK=cronos-testnet
RECIPIENT_ADDRESS=0xYourAddress
# Facilitator
FACILITATOR_URL=https://facilitator.cronoslabs.org/v2/x402
Register a new user account.
{
"email": "[email protected]",
"password": "secure_password",
"name": "User Name"
}
Authenticate and create session.
{
"email": "[email protected]",
"password": "secure_password"
}
End current session.
List all API keys for authenticated user.
Generate new API key.
{
"name": "My API Key",
"permissions": ["tools:call"]
}
Revoke API key.
MCP protocol endpoint for tool calls and server operations.
Supports standard MCP operations:
initialize - Initialize MCP connectionlistTools - List available toolscallTool - Execute tool (requires payment)listResources - List available resourcesExample tool call with payment:
{
"jsonrpc": "2.0",
"id": 1,
"method": "callTool",
"params": {
"name": "get_weather",
"arguments": {
"city": "Tokyo"
},
"_meta": {
"x402/payment": {
"type": "transfer_with_authorization",
"signature": "0x...",
"from": "0x...",
"validBefore": 1234567890
}
}
}
}
{
"mcpServers": {
"Cronos402": {
"command": "npx",
"args": [
"cronos402",
"connect",
"--urls",
"https://mcp.cronos402.dev/mcp",
"--api-key",
"your_api_key_here"
]
}
}
}
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
import { withX402Client } from 'cronos402/client';
import { createSigner } from 'x402/types';
const cronosSigner = await createSigner('cronos-testnet', '0x...');
const transport = new StreamableHTTPClientTransport(
new URL('https://mcp.cronos402.dev/mcp')
);
const client = new Client(
{ name: 'my-app', version: '1.0.0' },
{ capabilities: {} }
);
await client.connect(transport);
const paymentClient = withX402Client(client, {
wallet: { evm: cronosSigner },
maxPaymentValue: BigInt(1000000)
});
const result = await paymentClient.callTool({
name: 'premium_tool',
arguments: { query: 'data' }
});
_meta['x402/payment']/verify endpoint# Run all tests
pnpm test
# Watch mode
pnpm test:watch
# Coverage report
pnpm test:coverage
The server uses Drizzle ORM with the following core tables:
users - User accounts and authenticationsessions - Active user sessionsapi_keys - API key managementtool_calls - Tool usage trackingpayments - Payment transaction records# Generate migration
pnpm drizzle-kit generate
# Run migrations
pnpm drizzle-kit migrate
# Studio (database UI)
pnpm drizzle-kit studio
pnpm build
NODE_ENV=production pnpm start
FROM node:20-alpine
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
EXPOSE 3005
CMD ["pnpm", "start"]
Production environment requires:
The server provides health check and metrics endpoints:
GET /health - Server health statusGET /metrics - Prometheus-compatible metricsMIT
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
Daydreams is a set of tools for building agents for commerce
The first agentic payment network: policy-controlled, gasless, and real money-ready. OmniClaw CLI + Financial Policy Engine let autonomous agents pay and earn safely at machine speed.
Agent behavior that compiles
The A2A x402 Extension brings cryptocurrency payments to the Agent-to-Agent (A2A) protocol, enabling agents to monetize their services through on-chain payments. This extension revives the spirit of HTTP 402 "Payment Required" for the decentralized agent ecosystem.
Live data for AI agents — search, research, markets, crypto, X/Twitter. Pay-per-call via x402 micropayments.