Skip to content

gproxy v4.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Nov 07:07

v4.3.0

GPROXY now fronts MCP servers, and adds the Factory Droid channel. The full gateway is native-only: Cloudflare Workers, Netlify and Vercel run the new single-tenant engine gproxy-lite, and the edge and serverless builds of the full gateway are removed. Running SSE streams receive heartbeats while they are quiet.

GPROXY 现在可以代理 MCP 服务器,并新增 Factory Droid 渠道。完整的网关只支持原生目标:Cloudflare Workers、Netlify 和 Vercel 改为运行新的单租户引擎 gproxy-lite,完整网关的 edge 与 serverless 构建已移除。流式响应静默时会收到心跳。

English

Breaking: serverless platforms run gproxy-lite

This release removes deployment targets. Native, Docker, Render and Heroku deployments are not affected; Cloudflare Workers, Netlify and Vercel deployments must be set up again before upgrading.

  • The Cloudflare Workers host (gproxy-host-edge) and its WebAssembly bundle (gproxy-edge-cloudflare.zip) are removed, together with the D1 store backend (store.kind = "d1") and the store cache backend. A migration drops that cache's tables.
  • The Cloudflare, Netlify and Vercel deployment templates and their deploy buttons are removed.
  • The gproxy-serverless executable that the Netlify and Vercel templates ran is removed, together with its release archives (gproxy-serverless-linux-<arch>-musl.zip).
  • Those platforms now run gproxy-lite, from the templates in deploy/lite. See Cloudflare Workers, Netlify, and Vercel. It has every channel, including the ones that sign in with OAuth, and every HTTP operation with protocol conversion, in a WebAssembly module of 10.7 MB (the old Workers bundle was 27 MB).
  • gproxy-lite is single-tenant and has no database. It lacks users, organizations, teams, API keys and permissions (one access key admits every request); budgets, quotas, pricing, usage records, rate limits and the audit log; several credentials per provider; routes, aliases and tiers; rewrite rules; the console and the management API; MCP; a local model catalogue and tokenizer. Its configuration is one JSON document in GPROXY_LITE_CONFIG, and its state is one key-value store per deployment: a Durable Object on Cloudflare, Netlify Blobs on Netlify, Upstash Redis on Vercel. Credentials are renewed before a request, after a 401 and on a schedule.
  • It does not read a v4.2 database. A former deployment is set up again from its providers and credentials; OAuth channels sign in again through /lite/login/start.
  • If you need what gproxy-lite lacks, move to the container deployment: Docker on your own host, or the Render or Heroku template, with PostgreSQL. See Docker, Render, and Heroku. Netlify and Vercel deployments already use PostgreSQL, so they can keep their database. The native binary does not open a D1 database, so a former Workers deployment starts on a new one.
  • The templates build from source (sh deploy/lite/build.sh); there are no deploy buttons and no prebuilt release archive yet.
  • The stateless crates gproxy-protocol, gproxy-client, gproxy-client-sdk, gproxy-upstream, gproxy-channel, gproxy-convert and gproxy-lite build for wasm32-unknown-unknown, and CI checks them on that target. The engine, the store, the app and the hosts no longer do.

MCP servers

GPROXY fronts MCP servers (Model Context Protocol, streamable HTTP) the way it fronts model providers. See MCP servers.

  • An administrator registers a server as a provider with the channel mcp and its endpoint as the base URL. Users, teams and organizations sign in to it with OAuth, a pasted secret or nothing; GPROXY keeps the sign-in alive. A tool call never uses another person's credential.
  • A client needs only a URL and a gateway API key. A client that cannot do OAuth itself needs no change.
  • Two addresses: /connect/mcp/<name> is one server with its own tool names, and /connect/mcp aggregates every server the caller can use, with tools named <server>__<tool>; ?servers=a,b narrows it.
  • Scopes restrict tools: mcp:<server>:<tool>, with * in either position and @read, @write or @destructive in place of a tool. MCP is allowed by default; a user or key with no MCP rule may use every server it can see a credential for. Model permission rules do not apply to MCP.
  • Every tool call is written to the audit trail as mcp.tools.call.
  • An OAuth access token issued by GPROXY needs the scope gproxy:mcp.
  • Limits: only tools are proxied, not prompts or resources. Every answer is one JSON body, with no SSE or GET stream towards clients, and progress notifications are dropped. Server-initiated requests work only as input_required results when both sides speak MCP 2026-07-28. A server without dynamic client registration cannot be signed in to with OAuth. A server's tool list is cached for 5 minutes.

Channels

  • New channel factory: Factory Droid (https://api.factory.ai), with a Factory API key or the CLI's WorkOS device login. Claude Messages, Responses, Chat Completions and Gemini are served on one origin and chosen per model. The Standard and Droid Core usage windows are shown on the credential. Factory checks tool names and the system prompt against its usage policy, so the channel adds the Droid identity line to the system prompt and sends tool names in an encoded form, decoding them back in the response.
  • Converting to Chat for GPT-6 models with reasoning enabled no longer removes tools, tool_choice, parallel_tool_calls, functions and function_call. The check matched on the model name, so compatible third-party Chat endpoints lost every tool as well.
  • An OpenAI Responses image_generation_call item without a result field, as OpenRouter and items that have only begun send it, is read as result: null instead of failing.
  • Claude Code no longer lists spent rate-limit reset grants that can no longer be redeemed, as the CLI does.

Streams

  • A streaming generation response that goes quiet for 15 seconds, for example while a model thinks between two summarized thinking blocks, now receives a heartbeat, so a client or reverse proxy with a short idle timeout does not close the connection. Before, heartbeats were sent only while a buffered upstream result was pending.
  • The heartbeat is the one each protocol already used: a ping event for Claude, an SSE comment line for OpenAI Chat, Responses and Gemini Interactions, a blank line for Gemini alt=sse. It is sent only between two events, and is not counted in usage or recorded in captures. Gemini JSON-array streams and WebSocket connections are unchanged.

Quotas

  • Changing a credential's cap_percent releases the windows the new cap no longer exhausts. Before, a window blocked at its cap stayed blocked until it reset, so raising the cap or clearing it left the credential unusable.

Console

  • The variant presets gain the missing tiers: OpenAI reasoning minimal and max, the ultrafast service tier, and Gemini thinking XHIGH. The -fast preset sends service_tier: fast instead of priority.
  • The credential usage page no longer has its own refresh button in the header.

Packages

  • HarmonyOS application: the launcher entry is named after the app, privacy consent is asked for on first launch (declining quits), the icon has an opaque background, and the system back gesture closes dialogs and steps back through console history.

Developers

  • The account side of a channel (provider and credential views, sign-in, refresh, state, caller identity) moved from gproxy-channel to the new crate gproxy-upstream, with OAuth for a protected resource (discovery, dynamic client registration, PKCE, refresh). The new gproxy-mcp crate builds on it.
  • Renames: ChannelError is UpstreamError, OperationFuture is UpstreamFuture, ChannelState is UpstreamState; ConfigKey and ConfigKeyKind moved with them, unchanged.
  • BaseChannel is now UpstreamKind plus the model side. id and the account-side methods (validate_credential_secret, default_connection, credential_refresh, the OAuth accessors and the rest) are in gproxy_upstream::UpstreamKind.
  • The ingress path table (from gproxy-host-axum), the default passthrough-or-convert routing, the native endpoints, request preparation and the conversion drivers (from gproxy-core) moved to the new stateless crate gproxy-convert, which gproxy-core and gproxy-lite both use. The drivers run over a Host: an upstream, a state store and resource access.
  • gproxy_core::convert keeps the same public items, re-exported. gproxy_core::form is gproxy_convert::form, whose functions return FormError rather than CoreError.
  • PKCE and reading a pasted callback moved from gproxy-sdk to gproxy_upstream::login; gproxy_sdk::login::pasted_code is gproxy_upstream::login::pasted_code.
  • Out-of-tree channel plugins: add gproxy-upstream as a dependency, split the impl into impl UpstreamKind and impl BaseChannel, and import the moved items from gproxy_upstream. The edge crate of examples/channel-plugin is removed; the channel and native crates are unchanged. See Adding a channel.

简体中文

不兼容变更:serverless 平台改为运行 gproxy-lite

本次移除了部分部署目标。原生、Docker、Render 和 Heroku 部署不受影响;Cloudflare Workers、Netlify 和 Vercel 部署需要在升级前重新配置。

  • 移除 Cloudflare Workers 宿主(gproxy-host-edge)及其 WebAssembly 包(gproxy-edge-cloudflare.zip),同时移除 D1 存储后端(store.kind = "d1")和 store 缓存后端。一个迁移会删除该缓存的表。
  • 移除 Cloudflare、Netlify 和 Vercel 的部署模板及对应的部署按钮。
  • 移除 Netlify 和 Vercel 模板所运行的 gproxy-serverless 可执行文件及其发布包(gproxy-serverless-linux-<arch>-musl.zip)。
  • 这些平台现在运行 gproxy-lite,使用 deploy/lite 中的模板。见 Cloudflare Workers、Netlify 与 Vercel。它包含全部渠道(包括通过 OAuth 登录的渠道)和全部 HTTP 操作,带协议转换,WebAssembly 模块大小为 10.7 MB(原先的 Workers 包为 27 MB)。
  • gproxy-lite 是单租户的,不带数据库。它没有用户、组织、团队、API Key 和权限(一把访问密钥放行所有请求);没有预算、配额、计价、用量记录、限流和审计记录;每个供应商不能有多把凭证;没有路由、别名和层级;没有重写规则;没有控制台和管理 API;没有 MCP;没有本地模型目录和 tokenizer。配置是 GPROXY_LITE_CONFIG 中的一个 JSON 文档,状态放在每个部署的一个键值存储中:Cloudflare 上是 Durable Object,Netlify 上是 Netlify Blobs,Vercel 上是 Upstash Redis。凭证在请求前、收到 401 后以及定时续期。
  • 它不读取 v4.2 的数据库。原有部署需要按其供应商和凭证重新配置;OAuth 渠道通过 /lite/login/start 重新登录。
  • 需要 gproxy-lite 没有的功能时,请改用容器部署:在自己的主机上运行 Docker,或使用 Render、Heroku 模板,数据库用 PostgreSQL。见 Docker、Render 与 Heroku。Netlify 和 Vercel 部署本来就使用 PostgreSQL,可以保留原有数据库。原生程序不能打开 D1 数据库,原先的 Workers 部署需要换用新的数据库。
  • 模板从源码构建(sh deploy/lite/build.sh);目前没有部署按钮,也没有预构建的发布包。
  • 无状态的 crate gproxy-protocol、gproxy-client、gproxy-client-sdk、gproxy-upstream、gproxy-channel、gproxy-convert 和 gproxy-lite 可以为 wasm32-unknown-unknown 构建,CI 会在该目标上检查它们;引擎、store、app 和各宿主不再支持该目标。

MCP 服务器

GPROXY 可以像代理模型供应商一样代理 MCP 服务器(Model Context Protocol,streamable HTTP)。见 MCP 服务器。

  • 管理员把服务器注册为 mcp 渠道的供应商,base URL 填服务器的端点。用户、团队和组织通过 OAuth、粘贴密钥或无认证方式登录,登录状态由 GPROXY 维持。工具调用不会使用他人的凭证。
  • 客户端只需要一个 URL 和一把网关 API Key。自己不支持 OAuth 的客户端无需改动。
  • 两个地址:/connect/mcp/<name> 是单台服务器,工具保持原名;/connect/mcp 聚合调用方可用的所有服务器,工具名为 <server>__<tool>,?servers=a,b 可以缩小范围。
  • 用 scope 限制工具:mcp:<server>:<tool>,两个位置都可以写 *,工具位置可以写 @read、@write 或 @destructive。MCP 默认允许:没有 MCP 规则的用户或密钥可以使用它能看到凭证的每一台服务器。模型的权限规则不用于 MCP。
  • 每次工具调用都以 mcp.tools.call 写入审计记录。
  • GPROXY 签发的 OAuth 访问令牌需要带有 scope gproxy:mcp。
  • 限制:只代理工具,不代理 prompts 和 resources。每个响应都是一个 JSON 正文,面向客户端没有 SSE 流和 GET 流,进度通知会被丢弃。服务器发起的请求只在双方都使用 MCP 2026-07-28 时以 input_required 结果的形式支持。不支持动态客户端注册的服务器无法通过 OAuth 登录。服务器的工具列表缓存 5 分钟。

渠道

  • 新渠道 factory:Factory Droid(https://api.factory.ai),使用 Factory API Key 或 CLI 的 WorkOS 设备码登录。Claude Messages、Responses、Chat Completions 和 Gemini 在同一个源上提供,按模型选择。凭证上显示 Standard 和 Droid Core 用量窗口。Factory 会按使用政策检查工具名和系统提示,因此渠道会在系统提示中加入 Droid 身份行,并以编码形式发送工具名,在响应中再解码回来。
  • 为启用推理的 GPT-6 模型转换为 Chat 时,不再移除 tools、tool_choice、parallel_tool_calls、functions 和 function_call。此前的判断只看模型名,兼容的第三方 Chat 端点也会丢失全部工具。
  • OpenAI Responses 中不带 result 字段的 image_generation_call 条目(OpenRouter 和刚开始生成的条目会这样发送)按 result: null 读取,不再报错。
  • Claude Code 不再列出已用完、无法再兑换的限额重置机会,与 CLI 一致。

流式响应

  • 流式生成响应静默 15 秒时(例如模型在两段思考摘要之间思考),现在会发送心跳,空闲超时较短的客户端或反向代理不会因此断开连接。此前只在等待非流式上游结果时发送心跳。
  • 心跳沿用各协议原有的格式:Claude 为 ping 事件,OpenAI Chat、Responses 和 Gemini Interactions 为 SSE 注释行,Gemini alt=sse 为空行。心跳只在两个事件之间发送,不计入用量,也不写入抓包记录。Gemini 的 JSON 数组流和 WebSocket 连接不受影响。

额度

  • 修改凭证的 cap_percent 后,新上限下不再算耗尽的窗口会立即解除。此前达到上限而被阻止的窗口要等到重置才解除,调高或清除上限后凭证仍然不可用。

控制台

  • 变体预设补上了缺少的档位:OpenAI 推理的 minimal 和 max、ultrafast 服务层级,以及 Gemini 思考的 XHIGH。-fast 预设改为发送 service_tier: fast,不再是 priority。
  • 凭证用量页面去掉了标题栏中单独的刷新按钮。

安装包

  • HarmonyOS 应用:启动器名称改为应用名,首次启动时请求隐私同意(拒绝则退出),图标改为不透明背景,系统返回手势会关闭对话框并在控制台历史中后退。

开发者

  • 渠道的账户侧(供应商与凭证视图、登录、刷新、状态、调用方身份)从 gproxy-channel 移到新的 crate gproxy-upstream,并支持受保护资源的 OAuth(发现、动态客户端注册、PKCE、刷新)。新的 gproxy-mcp crate 建立在它之上。
  • 改名:ChannelError 改为 UpstreamError,OperationFuture 改为 UpstreamFuture,ChannelState 改为 UpstreamState;ConfigKey 和 ConfigKeyKind 也一并移入,内容不变。
  • BaseChannel 现在是 UpstreamKind 加模型侧。id 和账户侧的方法(validate_credential_secret、default_connection、credential_refresh、OAuth 访问器等)位于 gproxy_upstream::UpstreamKind。
  • 入口路径表(原在 gproxy-host-axum)、默认的透传或转换路由、原生端点、请求准备和转换驱动(原在 gproxy-core)移到新的无状态 crate gproxy-convert,gproxy-core 和 gproxy-lite 都使用它。驱动运行在 Host 之上:上游、状态存储和资源访问。
  • gproxy_core::convert 的公开项不变,改为重新导出。gproxy_core::form 即 gproxy_convert::form,其函数返回 FormError 而不是 CoreError。
  • PKCE 和读取粘贴的回调从 gproxy-sdk 移到 gproxy_upstream::login;gproxy_sdk::login::pasted_code 改为 gproxy_upstream::login::pasted_code。
  • 仓库外的渠道插件:添加 gproxy-upstream 依赖,把 impl 拆成 impl UpstreamKind 和 impl BaseChannel,并从 gproxy_upstream 导入移走的类型。examples/channel-plugin 的 edge crate 已移除,channel 和 native 两个 crate 不变。见新增渠道。

Built once by GitHub Actions. CLI (gproxy-*) and Application (gproxy-tauri-*) packages are separate.