网站首页 > 精选文章 正文
项目简介
提供对 PostgreSQL 数据库的只读访问功能。该服务器允许大型语言模型(LLMs)检查数据库的模式结构,并执行只读查询操作。
核心功能
- 提供对 PostgreSQL 数据库的只读访问
- 允许 LLM(大语言模型)查看数据库架构和执行只读查询
- 确保数据安全性(仅支持读操作)
配置使用方法
提供了两种配置方式:
Docker 方式
{
"mcpServers": {
"postgres": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/postgres",
"postgresql://host.docker.internal:5432/mydb"
]
}
}
}
特别说明:
- MacOS 上运行 Docker 时,如果服务器在主机网络上运行,使用 host.docker.internal
- 可以在 PostgreSQL URL 中添加用户名和密码:postgresql://user:password@host:port/db-name
NPX 方式
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
]
}
}
}
构建说明
提供了 Docker 构建命令:
docker build -t mcp/postgres -f src/postgres/Dockerfile .
相关链接
- MCP PostgreSQL: https://github.com/modelcontextprotocol/servers/tree/main/src/postgres
#MCP #PostgreSQL #NPX #Docker #SQL
猜你喜欢
- 2025-09-06 优雅映射application.yml到Java Bean的实战技巧
- 2025-09-06 ExcelVBA 操作 SQLite3 数据库实例分享
- 2025-09-06 [811]ScalersTalk成长会Java小组第4周学习笔记
- 2025-09-06 数据库工程师必学的 100 个数据库命令(全栈实操版)
- 2025-09-06 好用的开源大语言模型数据库操作工具-ToolFront
- 2025-09-06 从零开始:深入剖析 Spring Boot3 中配置文件的加载顺序
- 2025-09-06 深入理解Rust中的Arc:多线程共享数据的"聪明指针"
- 最近发表
- 标签列表
-
- 向日葵无法连接服务器 (32)
- git.exe (33)
- vscode更新 (34)
- dev c (33)
- git ignore命令 (32)
- gitlab提交代码步骤 (37)
- java update (36)
- vue debug (34)
- vue blur (32)
- vscode导入vue项目 (33)
- vue chart (32)
- vue cms (32)
- 大雅数据库 (34)
- 技术迭代 (37)
- 同一局域网 (33)
- github拒绝连接 (33)
- vscode php插件 (32)
- vue注释快捷键 (32)
- linux ssr (33)
- 微端服务器 (35)
- 导航猫 (32)
- 获取当前时间年月日 (33)
- stp软件 (33)
- http下载文件 (33)
- linux bt下载 (33)