PostgreSQL MCP Server

PostgreSQL MCP Server

Enables Claude to interact with PostgreSQL databases by executing SQL queries, exploring schemas, and monitoring database health. It provides tools for data manipulation and schema management via a secure SSE connection.

Category
Visit Server

README

PostgreSQL MCP Server

An MCP (Model Context Protocol) server that gives Claude full access to your PostgreSQL database over SSE (HTTP).

Available Tools

Tool Description
execute_query Run any SQL — SELECT, INSERT, UPDATE, DELETE, DDL
list_tables List tables with sizes and row estimates
describe_table Full schema of a table: columns, indexes, foreign keys
list_schemas List all schemas in the database
get_db_stats Database size, connections, cache hit ratio, top tables

Setup

1. Configure environment

cp .env.example .env
nano .env   # fill in your Postgres credentials

Key settings:

  • PG_HOST — IP or hostname of your PostgreSQL server
  • If Postgres runs on the same Docker host: use host.docker.internal (Linux: requires extra_hosts in compose) or the host's LAN IP
  • If Postgres runs in another Docker container/network: use the container name and add the network to docker-compose.yml

2. Build and start

docker compose up -d --build

3. Verify it's working

curl http://localhost:3000/health
# → {"status":"ok","database":"connected","sessions":0}

Connect Claude Desktop

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

{
  "mcpServers": {
    "power-db": {
      "transport": "sse",
      "url": "http://YOUR_SERVER_IP:3000/sse"
    }
  }
}

Replace YOUR_SERVER_IP with your Docker host's IP (e.g. 192.168.1.50).

Then restart Claude Desktop. You'll see the tools appear in Claude's tool panel.


Connect Claude.ai (Remote MCP)

In Claude.ai Settings → Integrations → Add MCP Server:

  • URL: http://YOUR_SERVER_IP:3000/sse

Note: For claude.ai remote MCP, the server must be reachable from the internet or via a tunnel (e.g. ngrok http 3000).


Networking Tips

Postgres on Docker host (Linux)

Add to docker-compose.yml under the service:

extra_hosts:
  - "host.docker.internal:host-gateway"

Then use PG_HOST=host.docker.internal.

Postgres in another Docker network

networks:
  - your_postgres_network

networks:
  your_postgres_network:
    external: true

Logs

docker compose logs -f

Stop / Restart

docker compose down
docker compose up -d

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured