- Mcp Server For Agents And X402 Billing
Mcp Server For Agents And X402 Billing
Overview
🧪 X402 Protocol Test Server
Testing Coinbase X402 standard on Base Mainnet
<!-- Ссылки на файлы -->
<div class="card">
<h3>📄 Protocol Files</h3>
<div class="links">
<a href="/.well-known/agent.json" target="_blank">📋 agent.json</a>
<a href="/.well-known/x402.json" target="_blank">⚙️ x402.json</a>
<a href="/openapi.yaml" target="_blank">📖 openapi.yaml</a>
<a href="/hello" target="_blank">🔓 /hello (free)</a>
<a href="/test-billing" target="_blank">💰 /test-billing (paid)</a>
</div>
</div>
<!-- Тестовые кнопки -->
<div class="card">
<h3>🧪 Live Tests</h3>
<button onclick="testHello()">1. Test /hello (free)</button>
<button onclick="testBilling()">2. Test /test-billing (expect 402)</button>
<h3>📊 Results:</h3>
<pre id="result">Click a button...</pre>
</div>
<!-- Информация о сервере -->
<div class="card">
<h3>ℹ️ Server Info</h3>
<p><strong>Network:</strong> Base Mainnet (eip155:8453)</p>
<p><strong>Asset:</strong> USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)</p>
<p><strong>Address:</strong> 0x3803A19280DeeFe533D177C4A169412BD341101b</p>
</div>
<script>
// Автоматически определяем базовый URL (без hardcode)
const BASE_URL = window.location.origin;
async function testHello() {
const result = document.getElementById('result');
result.textContent = 'Loading...';
try {
const res = await fetch(`${BASE_URL}/hello`);
const data = await res.json();
result.innerHTML = `<span class="success">✅ ${res.status} OK</span>\n${JSON.stringify(data, null, 2)}`;
} catch (err) {
result.innerHTML = `<span class="error">❌ ${err.message}</span>`;
}
}
async function testBilling() {
const result = document.getElementById('result');
result.textContent = 'Loading...';
try {
const res = await fetch(`${BASE_URL}/test-billing`);
const data = await res.json();
let output = `Status: ${res.status} ${res.statusText}\n\n`;
// Показываем X402 заголовки
for (let [key, value] of res.headers.entries()) {
if (key.toLowerCase().includes('payment') || key.toLowerCase().includes('payable')) {
output += `${key}: ${value}\n`;
}
}
output += `\nBody:\n${JSON.stringify(data, null, 2)}`;
if (res.status === 402) {
result.innerHTML = `<span class="success">✅ Correctly requires payment (402)</span>\n\n${output}`;
} else {
result.innerHTML = output;
}
} catch (err) {
result.innerHTML = `<span class="error">❌ ${err.message}</span>`;
}
}
</script>
Server Config
{
"mcpServers": {
"x402-billing": {
"type": "streamable-http",
"url": "https://x402helper.xyz",
"description": "Демонстрационный сервер с x402 микроплатежами. Платные эндпоинты: /test-billing (0.001 USDC)",
"x402": {
"enabled": true,
"facilitatorUrl": "https://x402.dexter.cash"
}
}
}
}Project Info
Created At
2 months agoUpdated At
2 months agoAuthor Name
AStar
-Language
-License
-Homepage
https://x402helper.xyzRecommend Servers
View AllMemory
@modelcontextprotocol
a year ago
Mcp Server Chatsum
@chatmcp
summarize chat message
typescript
a year ago
Shotapi
@smallhandsome
16 hours ago