Envdb
Browse and query the databases in your project's .env (PostgreSQL, MySQL, SQLite). Read-only.
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
From the project's README.