-
securityF
license-
qualityA Model Context Protocol server providing both read and write access to PostgreSQL databases, enabling LLMs to query data, modify records, and manage database schemas.
Last updated -
141
7
JavaScript
PostgreSQL 的模型上下文协议 (MCP) 服务器实现,提供通过 MCP 与 PostgreSQL 数据库交互的简单接口。
.env
文件:MCP 服务器提供以下端点:
sql_query
运行 SELECT 查询并以 JSON 形式返回结果。
参数:
query
:SQL 查询字符串params
:查询参数的可选 JSON 字符串(列表或字典)例子:
sql_execute
执行 INSERT/UPDATE/DELETE 语句。
参数:
query
:SQL语句params
:查询参数的可选 JSON 字符串(列表或字典)例子:
create_database
创建一个新的 PostgreSQL 数据库。
参数:
database_name
:要创建的数据库的名称create_or_update_table
创建或更新表模式。
参数:
sql
:CREATE TABLE 或 ALTER TABLE SQL 语句debug_postgres_connection
调试 PostgreSQL 连接。
多变的 | 默认 | 描述 |
---|---|---|
PG_HOST | 本地主机 | PostgreSQL 主机 |
PG_PORT | 5432 | PostgreSQL 端口 |
PG_用户 | PostgreSQL | PostgreSQL 用户名 |
PG_密码 | PostgreSQL 密码 | |
PG_数据库 | PostgreSQL | 默认数据库名称 |
主持人 | 0.0.0.0 | 绑定 MCP 服务器的主机 |
港口 | 8056 | 运行 MCP 服务器的端口 |
有关详细的 API 文档,请参阅OpenAPI 规范。
欢迎贡献代码!欢迎提交 Pull 请求。
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议服务器实现提供了一个简单的接口来与 PostgreSQL 数据库交互,通过 MCP 实现 SQL 查询、数据库操作和模式管理。
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/asadudin/mcp-server-postgres'
If you have feedback or need assistance with the MCP directory API, please join our Discord server