PostgreSQL MCP Legacy

v1.0.0Databasesstable

⚠️ DEPRECATED - Use https://github.com/neverinfamous/postgresql-mcp instead.

aiai-agentsai-databaseclaudecursor
Share:
8
Stars
0
Downloads
0
Weekly
0/5

What is PostgreSQL MCP Legacy?

PostgreSQL MCP Legacy is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ⚠️ deprecated - use https://github.com/neverinfamous/postgresql-mcp instead.

⚠️ DEPRECATED - Use https://github.com/neverinfamous/postgresql-mcp instead.

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • ⚠️ DEPRECATED - Use https://github.com/neverinfamous/postgre

Use Cases

PostgreSQL database operations
Deprecated - use postgresql-mcp instead
neverinfamous

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx postgres-mcp-legacy

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use PostgreSQL MCP Legacy

PostgreSQL MCP Legacy is the deprecated Python implementation of a PostgreSQL MCP server. It is no longer maintained and will not receive security patches. Users should migrate to the actively supported TypeScript successor at https://github.com/neverinfamous/postgresql-mcp, which expands from 63 tools to 203 tools and adds HTTP/SSE transport and OAuth 2.1 authentication.

Prerequisites

  • Python 3.9+ (for the legacy version only)
  • A running PostgreSQL instance with connection credentials
  • pip or uv package manager
  • Claude Desktop or another MCP-compatible client
  • NOTE: The new postgresql-mcp package is strongly recommended over this legacy version
1

Install the legacy package (not recommended)

If you specifically require the legacy Python version, clone the repository directly. No PyPI package is available for the legacy version. Be aware that this version receives no updates or security patches.

git clone https://github.com/neverinfamous/postgres-mcp-legacy.git
cd postgres-mcp-legacy
pip install -r requirements.txt
2

Migrate to the maintained TypeScript version (recommended)

Install the actively maintained successor package using Docker or npm. The TypeScript version supports stdio and HTTP/SSE transport, OAuth 2.1, 203 tools, 20 resources, and 19 prompts.

# Docker (recommended)
docker pull writenotenow/postgres-mcp:latest

# npm global install
npm install -g @neverinfamous/postgres-mcp

# or use npx without installing
npx @neverinfamous/postgres-mcp
3

Configure database connection

Set the PostgreSQL connection string as an environment variable. The server uses the standard libpq connection URI format including host, port, database name, user, and password.

export DATABASE_URL="postgresql://username:password@localhost:5432/mydb"
4

Add to Claude Desktop configuration

Update your Claude Desktop config file to include the postgresql-mcp server. On macOS the config is at ~/Library/Application Support/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "postgresql": {
      "command": "npx",
      "args": ["-y", "@neverinfamous/postgres-mcp"],
      "env": {
        "DATABASE_URL": "postgresql://username:password@localhost:5432/mydb"
      }
    }
  }
}
5

Verify the connection

Restart Claude Desktop and ask Claude to list tables in the connected database. If the server connects successfully, Claude will describe the schema of your PostgreSQL instance.

PostgreSQL MCP Legacy Examples

Client configuration

Claude Desktop configuration for the recommended postgresql-mcp TypeScript package replacing the legacy version.

{
  "mcpServers": {
    "postgresql": {
      "command": "npx",
      "args": ["-y", "@neverinfamous/postgres-mcp"],
      "env": {
        "DATABASE_URL": "postgresql://myuser:mypassword@localhost:5432/mydb"
      }
    }
  }
}

Prompts to try

Example questions to ask Claude after connecting to PostgreSQL.

- "List all tables in the public schema and describe their columns"
- "Show the top 10 rows from the orders table ordered by created_at descending"
- "Write and run a query to find duplicate email addresses in the users table"

Troubleshooting PostgreSQL MCP Legacy

Legacy server fails to start with import errors or missing dependencies

The legacy Python package is unmaintained and may have broken dependencies. Switch to @neverinfamous/postgres-mcp which is actively maintained and available via npx without any Python environment setup.

Connection refused when the server tries to reach PostgreSQL

Verify DATABASE_URL is correct and that PostgreSQL is running and accepting connections on the specified host and port. Test with psql using the same connection string before starting the MCP server.

Security warnings about using an unmaintained package in production

Migrate to https://github.com/neverinfamous/postgresql-mcp immediately. The legacy repository explicitly states that security patches will not be applied. The TypeScript successor is a drop-in functional replacement with significantly more features.

Frequently Asked Questions about PostgreSQL MCP Legacy

What is PostgreSQL MCP Legacy?

PostgreSQL MCP Legacy is a Model Context Protocol (MCP) server that ⚠️ deprecated - use https://github.com/neverinfamous/postgresql-mcp instead. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install PostgreSQL MCP Legacy?

Follow the installation instructions on the PostgreSQL MCP Legacy GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with PostgreSQL MCP Legacy?

PostgreSQL MCP Legacy works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is PostgreSQL MCP Legacy free to use?

Yes, PostgreSQL MCP Legacy is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "postgres-mcp-legacy": { "command": "npx", "args": ["-y", "postgres-mcp-legacy"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use PostgreSQL MCP Legacy?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides