envdb
Let your AI agent see your database. envdb reads the .env of your project, finds every
database it points to and exposes them over MCP so the
agent in Zed (or Claude Code, Cursor, VS Code…) can list tables, read the schema, page through
rows and run SQL. PostgreSQL, MySQL/MariaDB and SQLite are supported.
It also ships a fast terminal viewer (envdb) for browsing, filtering and editing tables yourself.
- Zero config: uses the connection your app already has (
DATABASE_URL, any*_URL, LaravelDB_*,PG*,MYSQL_*) plus any.db/.sqlitefile in the project. - Read-only by default: connections are opened read-only and
run_queryonly acceptsSELECT/WITH/EXPLAIN/SHOW/PRAGMA. Writes need an explicit opt-in. - Credentials never leave the machine: passwords are never returned to the model.
Tools
| Tool | What it does |
|---|---|
list_databases |
Connections found in .env, .env.local, .env.development… and SQLite files. Optionally the other databases on each server. |
list_tables |
Tables and views, optionally with row counts. |
describe_table |
Columns, types, nullability, defaults, primary and foreign keys, row count. |
query_table |
Paginated rows (10/25/50…) with per-column filters: text (contains), 42, >100, <=5, !=3, null, !null. |
run_query |
One read-only SQL statement. |
execute_statement |
INSERT/UPDATE/DELETE/DDL. Only exists when writes are enabled. |
Use it in Zed
With the extension
Install envdb from Zed's extension page. The extension downloads
uv, which fetches Python and this package; nothing else to install.
Open a project with a .env, open the Agent Panel and ask things like
"what tables does my database have?" or "show me the last 10 orders with their customer".
Optional settings (settings.json):
"context_servers": {
"envdb": {
"settings": {
"allow_writes": false, // true adds execute_statement
"project_path": null, // folder to scan, if not the opened one
"max_rows": 500
}
}
}
Without the extension
"context_servers": {
"envdb": { "command": "uvx", "args": ["envdb", "mcp"] }
}
Other MCP clients
claude mcp add envdb -- uvx envdb mcp # Claude Code
Any client: command uvx, args ["envdb", "mcp"]. Environment variables:
| Variable | Meaning |
|---|---|
ENVDB_PROJECT |
Project folder to scan (default: current directory). |
ENVDB_ALLOW_WRITES |
1 enables execute_statement. |
ENVDB_MAX_ROWS |
Max rows per call (default 500). |
Terminal viewer
uv tool install envdb
envdb # pick a database from the project's .env, browse and edit tables
envdb --print # show what was detected (no passwords)
Click a table, click a column header to filter, double-click a cell to copy or edit it,
s opens a SQL editor (F5 runs). To open it inside Zed's bottom panel with a shortcut,
see zed-config/ (a task plus a Ctrl+Alt+D key binding).
What it understands in .env
| Variables | Example |
|---|---|
DATABASE_URL, DB_URL, POSTGRES_URL, MYSQL_URL, any *_URL/*_DSN |
postgresql://u:pw@localhost:5432/app, mysql://…, sqlite:///app.db, file:./dev.db (Prisma) |
| Laravel | DB_CONNECTION=pgsql|mysql|sqlite, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD |
| libpq / MySQL | PGHOST, PGUSER… / MYSQL_HOST, MYSQL_USER… |
Files: .env, .env.local, .env.development, .env.development.local (and .env.production,
.env.test, .env.example for the list), searched in the project folder and its parents.
Development
uv venv && uv pip install -e .
envdb mcp demo/ # run the MCP server against the sample databases
The Zed extension lives in zed-extension/ (Rust → WebAssembly).
In Zed run zed: install dev extension and pick that folder; set
"package": "/path/to/this/repo" in the server settings to use your local checkout.
Leer en español.
License
MIT
Metadata
Release files for envdb 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| envdb-0.3.0.tar.gz | 25.2 kB | Without provenance | Details for envdb-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| envdb-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for envdb-0.3.0-py3-none-any.whl |
Total release size: 53.0 kB
Release files / envdb-0.3.0.tar.gz
| Download URL | envdb-0.3.0.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef3f6f1a9c1d1a2d55e8893e43339c35bc9b3b604015bdd5d02cc8fd64a5eab7
|
|
BLAKE2b-256 checksum How to use checksums |
d9f6858256d3dabb547db7f7f1936f448691a919a5de6cd4f82e7010dc0f1cb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"45","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / envdb-0.3.0-py3-none-any.whl
| Download URL | envdb-0.3.0-py3-none-any.whl |
|---|---|
| Size | 27.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e391ffd481c051cfc9434c1cc9cd0ba67ef8bc9b58da1835c7a3843300c7488
|
|
BLAKE2b-256 checksum How to use checksums |
56b7c6a532cee2d54254bf554783a9398b5a7b2ce666c9621ae815110511cef7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"45","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for envdb 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.