PgAdmin-MCP
Provides tools for exploring PostgreSQL databases and running SQL, including switching profiles, listing databases, schemas, and tables, describing table columns, and executing queries with read-only safety by default.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PgAdmin-MCP what tables are in the public schema?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@mhdd_24/pgadmin-mcp
MCP server for PostgreSQL / pgAdmin-style exploration and SQL from Cursor (or any MCP client). Follows the same architecture as flyway-mcp.
Say "pg status", "list postgres tables", or "run this SQL on Dev" in chat — the assistant calls the matching tools.
Full documentation: docs/WIKI.md
Tools
Tool | Role |
| Sticky session switch: |
| Sticky + active profile, host, |
| List databases on active (or one-shot) profile server |
| List user schemas |
| List tables/views in a schema |
| Column metadata |
| Run SQL (read-only by default) |
Profiles (no connection details in chat)
Put both Dev and QA credentials in
mcp.json(PG_DEV_*,PG_QA_*).Say
pgprofile=qaorpgprofile=dev— the assistant callspg_set_profile.Later tools reuse that sticky profile until you switch or the MCP process restarts.
Optional one-shot: pass
profile: "qa"on a single tool without changing sticky.databasestill means the logical DB name on that server (e.g.transboard), not the env profile.
Related MCP server: Database Assistant MCP Server
Safety
Read-only by default — only
SELECT/WITH…SELECT/EXPLAIN/SHOW/VALUESSet
PG_ALLOW_WRITE=trueto allow writes (still subject to DB user privileges)PG_MAX_ROWScaps returned rows;PG_QUERY_TIMEOUT_MSsets statement timeout
Install / run
cd C:/workspace/pgadmin-mcp
npm install
npm run build
node dist/index.jsCursor mcp.json
"pgadmin": {
"command": "node",
"args": ["C:/workspace/pgadmin-mcp/dist/index.js"],
"env": {
"PG_PROFILE": "dev",
"PG_DEV_HOST": "192.168.1.141",
"PG_DEV_PORT": "5432",
"PG_DEV_USER": "postgres",
"PG_DEV_PASSWORD": "YOUR_PASSWORD",
"PG_DEV_DATABASE": "postgres",
"PG_ALLOW_WRITE": "false",
"PG_MAX_ROWS": "500"
}
}Or use discrete PGHOST / PGUSER / PGPASSWORD / PGDATABASE, or a single DATABASE_URL.
Restart Cursor after saving.
Example prompts
pgprofile=qa
pgprofile=dev
pg status
list databases
list tables in schema transc for database transboard
describe table translations schema transc database transboard
run: SELECT version();
Available Tools
7 toolspg_describe_tableA
Describe columns for a table or view. Optional schema, database, and/or profile override.
Inputs: table (required), schema, profile, database.
pg_list_databasesA
List databases on the active profile server (or optional one-shot profile=dev|qa).
Inputs: profile.
pg_list_schemasA
List non-system schemas. Optional database and/or profile (dev|qa) override.
Inputs: profile, database.
pg_list_tablesA
List tables/views for a schema (default public). Optional database and/or profile override.
Inputs: schema, profile, database.
pg_queryA
Run SQL against the sticky session profile (or optional profile=dev|qa for one call). Read-only by default. Optional database name and maxRows. Do not ask the user for connection host/password — use profiles.
Inputs: sql (required), maxRows, profile, database.
pg_set_profileA
Set the sticky session connection profile to "dev" or "qa" (or "default"). Call when the user says pgprofile=dev, pgprofile=qa, use Dev DB, switch to QA, etc. Later tools reuse this profile automatically — no host/password in chat. Credentials are loaded from PG_DEV_* / PG_QA_* in mcp.json.
Inputs: profile (required), verify.
pg_statusA
Show current sticky PostgreSQL profile, host, database, write mode, and a live SELECT 1 health check. Optional profile arg for a one-shot check without changing the sticky session.
Inputs: profile, database.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool maps to a distinct operation: profile management, status, list databases/schemas/tables, describe table, and execute queries. No overlapping purposes.
All tools follow the pg_ prefix with clear verb-ish suffixes (list_*, describe_*, set_*, query). Consistent and predictable pattern.
7 tools is well-scoped for a PostgreSQL browsing and querying server. No redundancy and each tool serves a clear need.
Covers profile switching, metadata exploration, and querying. Missing write operations or schema modification, but core read and navigate workflows are complete.
Maintenance
Related MCP Connectors
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables querying and interacting with PostgreSQL databases using natural language through MCP. Supports configuration via environment variables and Cursor IDE integration.3MIT
- FlicenseAqualityDmaintenanceEnables read-only exploration and querying of PostgreSQL or MySQL databases via MCP, with schema discovery, safe SQL validation, natural language to SQL conversion, and CSV export.112-
- AlicenseNot gradedqualityCmaintenanceEnables read-only, SELECT-only querying of any Postgres database through MCP-compatible clients like Claude, with schema introspection and guarded SQL execution.MIT
- AlicenseAqualityCmaintenanceEnables natural language interaction with PostgreSQL databases via MCP, supporting database exploration, schema listing, and SQL queries with profile-based connections.75 npmISC