MCP Server

PostgreSQL MCP Server:

Your AI Coding Agent, Now Connected.

The SelfHost PostgreSQL MCP server gives Claude, Cursor, and VS Code direct access to your database infrastructure on AWS and Hetzner Cloud. Provision, scale, monitor, backup, restore to any second, manage users - all without leaving your editor. Manage PostgreSQL from Claude with 111 production-ready tools.

$ npx @selfhost.dev/mcp-server
Works with
Claude
Cursor
Windsurf
VS Code
+ any MCP client
claude - selfhost workspace

What we believe

The SelfHost
PostgreSQL MCP Server.

MCP, explained simply

One protocol. Total control.

MCP is the standard that lets your AI tools work with the system through a controlled interface, enabling actions, not direct access.

AI database management tools

Operate through AI

SelfHost exposes your database infrastructure through MCP, so AI can provision, scale, monitor, and manage your databases. No other PostgreSQL MCP server offers this depth - see how competitors compare.

How it connects

AI Client Claude · Cursor · Windsurf
MCP protocol
SELFHOST MCP SERVER @selfhost.dev/mcp-server
list_instances get_metrics
connection...
Your hosted DB AWS + Hetzner · Postgres
BYOC safe encrypted

111 MCP tools PostgreSQL, 14 modules

Everything your
infrastructure needs.

Create, scale, reboot, fork, and delete database instances on AWS or Hetzner. Platform-managed or BYOC.

mcp · instances

$ Create a Postgres 18 in us-east-1 with 4GB RAM

⚡ calling create_instance ...

✓ Instance created: prod-pg-18

  us-east-1 · t4g.medium · 4 GB · PostgreSQL 18

  Status: launching

Quickstart

Three steps,
that's it.

mcp · instances

$ npm install -g @selfhost.dev/mcp-server

✓ Installed @selfhost.dev/mcp-server@1.2.0

# Add to your MCP config:

# "selfhost": { "command": "npx", "args": ["@selfhost.dev/mcp-server"] }

$ npx @selfhost.dev/mcp-server

Opening browser for authentication...

✓ Signed in as divyam@selfhost.dev

✓ Organization: Swatantra Cloud Systems

✓ 111 tools registered. Ready.

Security

Your data stays
where you put it.

The MCP server database management runs on your machine. It talks to the SelfHost API to manage infrastructure - it never connects to your databases directly. Credentials are stored locally with owner-only permissions.

01

Runs locally on your machine

Service process stays in your terminal, not our cloud

02

No database connection

Manages infrastructure via API - never touches your data

03

Destructive ops require confirmation

delete, stop, reboot - Claude will always ask before acting

04

Credentials stored with chmod 600

~/.selfhost/credentials.json - owner-only access

Frequently Asked Questions

What is the SelfHost PostgreSQL MCP server?
The SelfHost PostgreSQL MCP server is an AI-powered toolkit with 111 tools that lets you manage your entire database infrastructure across AWS and Hetzner Cloud from Claude, Cursor, or VS Code using natural language. It covers provisioning, backups, point-in-time recovery, database users, scaling, connection pooling, monitoring, alerts, networking, PG configuration, billing, and team management - no other PostgreSQL MCP server offers this scope.
How many MCP tools does SelfHost provide for PostgreSQL?
SelfHost provides 111 MCP tools for PostgreSQL across 14 modules: Instances (14), Backups (11), PITR (7), Database Users (5), Scaling (5), Connection Pooling (4), Alerts (14), Networking (8), PG Config (3), Cloud Credentials (6), Hetzner Cloud (7), Authentication (8), Teams (12), and Billing (6). All 111 tools are available on every plan - the rate limits scale up with your tier. See pricing.
Which AI tools work with the SelfHost PostgreSQL MCP server?
The SelfHost PostgreSQL MCP server works with Claude (Desktop and Code), Cursor, Windsurf, VS Code, and any MCP-compatible client. Install with npx @selfhost.dev/mcp-server, authenticate via browser, and all 111 tools become available in your AI editor immediately.
Can I manage PostgreSQL from Claude using SelfHost MCP?
Yes - you can manage PostgreSQL from Claude using SelfHost's MCP server. Ask Claude to create databases, run backups, configure alerts, tune PostgreSQL settings, check metrics, and manage team access - all in plain English. Claude executes these through the MCP protocol with full confirmation on destructive operations.
How does the SelfHost MCP server compare to other PostgreSQL MCP servers?
Most PostgreSQL MCP servers (Anthropic's reference server, pgEdge, Crystal DBA) focus on queries and schema access - typically 5-15 tools. SelfHost provides 111 tools covering the full infrastructure lifecycle: provisioning across AWS and Hetzner Cloud, backups, point-in-time recovery, database users, autoscaling, connection pooling, monitoring, alerts, networking, configuration, billing, and team management. See full comparisons.
Is the SelfHost MCP server safe for production databases?
Yes - the MCP server runs locally on your machine and communicates with the SelfHost API to manage infrastructure. It never connects to your databases directly. Destructive operations (delete, stop, reboot) require explicit confirmation. Credentials are stored locally with chmod 600 owner-only permissions.
How do I install the SelfHost PostgreSQL MCP server?
Run npx @selfhost.dev/mcp-server to install. Add it to your MCP config file, then run the server - it opens your browser for authentication. Once signed in, all 111 tools register automatically. The entire setup takes under 2 minutes. Available on npm at @selfhost.dev/mcp-server.
What can I do with PostgreSQL MCP tools for backups?
SelfHost's 11 backup MCP tools plus 7 dedicated PITR tools let you create on-demand snapshots, set up automated DLM backup policies with custom retention, configure S3 backup targets, and restore to any second within the retention window - all via natural language. Ask your AI: "Set up daily backups with 7-day retention" or "Restore prod-db to 14:30 yesterday" and it handles the rest.
What PostgreSQL AI tools does SelfHost offer for monitoring?
SelfHost's alert module includes 14 PostgreSQL AI tools for monitoring CPU, memory, disk usage, replication lag, cache hit ratio, and custom PostgreSQL metrics. Set up multi-channel notifications via email, Slack, or webhooks - all through natural language commands in Claude, Cursor, or VS Code.
Is the SelfHost MCP server free?
The MCP server is included on every SelfHost plan at no extra cost. All 111 tools are available on every plan; rate limits scale with your tier - Free is ~60 reads/min, Starter ($19/mo) gives ~150, Pro ($79/mo) gives ~300, and Enterprise ($249/mo) gives ~600 with unlimited concurrent connections. See pricing.
Can I use the SelfHost MCP server with BYOC (Bring Your Own Cloud)?
Yes - all 111 MCP tools work with both Managed and BYOC deployments. On BYOC, the MCP server manages databases running in your own AWS account through the SelfHost API. This means you get AI-native database management while maintaining full infrastructure ownership. BYOC is available on Pro ($79/mo).
What MCP modules does the SelfHost PostgreSQL server include?
The SelfHost PostgreSQL MCP server includes 14 modules: Instances (14 tools - create, scale, fork, delete), Backups (11 - snapshots, DLM), PITR (7 - WAL archive + restore to any second), Database Users (5 - role-based access, password rotation), Scaling (5 - autoscaling and scheduled start/stop), Connection Pooling (4 - PgBouncer), Alerts (14 - metrics, thresholds, notifications), Networking (8 - VPC, subnets, security groups), PG Config (3 - parameter tuning), Cloud Credentials (6 - BYOC), Hetzner Cloud (7 - alt cloud provider), Authentication (8 - sign-in, switch orgs), Teams (12 - orgs, roles, audit logs), and Billing (6 - subscriptions, payment).
Does the SelfHost MCP server work with Hetzner Cloud?
Yes - SelfHost is multi-cloud. The 7-tool Hetzner Cloud module lets you provision PostgreSQL across 5 Hetzner datacenters (fsn1, nbg1, hel1, ash, sin) on cpx11-cpx51 server types directly from Claude, Cursor, or VS Code. Use AWS for the full feature set or Hetzner Cloud for 30-70% lower compute costs - your AI agent picks the right tool for the job.

Try the SelfHost
PostgreSQL MCP Server today.

Available on all plans
All 111 tools, no credit card required