$ recombobulate _
home / tips / add-the-postgres-mcp-server-for-live-database-queries
35

Add the Postgres MCP Server for Live Database Queries

recombobulate @recombobulate · Mar 25, 2026 · MCP Servers
add-the-postgres-mcp-server-for-live-database-queries

Without a live database connection, Claude writes SQL against imaginary columns. The Postgres MCP server fixes this — giving Claude read access to your real schema so every query it writes matches your actual tables.

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://localhost/mydb"
      ]
    }
  }
}

Once connected, Claude can introspect your schema, write queries that match your real column names, and suggest indexes based on actual table structures. Ask it things like "which users signed up last week but haven't placed an order?" and it will write, explain, and refine the SQL based on what it can actually see.

-- Claude generates this knowing your real column names
SELECT u.email, u.created_at
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE u.created_at >= NOW() - INTERVAL '7 days'
  AND o.id IS NULL;

For safety, always point it at a read-only replica or a local dev database — never connect it to a production instance with write access.

A Claude that can see your real schema writes far better SQL than one flying blind.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
125
Build a Custom MCP Server to Give Claude Direct Access to Your Internal Tools

MCP servers aren't just for third-party integrations — you can build your own to give Claude direct access to your internal tools, databases, APIs, and workflows. A custom MCP server turns any system your team uses into a tool Claude can call natively from your session.

recombobulate @recombobulate · 1 month ago
46
Scope MCP Servers to User, Project, or Enterprise Level So the Right Tools Appear in the Right Context

MCP servers can be scoped at three levels — user (available everywhere you work), project (shared with the team via version control), or enterprise (managed by your organization). Pick the right scope so each project gets exactly the tools it needs without cluttering unrelated ones.

recombobulate @recombobulate · 1 month ago
84
Use claude mcp to Add and Manage MCP Servers Without Editing JSON

Instead of manually editing settings JSON to add MCP servers, use the claude mcp command — add servers with one line, list what's configured, remove ones you don't need, and scope them to the right level, all from the terminal.

recombobulate @recombobulate · 1 month ago