AgentSQL
Protects MySQL 8 business databases as a gateway target, applying the same identity, AST-level authorization, dangerous-statement blocking, row/result limits, masking and audit pipeline to agent-issued SQL.
Protects PostgreSQL 14–18 business databases as the gateway's target: every agent-issued query is authenticated, SQL-parsed into an AST, authorized/rule-evaluated, executed under limits, result-masked and audited. Also supports PostgreSQL 15+ (PG18 baseline) as the control plane for metadata and audit storage, including separate metadata/audit databases and migration from SQLite.
Exposes Prometheus metrics alongside health and readiness probes so gateway operations, decisions and query activity can be scraped and monitored.
Default zero-configuration control plane backend, storing AgentSQL metadata and audit records in a single combined SQLite database (e.g. /var/lib/agentsql/agentsql.db), with the ability to migrate that data to PostgreSQL later.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
AgentSQL(智盾)
AgentSQL = 独立 AI 问数 Agent + MCP Server 数据库安全网关。 用户可直接在 AgentSQL 自有页面用自然语言问数;其他 AI Agent 可把 AgentSQL 当作独立 MCP Server 使用。两条入口共用当前身份与授权、受控 SQL 执行、结果脱敏和持久审计。AgentSQL 自有问数不依赖 SQLBot;SQLBot 是可经固定版本适配器接入的可选客户端。
官网 · 中文问数界面与功能示意 · v4.13.0 下载与发布边界 · 三种使用方式 · 文档索引
选一种使用方式
方式 | 你来做什么 | 从哪里开始 |
独立问数 | 登录 AgentSQL 自有页面,选择已绑定数据源,提问并核对生成的 SQL、结果和审计 | |
独立 MCP 安全网关 | 给外部 AI Agent 配置 Agent API Key,让 MCP 工具在授权范围内查询 | |
两者一起 | 员工用 AgentSQL 页面问数,外部 Agent 通过 MCP 查询;分别授权,共用安全审计 |
AgentSQL 自有页面 → Go 问数 Agent ─────┐
├→ AgentSQL 安全网关 → 当前受权数据库
外部 AI Agent → AgentSQL MCP Server ─┘Related MCP server: PostgreSQL MCP Server
v4.13.0 能力与边界
能力 | 当前状态 | 关键边界 |
自有 AI 问数 | 限定路径已验 | 自有 Go/Web 问数;本地模型、运营方登记的 PostgreSQL 网关别名和当前权限,无需 SQLBot 运行 |
受权向量预热与问数 | 按当前授权准备结构 | 固定 ONNX 表向量支持后台预热与热索引复用;权限变化后重新核对,模型和数据库的实际环境与耗时见本版发布说明 |
受权结果图表 | 维度与最多四指标 | 当前响应的柱/条形/折线与单指标饼图;结构化 null 断线,零值可绘;当前网关将 SQL NULL 字符串化时保守回表格,不当零值;负值饼图与不安全数字回退原表;重开恢复问题指定默认图表,手动选择仅当前视图 |
历史与文件导出 | 当前授权逐次复核 | 历史重开与 CSV/XLSX 下载都重新校验授权并留审计;权限变化、会话删除或服务故障时拒绝旧内容,页面忽略迟到响应 |
私有数据源绑定轮换 | 限定路径已验 | 运维侧先建立新网关绑定并预检受权结构,再以旧绑定 ID 和存储修订比较提交;浏览器不能更换目标或凭据 |
MCP Server 安全网关 | 可独立使用 | stdio、Streamable HTTP 和独立无状态 HTTP;Agent Key 不等于管理员令牌,每次请求按当前授权执行 |
基本助手与 Type 4 页面嵌入 | 限定路径已验 | 单数据源基本游客助手与指定页面嵌入,来源、身份及撤权仍受控 |
SQLBot 接入 | 可选固定基线 | 已验适配器可把指定 SQLBot 执行路径交给 AgentSQL MCP;不承诺任意部署零改动接入 |
Type 1 高级助手 | 沿用历史限定范围 | 运营方登记第三方目录并映射到当前受权网关别名;本版未扩大该入口的支持声明 |
活动数据权限 | 限定形态已验 | 明确列出的同工作空间用户;内建管理员/普通成员角色限定;非空白名单只作元数据,不豁免行列限制 |
更广兼容 | 部分只读载入;其余未验证 | 原版社区管理页列表可加载不等于创建、编辑、导入导出已验;云模型真实推理、任意角色扩展及原版权限库直接迁移仍未验证 |
自然语言结果需要核对生成的 SQL 和业务含义。v4.13.0 未在用户真实业务系统验证,不宣称 100% 兼容或零改动切换;正式发布说明给出精确提交、验收场景、性能数字与限制。固定 25 场景评分合同按精确发行提交重新验收,分数与未完成项见发布记录;本版逐项验收列明证据与未测项,未完成合同的场景计零;这不等于 AgentSQL 独立 MCP 安全网关的能力覆盖率。公网 Demo 的问数模型仅作模拟展示。
快速开始
Linux amd64 / arm64 原生包要求 glibc ≥ 2.28 和 PID 1 的 systemd。下载正式包后先按发布说明核对签名和哈希。以下命令安装网关;自有问数需要按三种使用方式安装问数组件并配置本地文本模型与个人数据源绑定。
curl -fsSL https://github.com/cuipengdba/agentsql/releases/download/v4.13.0/install.sh | sudo sh -s -- install --version v4.13.0Docker 使用多架构正式镜像;一键脚本仅绑定本机回环地址并创建持久卷:
curl -fsSL https://raw.githubusercontent.com/cuipengdba/agentsql/v4.13.0/scripts/quickstart.sh -o quickstart.sh && sh quickstart.sh --version v4.13.0网关控制台默认 http://127.0.0.1:7780,安装了问数组件后自有页面默认 http://127.0.0.1:8000。安装器生成持久管理员密码;非交互日志不输出,可由 root 在 /etc/agentsql/agentsql.env 查看。远程访问应使用 SSH 本地转发或受控 HTTPS 反向代理,不直接暴露管理端口。离线安装、密钥、备份和升级步骤见部署指南。
按任务查文档
任务 | 文档 |
三种产品形态与验收步骤 | |
自有问数模型与个人绑定 | |
MCP 客户端、协议与工具 | |
控制台权限、规则、脱敏与审计 | |
SQLBot 固定版本适配 | |
数据库适配分级与证据 | |
离线安装、升级、备份与恢复 |
数据库“已注册”“连接级”“指定版本受控只读”“指定场景完整防护”是不同等级。官网矩阵保留逐库版本、拓扑与验收边界;连接成功不等于可安全问数,也不等于厂商认证。
社区与项目
历史 Release · CHANGELOG · 路线图 · Issues · Discussions · 贡献指南
当前源码按 Apache-2.0 发布,并附 NOTICE;AgentSQL 名称和标识的商标权不由该许可证授予。未修复漏洞请按 SECURITY.md 私下报告,不在公开 Issue 中提交真实凭据或连接串。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Security layer for AI agents: Retrieve for controlled SQL reads, Guard for allow/deny writes.
Related MCP Servers
- AlicenseAqualityCmaintenanceSecure MCP server for safe, read-only DB access by AI agents, with SQL guardrails, table allowlists, PII masking, and audit logs652 npm9MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with PostgreSQL databases through MCP, supporting multi-database and schema access with security controls like read-only mode and SQL auditing.MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables AI agents to securely interact with PostgreSQL databases with least-privilege scopes, PII masking, and human approval for writes.4MIT
- AlicenseNot gradedqualityDmaintenanceProvides read-only access to PostgreSQL databases via MCP, enforcing least-privilege roles, row-level security, masked views, and SQL AST guardrails to prevent data leakage and unauthorized operations, enabling AI agents to safely query sensitive production data.MIT