原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

A2db

作者:agentic-eng版本 0.2.1i★ –i在你的电脑上运行
注册名称io.github.agentic-eng/a2db

安装

概览

作者提供的说明(英文原文)

Safe, read-only database access for AI agents. 5 databases, batch queries, SQLGlot.

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 数据库与数据集

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 注册中心没有列出需要填写的密钥。

你需要

  • PyPI已安装 Python 的 uv(用于 uvx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "a2db": {
      "command": "uvx",
      "args": [
        "a2db"
      ]
    }
  }
}

在终端中运行这条命令

claude mcp add a2db -- uvx a2db

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "a2db": {
      "command": "uvx",
      "args": [
        "a2db"
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "a2db": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "a2db"
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 agentic-eng 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“数据库与数据集”中的其他服务器比较i

  • 星标数多于此分类中其他 953 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 953 个服务器的 8% 更新
  • 基础检查结果等于或优于此分类中其他 953 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

A2db 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.2.1)于7个月前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Supabase

作者:supabase

MCP server for interacting with the Supabase platform

电脑或云端★ 2,993Apache-2.0昨天更新
安装

MongoDB MCP Server

作者:mongodb-js

MongoDB Model Context Protocol Server

在你的电脑上运行★ 1,157Apache-2.0前天更新
安装

MCP server for interacting with Elasticsearch

在你的电脑上运行★ 315Apache-2.014个月前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

🗄️ a2db

Agent-to-Database

Give AI agents safe, read-only access to your databases. One call, multiple queries, clean results.

5 databases · batch queries · pre-configured connections · SQLGlot read-only

Quick Start · MCP Tools · Security · Comparison · Setup


Agent: "Show me active users and their recent orders"

↓ a2db execute → 2 queries, 1 call, structured results ↓ Agent: "Got it — 847 active users, avg order $42.50"

Why a2db?

Most database MCP servers make you run one query at a time, repeat connection details on every call, and return results double-encoded inside JSON strings. a2db fixes all of that:

  • Pre-configured connections — define databases in .mcp.json with --register, agent queries immediately
  • Batch queries — run multiple named queries in a single tool call
  • Default connection — set connection once, use it across all queries in a batch
  • Clean output — structured JSON envelope with compact TSV data and per-query timing (see why TSV?)
  • Read-only enforced — SQLGlot AST parsing blocks all write operations
  • All drivers bundled — pip install a2db and you're done
  • Secrets stay in env — ${DB_PASSWORD} in DSNs, expanded only at connection time

Supported Databases

DatabaseDriverAsync
PostgreSQLasyncpgnative
SQLiteaiosqlitenative
MySQL / MariaDBmysql-connector-pythonwrapped
Oracleoracledbwrapped
SQL Serverpymssqlwrapped

Quick Start

pip install a2db
As an MCP Server (recommended)

Claude Code (with pre-configured connection):

claude mcp add -s user a2db -- a2db-mcp \

--register myapp/prod/main 'postgresql://user:${DB_PASSWORD}@host/mydb'

Claude Code (minimal — agent calls login on demand):

claude mcp add -s user a2db -- a2db-mcp

Claude Desktop / Cursor / any MCP client (.mcp.json):

{

"mcpServers": { "a2db": { "command": "uvx", "args": [ "a2db-mcp", "--register", "myapp/prod/main", "postgresql://user:${DB_PASSWORD}@host/mydb" ], "env": { "DB_PASSWORD": "your-password-here" } } } }

Multiple databases:

{

"args": [ "a2db-mcp", "--register", "myapp/prod/main", "postgresql://user:${DB_PASSWORD}@host/maindb", "--register", "myapp/prod/analytics", "postgresql://user:${DB_PASSWORD}@host/analytics" ] }

--register pre-registers connections at server startup — the agent can query immediately. Passwords use ${ENV_VAR} syntax and are expanded at connection time, never stored in plaintext.

As a CLI
# Save a connection (validates immediately)

a2db login -p myapp -e prod -d main 'postgresql://user:${DB_PASSWORD}@localhost/mydb'

Query

a2db query -p myapp -e prod -d main "SELECT * FROM users LIMIT 10"

JSON output

a2db query -p myapp -e prod -d main -f json "SELECT * FROM users LIMIT 10"

Explore schema

a2db schema -p myapp -e prod -d main tables a2db schema -p myapp -e prod -d main columns -t users

List / remove connections

a2db connections a2db logout -p myapp -e prod -d main

MCP Tools

ToolDescription
loginSave a connection — validates by connecting first
logoutRemove a saved connection
list_connectionsList connections (no secrets exposed)
executeRun named batch queries with pagination
search_objectsExplore schema — tables, columns, with detail levels
execute — the core tool

Named dict with default connection (preferred):

{

"connection": {"project": "myapp", "env": "prod", "db": "main"}, "queries": { "active_users": {"sql": "SELECT id, name FROM users WHERE active = true"}, "recent_orders": {"sql": "SELECT id, total FROM orders ORDER BY created_at DESC LIMIT 5"} } }

List format (auto-named q1, q2, ...):

{

"connection": {"project": "myapp", "env": "prod", "db": "main"}, "queries": [ {"sql": "SELECT COUNT(*) AS cnt FROM users"}, {"sql": "SELECT AVG(total) AS avg_order FROM orders"} ] }

Response (TSV format — default):

{

"active_users": { "data": "id\tname\n1\tAlice\n2\tBob\n3\tCharlie", "rows": 3, "truncated": false, "time_ms": 12 }, "recent_orders": { "data": "id\ttotal\n501\t129.00\n500\t49.99", "rows": 2, "truncated": false, "time_ms": 8 } }

No ::text casts needed — integers, floats, timestamps, arrays, NULLs all work natively.

Error context

When a query fails with a column error, a2db enriches the message:

column "nme" does not exist

Did you mean: name? Available columns: id (integer), name (text), email (text), active (integer)

Why TSV?

LLM context windows are expensive. JSON row data is verbose — every row repeats every column name, adds braces, commas, and quotes. TSV is a flat grid: one header row, then just values separated by tabs.

For a 100-row, 5-column result set, TSV typically uses 40-60% fewer tokens than JSON row format. The structured JSON envelope still gives you metadata (row count, truncation status) — only the row payload is TSV.

Set format="json" if you need full structured output with column names on every row.

Security

Read-Only Enforcement

Every query is parsed by SQLGlot before execution:

  • Blocked: INSERT, UPDATE, DELETE, DROP, TRUNCATE, ALTER, CREATE, GRANT, REVOKE
  • Bypass-resistant: multi-statement attacks and comment-wrapped writes are caught at the AST level, not just keyword matching
  • Allowed: SELECT, UNION, EXPLAIN, SHOW, DESCRIBE, PRAGMA

This is defense-in-depth — you should also use a read-only database user, but a2db won't let writes through even if the user has write permissions.

Write support is implemented in the core but not yet exposed via MCP. Planned: per-connection write permissions, explicitly enabled by the human operator — not the agent. See TODO.md.

Credential Storage

Connections are saved in ~/.config/a2db/connections/ as TOML files.

  • `${DB_PASSWORD}` syntax — environment variable references are stored literally and expanded only at connection time. Secrets stay in your environment, not on disk.
  • No secrets in list output — list_connections shows project/env/db and database type, never DSNs or passwords
  • Connection files are local to your machine and outside any repository
Deployment Scope

a2db currently runs as a local stdio MCP server. It inherits environment variables from the process that launches it (your shell, Claude Code, Docker). This is the standard model for local MCP servers — the same approach used by DBHub, Google Toolbox, and others.

Planned: remote HTTP transport with OAuth 2.1 per the MCP spec. For now, if running in Docker, inject secrets via environment variables at container runtime.

Comparison

Featurea2dbDBHubGoogle ToolboxPGMCPSupabase MCP
Databases5 (PG, SQLite, MySQL, Oracle, MSSQL)5 (PG, MySQL, MSSQL, MariaDB, SQLite)40+ (cloud + OSS)PG onlyPG (Supabase)
Batch queriesNamed dict + listSemicolon-separatedNoNoNo
Default connectionSet once, use for allPer-queryN/ASingle DBSingle project
Read-onlySQLGlot AST (enforced)Keyword check (config)Hint/annotationRead-only tx + regexConfig flag
Write supportPlanned (per-connection)Config flagVia tool definitionNoConfig flag
OutputJSON + TSV dataStructured textMCP protocolTable / JSON / CSVJSON
Schema discovery3 detail levelsDedicated toolPrebuilt toolsVia NL-to-SQLDedicated tools
Pre-configured--register in MCP configConfig fileYAML configEnv varCloud-managed
Credentials${ENV_VAR} in DSNDSN stringsEnv vars + GCP IAMEnv varOAuth 2.1
Drivers bundledAll includedAll includedVariesBuilt-inManaged
CLIYesNoYesYesNo
Error contextColumn suggestions + typesNoNoNoNo
LicenseApache 2.0MITApache 2.0Apache 2.0Apache 2.0

When to use what:

  • a2db — multi-DB batch queries with clean output, agent-first design, fast setup
  • DBHub — custom tools via TOML config, web workbench UI
  • Google Toolbox — GCP ecosystem, IAM integration, 40+ sources
  • PGMCP — natural-language-to-SQL for PostgreSQL (requires OpenAI key)
  • Supabase MCP — full Supabase platform management (edge functions, branching, storage)

Setup by Environment

Local (macOS / Linux)
pip install a2db

CLI

a2db login -p myapp -e dev -d main 'postgresql://user:pass@localhost/mydb'

Or add as MCP server (see Quick Start)

Docker
FROM python:3.12-slim

RUN pip install a2db CMD ["a2db-mcp", "--register", "myapp/prod/main", "postgresql://user:${DB_PASSWORD}@host/mydb"]

docker run -e DB_PASSWORD=secret -i my-a2db-image

Secrets are injected as environment variables at runtime — never baked into the image.

CI / Automation
pip install a2db

Pre-configured — no login needed

a2db-mcp --register myapp/ci/main "postgresql://ci_user:${CI_DB_PASSWORD}@db-host/mydb"

Or use CLI directly

a2db login -p myapp -e ci -d main "postgresql://ci_user:${CI_DB_PASSWORD}@db-host/mydb" a2db query -p myapp -e ci -d main "SELECT COUNT(*) FROM migrations"

Development

make bootstrap   # Install deps + hooks

make check # Lint + test + security (full gate) make test # Tests with coverage (90% minimum) make lint # Lint only (never modifies files) make fix # Auto-fix + lint

License

Apache 2.0


🗄️ Agent-first database access since 2025.

Built by Denis Tomilin

问 PopNx