PG Readonly MCP Server
by les-kio.github.les-k/pg-readonly-mcpv0.1.1
A read-only Postgres MCP server that parses SQL rather than pattern-matching it.
context tax
queued
security
queued
cold start
queued
freshness
Active7d ago
Install PG Readonly MCP server
Install in Claude Code
claude mcp add pg-readonly -e PG_READONLY_MCP_DSN='<pg-readonly-mcp-dsn>' -- uvx pg-readonly-mcpInstall in Cursor
{
"mcpServers": {
"pg-readonly": {
"command": "uvx",
"args": [
"pg-readonly-mcp"
],
"env": {
"PG_READONLY_MCP_DSN": "<pg-readonly-mcp-dsn>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"pg-readonly": {
"command": "uvx",
"args": [
"pg-readonly-mcp"
],
"env": {
"PG_READONLY_MCP_DSN": "<pg-readonly-mcp-dsn>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"pg-readonly": {
"type": "stdio",
"command": "uvx",
"args": [
"pg-readonly-mcp"
],
"env": {
"PG_READONLY_MCP_DSN": "<pg-readonly-mcp-dsn>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"pg-readonly": {
"command": "uvx",
"args": [
"pg-readonly-mcp"
],
"env": {
"PG_READONLY_MCP_DSN": "<pg-readonly-mcp-dsn>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| PG_READONLY_MCP_DSN | yes | yes | Postgres connection string for a role that holds only SELECT. The server refuses to start otherwise. |
Freshness
Active — last maintenance signal 7d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-10-02 · 7d ago · GitHub
Latest release
no data · GitHub
Package published
no data · npm/PyPI
Registry entry updated
2026-10-02 · 7d ago · official registry · v0.1.1
FAQ
›How do I install the PG Readonly MCP server in Claude Code?
Run: claude mcp add pg-readonly -e PG_READONLY_MCP_DSN='<pg-readonly-mcp-dsn>' -- uvx pg-readonly-mcp. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does PG Readonly require an API key?
Yes. It expects PG_READONLY_MCP_DSN, of which 1 is a secret.
›Can I use PG Readonly as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is PG Readonly in the official MCP registry?
Yes, as io.github.les-k/pg-readonly-mcp.
Alternatives to PG Readonly
Other database MCP servers.