本服务器基于模型上下文协议(Model Context Protocol)构建,可提供对 PostgreSQL 数据库的只读访问。其增强的多模式支持,能让大型语言模型(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
sql
(字符串),即要执行的 SQL 查询。该服务器为每个表提供授权架构中的模式信息:
postgres://///schema)
- 每个表的 JSON 模式信息。
- 包括列名、数据类型和类型修饰符。
- 自动从数据库元数据中发现。
- 支持多架构,带有明确的架构允许列表。
与 Claude Desktop 配置一起使用
在你的 claude_desktop_config.json
中配置 "mcpServers" 部分:
NPX
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"mcp-server-postgres-multi-schema",
"postgresql://localhost/mydb",
"public,audit"
]
}
}
}
📄 许可证
该多架构 MCP 服务器根据 MIT 许可证发布。你可以按照 LICENSE 文件中所述的条款使用、修改和分发软件。
请先 登录 后评论
您需要登录后才可以回答问题,
-
0 关注
-
0 收藏,10 浏览
-
system
提出于 2025-09-24 17:06
相似服务问题
发送私信
举报此文章