cd /news/developer-tools/i-just-published-postgres-mcp-server… · home topics developer-tools article
[ARTICLE · art-47673] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I just published Postgres MCP Server in Go!

Developer Akshay Gupta open-sourced Postgres MCP Server, a Go-based MCP server that connects AI coding assistants like Claude Code and Cursor directly to live PostgreSQL databases. The server exposes nine tools for query execution, performance analysis, and database health checks, shipping as a single ~15 MB static binary with no Python runtime required.

read2 min views2 publishedJul 4, 2026

I open sourced a project I have been building on the side: a Go MCP server that connects Claude Code (or Cursor) directly to a live PostgreSQL database.

Repo: github.com/gupta-akshay/postgres-mcp Most "AI plus database" workflows still look like this: copy SQL out of a chat window, paste it into a DB client, run it, copy the output back. It breaks flow, and the assistant never sees your actual schema, so it guesses.

MCP fixes the connection problem. This server is what sits on the other end for Postgres.

The server exposes nine tools over MCP:

execute_sql

  • run queries directly (read only in restricted mode)explain_query

  • EXPLAIN ANALYZE, including against a hypothetical indexget_top_queries

  • pull slow queries from pg_stat_statements

hypopg

analyze_db_health

  • vacuum, XID wraparound, replication lag, invalid indexes, and more, checked in parallelThat means you can ask "why is this query slow" and the assistant actually runs the EXPLAIN, checks the stats, and can simulate an index before anyone touches the schema.

The project is inspired by the Python crystaldba/postgres-mcp. I rebuilt it from scratch in Go so it ships as a single ~15 MB static binary. No Python runtime, no dependency chasing. docker build

, point Claude Code at it, done.

Restricted mode wraps every call in a read only transaction, so write protection comes from Postgres itself, not string matching on the query text.

The repo has the full setup instructions, the Docker config, and the test suite (unit, integration, and end to end against a real Postgres container with pg_stat_statements

and hypopg

). CI fails under 95% coverage.

If you spend real time in Claude Code or Cursor and also spend real time worrying about Postgres performance, take a look: github.com/gupta-akshay/postgres-mcp I wrote up the build in more depth on my blog and on dev.to if you want the architecture and testing details.

── more in #developer-tools 4 stories · sorted by recency
── more on @akshay gupta 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-just-published-pos…] indexed:0 read:2min 2026-07-04 ·