
call518/mcp-postgresql-ops 是从 https://github.com/call518/mcp-postgresql-ops. 导入的 MCP 服务器候选
概览
call518/mcp-postgresql-ops 是从 https://github.com/call518/mcp-postgresql-ops. 导入的 MCP 服务器候选
概述(AI 翻译)
架构与内部(DeepWiki)
概述
MCP-PostgreSQL-Ops 是一台专业的 MCP 服务器,用于 PostgreSQL 数据库操作、监控和管理。支持 PostgreSQL 12-18,提供全面的数据库分析、性能监控和通过自然语言查询的智能维护建议。大多数功能独立工作,但当安装 pg_stat_statements 和(可选)pg_stat_monitor 扩展时,高级查询分析能力得到增强。
特色
- ✅ 零配置:可开箱即用 PostgreSQL 12-18,并自动检测版本。
- ✅ 自然语言:问诸如“显示慢查询”或“分析表格膨胀”等问题。
- ✅ 生产安全:只读操作,RDS/Aurora 兼容普通用户权限。
- ✅ 扩展增强:可选的
pg_stat_statements和pg_stat_monitor用于高级查询分析。 - ✅ 全面数据库监控:性能分析、臃肿检测及维护建议。
- ✅ 智能查询分析:通过
pg_stat_statements和pg_stat_monitor集成实现缓慢查询识别。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP-PostgreSQL-Ops
Give Claude and other AI assistants read-only PostgreSQL observability for slow queries, locks, bloat, VACUUM, indexes, replication, WAL, and capacity.
What is MCP-PostgreSQL-Ops?
MCP-PostgreSQL-Ops lets Claude, OpenWebUI, and other MCP clients inspect a PostgreSQL server through natural-language questions. It turns requests such as “Which tables need VACUUM now?” into predefined, read-only SQL queries and returns the evidence needed to diagnose the database.
- Read-only tools: no arbitrary SQL execution or data-changing operations.
- PostgreSQL 12–18: version-specific views and columns are detected automatically.
- Useful without extensions: core monitoring works immediately;
pg_stat_statementsandpg_stat_monitoradd query analytics. - Deployment choice: install a Claude Desktop extension, run with
uvx, or connect OpenWebUI directly to the HTTP MCP server.
For an AI-generated code walkthrough, use
.
What can you ask?
Show the current active connections and blocked sessions
Which queries consume the most execution time?
Find bloated tables and explain what needs attention first
Which tables need VACUUM or autovacuum tuning?
Show unused or inefficient indexes
Check replication, WAL, checkpoints, and background processes
Summarize database size, growth, and I/O activity
Draw the relationships for the ecommerce schema
More requests to try: see Example Queries for requests by area (performance, health checks, capacity and VACUUM, structure, troubleshooting, multi-step workflows) and per-tool examples.
Core tools work with normal catalog access. Broader cross-database visibility
安装
uvx --python 3.12 mcp-postgresql-ops配置
{
"mcpServers": {
"mcp-postgresql-ops": {
"command": "uv",
"args": ["run", "python", "-m", "mcp_postgresql_ops"],
"env": {
"POSTGRES_HOST": "127.0.0.1",
"POSTGRES_PORT": "15432",
"POSTGRES_USER": "postgres",
"POSTGRES_PASSWORD": "changeme",
"POSTGRES_DB": "ecommerce"
}
}
}
}