{"id":48571715,"url":"https://github.com/tse-wei-chen/hs-sql-agent","last_synced_at":"2026-05-30T10:01:23.513Z","repository":{"id":350008990,"uuid":"1200271184","full_name":"tse-wei-chen/hs-sql-agent","owner":"tse-wei-chen","description":"A high-performance C# SQL Agent MCP that eliminates LLM hallucinations and security risks. Instead of letting the AI write raw SQL, it extracts parameters to generate deterministic, injection-free queries across 6 major databases—complete with a visual Admin UI and enterprise guardrails.","archived":false,"fork":false,"pushed_at":"2026-05-27T14:19:02.000Z","size":2798,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-27T14:23:57.064Z","etag":null,"topics":["accuracy","admin-panel","ai-safety","ai-safety-design","anti-hallucination","firebird","mcp","mcp-server","mcp-servers","mysql","nl2sql","oracle","postgres","postgresql","security","sql-agent","sql-server","sqlite"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tse-wei-chen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-03T08:10:29.000Z","updated_at":"2026-05-27T14:21:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tse-wei-chen/hs-sql-agent","commit_stats":null,"previous_names":["tse-wei-chen/hs-sql-agent"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/tse-wei-chen/hs-sql-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tse-wei-chen%2Fhs-sql-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tse-wei-chen%2Fhs-sql-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tse-wei-chen%2Fhs-sql-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tse-wei-chen%2Fhs-sql-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tse-wei-chen","download_url":"https://codeload.github.com/tse-wei-chen/hs-sql-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tse-wei-chen%2Fhs-sql-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33687722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accuracy","admin-panel","ai-safety","ai-safety-design","anti-hallucination","firebird","mcp","mcp-server","mcp-servers","mysql","nl2sql","oracle","postgres","postgresql","security","sql-agent","sql-server","sqlite"],"created_at":"2026-04-08T15:00:14.166Z","updated_at":"2026-05-30T10:01:23.508Z","avatar_url":"https://github.com/tse-wei-chen.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hs-sql-agent\n\n\u003e **The high-performance MCP server for instant SQL interaction and secure enterprise governance.**\n\n[![License: Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-green)](https://github.com/tse-wei-chen/hs-sql-agent/blob/main/LICENSE) [![Docker](https://github.com/tse-wei-chen/hs-sql-agent/actions/workflows/docker-publish.yml/badge.svg?event=release)](https://github.com/tse-wei-chen/hs-sql-agent/actions/workflows/docker-publish.yml) [![CodeQL Advanced](https://github.com/tse-wei-chen/hs-sql-agent/actions/workflows/codeql.yml/badge.svg?event=release)](https://github.com/tse-wei-chen/hs-sql-agent/actions/workflows/codeql.yml) [![Tests](https://github.com/tse-wei-chen/hs-sql-agent/actions/workflows/test.yml/badge.svg)](https://github.com/tse-wei-chen/hs-sql-agent/actions/workflows/test.yml)\n\n`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.\n\n## 🤔 Why hs-sql-agent?\n\nMost \"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](https://sqlkata.com)) constructs the final SQL. Zero hallucinated syntax, zero injection surface.\n\n- **Deterministic Accuracy** — The LLM never writes raw SQL. No made-up tables, no wrong functions, no dialect mix-ups between PostgreSQL and Oracle.\n- **Universal DB Support** — One agent for SQLite, PostgreSQL, MySQL, SQL Server, Oracle, and Firebird. The same MCP endpoint switches engines transparently.\n- **Enterprise Governance** — Built-in Admin Web UI, key-level connection mapping, table whitelisting, per-key CORS, rate limiting, and full audit logs.\n- **Semantic Layer** — Map cryptic legacy column names to business-friendly labels so the LLM understands your schema.\n\n### Where to use it\n\n| Use case | Description |\n|----------|-------------|\n| **Cursor / Claude Desktop** | Let devs query dev/test DBs in natural language from their AI IDE. |\n| **Multi-DB agents** | One MCP server, many databases — switch between PostgreSQL, MySQL, Oracle, etc. per API key. |\n| **Enterprise chatbots** | Connect internal AI agents to ERP/CRM systems with table-level permission isolation. |\n| **Legacy modernization** | Bridge modern AI to decades-old databases via the semantic layer. |\n\n## 🚀 Quick Start\n\n```bash\ncp .env.example .env      # set HMAC_KEY and JWT_KEY (32+ bytes)\ndocker compose up -d       # http://localhost:8080\n```\n\n## 📦 NuGet for Existing .NET APIs\n\nAlready have an ASP.NET Core API? Embed the full MCP SQL Agent + Admin UI in minutes:\n\n```bash\ndotnet add package HsSqlAgent.Server\n```\n\n```csharp\nbuilder.Services.AddHsSqlAgent(options =\u003e { ... });\napp.UseHsSqlAgent();                    // API-only\n// app.UseHsSqlAgent().ServeAdminUi();  // with Admin UI\n```\n\n\u003e The Admin UI is embedded in the DLL — no external files to deploy. See the [NuGet Package guide](https://github.com/tse-wei-chen/hs-sql-agent/wiki/NuGet-Package) for details.\n\n## 📖 Documentation\n\nDetailed docs are on the [Wiki](https://github.com/tse-wei-chen/hs-sql-agent/wiki):\n\n| Topic | Link |\n|-------|------|\n| 🚀 Getting Started | [Getting-Started](https://github.com/tse-wei-chen/hs-sql-agent/wiki/Getting-Started) |\n| ✨ Features | [Features](https://github.com/tse-wei-chen/hs-sql-agent/wiki/Features) |\n| 📘 MCP Tools | [MCP-Tools-Reference](https://github.com/tse-wei-chen/hs-sql-agent/wiki/MCP-Tools-Reference) |\n| 🖥️ Admin Panel | [Admin-Panel](https://github.com/tse-wei-chen/hs-sql-agent/wiki/Admin-Panel) |\n| ⚙️ Configuration | [Configuration](https://github.com/tse-wei-chen/hs-sql-agent/wiki/Configuration) |\n| 🐳 Deployment | [Deployment](https://github.com/tse-wei-chen/hs-sql-agent/wiki/Deployment) |\n| 🏠 Development | [Development](https://github.com/tse-wei-chen/hs-sql-agent/wiki/Development) |\n| 📡 API Reference | [API-Reference](https://github.com/tse-wei-chen/hs-sql-agent/wiki/API-Reference) |\n| ❓ FAQ | [FAQ](https://github.com/tse-wei-chen/hs-sql-agent/wiki/FAQ) |\n\n## 🤝 Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) and the [Development](https://github.com/tse-wei-chen/hs-sql-agent/wiki/Development) wiki page.\n\n## 📜 License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftse-wei-chen%2Fhs-sql-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftse-wei-chen%2Fhs-sql-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftse-wei-chen%2Fhs-sql-agent/lists"}