MCP.Market

AgentSQL MCP server

online · 100% uptime
by cuipengdba·io.github.cuipengdba/agentsql·v0.4.0·3 stars

Guard AI agents' PostgreSQL/MySQL access via MCP: SQL audit, auth, masking, write approval

A87/100grade A
What users say
No reviews yet
Be the first
Safety scan
A87/100

full report

Adoption
Growing

3 stars

Reviews

Write one

Nobody has reviewed AgentSQL yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

AgentSQL tools

Tool list not cached yet. `describe` through the gateway fetches it live.

Public scan report

scanner v0.1.10 · 2026-10-01 · same rubric, same numbers if you re-run it

no findings
  • –Code scanremote-only server, no package to scann/a
  • Live reliabilityremote reachable in 1098ms (auth required)20/20
  • –Tool poisoningtools not inspected (endpoint requires auth); not countedn/a
  • Auth qualityauth enforced (unknown)9/15
  • Maintenancelast push 0 days ago15/15
  • Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Overall 87/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

How AgentSQL compares

Against every graded Databases MCP server, from our own scans and uptime checks. Updated after each scan run.

Safety score
87/100
higher than 70% of 802 Databases servers
Uptime
100%
of our recent checks; the typical remote Databases server answers 100%
Response time
1,716 ms
faster than 4% of 292 Databases servers
GitHub stars
3
more than 65% of 602 Databases servers

Install AgentSQL in Claude Code, Cursor or VS Code

claude mcp add --transport http agentsql https://demo.agentsql.cn/mcp
Add to Cursor

What the publisher says

From the AgentSQL repository's README, as published. We do not edit it. Read it on GitHub

AgentSQL

AgentSQL(中文品牌名:智盾,控制台显示为「AgentSQL 智盾控制台」)是面向 AI Agent 的数据库安全网关与生产级 MCP Server:让模型发出的每条 PostgreSQL/MySQL 请求在到达数据库前,经过身份认证、SQL 解析、授权与规则评估、受控执行、结果脱敏和审计。

AI Agent → LLM / MCP Client → AgentSQL 网关 → PostgreSQL / MySQL
                                  │
                                  └─ 鉴权 · 授权 · 规则 · 审批 · 脱敏 · 审计

核心特性

  • 双 MCP 承载:本机 stdio 与 Streamable HTTP /mcp,提供 7 个受控数据库工具。
  • 默认拒绝的安全链路:API Key 认证、Agent 能力档位、对象/列授权、SQL AST 规则与 fail-closed 错误处理。
  • 受控读写:只读保护、危险 SQL 拦截、Explain 风险评估、超时、连接/QPS/结果行数限制和人工审批。
  • 基础数据保护:列级脱敏提供四种算法——六类 mask 部分遮蔽、九类均可用的带专用密钥 HMAC hash 指纹、无需密钥且把非空值统一替换为 的 block 整值阻断,以及仅用于 number / date、通过数值分桶或日期截断保留粗粒度分布且无需密钥的 range。数据源口令另由 32 字节 AGENTSQLSECRET 加密保存。
  • 可追溯运维:默认零配置 SQLite;可选 PostgreSQL 15+ 控制面(PostgreSQL 18 为基准,metadata 与 audit 可分库);支持审计导出(面向机器的 JSONL,以及 Excel/WPS 可直接打开、带公式注入防护的中文 CSV)、审批决策闭环、Prometheus 指标与健康/就绪探针。
  • 安全事件通知:按决策过滤并以 Webhook 或 Syslog 旁路外发;默认关闭、默认不含 SQL,通知失败不影响审计与 SQL 决策。
  • 内嵌 Web 控制台:总览、审计、演示台、Agent、数据源、权限、规则、审批和脱敏规则管理。

5 分钟快速开始

以下三条路径都默认只在宿主机回环地址监听。自动安装器生成的是持久使用的管理员密码,不是一次性口令;远程访问请使用 SSH 本地转发,例如 ssh -L 7780:127.0.0.1:7780 user@server,不要直接向公网暴露 7780。

1. Linux 裸机一行安装(推荐)

v0.4.0 起提供 linux/amd64 与 linux/arm64 两种原生 glibc 包:uname -m 为 x86_64 / amd64 时使用 amd64 包,为 aarch64 / arm64 时使用 arm64 包。两者均要求 glibc 2.28+ 且 systemd 为 PID 1;安装器会自动选择本机架构、校验发布包外层与包内哈希,并安装为 systemd 服务。musl / Alpine 与 CentOS 7 仍不支持:

curl -fsSL https://github.com/cuipengdba/agentsql/releases/latest/download/install.sh | sudo sh -s -- install

管道和 CI 的非 TTY 输出不会显示自动生成的管理员密码;root 可在 /etc/agentsql/agentsql.env 查看。交互终端会在首次创建凭据时显示一次,也可显式加 --show-password。离线环境同时取得 tarball 与同名 .sha256 后,校验、解压并从包根安装:

以下是既有 amd64 资产示例;v0.4.0 起 arm64 主机使用同版本的 -linux-arm64 资产名。

sha256sum -c agentsql-v0.4.0-linux-amd64.tar.gz.sha256
tar -xzf agentsql-v0.4.0-linux-amd64.tar.gz
cd agentsql-v0.4.0-linux-amd64
sudo ./install.sh install

2. Docker 一行启动

脚本默认拉取 GitHub 最新稳定 Release 对应的精确 GHCR tag;该 tag 是 linux/amd64 + linux/arm64 多架构镜像,Docker 会自动匹配运行架构。脚本生成权限为 0600 的 .env,使用 agentsql-data 命名卷,并固定绑定回环地址:

curl -fsSL https://raw.githubusercontent.com/cuipengdba/agentsql/main/scripts/quickstart.sh -o quickstart.sh && sh quickstart.sh

GHCR 包必须由发布者设为 public,以上命令才能在未登录环境匿名拉取。也可先用一条命令拉取,Docker 会从 manifest list 自动选择 linux/amd64 或 linux/arm64:

docker pull ghcr.io/cuipengdba/agentsql:v0.4.0

等价的单条 docker run 如下;随机值只通过当前 shell 环境传入,不写进命令行参数:

export AGENTSQL_SECRET="$(openssl rand -base64 24)" AGENTSQL_ADMIN_USER=admin AGENTSQL_ADMIN_PASSWORD="$(openssl rand -base64 18)"
docker run -d --name agentsql --restart unless-stopped --security-opt no-new-privileges:true -p 127.0.0.1:7780:7780 -e AGENTSQL_SECRET -e AGENTSQL_ADMIN_USER -e AGENTSQL_ADMIN_PASSWORD -v agentsql-data:/var/lib/agentsql ghcr.io/cuipengdba/agentsql:v0.4.0

3. 本地 Live Demo(一条命令,无需源码)

这套自包含环境只连接合成的 PostgreSQL/MySQL 演示数据,不连接真实数据库。无需克隆源码、无需编辑配置或构建镜像,只需下载一个 compose 文件并启动:

mkdir agentsql-demo && cd agentsql-demo
curl -fsSL -o docker-compose.yml https://raw.githubusercontent.com/cuipengdba/agentsql/main/deploy/quickstart/docker-compose.yml
docker compose up -d

等待约 1–2 分钟,四个容器就绪后打开 :登录页已自动填好演示账号,直接点「登录」即可。「演示台」内置 5 个真实剧本:列授权 + 脱敏、列授权缺失、对象越权、DDL 越权、写操作转人工。彻底清理:

docker compose down -v

Demo 凭据均为固定演示值、写在 compose 中,仅用于本地体验,切勿连接真实数据。完整说明见 5 分钟快速上手 与 Live Demo 指南。

其他安装方式(源码构建、离线与审计环境)

需要审计每一步、修改 Compose 配置或从源码构建时,可继续使用原有流程。Docker Compose 默认只启动 AgentSQL,元数据和审计写入命名卷 agentsql-data 中的 /var/lib/agentsql/agentsql.db:

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

AgentSQL: common questions

Is AgentSQL MCP server safe?
Yes, by our scan: it is graded A (87/100). Read the AgentSQL safety report
How do I install AgentSQL?
It runs remotely at demo.agentsql.cn. Add it to Claude Code, Cursor, VS Code or Claude Desktop with the snippets above, or call it through the mcp.market gateway without installing anything.
Does AgentSQL need an API key?
Yes. The registry entry asks for Authorization.
Is AgentSQL maintained?
The last commit was 34 days ago (2026-10-01). The latest release is v0.4.0.
Is AgentSQL up?
100% of our last 28 checks got an answer. We check remote servers about four times a day.
What can I use instead of AgentSQL?
Servers from other publishers that do the same job: DBHub MCP server, Faucet MCP server and Midplane MCP server. Compare all AgentSQL alternatives.
How does AgentSQL compare with other Databases MCP servers?
safety score 87/100 (higher than 70% of 802 Databases servers); uptime 100% (of our recent checks; the typical remote Databases server answers 100%); response time 1,716 ms (faster than 4% of 292 Databases servers). Full comparison.

Alternatives to AgentSQL

Same job from other publishers: the closest match first, then the best rated.

All AgentSQL alternatives →
  • DBHub
    Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite
    A
  • Faucet
    SQL database to MCP tools and REST API: PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake.
    A
  • Midplane
    A gateway between AI agents and Postgres: table access, masking at the source, approvals and audit.
    B
  • NeoSQL MCP
    Schemas, SQL, ERDs, and codegen for PostgreSQL, MySQL, Oracle, SQLite, and more via NeoSQL Desktop.
    A
  • DB Explorer
    Read-only SQL for PostgreSQL, MySQL and SQLite: schema, safe SELECTs, EXPLAIN, index advice
    B