LocalFree

pg Readonly MCP server

les-k/pg-readonly-mcp

A read-only Postgres MCP server that parses SQL rather than pattern-matching it.

0 GitHub stars

Install pg Readonly in Claude Code

Claude Code
claude mcp add pg-readonly -e PG_READONLY_MCP_DSN=... -- uvx pg-readonly-mcp
mcp.json (Claude Desktop, Cursor, VS Code, Windsurf)
{
  "mcpServers": {
    "pg-readonly": {
      "command": "uvx",
      "args": [
        "pg-readonly-mcp"
      ],
      "env": {
        "PG_READONLY_MCP_DSN": "..."
      }
    }
  }
}

Replace each ... with your own value.

Frequently asked questions

What does the pg Readonly MCP server do?

A read-only Postgres MCP server that parses SQL rather than pattern-matching it.

Is the pg Readonly MCP server free?

Yes, most likely. Open source and no paid account or API key is mentioned in the listing. Check the provider for current pricing.

Does pg Readonly run locally or remotely?

Local. Runs on your machine (stdio). You install it with npx, uvx, Docker or from source.

How do I add pg Readonly to Claude Code?

Run: claude mcp add pg-readonly -e PG_READONLY_MCP_DSN=... -- uvx pg-readonly-mcp

More databases MCP servers

View all