hs-sql-agent

by tse-wei-chen

Not rated
GitHub

About

C# SQL Agent MCP server featuring raw SQL input, strict AST validation, and an embedded Admin UI. Eliminates LLM hallucinations and security risks across 6 major databases.

Details

Author
tse-wei-chen
Categories
Database, AI

Setup

Install hs-sql-agent in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/tse-wei-chen/hs-sql-agent

Follow the installation instructions in the repository README, then restart your MCP client.

A high-performance MCP server for secure SQL access and enterprise governance.

hs-sql-agentconnects MCP clients to SQLite, PostgreSQL, MySQL, SQL Server, Oracle, and Firebird through an HTTP MCP endpoint and a built-in Admin Panel.

Instead of executing unrestricted LLM-generated SQL, the server parses supported SQL into structured definitions, validates it, and rebuilds the final statement through a provider-specific SQL compiler.

- Six database providers— SQLite, PostgreSQL, MySQL, SQL Server, Oracle, and Firebird.
- Governed access— Per-key database binding, table whitelisting, CORS, rate limits, and execution policies.
- Safe DML— Transactional dry-run followed by MCP Elicitation for explicit human approval.
- Admin Panel— Manage databases, keys, roles, custom tools, audit records, and runtime policies.
- Enterprise ready— OIDC SSO, TOTP MFA, audit retention, Prometheus metrics, OTLP, and webhook/SIEM delivery.
- Semantic metadata— Table and column synonyms, relationships, and scoped metric metadata for schema discovery.

SQL support is intentionally bounded: unsupported syntax is rejected instead of silently changing its meaning. See theMCP Tools Referencefor the supported SQL contract.

cp .env.example .env # Set HMAC_KEY and JWT_KEY to unique secrets of at least 32 bytes. docker compose up -d

Open the Admin Panel athttp://localhost:8080. Configuration options and production deployment guidance are documented in theWiki.

Create an MCP key in the Admin Panel. The key dialog displays the plaintext secret once and generates configuration for Claude Desktop, Cursor, and generic Streamable HTTP clients.

SetMCP_PUBLIC_ENDPOINTto the externally reachable MCP URL, including/mcp. For client compatibility, onboarding, and DML Elicitation requirements, seeMCP client onboarding.

Embed the MCP SQL Agent and optional Admin UI in an ASP.NET Core application:

builder.Services.AddHsSqlAgent(options => { ... }); app.UseHsSqlAgent(); // API only // app.UseHsSqlAgent().ServeAdminUi(); // API and Admin UI

See theNuGet Package guidefor configuration and deployment details.
- Authenticate the MCP key and apply its database, table, and policy scope.
- Parse supported SQL into a structured definition.
- Validate the definition and compile it for the configured database provider.
- Execute queries within configured limits.
- For DML, dry-run in a transaction and require human approval through MCP Elicitation before commit.

Custom SQL tools pass through the same parser, validation, access policy, and execution limits as built-in tools. Lifecycle, parameter, and publishing rules are documented in theAdmin Panel guide.

This is what the human-in-the-loop approval step looks like duringexecute_dml_sql:

SeeCONTRIBUTING.mdand theDevelopment guide.

Hydrolix time-series datalake integration providing schema exploration and query capabilities to LLM-based workflows.

614 million contacts, live SMTP-verified. Invalid emails cost you $0. Connect Argorant with any Agent through CLI, MCP or API and build verified lists in Claude, GPT or Hermes.

Chinese writing toolbox for Claude Code: text analysis, outline generation, GB/T 7714 references,character frequency

A lightweight MCP server for connecting to Apache Doris and other MySQL-compatible databases, providing tools and prompts for LLM applications.

Build and access a personal LLM knowledge base from your editor or client without any infrastructure setup.

Mantora is a local-first MCP observer: a lightweight UI + proxy for inspecting LLM data access (sessions, tool calls, results) with protective defaults.

Biologically-inspired memory for Claude. Hebbian plasticity, dream cycles, and temporal decay for persistent knowledge synthesis.

Access the Quran API from alquran.cloud to retrieve accurate Quranic text and reduce LLM hallucinations.

An MCP server for local Tabular Models like PowerBI. It allows LLM clients to debug, analyze, and compose DAX queries by connecting to a local Tabular model instance.

Interact with Verodat AI Ready Data platform

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.