MCP Postgres Server logo

MCP Postgres Server

by MCP-Mirror

This server implements the Model Context Protocol (MCP) for Cursor, allowing the use of a PostgreSQL database as storage for model contexts. It enables Cursor to securely explore and query the database.

View on GitHub

Last updated: N/A

What is MCP Postgres Server?

The MCP Postgres Server is a server that implements the Model Context Protocol (MCP) for Cursor, using a PostgreSQL database to store model contexts.

How to use MCP Postgres Server?

  1. Clone the repository. 2. Start the server using Docker Compose (docker-compose up -d). 3. In Cursor, go to Settings > MCP and add a new connection with the following parameters: Name: MCP Postgres Server, Type: command, Command: docker exec -i mcp-postgres-server node dist/index.js.

Key features of MCP Postgres Server

  • Exposes PostgreSQL database to Cursor via MCP

  • Provides tools for querying and exploring the database schema

  • Supports read-only SQL queries

  • Lists tables in the database

  • Describes the schema of a specific table

Use cases of MCP Postgres Server

  • Allowing Cursor to access and utilize data stored in a PostgreSQL database

  • Enabling Cursor to perform data analysis and exploration on PostgreSQL data

  • Integrating PostgreSQL data into Cursor-based workflows

  • Providing a secure and controlled way for Cursor to interact with a PostgreSQL database

FAQ from MCP Postgres Server

How do I check the server logs?

Use the command docker logs mcp-postgres-server.

How do I restart the server?

Use the command docker-compose restart.

What tools does the server expose?

The server exposes postgres_query, postgres_list_tables, and postgres_describe_table.

What is the purpose of postgres_query?

It allows Cursor to execute read-only SQL queries against the database.

What is the purpose of postgres_list_tables?

It allows Cursor to list all the tables in the database.