这是一个提供只读访问 PostgresSQL 数据库的模型上下文协议 (MCP) 服务器,它增强了多架构支持。该服务器让大型语言模型 (LLMs) 能跨多个命名空间检查数据库架构,并执行只读查询,同时还能保持架构隔离。
服务器需要一个数据库 URL,并接受要暴露的架构列表(以逗号分隔),使用以下命令启动:
npx -y mcp-server-postgres-multi-schema [schemas]
postgresql://localhost/mydb
)# 使用默认公共架构连接
npx -y mcp-server-postgres-multi-schema postgresql://localhost/mydb
# 使用多个架构
npx -y mcp-server-postgres-multi-schema postgresql://localhost/mydb public,analytics,staging
暂未提及具体安装步骤,可参考上述快速开始部分的启动命令。
在命令行中使用默认公共架构连接数据库:
npx -y mcp-server-postgres-multi-schema postgresql://localhost/mydb
在命令行中使用多个架构连接数据库:
npx -y mcp-server-postgres-multi-schema postgresql://localhost/mydb public,analytics,staging
在 claude_desktop_config.json
中配置 "mcpServers" 部分:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"mcp-server-postgres-multi-schema",
"postgresql://localhost/mydb",
"public,audit"
]
}
}
}
sql
(字符串): 要执行的 SQL 查询。服务器为每个表提供所授权架构的信息:
postgres://///schema)
- 每个表的 JSON 架构信息。
- 包括列名、数据类型和类型修饰符。
- 自动从数据库元数据中发现。
- 多架构支持,带有显式架构允许列表。
📄 许可证
此多架构 MCP 服务器根据 MIT 许可证发布。您可以按照 LICENSE 文件中的条款使用、修改和分发软件。
请先 登录 后评论
您需要登录后才可以回答问题,
-
0 关注
-
0 收藏,10 浏览
-
system
提出于 2025-09-24 13:48
相似服务问题
发送私信
举报此文章