Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

A secure MCP server that lets AI assistants directly interact with PostgreSQL databases via tools like create_table, list_tables, and execute_sql, plus a web configurator for managing connections.

README.md

PostgreSQL MCP

A Model Context Protocol (MCP) server that provides AI assistants (like Claude) with tools to directly interact with PostgreSQL databases securely.

<img src="./demo.png"/> <img src="./pgadmin.png"/>

Features

  • create_table: Create a new table with custom columns.
  • list_tables: List all tables in the public schema.
  • describe_table: Get the schema and column details of a specific table.
  • execute_sql: Execute arbitrary SQL queries.
  • Web Configurator: A built-in local web UI to securely manage connection strings and generate API keys.

Installation

You can install and run this package easily using uv:

# Run without installing globally
uvx postgresql-mcp

# Or install globally for easy access
uv tool install postgresql-mcp

Setup & Configuration

This project requires an API Key mapped to your PostgreSQL database URL. To easily set this up, we provide a built-in Web Configurator.

1. Generate an API Key

Run the web configurator: ``bash postgresql-mcp-web ` Or, if running without global installation: `bash uvx --from . postgresql-mcp-web ``

Open your browser to http://localhost:8000. Enter your database URL (postgresql://user:pass@host/db) and click "Generate API Key".

The application securely stores your credentials in ~/.sql-mcp/keys.json and outputs a configuration snippet.

2. Connect Claude Desktop

Copy the generated snippet and add it to your Claude Desktop configuration file (typically located at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS).

{
  "mcpServers": {
    "postgresql-mcp": {
      "command": "uvx",
      "args": [
        "postgresql-mcp"
      ],
      "env": {
        "API_KEY": "postgresql-mcp-your-generated-key"
      }
    }
  }
}

Restart Claude Desktop, and your AI assistant will now be able to interact with your database!

Usage Tracking

The server automatically tracks how many times each API key is utilized. You can view this data locally in ~/.sql-mcp/usage.json.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details on how to get started.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Databases servers.