MCP Postgres Server
Servidor Postgres MCP
Este servidor implementa el Protocolo de Contexto de Modelo (MCP) para Cursor, lo que permite utilizar una base de datos PostgreSQL como almacenamiento para contextos de modelo.
Prerrequisitos
Estibador
Docker Compose
Related MCP server: pg-mcp-server
Instalación y puesta en marcha
Clonar este repositorio
Inicie el servidor con Docker Compose:
docker-compose up -dConfiguración en Cursor
Cursor abierto
Vaya a Configuración > MCP
Agregue una nueva conexión con la siguiente configuración:
Nombre: Servidor Postgres MCP
Tipo: comando
Comando:
docker exec -i mcp-postgres-server node dist/index.js
Solución de problemas
Si el servidor no se inicia correctamente:
Consulte los registros del contenedor:
docker logs mcp-postgres-serverPara reiniciar el servidor:
docker-compose restart
Características del servidor MCP
El servidor PostgreSQL MCP expone las siguientes herramientas para Cursor:
postgres_query- Ejecuta una consulta SQL de solo lecturapostgres_list_tables: enumera todas las tablas de la base de datospostgres_describe_table- Obtener el esquema de una tabla específica
Estas herramientas permiten a Cursor explorar y consultar la base de datos de forma segura.
Available Tools
10 toolsdescribe_tableC
Get the structure of a database table
Inputs: schema (required), table (required).
explain_queryC
Get query execution plan (EXPLAIN)
Inputs: sql (required), analyze, buffers, costs, +1 more.
get_constraintsC
Get constraints for a table
Inputs: schema (required), table (required).
get_table_statsC
Get table statistics and size information
Inputs: schema (required), table.
list_functionsC
List functions and procedures in a schema
Inputs: schema.
list_indexesC
List indexes for a table or schema
Inputs: schema (required), table.
list_schemasC
List all schemas in the database
Inputs: includeSystemSchemas.
list_tablesC
List all tables in a schema
Inputs: schema.
list_viewsC
List views in a schema
Inputs: schema.
queryA
Execute SQL queries with pagination support and parameterization for security. Supports page sizes up to 500 rows.
Inputs: sql (required), offset, pageSize, parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose targeting specific database metadata or operations, with no overlap. For example, list_tables enumerates tables, describe_table provides table structure, and query executes SQL, making them easily distinguishable.
All tools follow a consistent verb_noun pattern using snake_case, such as list_tables, describe_table, and get_constraints. This uniformity makes the tool set predictable and easy to navigate.
With 10 tools, the server is well-scoped for database introspection and querying, covering essential metadata operations without being overwhelming. Each tool serves a clear, necessary function in the domain.
The tool set provides comprehensive coverage for database metadata exploration and query execution, including listing, describing, and analyzing tables, schemas, and functions. A minor gap is the lack of tools for modifying database structures (e.g., creating or altering tables), but core read operations are complete.
Maintenance
Related MCP Connectors
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Xata MCP server lets AI agents interact with your Xata projects, and Postgres database branches.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server implementation that provides a simple interface to interact with PostgreSQL databases, enabling SQL queries, database operations, and schema management through MCP.-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for PostgreSQL databases that enables AI agents to connect, query, and explore multiple databases with schema discovery and extension context.542MIT
- AlicenseNot gradedqualityDmaintenanceA standardized Model Context Protocol server for interacting with PostgreSQL databases, enabling full CRUD operations, schema management, and database introspection.1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for PostgreSQL that enables Cursor and other MCP clients to execute SQL queries, list tables, and explore database schemas via HTTP.MIT