Polygon x402 AI Data Agent
⚡ x402-cleanweb-agent
Convierte cualquier página web desordenada, video de YouTube o documento PDF en Markdown limpio y listo para LLM en Polygon.
Cero registro. Cero suscripciones. Verdaderos micropagos HTTP 402 de máquina a máquina para agentes de IA autónomos.
💡 ¿Por qué x402-cleanweb-agent?
Las APIs tradicionales de scraping web y extracción de datos imponen costosas suscripciones de $49/mes y una gestión compleja de claves de API.
x402-cleanweb-agent resuelve esto para agentes de IA autónomos, scrapers y desarrolladores:
❌ Sin suscripciones mensuales: Paga solo por lo que consultas ($0.005 ~ $0.05 por llamada en USDC).
❌ Sin registros ni claves de API: Protocolo nativo de máquina a máquina HTTP 402 Payment Required.
🤖 Listo para agentes de IA sin intervención humana: Los agentes de IA con una billetera cripto pueden comprar datos de forma autónoma 24/7.
⚡ Velocidad de menos de un segundo: Elimina anuncios, scripts de rastreo y desorden, devolviendo Markdown puro y estructurado.
🪙 Tarifas de gas ultrabajas: Impulsado por Polygon PoS (< $0.005 de gas de red).
📊 Motor de ahorro de tokens: Calcula la reducción de tokens entre el contenido bruto y el limpio (ahorro promedio del 60~85%) y el ahorro estimado en costos de prompts de LLM ($).
Related MCP server: ToolSnap MCP
🚀 Demo en vivo y endpoints del servicio
🌐 Interfaz de DApp Web3: https://x402-cleanweb-agent.onrender.com
📚 Documentación de la API Swagger: https://x402-cleanweb-agent.onrender.com/docs
📂 Repositorio de GitHub: https://github.com/nohosa001-pixel/x402-cleanweb-agent
Servicio | Endpoint | Precio | Salida y descripción |
🌐 Web limpia |
| 0.01 USDC | Eliminación de anuncios/ruido + Markdown listo para IA + Analíticas de ahorro de tokens |
🎬 Transcripción de YouTube |
| 0.02 USDC | Transcripciones completas de video con marcas de tiempo formateadas en Markdown |
📑 Documento PDF e informe |
| 0.05 USDC | Documentos de arXiv e informes de ganancias convertidos en Markdown estructurado |
📝 Texto plano puro |
| 0.005 USDC | Extracción de texto bruto ultraligera para indexación vectorial rápida |
🤖 Integración de agentes de IA autónomos sin intervención humana (SDK de Python)
Los agentes de IA con una billetera de Polygon (clave privada) pueden gestionar de forma autónoma el pago y la extracción de datos con cero intervención humana:
from autonomous_agent_client import AutonomousX402Agent
# 1. Initialize Autonomous Agent with Polygon Wallet
agent = AutonomousX402Agent(private_key="0xYOUR_AGENT_PRIVATE_KEY")
# 2. Autonomous Clean Web Extraction (0.01 USDC)
result = agent.clean_web("https://example.com/article")
print("AI-Ready Markdown:\n", result["markdown_content"])
print("Token Savings:", result["token_analytics"]["token_savings_percentage"])
# 3. Autonomous YouTube Transcript Extraction (0.02 USDC)
yt_result = agent.clean_youtube("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
print("YouTube Transcripts:\n", yt_result["markdown_transcript"])
# 4. Autonomous PDF Paper Extraction (0.05 USDC)
pdf_result = agent.clean_pdf("https://arxiv.org/pdf/2301.00001.pdf")
print("PDF Paper Markdown:\n", pdf_result["markdown_content"])🛠️ Cómo funciona (arquitectura M2M)
sequenceDiagram
autonumber
actor Agent as Autonomous AI Agent
participant Server as x402 Gateway (FastAPI)
participant Polygon as Polygon Mainnet (Bor RPC)
participant Scraper as AI Data Cleaning Engine
Agent->>Server: GET /api/v1/clean-web?url=https://example.com
Note over Server: Check X-Payment-Tx header
Server-->>Agent: 402 Payment Required (Chain ID: 137, Recipient, Amount)
Agent->>Polygon: Send USDC Transfer (e.g. 0.01 USDC)
Polygon-->>Agent: Return Tx Hash (0xabc...123)
Agent->>Server: GET /api/v1/clean-web?url=... with Header [X-Payment-Tx: 0xabc...123]
Server->>Polygon: Verify Receipt, Event Logs, Recipient & Nonce
Polygon-->>Server: Tx Confirmed (Status: 1)
Server->>Scraper: Sanitize and Structure to Clean Markdown
Scraper-->>Server: Return Clean Markdown + Token Analytics
Server-->>Agent: 200 OK (Clean Markdown & Analytics JSON)⚡ Inicio rápido directo con cURL
# Step 1: Query without payment to inspect 402 payment requirements
curl -i -X GET "https://x402-cleanweb-agent.onrender.com/api/v1/clean-web?url=https://example.com"
# Step 2: After sending USDC on Polygon, query with transaction hash
curl -X GET "https://x402-cleanweb-agent.onrender.com/api/v1/clean-web?url=https://example.com" \
-H "X-Payment-Tx: 0x<YOUR_POLYGON_TX_HASH>"Respuesta de ejemplo
{
"status": "success",
"service": "clean-web",
"source_url": "https://example.com",
"title": "Example Domain",
"markdown_content": "# Example Domain\n\nThis domain is for use in illustrative examples...",
"token_analytics": {
"raw_html_estimated_tokens": 1250,
"clean_markdown_estimated_tokens": 280,
"tokens_saved": 970,
"token_savings_percentage": "77.6%",
"estimated_llm_cost_saved_usd": "$0.0029"
},
"processing_time_seconds": 0.38
}🔌 Configuración del Protocolo de Contexto de Modelo (MCP)
Opción 1: Instalador automático con 1 clic (recomendado)
Configura automáticamente Claude Desktop y Cursor sin editar archivos JSON:
# Windows
install_mcp.bat
# macOS / Linux
python install_mcp.pyOpción 2: Ejecutar mediante uvx (sin necesidad de instalación)
Añádelo directamente a tu claude_desktop_config.json o a Cursor:
{
"mcpServers": {
"polygon-x402-cleanweb": {
"command": "uvx",
"args": ["--from", "git+https://github.com/nohosa001-pixel/x402-cleanweb-agent", "x402-agent"]
}
}
}Opción 3: Configuración local manual
{
"mcpServers": {
"polygon-x402-cleanweb": {
"command": "python",
"args": ["-u", "/absolute/path/to/x402-micro-agent/mcp_server.py"],
"env": {
"PYTHONUNBUFFERED": "1",
"POLYGON_RPC_URL": "https://polygon-bor-rpc.publicnode.com",
"SERVER_WALLET_ADDRESS": "0x255F9991233f86B29dB847c8d5b8CB9915e80dCf",
"USDC_CONTRACT_ADDRESS": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"
}
}
}
}Herramientas MCP expuestas
get_payment_info(): Recupera los niveles de precios y la dirección del destinatario.fetch_clean_markdown(url, payment_tx_hash): Scraper de web limpia (0.01 USDC).fetch_youtube_transcript(url, language, payment_tx_hash): Extractor de transcripciones de YouTube (0.02 USDC).fetch_pdf_markdown(url, payment_tx_hash): Conversor de documentos de investigación PDF (0.05 USDC).fetch_plain_text(url, payment_tx_hash): Scraper de texto ligero (0.005 USDC).
🛠️ Desarrollo local y ejecución
# 1. Clone repository
git clone https://github.com/nohosa001-pixel/x402-cleanweb-agent.git
cd x402-cleanweb-agent
# 2. Setup virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Start local server
python main.py
# Server running at: http://localhost:8000📜 Detalles del contrato en cadena y de la red
Red: Polygon Mainnet (ID de cadena:
137)Contrato de token (USDC):
0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359Tesorería del destinatario:
0x255F9991233f86B29dB847c8d5b8CB9915e80dCfEstándar: HTTP 402 Payment Required
🤝 Contribuciones y licencia
¡Las contribuciones y sugerencias son bienvenidas!
No dudes en abrir un issue o pull request en GitHub: https://github.com/nohosa001-pixel/x402-cleanweb-agent/issues
Distribuido bajo la Licencia MIT.
Maintenance
Related MCP Servers
- AlicenseAqualityBmaintenancePay-per-use clean web reader for AI agents. URL in, markdown plus metadata out, in milliseconds. Settled per-call in USDC over x402 — no signup, no API keys.21852MIT
- AlicenseAqualityAmaintenanceContext-efficient MCP server for AI agents. fetch_extract reduces token usage by a median 98.1% (53,820 → 2,001 tokens) vs raw HTML — saves ~$0.156/call at Sonnet pricing. Pay $0.02 USDC on Base via x402. First call free per wallet. 10 always-free utility tools included.331MIT
- AlicenseNot gradedqualityBmaintenanceMCP server providing 17 keyless, pay-per-use web-data tools with signed-provenance receipts, enabling AI agents to autonomously fetch, extract, and verify web content on Base mainnet.44MIT

nanoparse-mcpofficial
AlicenseAqualityBmaintenanceMCP server that enables AI agents to fetch web content as clean, structured Markdown via NanoParse's hosted API, using x402 micropayments in USDC on Base.1253MIT
Related MCP Connectors
Pay-per-call web scraping for AI agents via x402 on Base USDC. Six tools, no signup.
Web intelligence for AI agents: fetch, render, extract, research. x402 micropayments, no API keys.
Scrape, crawl, map and extract the web. Pay per call in USDC, no account or API key.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nohosa001-pixel/x402-cleanweb-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server