
MCP Postgres Server

2025.03.01
0
JavaScript数据库服务PostgreSQL 管理数据库
MCP Postgres Server 是一个实现了 MCP (Model Context Protocol) 协议的服务,专为 Cursor 设计,允许使用 PostgreSQL 数据库作为模型上下文的存储。该服务提供了与 PostgreSQL 数据库交互的工具集,使得用户能够安全地探索和查询数据库。
View on GitHub
Overview
基本能力
产品定位
MCP Postgres Server 是一个数据库服务,旨在通过 MCP 协议为 Cursor 提供 PostgreSQL 数据库的访问和管理能力。
核心功能
- 实现 MCP 协议,支持 PostgreSQL 数据库作为模型上下文的存储。
- 提供以下工具集:
postgres_query
: 执行只读 SQL 查询。postgres_list_tables
: 列出数据库中的所有表。postgres_describe_table
: 获取特定表的架构信息。
适用场景
- 在 Cursor 中安全地探索和查询 PostgreSQL 数据库。
- 需要将 PostgreSQL 数据库作为模型上下文存储的场景。
常见问题解答
- 问题: 服务器无法正常启动。
- 解决方案: 检查容器日志 (
docker logs mcp-postgres-server
) 或重启服务器 (docker-compose restart
)。
使用教程
使用依赖
- Docker
- Docker Compose
安装教程
- 克隆仓库。
- 使用 Docker Compose 启动服务器:
bash docker-compose up -d
配置 Cursor
- 打开 Cursor。
- 进入 设置 > MCP。
- 添加新连接,配置如下:
- 名称: MCP Postgres Server
- 类型: command
- 命令:
docker exec -i mcp-postgres-server node dist/index.js
调试方式
- 检查容器日志:
bash docker logs mcp-postgres-server
- 重启服务器:
bash docker-compose restart
许可证
None