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
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:
To restart the server:
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.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
A server implementing the Model Context Protocol (MCP) for Cursor that allows using a PostgreSQL database as storage for model contexts, enabling secure database exploration and querying.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA powerful Model Context Protocol (MCP) tool for exploring and managing different types of databases including PostgreSQL, MySQL, and Firestore.Last updated -95MIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server for Cursor IDE that simplifies the installation and configuration of other MCP servers.Last updated -37570MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables interaction with PostgreSQL databases to list tables, retrieve schemas, and execute read-only SQL queries.Last updated -26MIT License
- -securityAlicense-qualityA template project for building custom MCP servers that enables direct access to PostgreSQL databases, allowing SQL query execution and schema information retrieval through the Model Context Protocol.Last updated -31MIT License