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: postgres-mcp-readonly
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).
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 Servers
- Alicense-qualityCmaintenanceRead-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.764MIT
- AlicenseAqualityDmaintenanceA secure, read-only PostgreSQL MCP server that provides safe database introspection and querying capabilities.1412MIT
- AlicenseAqualityCmaintenanceRead-only PostgreSQL database MCP server for safely exploring schema, tables, relationships, and sample data without modification.1051MIT
- Alicense-qualityBmaintenanceRead-only MCP server for PostgreSQL, enabling schema discovery, table metadata, and safe SELECT queries via READ ONLY transactions.26MIT
Related MCP Connectors
MCP server for managing Prisma Postgres.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
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