AI 开源雷达

call518/MCP-PostgreSQL-Ops

让 AI 用自然语言只读诊断 PostgreSQL

★ 165 协议: MIT 最近提交: 0d 传输方式: stdio / http 仓库地址 ↗

解决什么问题

没有它,AI 助手无法直接查看 PostgreSQL 的慢查询、锁、膨胀等诊断证据。

适用客户端

安装命令

docker compose up -d
docker compose ps --all  # wait for mcp-server to be healthy and init to exit 0
docker compose -f docker-compose.custom-db.yml up -d
uvx --python 3.12 mcp-postgresql-ops --type stdio

一键配置

{
  "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"
      }
    }
  }
}
{
  "mcpServers": {
    "Postgresql-A": {
      "command": "uvx",
      "args": [
        "--python",
        "3.12",
        "mcp-postgresql-ops"
      ],
      "env": {
        "POSTGRES_HOST": "a.foo.com",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASSWORD": "postgres",
        "POSTGRES_DB": "postgres"
      }
    },
    "Postgresql-B": {
      "command": "uvx",
      "args": [
        "--python",
        "3.12",
        "mcp-postgresql-ops"
      ],
      "env": {
        "POSTGRES_HOST": "b.bar.com",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASSWORD": "postgres",
        "POSTGRES_DB": "postgres"
      }
    }
  }
}
{
  "mcpServers": {
    "mcp-postgresql-ops": {
      "type": "streamable-http",
      "url": "http://your-server:8000/mcp",
      "headers": {
        "Authorization": "Bearer replace-with-a-strong-random-secret"
      }
    }
  }
}

安全标记

维护状态

最近提交2026-12-05(0d)
Star165
待处理 issue0
协议MIT
已归档否
数据抓取于2026-12-05

原文摘录

以下为仓库 README 原文,未做改写,用于核对上面的摘要。

MCP-PostgreSQL-Ops lets Claude, OpenWebUI, and other MCP clients inspect a PostgreSQL server through natural-language questions.

同类替代