Skip to main content
Glama

MCP Postgres Server

by MadeByNando

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

  1. Clone this repository

  2. Start the server with Docker Compose:

docker-compose up -d

Configuration in Cursor

  1. Open Cursor

  2. Go to Settings > MCP

  3. 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:

  1. Check the container logs:

    docker logs mcp-postgres-server
  2. To restart the server:

    docker-compose restart

MCP Server Features

The MCP PostgreSQL server exposes the following tools for Cursor:

  1. postgres_query - Execute a read-only SQL query

  2. postgres_list_tables - List all tables in the database

  3. postgres_describe_table - Get the schema of a specific table

These tools allow Cursor to securely explore and query the database.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MadeByNando/mcp-postgres-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server