mcp
by Cronos402
Overview
Core Model Context Protocol (MCP) server that enables x402 payment-gated tool execution on the Cronos blockchain for AI clients.
Installation
tsx src/index.tsEnvironment Variables
- BETTER_AUTH_SECRET
- GITHUB_CLIENT_ID
- GITHUB_CLIENT_SECRET
- DATABASE_URL
- NODE_ENV
- PORT
- VLAYER_WEB_PROOF_API
- VLAYER_CLIENT_ID
- VLAYER_BEARER_TOKEN
- MCP_DATA_URL
- MCP_DATA_SECRET
- CRONOS_FACILITATOR_URL
- CRONOS_DEFAULT_NETWORK
Security Notes
1. Server-Side Request Forgery (SSRF) Risk: The server acts as a proxy, and the `targetUrl` for proxying can be specified via a base64-encoded header (`x-cronos402-target-url`) or query parameter. There is no explicit server-side validation or whitelisting of this `targetUrl` before the proxy request is made (outside of the optional VLayer hook's domain filtering), which could allow an attacker to make arbitrary requests from the server's context to internal or external systems. 2. Payment Signing Vulnerability (Latent): The `X402WalletHook` for USDC.e payments explicitly notes that 'private key access is not secure' and comments out the insecure signing logic, returning an error. However, the `createAndSignTransfer` function in `eip3009-signer.ts` exists and accepts a private key. If the `TODO` for implementing secure wallet integration is not handled carefully (e.g., by ensuring client-side signing via WalletConnect/MetaMask instead of server-side private key usage), this could become a critical vulnerability in future development. 3. Positive Security Measures: The `SecurityHook` actively removes common sensitive headers (e.g., Authorization, API keys, Cookies) from proxied requests, which is a good practice. Environment variables are validated using Zod, and database interactions use Drizzle ORM, which mitigates common injection risks. OAuth and API key management are handled by `better-auth`.
Similar Servers
solx402-mcp-server
The SOLx402 MCP Server enables AI assistants to interact with the x402 payment protocol on Solana, providing tools for service discovery, consumption, USDC payments, and access to Solana development resources.
mcp-x402
Generates X402 payment headers and looks up associated wallet addresses for internet-native payments using the Model Context Protocol.
x402-mcp-server
Enables native x402 payments for AI agents via a Spring Boot server, exposing payment operations as MCP tools.
x402-mcp-server
Enables AI agents to pay for x402-protected database queries and API calls using USDC on the Base blockchain.