regexcronsql-validator

io.github.encodiPublished by GitHub account encodiv1.0.0Updated Oct 24, 2026

Valida regex, cron y SQL contra ejecucion real. Pago por llamada via x402/USDC.

VerifiedStreamable HTTPWeb executableDatabasesDeveloper Tools

Overview

AI-generated overview

Remote MCP server that validates regular expressions, cron expressions and Postgres SQL by actually running them, charging a small USDC fee per call.

What you can do
Run a JavaScript regular expression against a list of test strings and see which match and which do not. Compute the next real execution times of a cron expression from a given date. Execute a Postgres-dialect SQL query against in-memory test tables you supply and return the resulting rows. Each call is self-contained: no database, no persistent state, and test tables are rebuilt and discarded every time.
When to use it
Useful when you want an assistant to check a regex, cron schedule or SQL query against real execution instead of guessing, for example before shipping a pattern or a query. Best for occasional, one-off checks where a per-call fee is acceptable.
Requirements
A remote Streamable HTTP endpoint; no API key or account is needed. Each tool call must be paid in USDC on Base mainnet via x402, so the client needs an x402-aware MCP client with its own funded wallet and private key to sign payments.
Before you install
Every tool call costs real money in USDC on Base mainnet (about $0.02 to $0.04 per call), and an unpaid call returns an error with payment details rather than a result. Paying requires a wallet holding real funds and its private key on the client side. SQL queries run against in-memory test tables you provide, not your own database.

Installation

In SourceWeft

  1. Open regexcronsql-validator in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.encodi%2Fregexcronsql-validator/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "regexcronsql-validator": {
      "type": "http",
      "url": "https://regexcronsql-validator.encodari.workers.dev/mcp"
    }
  }
}

README

regexcronsql-validator

Servidor MCP remoto (Cloudflare Workers, template remote-mcp-authless) con dos tools que validan contra ejecución real, no contra lo que un LLM cree que hacen:

  • validar_regex — corre el patrón con RegExp nativo de JS contra una lista de strings.
  • validar_cron — calcula las próximas ejecuciones reales de una expresión cron con cron-parser.
  • validar_sql — ejecuta una consulta SQL (dialecto Postgres) contra tablas de prueba en memoria con pg-mem y devuelve las filas reales resultantes.

Sin base de datos, sin estado persistente: cada llamada crea un McpServer nuevo (ver createServer() en src/index.ts) y es autocontenida — para validar_sql esto también aplica a las tablas de prueba: se crean desde cero en cada llamada (pg-mem en memoria) y se descartan al terminar.

Cobro (x402)

Las tres tools cobran por llamada vía x402 — pago en USDC real sobre Base mainnet, sin API key, contra el facilitator público x402.org/facilitator. El pago viaja dentro del propio JSON-RPC de MCP (_meta), no como header HTTP; ver src/payments.ts.

ToolPrecio
validar_regex$0.02 USDC
validar_cron$0.02 USDC
validar_sql$0.04 USDC

Un tools/call sin pago devuelve isError: true con los accepts (red, monto, payTo) que el cliente necesita para pagar y reintentar — no una excepción sin explicar. Un cliente MCP x402-aware con wallet propia (ej. createX402MCPClient de @x402/mcp) firma el pago y lo adjunta automáticamente; probarlo end-to-end requiere una wallet con fondos reales en Base mainnet y su clave privada, algo que este repo no maneja ni pide.

Estructura

src/  index.ts        # registra las tools en el McpServer y expone el handler HTTP MCP  tools/    regex.ts      # lógica pura de validar_regex (testeable sin Workers)    regex.test.ts    cron.ts       # lógica pura de validar_cron (testeable sin Workers)    cron.test.ts    sql.ts        # lógica pura de validar_sql (testeable sin Workers)    sql.test.tsscripts/  dev-node.ts     # servidor de dev que corre el handler en Node puro, sin wrangler

Correrlo local

⚠️ Nota sobre wrangler dev: el runtime real de Cloudflare Workers (workerd) requiere macOS 13.5+. Si tu Mac tiene una versión más vieja, wrangler dev (y npm run dev) van a fallar con Unsupported macOS version. Para ese caso este proyecto trae un shim en Node puro que corre exactamente el mismo fetch() handler sin necesitar workerd.

1. Instalar dependencias

bash
npm install

2. Correr los tests unitarios

bash
npm test

3a. Si tu wrangler dev funciona (macOS 13.5+, Linux, Windows)

bash
npm run dev

Levanta en http://localhost:8787/mcp.

3b. Si wrangler dev falla por versión de macOS

bash
npm run dev:node

Levanta el mismo handler en http://localhost:8787/mcp pero corriendo en Node directo (usa tsx, con watch mode). Ver el comentario en scripts/dev-node.ts para el detalle de por qué esto es seguro (el handler no usa bindings de Cloudflare como KV o Durable Objects).

4. Probar con curl

El transporte es MCP "Streamable HTTP": todo entra por POST a /mcp como JSON-RPC.

bash
# 1) initialize (obligatorio primero en la mayoría de los clientes)curl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl-test","version":"0.0.1"}}}'
# 2) tools/list — ver el JSON Schema real que expone cada toolcurl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
# 3) tools/call — validar_regexcurl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"validar_regex","arguments":{"pattern":"^[0-9]{3}-[0-9]{4}$","test_strings":["555-1234","abc-1234"]}}}'
# 4) tools/call — validar_croncurl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"validar_cron","arguments":{"cron_expression":"0 9 * * 1-5","from_date":"2026-08-07T00:00:00Z","count":5}}}'
# 5) tools/call — validar_sqlcurl -s -X POST http://localhost:8787/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"validar_sql","arguments":{"query":"SELECT nombre, monto FROM ventas WHERE monto > 100 ORDER BY monto DESC","tables":[{"name":"ventas","rows":[{"id":1,"nombre":"Ana","monto":150.5},{"id":2,"nombre":"Luis","monto":42}]}]}}}'

Las respuestas vienen como Server-Sent Events (una línea event: message + data: {...}); el data: es la respuesta JSON-RPC de siempre.

5. Probar con MCP Inspector (más cómodo que curl)

bash
npx @modelcontextprotocol/inspector

Abre una UI en el navegador. Ahí:

  1. Transport type: Streamable HTTP.
  2. URL: http://localhost:8787/mcp.
  3. Connect → pestaña Tools → List Tools → deberías ver validar_regex, validar_cron y validar_sql con sus schemas.
  4. Elegí una tool, completá los inputs y Run Tool para ver el resultado real.

Deploy y listados

Desplegado en https://regexcronsql-validator.encodari.workers.dev/mcp (Cloudflare Workers). Publicado en el registry oficial de MCP, Smithery, mcp.so y con PR abierto a awesome-mcp-servers.

La mayoría de los cambios de código son solo npm run deploy — no hace falta re-publicar en los listados salvo que cambie el precio, la descripción, o la URL del servidor. Ver ROADMAP.md para el detalle y el plan de mejoras a futuro.

Cómo ver si se está usando

  • Pagos reales: balance de USDC de la wallet de cobro en BaseScan — cada pago liquidado por x402 aparece ahí.
  • Tráfico (pagado o no): dashboard de Cloudflare → Workers & Pages → regexcronsql-validator → Metrics.
  • Smithery: tiene su propia página de stats por servidor.

Qué NO hace (todavía)

  • Cobra en Base mainnet con dinero real. Para volver a testnet (Base Sepolia, eip155:84532) durante desarrollo, cambiá NETWORK en src/payments.ts.
  • No tiene base de datos ni estado persistente entre llamadas (más allá de la config de cobro, cacheada en memoria por isolate — ver src/payments.ts).

Source: README.md at commit 65ca16b

Tools

0
SourceWeft has not read this server's tools yet.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

85% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts