The high-performance MCP server for instant SQL interaction and secure enterprise governance.
hs-sql-agent is an HTTP MCP server for relational databases (SQLite, PostgreSQL, MySQL, SQL Server, Oracle, Firebird) with a built-in Admin Panel for governance.
Most "Chat with your Data" tools ask the LLM to write raw SQL — a recipe for hallucinations, dialect confusion, and injection risks. hs-sql-agent flips the model: the LLM only extracts logical parameters (tables, columns, conditions), and a deterministic engine (SqlKata) constructs the final SQL. Zero hallucinated syntax, zero injection surface.
- Deterministic Accuracy — The LLM never writes raw SQL. No made-up tables, no wrong functions, no dialect mix-ups between PostgreSQL and Oracle.
- Universal DB Support — One agent for SQLite, PostgreSQL, MySQL, SQL Server, Oracle, and Firebird. The same MCP endpoint switches engines transparently.
- Enterprise Governance — Built-in Admin Web UI, key-level connection mapping, table whitelisting, per-key CORS, rate limiting, and full audit logs.
- Semantic Layer — Map cryptic legacy column names to business-friendly labels so the LLM understands your schema.
| Use case | Description |
|---|---|
| Cursor / Claude Desktop | Let devs query dev/test DBs in natural language from their AI IDE. |
| Multi-DB agents | One MCP server per database, each secured with its own API key. The agent aggregates multiple MCP connections to seamlessly orchestrate workflows across PostgreSQL, MySQL, and Oracle. |
| Enterprise chatbots | Connect internal AI agents to ERP/CRM systems with table-level permission isolation. |
| Legacy modernization | Bridge modern AI to decades-old databases via the semantic layer. |
cp .env.example .env # set HMAC_KEY and JWT_KEY (32+ bytes)
docker compose up -d # http://localhost:8080Already have an ASP.NET Core API? Embed the full MCP SQL Agent + Admin UI in minutes:
dotnet add package HsSqlAgent.Serverbuilder.Services.AddHsSqlAgent(options => { ... });
app.UseHsSqlAgent(); // API-only
// app.UseHsSqlAgent().ServeAdminUi(); // with Admin UIThe Admin UI is embedded in the DLL — no external files to deploy. See the NuGet Package guide for details.
Detailed docs are on the Wiki:
| Topic | Link |
|---|---|
| 🚀 Getting Started | Getting-Started |
| ✨ Features | Features |
| 📘 MCP Tools | MCP-Tools-Reference |
| 🖥️ Admin Panel | Admin-Panel |
| ⚙️ Configuration | Configuration |
| 🐳 Deployment | Deployment |
| 🏠 Development | Development |
| 📡 API Reference | API-Reference |
| ❓ FAQ | FAQ |
See CONTRIBUTING.md and the Development wiki page.