Provides tools for exploring and querying a PostgreSQL database, including executing read-only SQL queries, listing tables, and obtaining schema information for specific tables.
MCP Postgres Server
This server implements the Model Context Protocol (MCP) for Cursor, allowing a PostgreSQL database to be used as storage for model contexts.
Prerequisites
Docker
Docker Compose
Related MCP server: Cursor MCP Installer
Installation and startup
Clone this repository
Start the server with Docker Compose:
Configuration in Cursor
Open Cursor
Go to Settings > MCP
Add a new connection with the following settings:
Name: MCP Postgres Server
Type: command
Command:
docker exec -i mcp-postgres-server node dist/index.js
Troubleshooting
If the server does not start correctly:
Check the container logs:
docker logs mcp-postgres-serverTo restart the server:
docker-compose restart
MCP Server Features
The MCP PostgreSQL server exposes the following tools for Cursor:
postgres_query- Execute a read-only SQL querypostgres_list_tables- List all tables in the databasepostgres_describe_table- Get the schema of a specific table
These tools allow Cursor to securely explore and query the database.