mcp server · postgres

Postgres MCP server, without the self-hosting tax.

Route Claude, Cursor, Codex, and any MCP client to your Postgres through wmcp.sh. Per-user credential vault, edge query routing, row-level audit log, parameterized read-only queries by default. wmcp.sh is not affiliated with PostgreSQL or the PostgreSQL Global Development Group.

Connect at https://wmcp.sh/mcp/postgres · setup ~3 minutes · free tier covers 100 reads/day

Why route through wmcp.sh instead of running the official server.

The reference Postgres MCP server (originally shipped in the modelcontextprotocol/servers repo) was moved to the archived-servers repository in 2025 and is no longer actively maintained by the steering group. Community forks exist but are typically single-tenant: one binary, one connection string baked into config.

That's fine for local dev. It breaks the moment you want (a) more than one developer hitting the same DB, (b) credentials that aren't checked into a shared config, (c) an audit trail of which agent called which query, (d) Claude.ai / Cursor remote-MCP integration that needs an HTTPS endpoint, not stdio.

wmcp.sh adds the multi-tenant layer: encrypted per-user connection strings, an HTTPS endpoint with OAuth, automatic parameterized-query enforcement, and a row-level audit log. No Docker, no VPC, no on-call rotation for a database proxy.

Postgres tools, MCP-shaped.

Eight tools, ready for Claude tool_use, OpenAI function-calling, or any MCP client.

Python — call Postgres MCP from a Claude agent.

# pip install anthropic mcp
import os
from anthropic import Anthropic
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

WMCP = "https://wmcp.sh/mcp/postgres"
TOKEN = os.environ["WMCP_TOKEN"]  # grab from /dashboard

async def ask(question: str):
    async with streamablehttp_client(WMCP, headers={"Authorization": f"Bearer {TOKEN}"}) as (r, w, _):
        async with ClientSession(r, w) as session:
            await session.initialize()
            tools = (await session.list_tools()).tools
            client = Anthropic()
            msg = client.messages.create(
                model="claude-opus-4-5",
                max_tokens=1024,
                tools=[{"name": t.name, "description": t.description, "input_schema": t.inputSchema} for t in tools],
                messages=[{"role": "user", "content": question}],
            )
            # dispatch tool_use blocks back to session.call_tool(...) — standard MCP loop
            return msg

# > await ask("How many orders did we ship last week, grouped by region?")

Self-hosted Postgres MCP server vs wmcp.sh-routed.

CapabilitySelf-hosted reference / community serverwmcp.sh-routed
Transportstdio (local only)Streamable HTTP + OAuth, remote-MCP friendly
Multi-user credential isolationSingle conn-string in configPer-user encrypted vault, rotatable
Audit logNone (you'd build it)Row-level: who, when, statement, params, rows, ms
Read-only enforcementManual role configParser-layer rejection of DDL/DML + role-side belt
Schema introspectionBasic list_tablesSchemas, tables, columns, FKs, indexes, extensions
Works with Claude.ai connectorsNo (stdio)Yes (HTTPS + OAuth 2.1 DCR)
Setup time30–90 min (Docker, network, secrets)~3 minutes — paste conn-string, copy URL
Maintenance burdenYou own itWe run it on Cloudflare's edge

Common questions.

Is there an official Postgres MCP server?
A reference implementation existed in the modelcontextprotocol/servers repo and was moved to the archived-servers repo in 2025. Community Postgres MCP servers exist on GitHub and work for single-tenant local use. wmcp.sh is not affiliated with any of them — we're a hosted alternative that adds multi-tenant credential isolation, audit logging, and an HTTPS endpoint.
Does wmcp.sh store my database password?
Connection strings live in a per-user encrypted vault scoped to your wmcp.sh account. Plaintext is decrypted in-memory at the edge per request and never logged. Rotate or revoke at any time from /dashboard.
Can agents write to my database?
Default is read-only. postgres.query rejects DDL and DML at the parser before any traffic reaches your DB. Write access is opt-in per connection and recommended only for service-role connections.
What about pgvector / pgvector queries?
Yes — the query tool runs any valid read SQL, including vector similarity (<->, <=>) operators. postgres.list_extensions reports whether pgvector is installed so your agent can plan accordingly.
Does the audit log capture parameter values?
Yes — timestamp, client identity, statement, parameter values, row count, execution time. Retention is 30 days on Pro, 1 year on Enterprise.
Pricing?
Free 100 reads/day anonymous. Managed Starter $499 one-time for setup + audit, Managed Retainer $999/mo, Enterprise $4,999+/mo. See /managed.

Need this in production?

If you're past the prototype stage and want a routed Postgres MCP endpoint with audit logs, SSO, and a configured read-only role on your DB, we'll set it up end-to-end. $499 one-time for Starter (setup + audit + one connection), Managed Retainer $999/mo for ongoing, Enterprise $4,999+/mo for VPC peering + dedicated support.

→ Managed setup ($499) Submit your MCP server (free)