pgEdge Distributed Postgres
pgedge
Query and analyze PostgreSQL databases — SQL execution, schema discovery, EXPLAIN analysis, and hybrid vector search — via the official pgEdge Postgres MCP server.
- Installs
- 178
- Namespace
- pgedge
- Version
- >=1.0.0 <2.0.0
- Last attach
- reviewed1 months ago
Add to your mcp.json
{
"mcpServers": {
"pgedge": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PGEDGE_DB_HOST",
"-e",
"PGEDGE_DB_PORT",
"-e",
"PGEDGE_DB_NAME",
"-e",
"PGEDGE_DB_USER",
"-e",
"PGEDGE_DB_PASSWORD",
"-e",
"PGEDGE_DB_SSLMODE",
"ghcr.io/pgedge/postgres-mcp"
]
}
}
}Attach in a FrootAI play (fai-manifest)
mcp_scope:
attached:
- pgedgeAuthentication
point the server at PostgreSQL via the PGEDGE_DB_* variables (host/port/name/user/password) and use a least-privilege read-only role; leave PGEDGE_DB_ALLOW_WRITES unset for read-only access.
No credentials required.
Environment variables
| Variable | Required | Auth mode | Description |
|---|---|---|---|
| PGEDGE_DB_HOST | no | connection | PostgreSQL host to connect to. Provide the connection via these PGEDGE_DB_* vars or a config file. |
| PGEDGE_DB_PORT | no | connection | PostgreSQL port (default 5432). |
| PGEDGE_DB_NAME | no | connection | Target database name. |
| PGEDGE_DB_USER | no | connection | Database user. Prefer a least-privilege, read-only role. |
| PGEDGE_DB_PASSWORD | no | connection | Database user password; pass via env, never inline in args (doctrine #6). |
| PGEDGE_DB_SSLMODE | no | any | Postgres SSL mode (e.g. require, verify-full, prefer). Use require/verify-full for remote clusters. |
| PGEDGE_DB_ALLOW_WRITES | no | any | Set to `true` to allow write queries (INSERT/UPDATE/DELETE/DDL). Off by default — the server runs read-only transactions. |
Sample tools
pgedge.query_databaseExecute a SQL query (runs inside a read-only transaction by default).
pgedge.count_rowsCount rows in a table before querying large datasets.
pgedge.get_schema_infoDiscover tables, columns, data types, and relationships.
pgedge.execute_explainRun EXPLAIN ANALYZE on a SELECT query to analyze performance.
pgedge.similarity_searchHybrid vector + BM25 + MMR search over pgvector columns.
pgedge.read_resourceRead MCP resources such as pg://system_info.
Used in recipes
FAI cookbook recipes that attach pgedge.
Destructive-action audit
No destructive tools — audited read-only
Destructive-action audit (X2.18): no tools match destructive name patterns (destructive_tools is empty); write capability is gated behind the off-by-default PGEDGE_DB_ALLOW_WRITES and the read-only-transaction guardrail.
Known limitations
- Connect to PostgreSQL via the PGEDGE_DB_* variables (host/name/user/password) or a config file; without a configured connection the data tools return no results.
- Distributed as a Docker image (ghcr.io/pgedge/postgres-mcp) — Docker must be installed and running; there is no npm package.
- Read-only by default — query_database runs inside read-only transactions; setting PGEDGE_DB_ALLOW_WRITES=true enables DDL/DML and the server then marks query_database with `destructiveHint`.
- Semantic tools (similarity_search, generate_embedding, search_knowledgebase) require extra setup — pgvector columns, an embedding provider, and/or a prebuilt knowledgebase — and are otherwise unavailable.
Spec contributors
Maintainers who landed commits onmcp-specs/pgedge.json.
- pspsbali
Freshness
When this spec was last reviewed by a maintainer and last machine-validated against the live server.
- Spec last reviewed
- 1 months ago(2026-06-25)
- Auto-validated
- never