easy-pg-admin-mcp
This server provides high-privilege PostgreSQL administration capabilities focused on database, role, and grant management — without supporting raw SQL execution or schema/table operations.
Database Management: List, create, inspect, and change owners of PostgreSQL databases. Dropping a database requires a short-lived confirmation token.
Role Management: List, create, alter passwords/attributes, and drop PostgreSQL roles. SUPERUSER privileges are explicitly unsupported, and dropping roles requires a confirmation token.
Role Membership: Grant/revoke roles to/from other roles, and view memberships for a specific role.
Privilege Management: Grant/revoke database-level privileges to/from roles, and view grants for a role on a database.
Secure Destructive Actions:
pg_drop_databaseandpg_drop_roleare protected by short-lived, single-use confirmation tokens executed viapg_confirm_task.Safety Guarantees: No raw SQL passthrough, and no management of schemas, tables, views, indexes, triggers, or functions.
Provides tools for managing PostgreSQL databases and roles, including creating, altering, and dropping databases and roles, as well as granting and revoking privileges.
Click on "Install 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., "@easy-pg-admin-mcpcreate a role named 'analyst' without login"
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.
easy-pg-admin-mcp
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
Related MCP server: PostgreSQL MCP Server
Available Tools
Tool | Description |
| List databases in the current PostgreSQL instance |
| Create a PostgreSQL database |
| Inspect a PostgreSQL database |
| Change a database owner |
| Request database deletion and return a confirmation token |
| List PostgreSQL roles |
| Create a PostgreSQL role without SUPERUSER support |
| Change a role password |
| Change supported role attributes |
| Request role deletion and return a confirmation token |
| Grant a role to another role |
| Revoke a role from another role |
| Show memberships for a role |
| Grant database-level privileges to a role |
| Revoke database-level privileges from a role |
| Show database-level grants for a role |
| 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 OWNEDConfirmation tokens are random, single-use, and expire quickly
Configuration
Use environment variables, matching the rest of the easy-*-mcp family.
Variable | Required | Default | Description |
| Conditional | - | PostgreSQL connection string. Takes precedence when provided |
| Conditional | - | PostgreSQL host when no connection string is provided |
| No |
| PostgreSQL port |
| Conditional | - | PostgreSQL admin role name when no connection string is provided |
| No | - | PostgreSQL password |
| Conditional | - | Default database used for the admin connection |
| No |
| Maximum number of active pool connections |
| No |
| Connection establishment timeout in milliseconds |
| No |
| Idle connection timeout in milliseconds |
| No |
| Whether TCP keep-alive is enabled |
| No |
| Initial TCP keep-alive delay in milliseconds |
| No |
| Use |
| No |
| 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=120Claude 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",
},
},
},
}Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceMCP server that exposes PostgreSQL database operations via psycopg2, including connection management, query execution, and transaction control.MIT
- AlicenseAqualityCmaintenanceFull-featured MCP server that exposes 36 tools for interacting with PostgreSQL databases, covering schema introspection, query execution, data exploration, performance monitoring, security auditing, and maintenance.3611MIT
- AlicenseAqualityCmaintenanceLocal MCP server for safe querying and inspecting PostgreSQL databases, with write and maintenance operations disabled by default.8421ISC
- AlicenseAqualityDmaintenanceA secure, read-only PostgreSQL MCP server that provides safe database introspection and querying capabilities.1412MIT
Related MCP Connectors
MCP server for managing Prisma Postgres.
MCP server for interacting with the Supabase platform
Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chenkumi/easy-pg-admin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server