A read-only Postgres MCP server that parses SQL rather than pattern-matching it.
Connect Runs on your machine
claude mcp add pg-readonly-mcp -e PG_READONLY_MCP_DSN=<PG_READONLY_MCP_DSN> -- uvx pg-readonly-mcp==0.1.1
{
"mcpServers": {
"pg-readonly-mcp": {
"command": "uvx",
"args": [
"pg-readonly-mcp==0.1.1"
],
"env": {
"PG_READONLY_MCP_DSN": "<PG_READONLY_MCP_DSN>"
}
}
}
}
{
"mcpServers": {
"pg-readonly-mcp": {
"command": "uvx",
"args": [
"pg-readonly-mcp==0.1.1"
],
"env": {
"PG_READONLY_MCP_DSN": "<PG_READONLY_MCP_DSN>"
}
}
}
}
{
"servers": {
"pg-readonly-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"pg-readonly-mcp==0.1.1"
],
"env": {
"PG_READONLY_MCP_DSN": "<PG_READONLY_MCP_DSN>"
}
}
}
}
Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.
Tools
This server runs locally, so its tools are listed by your MCP client once it starts.
Environment variables
| Name | Description |
|---|---|
PG_READONLY_MCP_DSNRequired, secret | Postgres connection string for a role that holds only SELECT. The server refuses to start otherwise. |
Details
| Package | [email protected] (PYPI, stdio) |
| First published | 2 Oct 2026 |
| Last updated | 2 Oct 2026 |
| Registry name | io.github.les-k/pg-readonly-mcp |
More databases servers See all
Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.
