drio
Open app

MCP Postgres Server

Source

Catalog onlyCatalog onlySTDIO

Overview

MCP Postgres Server implements the Model Context Protocol (MCP) for Cursor, allowing the use of a PostgreSQL database as storage for model contexts.

To use MCP Postgres Server, clone the repository and start the server using Docker Compose with the command docker-compose up -d. Then configure it in Cursor by adding a new connection with the specified parameters.

  • Executes read-only SQL queries with postgres_query - Lists all tables in the database with postgres_list_tables - Retrieves the schema of a specific table with postgres_describe_table
  1. Storing and managing model contexts for applications.
  2. Querying PostgreSQL databases securely through Cursor.
  3. Facilitating data exploration and management in development environments.

Add to your AI client

Use these steps to connect MCP Postgres Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "mcp-postgres-server-madebynando": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-postgres-server-madebynando"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "mcp-postgres-server-madebynando": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-postgres-server-madebynando"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "mcp-postgres-server-madebynando": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-postgres-server-madebynando"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "mcp-postgres-server-madebynando": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-postgres-server-madebynando"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-postgres-server-madebynando": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-postgres-server-madebynando"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "mcp-postgres-server-madebynando": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-postgres-server-madebynando"
      ]
    }
  }
}

FAQ

What are the prerequisites for using MCP Postgres Server?

You need Docker and Docker Compose installed.

How do I troubleshoot if the server doesn't start?

Check the container logs with `docker logs mcp-postgres-server` and restart the server if necessary using `docker-compose restart`.

Can I use MCP Postgres Server with other databases?

No, MCP Postgres Server is specifically designed for PostgreSQL.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":1922,"uuid":"5bbccc5d-3eab-41a0-9921-11ae7920e801","name":"mcp-postgres-server","title":"MCP Postgres Server","description":"","avatar_url":"https://avatars.githubusercontent.com/u/17220401?v=4","created_at":"2025-03-05T06:07:41.404Z","updated_at":"2025-03-12T10:21:40.390Z","status":"created","author_name":"MadeByNando","author_avatar_url":"https://avatars.githubusercontent.com/u/17220401?v=4","tags":"mcp-postgres-server,postgresql,database","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/MadeByNando/mcp-postgres-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"\",\"language\":\"JavaScript\",\"is_official\":false,\"latest_commit_time\":\"2025-02-28 17:01:17\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]