mcp-postgres
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., "@mcp-postgresshow me the indexes on 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.
mcp-postgres
Serveur MCP (Model Context Protocol) d'administration PostgreSQL — périmètre lecture + maintenance non destructive. Conçu pour brancher un assistant (Claude Code, Claude Desktop, IDE) sur une base afin de l'inspecter, la monitorer et lancer des opérations de maintenance sûres, sans jamais pouvoir écrire de données ni altérer la structure.
Périmètre
Autorisé | Interdit (aucun tool exposé) |
Introspection du schéma |
|
Monitoring / activité / verrous |
|
Statistiques & plans ( |
|
| Tout SQL modifiant des données |
|
Related MCP server: db-mcp
Défense en profondeur
Rôle SQL à moindre privilège (deploy/roles/mcp_readonly_role.sql) — rempart final.
Séparation physique des connexions lecture (READ ONLY) et maintenance (src/mcp_postgres/db/session.py).
Validateur SQL par vrai parseur (
pglast), pas de regex (src/mcp_postgres/db/guard.py).Maintenance opt-in (
MCP_MAINTENANCE_ENABLED=falsepar défaut),statement_timeout,LIMITplafonné, secrets jamais loggés.
Installation
python -m venv .venv && . .venv/Scripts/activate # Windows: .venv\Scripts\Activate.ps1
pip install -e ".[dev]"
cp .env.example .env # puis renseigner les identifiants d'un rôle à moindre privilègeLancement
# stdio (défaut) — pour un client MCP local
mcp-postgres
# ou en HTTP
MCP_TRANSPORT=http mcp-postgresIntégration Claude Code / Desktop (stdio)
{
"mcpServers": {
"postgres": {
"command": "mcp-postgres",
"env": { "PG_HOST": "localhost", "PG_USER": "mcp_readonly", "PG_PASSWORD": "..." }
}
}
}Tests
pytest # unitaires (guard, config) sans base
pytest tests/integration # intégration (nécessite Docker via testcontainers)Structure
Voir docs/capabilities.md (carte des tools/resources/prompts) et docs/security.md (points de vigilance).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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.
Related MCP Connectors
Hosted MCP server for PostgreSQL diagnostics: slow queries, missing indexes, connection pressure.
- dataOAuthco.thinair
Read-only PostgreSQL, MySQL, SQL Server access via MCP — 24 dialect-aware hosted tools.
Read-only MCP server for turva.dev, an agent-readiness audit and advisory service.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceRead-only PostgreSQL MCP server that enables running SELECT queries, listing tables and schemas, and describing columns, with built-in protection against writes and malicious SQL attacks.751MIT
- AlicenseAqualityCmaintenanceRead-only PostgreSQL database MCP server for safely exploring schema, tables, relationships, and sample data without modification.1083MIT
- AlicenseNot gradedqualityBmaintenanceRead-only MCP server for PostgreSQL, enabling schema discovery, table metadata, and safe SELECT queries via READ ONLY transactions.27MIT
- FlicenseNot gradedqualityBmaintenanceRead-only MCP server for PostgreSQL enabling schema introspection and SELECT queries via MCP clients like Claude, with multi-layered write protection.-
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/wahidianas/mcp-postgres'
If you have feedback or need assistance with the MCP directory API, please join our Discord server