一款强大的基于模型上下文协议(MCP)的工具服务器,支持通过MCP调用与PostgreSQL数据库交互,为数据库操作提供高效、便捷的解决方案。
该项目基于 FastMCP 框架构建,并借助 SQLAlchemy 和 asyncpg 库实现高效的异步数据库操作,确保在处理数据库请求时具备高效性和响应性。
asyncio,使用 asyncpg 作为高性能的异步PostgreSQL驱动。请确保已安装 Python 3.8+。推荐使用 uvx 进行安装:
uvx pgsql-mcp-server --dsn postgresql://user:password@localhost:5432/db
您可以使用官方的 MCP 检查工具,以可视化方式检查服务器提供的工具、查看其参数和描述,并执行测试调用。
npx @modelcontextprotocol/inspector uvx pgsql-mcp-server --dsn "postgresql://user:password@host:port/database"
这将启动一个本地网络服务。在浏览器中打开提供的 URL 即可开始调试。
欢迎贡献!如果您有任何改进建议、特性请求或发现任何问题,请随时:
git checkout -b feature/AmazingFeature)。git commit -m 'Add some AmazingFeature')。git push origin feature/AmazingFeature)。