Koskamo

pg-readonly-mcp

A read-only Postgres MCP server that parses SQL rather than pattern-matching it. It uses sqlglot to build a syntax tree to ensure only read shapes (SELECT, UNION, etc.) are allowed and checks that the database connection role lacks write privileges, preventing the bypass found in the official Anthropic reference server.

Package and access

Local package with source-attributed installation metadata. Koskamo does not execute packages during review.

pg-readonly-mcp logo, by Leslie KadengeCommunity listingLocal stdioSource reviewed; not executedPublished by Leslie Kadenge
Vendor documentation

What you can do with it

  • Allow AI agents to query Postgres databases safely
  • Prevent accidental data modification by agents
  • Audit database schema and data without write risks

Source and maintenance

Community listingRegistry 0.1.1
Maintenance checked

Packages and installation

Source-provided package data. Koskamo has not executed or live-probed this package.

pg-readonly-mcp 0.1.1

pypi
pg-readonly-mcp package definition
{
  "version": "0.1.1",
  "transport": "stdio",
  "identifier": "pg-readonly-mcp",
  "registryType": "pypi",
  "environmentVariables": [
    {
      "name": "PG_READONLY_MCP_DSN",
      "format": "string",
      "isRequired": true,
      "description": "Postgres connection string for a role that holds only SELECT. The server refuses to start otherwise."
    }
  ]
}

Tools

Reported by the attributed source; not independently observed by Koskamo.

No tool definitions available.

Connect from your client

Each snippet configures the same source-provided package; replace placeholders before use.

This server is operated by the named third party. Listing and endpoint checks are not an endorsement or a security audit. Review the operator's permissions, terms, and data handling before connecting. How listings are checked and corrected.

Cursor

Merge this local stdio configuration, replace every placeholder environment value, and restart Cursor. Koskamo has not executed this package.
Cursor configuration
{
  "mcpServers": {
    "pg-readonly-mcp": {
      "command": "uvx",
      "args": [
        "pg-readonly-mcp==0.1.1"
      ],
      "env": {
        "PG_READONLY_MCP_DSN": "<YOUR_PG_READONLY_MCP_DSN>"
      }
    }
  }
}

Cline

Merge this local stdio configuration, replace every placeholder environment value, and restart Cline. Koskamo has not executed this package.
Cline configuration
{
  "mcpServers": {
    "pg-readonly-mcp": {
      "command": "uvx",
      "args": [
        "pg-readonly-mcp==0.1.1"
      ],
      "env": {
        "PG_READONLY_MCP_DSN": "<YOUR_PG_READONLY_MCP_DSN>"
      }
    }
  }
}

VS Code

Merge this local stdio configuration, replace every placeholder environment value, and restart VS Code. Koskamo has not executed this package.
VS Code configuration
{
  "servers": {
    "pg-readonly-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "pg-readonly-mcp==0.1.1"
      ],
      "env": {
        "PG_READONLY_MCP_DSN": "<YOUR_PG_READONLY_MCP_DSN>"
      }
    }
  }
}

Claude Desktop

Merge this local stdio configuration, replace every placeholder environment value, and restart Claude Desktop. Koskamo has not executed this package.
Claude Desktop configuration
{
  "mcpServers": {
    "pg-readonly-mcp": {
      "command": "uvx",
      "args": [
        "pg-readonly-mcp==0.1.1"
      ],
      "env": {
        "PG_READONLY_MCP_DSN": "<YOUR_PG_READONLY_MCP_DSN>"
      }
    }
  }
}

Let your agent find its tools

Find servers like pg-readonly-mcp from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.