postgres-explorer
Allows querying and exploring a PostgreSQL database in read-only mode, providing tools to get schema and execute SELECT queries.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@postgres-explorer list all tables in the public schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🐘 Postgres-Explorer MCP Server
Servidor MCP que permite a Claude Code explorar y consultar una base de datos PostgreSQL de forma segura (solo lectura).
✅ Requisitos
🐍 Python >= 3.12
🗄️ PostgreSQL accesible
🐳 Docker (opcional)
Related MCP server: PostgreSQL MCP Server
🔐 Variables de entorno
DB_HOST=localhost
DB_NAME=name_example
DB_USER=user_example
DB_PASSWORD=password_example
DB_PORT=5432⚙️ Configuración para Claude Code
Agrega esto a tu .mcp.json en la raíz del proyecto:
🐳 Opción 1 — Docker (recomendado)
Primero construye la imagen desde la raíz del proyecto:
docker build -t mi-mcp-postgres .Luego agrega esto a tu .mcp.json:
{
"mcpServers": {
"postgres-explorer": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--network",
"host",
"--env-file",
"/ruta/absoluta/hacia/tu/proyecto/.env",
"mi-mcp-postgres"
]
}
}
}o a tu opencode.json:
{
"mcp": {
"postgres-explorer": {
"type": "local",
"command": [
"docker",
"run",
"-i",
"--rm",
"--network",
"host",
"--env-file",
"/ruta/absoluta/hacia/tu/proyecto/.env",
"mi-mcp-postgres"
]
}
}
}⚡ Opción 2 — Python directo
{
"mcpServers": {
"postgres-explorer": {
"command": "uv",
"args": ["run", "python", "main.py"]
}
}
}🛠️ Herramientas disponibles
Herramienta | Descripción |
| 📋 Lista todas las tablas y sus columnas del esquema |
| 🔍 Ejecuta una consulta |
🔒 Seguridad: solo permite
SELECT. Conexiones en modo read-only.
Available Tools
2 toolsexecute_queryB
Ejecuta una consulta SQL SELECT en PostgreSQL y devuelve los resultados. Úsala solo para consultas de lectura.
Inputs: sql (required). Returns: result
get_schemaA
Obtiene la lista de tablas y sus columnas en el esquema público de PostgreSQL.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: execute_query handles arbitrary SELECT queries, while get_schema retrieves metadata about tables and columns. No overlap or ambiguity exists.
Both tools follow a consistent verb_noun pattern (execute_query, get_schema) using snake_case, making the naming predictable and clear.
With only 2 tools, the server feels minimal for a 'PostgreSQL explorer'. Typical exploration would benefit from additional tools like describe_table, list_schemas, or view_details, making 2 tools insufficient for a well-scoped exploration surface.
The server covers basic schema browsing and arbitrary read queries, but lacks more granular tools (e.g., specific table details, constraint info, index listing). Users cannot easily explore beyond the public schema or get metadata about individual objects without writing SQL.
Maintenance
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query your Postgres from ChatGPT or Claude without exposing the database or handing over credentials. Run npx boltschema connect next to your database and it dials out over HTTPS — no inbound firewall rule, no open port, works with localhost and VPC-private databases. Read-only is enforced by a SQL guard, a Postgres READ ONLY transaction, and a scoped role generated for you.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables secure read-only access to PostgreSQL databases through SELECT queries only, with tools for exploring schemas, listing tables, and executing common queries while preventing any data modification operations.4MIT
- AlicenseNot gradedqualityDmaintenanceProvides secure, read-only access to PostgreSQL databases for schema inspection and data querying. It enables users to list tables, describe structures, and execute SELECT statements while strictly blocking destructive operations.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables safe interaction with PostgreSQL databases through read-only queries, schema exploration, and performance analysis.-
- AlicenseNot gradedqualityNot gradedmaintenanceRead-only access to PostgreSQL databases, enabling schema inspection and safe SQL queries.MIT