Skip to content
hs-sql-agent

Open-source SQL-to-MCP tool factory · six SQL dialects · fail-closed

Turn trusted SQL into governed MCP tools for AI agents

Define parameterized SQL in the Admin UI, publish it as a typed MCP tool, and let AI agents supply only the arguments. Every call still passes through hs-sql-agent's fail-closed compiler, access policy, and Safe DML controls.

get_customer_orders
SELECT id, total, status
FROM orders
WHERE customer_id = {{ customerId }}
customerId: number → typed MCP argument

SQL → MCP

Ship an AI tool without writing MCP server code.

Name the tool, describe when the model should use it, write the SQL template, declare parameters such as {{ customerId }}, test it, then publish. The MCP schema is generated from your parameter contract.

01 Write SQL
02 Declare parameters
03 Test & publish
04 Agent calls the tool

GOVERNANCE

Deterministic SQL shape. Governed execution.

Custom tools do not bypass the safety boundary. Query tools use the same typed compiler and table policy; DML tools use the same preview, approval, revalidation, and transaction controls.

SIX DATABASES

PostgreSQL · MySQL · SQL Server · Oracle · SQLite · Firebird

One governed tool contract across six supported database providers, with provider-aware validation and lowering.

TWO MODES

Two ways to use hs-sql-agent

Custom SQL Tools Publish trusted SQL as reusable MCP tools when you want predictable, engineer-defined behavior.
Raw SQL Tools Keep raw SQL tools available when the agent genuinely needs flexible ad-hoc querying.