Check SQL before you run it: syntax validation with the real PostgreSQL 18 parser and the real SQLite engine (MySQL / MariaDB via node-sql-parser, measured against real MySQL 8.4 and MariaDB 11.8 servers), with the exact error position; 18 lint rules that catch real bugs (UPDATE/DELETE without WHERE, = NULL, NOT IN with NULLs, LIMIT without ORDER BY, comma joins, injection tautologies, non-sargable filters, destructive DDL); and a formatter for 19 dialects that refuses to return output unless it provably means the same query (same PostgreSQL parse tree, same tokens). The SQL is never executed.
No account and no API key. Pay per successful call with MPP on Tempo (USDC.e or pathUSD). Invalid input or an upstream failure returns 402 and is not charged.
| Route | Price | What you get |
|---|---|---|
POST /v1/sql/validate | $0.001 | Validate SQL syntax (real PostgreSQL / SQLite parsers) Is this SQL syntactically valid? PostgreSQL is checked by the PostgreSQL 18 parser itself (libpg_query) and SQLite by the SQLite engine, so the answer matches the database; MySQL and MariaDB use node-sql-parser (agreement with real MySQL 8.4 / MariaDB 11.8 servers is published). Returns valid, statement count and types, or the error message with position, line, column and the text near it. Unknown tables or columns are not syntax errors. The SQL is never executed. |
POST /v1/sql/lint | $0.002 | Lint SQL for bugs, safety and performance Find real problems before a query runs: UPDATE / DELETE without WHERE, = NULL comparisons, NOT IN (subquery) NULL trap, LIMIT without ORDER BY, comma (cartesian) joins, INSERT without a column list, always-true injection signatures (OR 1=1), stacked statements, destructive DDL, non-sargable filters (LOWER(col) = ...), leading-wildcard LIKE, large OFFSET, ORDER BY ordinals, UNION vs UNION ALL, SELECT *, COUNT(col). Each finding has rule, severity, line, column, snippet and a fix. Includes the syntax check. The SQL is never executed. |
POST /v1/sql/format | $0.001 | Format SQL (verified to mean the same query) Pretty-print SQL for 19 dialects (postgresql, mysql, sqlite, bigquery, snowflake, transactsql, redshift, trino, spark, duckdb, ...): keyword case, indent, tabular styles, expression width. Before returning, every output is checked: same token sequence as the input (comments kept), and for PostgreSQL the same parse tree from the real PostgreSQL parser. If a check fails the output is refused and you are not charged. |
These call POST /v1/sql/validate ($0.001) — Validate SQL syntax (real PostgreSQL / SQLite parsers). Swap the path for any other route in the table.
npx mppx https://sql-check.fmf-x402.workers.dev/v1/sql/validate -X POST -H 'content-type: application/json' -d '{"sql":"SELECT id FROM users WHERE email = 'a@b.co' LIMIT 1","dialect":"postgresql"}'
The CLI creates or reuses a Tempo account in your keychain and pays the 402 automatically. See mpp.dev/sdk.
curl -i -X POST https://sql-check.fmf-x402.workers.dev/v1/sql/validate -H 'content-type: application/json' -d '{"sql":"SELECT id FROM users WHERE email = 'a@b.co' LIMIT 1","dialect":"postgresql"}'
import { Mppx, tempo } from 'mppx/client'
import { privateKeyToAccount } from 'viem/accounts'
Mppx.create({
methods: [tempo({ account: privateKeyToAccount(process.env.TEMPO_PRIVATE_KEY) })],
})
// Global fetch now pays the 402 automatically.
const res = await fetch('https://sql-check.fmf-x402.workers.dev/v1/sql/validate', {
method: 'POST', headers: {
'content-type': 'application/json',
},
body: JSON.stringify({"sql":"SELECT id FROM users WHERE email = 'a@b.co' LIMIT 1","dialect":"postgresql"}),
})
console.log(await res.json())
# pip install pympp
# Docs: https://mpp.dev/sdk/python
import asyncio
from mpp.client import Mpp
from mpp.methods.tempo import TempoAccount
from mpp.methods.tempo import client as tempo
account = TempoAccount.from_key("0x...")
async def main():
async with Mpp(methods=[tempo.charge(account=account)]) as mpp:
response = await mpp.fetch("https://sql-check.fmf-x402.workers.dev/v1/sql/validate", method="POST", json={"sql":"SELECT id FROM users WHERE email = 'a@b.co' LIMIT 1","dialect":"postgresql"})
print(await response.json())
asyncio.run(main())
{
"mcpServers": {
"fmf-mpp-sql-check": {
"url": "https://sql-check.fmf-x402.workers.dev/mcp"
}
}
}
Transport is Streamable HTTP at https://sql-check.fmf-x402.workers.dev/mcp. tools/list is free. Paid tools/call needs an MPP Payment header, or just use mppx against the HTTP route.
Engines bundled in the worker: libpg_query (PostgreSQL 18 parser, BSD/PostgreSQL licence via libpg-query, MIT), SQLite via sql.js (public domain / MIT), node-sql-parser (Apache-2.0), sql-formatter (MIT). No database access; your SQL is never executed or stored. Operated by FMF Tools (fmf-tools@agentmail.to). Pay per call; invalid input returns 402 and is not charged.