agr_postgres_mcp
OfficialProvides tools for interacting with PostgreSQL databases, enabling querying, schema inspection, and database administration.
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., "@agr_postgres_mcpDescribe the users table"
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.
agr_postgres_mcp
MCP server for interacting with PostgreSQL databases via psql. Designed for use with Claude Code as a Model Context Protocol (MCP) server.
Configuration
The server is configured entirely through environment variables:
Variable | Required | Default | Description |
| Yes | — | PostgreSQL hostname |
| No |
| Database username |
| Yes | — | Database password |
| Yes | — | Database name |
| No |
| Database port |
| No |
| MCP server name (used in logs and tool prefixes) |
| No | auto-detect | Full path to the |
If PSQL_PATH is not set, the server searches common locations:
/opt/homebrew/opt/postgresql@15/bin/psql/opt/homebrew/opt/postgresql@13/bin/psql/Applications/Postgres.app/Contents/Versions/15/bin/psql/Applications/Postgres.app/Contents/Versions/14/bin/psql/usr/local/bin/psql/usr/bin/psql
Related MCP server: PostgreSQL MCP Server
Tools
Tool | Description |
| Execute arbitrary SQL with configurable output format (table/csv/expanded) and timeout |
| List all tables in a schema |
| Describe a table's columns, types, constraints, and indexes ( |
| List indexes, optionally filtered by table |
| Show table sizes (data, index, total) sorted by size |
| Show live/dead tuples, last vacuum/analyze times |
| Show active database connections from |
| Show current locks with blocking information |
| Show query execution plan ( |
| Show total database size and object counts |
| Estimated row counts for all tables |
| List foreign key constraints, optionally filtered by table |
| Index scan statistics for identifying unused indexes |
| Search for tables or columns by LIKE pattern |
Setup
npm install
npm run buildMCP Configuration
Add an entry to .mcp.json for each database instance:
{
"mcpServers": {
"pg-alpha": {
"type": "stdio",
"command": "node",
"args": ["/path/to/agr_postgres_mcp/dist/index.js"],
"env": {
"PG_SERVER_NAME": "alpha",
"PG_HOST": "your-db-host.example.com",
"PG_USER": "postgres",
"PG_PASSWORD": "your-password",
"PG_DATABASE": "your-database",
"PSQL_PATH": "/path/to/psql"
}
}
}
}Multiple instances can be configured by adding additional entries with different PG_SERVER_NAME and PG_HOST values.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/alliance-genome/agr_postgres_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server