
Security News
Open VSX Unblocks Extension IDs Used in Malware Campaign
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.
mcp-pg-server
Advanced tools
MCP server for PostgreSQL — query databases, inspect schemas, explain queries from your IDE
Query PostgreSQL, inspect schemas, and explain queries from your AI assistant. A daily-driver MCP for local and dev Postgres — same belt as docker and sqlite servers, not an enterprise DBA suite.
DATABASE_URL=postgres://user:pass@localhost:5432/mydb npx mcp-pg-server
Works with Claude Desktop, Cursor, VS Code Copilot, and any MCP client. Connects via
DATABASE_URLor per-callconnectionString.
Postgres is the default for most new backends, local dev stacks, and agent workflows that need a real SQL database. You already run it in Docker or on localhost — this server lets your assistant query it, read schemas, and explain plans without leaving the IDE. Read-only by default so exploration stays safe; opt into writes when you need them.
| Tool | What it does |
|---|---|
query | Execute SQL (SELECT, WITH, EXPLAIN, SHOW, ANALYZE). Returns a text table. |
schema | Tables in a schema (default public) with columns and approximate row counts |
table_info | One table: columns, types, null/default, PK, exact row count |
explain | EXPLAIN (FORMAT TEXT), optional ANALYZE |
list_schemas | List non-system schemas |
Add to .cursor/mcp.json:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["mcp-pg-server"],
"env": {
"DATABASE_URL": "postgres://user:pass@localhost:5432/mydb"
}
}
}
}
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["mcp-pg-server"],
"env": {
"DATABASE_URL": "postgres://user:pass@localhost:5432/mydb"
}
}
}
}
Configure the MCP server in your VS Code settings to run npx mcp-pg-server with DATABASE_URL set.
Read-only by default. The query tool accepts only SELECT, WITH, EXPLAIN, SHOW, and ANALYZE in readonly mode. Set readonly=false to enable INSERT, UPDATE, DELETE, and DDL.
Pass connectionString on any tool to override DATABASE_URL for a single call.
npm install
npm run typecheck
npm run build
npm test
npm run format
npm run lint
More MCP servers and developer tools on my portfolio.
MIT © 2026 Ofer Shapira
FAQs
MCP server for PostgreSQL — query databases, inspect schemas, explain queries from your IDE
The npm package mcp-pg-server receives a total of 61 weekly downloads. As such, mcp-pg-server popularity was classified as not popular.
We found that mcp-pg-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.