Postgres MCP Pro for VS Code: Setup & Config
Give VS Code PostgreSQL schema access, SQL execution, health checks, and performance analysis.
What you can do with Postgres MCP Pro in VS Code
Pick PostgreSQL tooling that goes beyond queries into health checks, plans, and index evaluation.
- Inspect tables, views, constraints, and indexes before writing SQL.
- Evaluate index recommendations against a workload or selected queries.
Before you start: Postgres MCP Pro in VS Code
- Python 3.12+ for this launch path
- uv with uvx
- PostgreSQL database access credentials
- An MCP-compatible client
The README supports this restricted replacement for its unrestricted example. pg_stat_statements and hypopg are optional database extensions needed for fuller performance and index analysis. Docker is also documented.
Postgres MCP Pro VS Code configuration
Choose VS Code configuration scope
For Postgres MCP Pro, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.
Add Postgres MCP Pro to VS Code
Use the postgres-mcp entry below in servers. Keep Postgres MCP Pro's documented stdio connection fields and your other VS Code entries.
Check Postgres MCP Pro in VS Code
Postgres MCP Pro: Start in VS Code’s MCP controls; inspect output and trust prompts.
Config file · Workspace: .vscode/mcp.json
{
"servers": {
"postgres-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"postgres-mcp",
"--access-mode=restricted"
],
"env": {
"DATABASE_URI": "<PostgreSQL connection URI with your database credentials>"
}
}
}
}Postgres MCP Pro tools available to VS Code
Postgres MCP Pro's stored tool list documents 9 tools; compare it with VS Code's connected tool list, because the stored list is not a live check.
- list_schemas
Look for list_schemas among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
- list_objects
Look for list_objects among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
Inspect tables, views, sequences, and extensions within a schema.
- get_object_details
Look for get_object_details among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
Read an object's columns, indexes, constraints, and related structural details.
- execute_sql
Look for execute_sql among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
Run SQL statements subject to the configured access restrictions.
- explain_query
Look for explain_query among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
- get_top_queries
Look for get_top_queries among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
Identify slow statements using pg_stat_statements execution statistics.
- analyze_workload_indexes
Look for analyze_workload_indexes among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
Recommend indexes for resource-intensive statements across a workload.
- analyze_query_indexes
Look for analyze_query_indexes among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
- analyze_db_health
Look for analyze_db_health among VS Code's agent-mode tools after starting Postgres MCP Pro through the MCP controls.
Troubleshooting Postgres MCP Pro in VS Code
- Make uvx postgres-mcp (from uv, for Python tools) available in the workspace, container, or remote environment hosting Postgres MCP Pro. Start through VS Code's MCP controls; inspect output and trust prompts.
- For Postgres MCP Pro, keep DATABASE_URI out of version control; VS Code documents input variables and secret handling.
- Postgres MCP Pro uses stdio here: VS Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Advanced workload and index analysis needs optional Postgres extensions.
- Known limitation: Unrestricted mode allows data and schema modification.
- Known limitation: Native Python execution requires Python 3.12 or newer.
- General VS Code troubleshooting lives in the /clients/vscode guide.
Postgres MCP Pro — details. VS Code guide