Skip to main content

Agent-to-Database — CLI and MCP server for AI agents to query databases.

Project description

a2db

Agent-to-Database — query databases from CLI or as an MCP server.

Install

pip install a2db

Install the database driver you need:

pip install psycopg2-binary        # PostgreSQL
pip install mysql-connector-python  # MySQL
# SQLite is built-in

CLI Usage

# Save a connection
a2db login -p myapp -e prod -d users "postgresql://user:pass@localhost/mydb"

# List connections
a2db connections

# Run a query
a2db query -p myapp -e prod -d users "SELECT * FROM users LIMIT 10"

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

# Explore schema
a2db schema -p myapp -e prod -d users tables
a2db schema -p myapp -e prod -d users columns -t users
a2db schema -p myapp -e prod -d users full

MCP Usage

Add to your MCP client configuration:

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

Development

make bootstrap   # Install deps
make check       # Lint + test

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2db-0.1.0.tar.gz (94.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2db-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file a2db-0.1.0.tar.gz.

File metadata

  • Download URL: a2db-0.1.0.tar.gz
  • Upload date:
  • Size: 94.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for a2db-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92224cc5f4508fa9546f1555d5bb48dbbe3ee9c74c3a9d5fc066ffd5aac07495
MD5 c5e847a41c5868b9f73ca014d0a31197
BLAKE2b-256 0a9cae821ddb627ac1b4861cdd349a73c8db1c946fdf922b098609aeca0e7ded

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2db-0.1.0.tar.gz:

Publisher: publish.yml on agentic-eng/a2db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file a2db-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: a2db-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for a2db-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7c82471e8bf0ab8b0815580161ef323d98789b7517df5c551337153d783b20
MD5 e20ed35d192e886a3ad9a076d6b9c4db
BLAKE2b-256 a5837d21383b036f96a7ae538da91829fe104cd48f9e3a641d2dd6e7856ed1ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2db-0.1.0-py3-none-any.whl:

Publisher: publish.yml on agentic-eng/a2db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page