A2db MCP Server

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

Local serverstdioPython

What is the A2db MCP server?

A2db MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. Give AI agents safe, read-only access to your databases. One call, multiple queries, clean results..

What you get

  • 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

What the assistant can call

Once A2db is connected, these are the calls the assistant has available:

  • login — Save a connection — validates by connecting first
  • logout — Remove a saved connection
  • list_connections — List connections (no secrets exposed)
  • execute — Run named batch queries with pagination
  • search_objects — Explore schema — tables, columns, with detail levels

Configuration and credentials

You will need one environment variable: DB_PASSWORD. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Setting it up

a2db on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Choosing this one

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. A2db's toolset — login, logout, list_connections and 2 more — is a fair guide to whether it matches your workflow. It is maintained by agentic-eng; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the a2db mcp server does with a few real requests.

Available tools

ToolWhat it does
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

How to install the A2db MCP server

{
  "mcpServers": {
    "a2db": {
      "command": "uvx",
      "args": ["a2db"],
      "env": {
        "DB_PASSWORD": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
DB_PASSWORDConfiguration value read at startup.Optional

Example prompts to try

  • Use A2db to login.
  • Use A2db to logout.
  • Use A2db to list connections.

Frequently asked questions

It connects A2db to MCP-compatible AI assistants such as Claude and Cursor, exposing 5 tools (login, logout, list_connections, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with A2db directly.