pREST

io.github.prest由 GitHub 账号 prest 发布v0.1.3更新于 Oct 24, 2026

Stdio MCP adapter bridging AI clients to pREST’s HTTP /_mcp endpoint for PostgreSQL APIs.

已验证STDIO仅桌面数据库开发者工具

概览

AI 生成的概览

一个 stdio 桥接器,让 MCP 客户端连接到正在运行的 pREST 实例的 HTTP MCP 端点,以访问 PostgreSQL API。

可以做什么
该适配器是一个小型传输桥接:它通过 stdio 与 MCP 客户端交换以换行分隔的 JSON-RPC 消息,并以 HTTP POST 将请求转发到 pREST 实例的 /_mcp 端点。它本身不解析数据库结构、不生成 SQL,也不实现 MCP 工具,这些能力都在 pREST 中。日志只写入 stderr。
适用场景
当你的 MCP 客户端或 AI IDE 只支持 stdio 服务器,而你想对接一个已经暴露 HTTP MCP 端点的 pREST 实例时使用。若没有正在运行的 pREST 部署,它本身没有用处。
运行要求
需要一个正在运行且提供 /_mcp 路由的 pREST 实例,并设置必需的环境变量 PREST_MCP_URL 指向该端点。可选:在启用 pREST 认证时设置 PREST_MCP_TOKEN,以及 PREST_MCP_TIMEOUT_MS(默认 30000)。以本地进程方式运行;可用 Go 1.26+ 从源码安装,或拉取 OCI 镜像。
安装前请注意
该适配器能访问 pREST 端点所允许的一切,因此写操作取决于 pREST 背后的数据库用户;除非明确需要写权限,建议使用只读的 PostgreSQL 用户。不要将未认证的 MCP 端点公开暴露,优先使用本地或私有网络端点。PREST_MCP_TOKEN 是 bearer 凭据(启用 pREST 认证时为 JWT),应妥善保密。

安装

在 SourceWeft 中

  1. 打开 控制台中的 pREST,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

pREST MCP Adapter

Official stdio adapter for pREST’s HTTP MCP endpoint.

This adapter lets MCP clients that require stdio connect to a running pREST instance exposing an HTTP MCP endpoint at /_mcp.

text
MCP client / AI IDE        ↓ stdio (NDJSON JSON-RPC)prest-mcp        ↓ HTTP POSThttp://localhost:3000/_mcp        ↓pREST

The adapter is a tiny transport bridge. It does not introspect schemas, generate SQL, or implement MCP tools. Those live in pREST.

Requirements

  • A running pREST instance with the /_mcp route available
  • Go 1.26+ (to build from source)

Environment variables

VariableRequiredDefaultDescription
PREST_MCP_URLyes—URL of the pREST HTTP MCP endpoint, e.g. http://localhost:3000/_mcp
PREST_MCP_TOKENno—Bearer token when pREST auth is enabled
PREST_MCP_TIMEOUT_MSno30000HTTP timeout in milliseconds

Install

From source

bash
go install github.com/prest/prest-mcp-adapter/cmd/prest-mcp@latest

Docker / OCI

bash
docker pull ghcr.io/prest/prest-mcp-adapter:0.1.3

Local usage

bash
PREST_MCP_URL=http://localhost:3000/_mcp prest-mcp

With token

bash
PREST_MCP_URL=https://api.example.com/_mcp \PREST_MCP_TOKEN=secret \prest-mcp

Docker usage

bash
docker run --rm -i \  -e PREST_MCP_URL=http://host.docker.internal:3000/_mcp \  ghcr.io/prest/prest-mcp-adapter:0.1.3

MCP client configuration

Cursor

Add to your MCP settings (e.g. .cursor/mcp.json):

json
{  "mcpServers": {    "prest": {      "command": "prest-mcp",      "env": {        "PREST_MCP_URL": "http://localhost:3000/_mcp"      }    }  }}

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "prest": {      "command": "prest-mcp",      "env": {        "PREST_MCP_URL": "http://localhost:3000/_mcp"      }    }  }}

Generic MCP client

Any client that can launch a stdio MCP server:

bash
PREST_MCP_URL=http://localhost:3000/_mcp prest-mcp

Protocol messages are newline-delimited JSON-RPC on stdin/stdout. Logs go only to stderr.

Security recommendation

Use a read-only PostgreSQL user for AI/MCP workflows unless write access is explicitly required.

Do not expose unauthenticated MCP endpoints publicly.

Prefer local or private-network pREST MCP endpoints.

When pREST auth is enabled, set PREST_MCP_TOKEN to a valid JWT.

Development

bash
make test       # go test -race ./... and overall coverage >= 80%make coverage   # coverage gate onlymake vetmake build      # writes bin/prest-mcp

License

MIT — see LICENSE.

来源:README.md,提交 f35ab01

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分