MCPg : Production Grade Postgresql Mcp Server
@devopam
关于 MCPg : Production Grade Postgresql Mcp Server
A safe-by-default PostgreSQL Model Context Protocol server for AI agents.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mcpg": {
"command": "uvx",
"args": [
"mcpg"
],
"env": {
"MCPG_DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is MCPg?
MCPg is a production-grade MCP server for PostgreSQL that provides AI agents with over 100 tools for schema introspection, natural-language-to-SQL, query optimization, index tuning, performance analysis, multi-tenancy operations, and DBA tasks, prioritizing safety.
How to use MCPg?
Install via pip install mcpg or Docker. Configure connection settings and choose a transport: stdio for Claude Desktop, or HTTP/SSE/Streamable HTTP. Connect any MCP client to start using the tools.
Key features of MCPg
- Safety-first design: read-only by default, AST validation, strict sanitization
- Broad PostgreSQL support: pgvector, TimescaleDB, PostGIS, Apache AGE
- Production ready: connection pooling, SET ROLE multi-tenancy, read-replica routing
- Prometheus metrics and structured audit logging with redaction
- Multiple transports: stdio, HTTP, SSE, Streamable HTTP
- Easy install: pip or Docker with OIDC + static auth and rate limiting
Use cases of MCPg
- AI-assisted schema exploration and database introspection
- Natural language to SQL query generation and optimization
- Automated index tuning and performance analysis
- Multi-tenant database operations with role isolation
- Production DBA tasks with safety guards
FAQ from MCPg
What tools does MCPg provide?
Over 100 tools covering schema introspection, natural-language-to-SQL, query optimization, index tuning, performance analysis, multi-tenancy operations, and DBA tasks.
How does MCPg ensure safety?
It is read-only by default, performs AST validation on all SQL, strictly sanitizes identifiers, and requires opt-in gates for DDL, shell commands, and LISTEN operations.
What transports are supported?
MCPg supports stdio (for Claude Desktop), HTTP, Server-Sent Events (SSE), and Streamable HTTP.
Is MCPg production ready?
Yes, it includes connection pooling, SET ROLE multi-tenancy, read-replica routing, Prometheus metrics, structured audit logging, OIDC + static authentication, and rate limiting.
What are the runtime requirements?
Python (psycopg3 driver), a PostgreSQL database, and optional extensions like pg_stat_statements for performance features.
数据库 分类下的更多 MCP 服务器
mcp_mysql_server
wenb1n-devModel Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展

Redis
modelcontextprotocolModel Context Protocol Servers
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
Neon MCP Server
neondatabaseMCP server for interacting with Neon Management API and databases
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
评论