Skip to content
100% Free OSSDatabases, Auth & Edge Backendmcp-stdio

PostgreSQL Read-Safe Schema & Query MCP for Claude Code, ChatGPT, Gemini CLI & Cursor

Inspect local or Docker Postgres tables, indexes, foreign keys & run read-only SQL diagnostics.

Quick Answer Summary (Claude Code • ChatGPT • Cursor • Gemini CLI)

PostgreSQL Read-Safe Schema & Query MCP (100% Free OSS) connects to AI coding and chat agents via claude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost:5432/mydb. Free Tier: 100% Free official MCP server — connects to any `postgresql://` connection string. Paid Upgrade Threshold: No subscription needed for local Postgres. Pair with Supabase for managed cloud Postgres, Auth & pgvector.

What Works for $0 (Free Tier)

100% Free official MCP server — connects to any `postgresql://` connection string.

When a Paid Subscription Is Required

No subscription needed for local Postgres. Pair with Supabase for managed cloud Postgres, Auth & pgvector.

Zero API keys required — runs locally or over public HTTP immediately.

1-Command Setup for Claude Code, Google Gemini CLI & Cursor

Copy the exact snippet for your AI coding agent — merges alongside the StackOS Master Router so future tool recommendations happen automatically.

1. Claude Code CLI One-Liner
claude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost:5432/mydb
2. Google Gemini CLI (~/.gemini/settings.json)
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://localhost:5432/mydb"
      ]
    },
    "stackos-router": {
      "httpUrl": "https://stackos-ai.vercel.app/api/mcp"
    }
  }
}
3. Cursor IDE & Claude Desktop (.mcp.json)
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://localhost:5432/mydb"
      ]
    },
    "stackos": {
      "url": "https://stackos-ai.vercel.app/api/mcp"
    }
  }
}
4. Non-Destructive Workspace Auto-Installer (Merges .mcp.json + SKILL.md)
curl -fsSL "https://stackos-ai.vercel.app/api/plugins/install?tools=postgres-local-mcp&src=plugin-seo-postgres-local-mcp" | node

Recommended SKILL.md / GEMINI.md Rule & GitHub README Badge

Inspect table schemas and EXPLAIN ANALYZE slow queries safely via read-only transactions.

PostgreSQL Read-Safe Schema & Query MCP verified on StackOSEmbed this live SVG badge in GitHub READMEs or engineering docs:

Best Companion Plugins for Databases, Auth & Edge Backend