Go 实现的零负担 Postgres MCP 服务器
用于与 PostgreSQL 交互的零负担、开箱即用的模型上下文协议 (MCP) 服务器,支持自动化和多语言。
快速入门
-
安装
- 下载最新版本 release,或使用 Go 安装: go install -v github.com/guoling2008/go-mcp-postgres@latest
-
运行
- 使用 stdio 模式: { "mcpServers": { "postgres": { "command": "go-mcp-postgres", "args": [ "--dsn", "postgresql://user:pass@host:port/db" ] } } }
- 或使用 sse 模式: ./go-mcp-postgres --t sse --ip x.x.x.x --port nnnn --dsn postgresql://user:pass@host:port/db --lang en
-
工具
- 列出数据库:
list_database
- 创建表:
create_table
- 查询数据:
read_query
- 更新数据:
update_query
- 删除数据:
delete_query
- 列出数据库:
-
可选参数
--lang
:设置语言(en/zh-CN)--read-only
:启用只读模式--with-explain-check
:禁用查询计划检查