Easy Pg Admin
FreeNot checkedHigh-privilege PostgreSQL admin MCP server for database and role/grant management.
About
High-privilege PostgreSQL admin MCP server for database and role/grant management.
README
High-privilege PostgreSQL admin MCP server for database and role/grant management.
This project is a DBA-style tool. It does not provide raw SQL execution and does not manage tables, schemas, views, indexes, triggers, or functions. Use easy-pg-mcp for data access and schema/table operations.
Features
- List, create, inspect, and change owners for databases
- List, create, update, and drop PostgreSQL roles
- Grant and revoke role memberships
- Grant and revoke database-level privileges
- Protect destructive actions with short-lived confirmation tokens
Available Tools
| Tool | Description |
|---|---|
pg_list_databases |
List databases in the current PostgreSQL instance |
pg_create_database |
Create a PostgreSQL database |
pg_describe_database |
Inspect a PostgreSQL database |
pg_alter_database_owner |
Change a database owner |
pg_drop_database |
Request database deletion and return a confirmation token |
pg_list_roles |
List PostgreSQL roles |
pg_create_role |
Create a PostgreSQL role without SUPERUSER support |
pg_alter_role_password |
Change a role password |
pg_alter_role_attributes |
Change supported role attributes |
pg_drop_role |
Request role deletion and return a confirmation token |
pg_grant_role |
Grant a role to another role |
pg_revoke_role |
Revoke a role from another role |
pg_show_role_memberships |
Show memberships for a role |
pg_grant_privileges |
Grant database-level privileges to a role |
pg_revoke_privileges |
Revoke database-level privileges from a role |
pg_show_grants |
Show database-level grants for a role |
pg_confirm_task |
Confirm and execute a destructive action token |
Safety
- No raw SQL passthrough
- No schema, table, view, index, trigger, or function management
- SUPERUSER role creation and modification are not supported
pg_drop_databaseandpg_drop_rolerequirepg_confirm_taskpg_drop_roledoes not supportREASSIGN OWNEDorDROP OWNED- Confirmation tokens are random, single-use, and expire quickly
Configuration
Use environment variables, matching the rest of the easy-*-mcp family.
| Variable | Required | Default | Description |
|---|---|---|---|
PG_CONNECTION_STRING |
Conditional | - | PostgreSQL connection string. Takes precedence when provided |
PG_HOST |
Conditional | - | PostgreSQL host when no connection string is provided |
PG_PORT |
No | 5432 |
PostgreSQL port |
PG_USER |
Conditional | - | PostgreSQL admin role name when no connection string is provided |
PG_PASSWORD |
No | - | PostgreSQL password |
PG_DATABASE |
Conditional | - | Default database used for the admin connection |
PG_CONNECTION_LIMIT |
No | 10 |
Maximum number of active pool connections |
PG_IDLE_TIMEOUT |
No | 30000 |
Idle connection timeout in milliseconds |
PG_ENABLE_KEEP_ALIVE |
No | true |
Whether TCP keep-alive is enabled |
PG_KEEP_ALIVE_INITIAL_DELAY |
No | 0 |
Initial TCP keep-alive delay in milliseconds |
PG_SSL |
No | false |
Use true, false, or no-verify |
PG_ADMIN_TOKEN_TTL_SECONDS |
No | 120 |
Confirmation token lifetime in seconds |
Example
PG_HOST=localhost
PG_PORT=5432
PG_USER=postgres
PG_PASSWORD=your_password
PG_DATABASE=postgres
PG_SSL=false
PG_ADMIN_TOKEN_TTL_SECONDS=120
Claude Desktop Example
{
"mcpServers": {
"easy-pg-admin-mcp": {
"command": "npx",
"args": ["-y", "easy-pg-admin-mcp"],
"env": {
"PG_HOST": "localhost",
"PG_PORT": "5432",
"PG_USER": "postgres",
"PG_PASSWORD": "your_password",
"PG_DATABASE": "postgres",
"PG_SSL": "false",
"PG_ADMIN_TOKEN_TTL_SECONDS": "120"
}
}
}
}
Codex config.toml Example
[mcp_servers.easy-pg-admin-mcp]
args = ["-y", "easy-pg-admin-mcp"]
command = "npx"
enabled = true
[mcp_servers.easy-pg-admin-mcp.env]
PG_HOST = "localhost"
PG_PORT = "5432"
PG_USER = "postgres"
PG_PASSWORD = "your_password"
PG_DATABASE = "postgres"
PG_SSL = "false"
PG_ADMIN_TOKEN_TTL_SECONDS = "120"
OpenCode opencode.jsonc Example
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"easy-pg-admin-mcp": {
"type": "local",
"command": ["npx", "-y", "easy-pg-admin-mcp"],
"enabled": true,
"environment": {
"PG_HOST": "localhost",
"PG_PORT": "5432",
"PG_USER": "postgres",
"PG_PASSWORD": "your_password",
"PG_DATABASE": "postgres",
"PG_SSL": "false",
"PG_ADMIN_TOKEN_TTL_SECONDS": "120",
},
},
},
}
Install Easy Pg Admin in Claude Desktop, Claude Code & Cursor
unyly install easy-pg-admin-mcpInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add easy-pg-admin-mcp -- npx -y easy-pg-admin-mcpFAQ
Is Easy Pg Admin MCP free?
Yes, Easy Pg Admin MCP is free — one-click install via Unyly at no cost.
Does Easy Pg Admin need an API key?
No, Easy Pg Admin runs without API keys or environment variables.
Is Easy Pg Admin hosted or self-hosted?
A hosted option is available: Unyly runs the server in the cloud, no local setup required.
How do I install Easy Pg Admin in Claude Desktop, Claude Code or Cursor?
Open Easy Pg Admin on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
by wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashPostgres
Query your database in natural language
by AnthropicPostgreSQL
Read-only database access with schema inspection.
by modelcontextprotocolCompare Easy Pg Admin with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
