Gcf Proxy

io.github.blackwell-systems由 GitHub 账号 blackwell-systems 发布v0.10.2更新于 Oct 24, 2026

Drop-in MCP proxy. 71% fewer tokens. Session dedup compounds to 92%. Zero code changes.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

一个可直接插入的 stdio 代理,置于任意 MCP 服务器之前,把 JSON 工具响应重新编码为紧凑的 GCF 格式以减少 token 消耗。

可以做什么
  • 包裹任意本地 MCP 服务器命令或远程 HTTP MCP 端点,原样转发其流量。
  • 将结构化的 JSON 工具响应重新编码为 GCF,并在日志中输出每次调用的字节与 token 节省量。
  • 把工具调用参数中的 GCF 字符串解码回 JSON 后再转发给上游。
  • 可选启用会话去重、响应缓存、增量更新、大小阈值和统计文件。
  • 可作为 Streamable HTTP 服务运行并提供健康检查端点,也可串联远程上游。
适用场景
适用于现有 MCP 服务器返回大量结构化 JSON、希望在既不修改服务器也不修改客户端的情况下减少输入 token 的场景。适合服务器为第三方或由其他团队维护、且可以接受一行配置改动的情况。
运行要求
以本地 stdio 进程运行,可从 npm、PyPI 或 Go 安装。需要被包裹的 MCP 服务器命令或上游 HTTP 地址。未声明任何认证、环境变量或请求头。
安装前请注意
它位于所有 MCP 流量中间,会看到每个请求和响应,包括其中携带的凭据或数据。它会重写响应并解码参数,可能改变模型或服务器看到的内容;在依赖它之前请用自己的服务器验证行为。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Playground] [Benchmarks] [License]

gcf-proxy

Bidirectional MCP proxy that translates between JSON and GCF. Drop-in, zero changes to your server or client. Works with any structured data format.

100% comprehension on every frontier model. 29% fewer tokens than TOON, 56% fewer than JSON (2,400+ evals, 11 models, 3 providers). Nested object flattening with opt-out for open-weight models. One line change in your MCP config.

Install

bash
pip install gcf-proxy                                         # PyPInpm install -g @blackwell-systems/gcf-proxy                   # npmgo install github.com/blackwell-systems/gcf-proxy@latest      # Go

Try it (30 seconds, no auth)

bash
gcf-proxy --verbose uvx yfinance-mcp

Use it with any MCP client. When tools return structured JSON, the proxy re-encodes to GCF and logs savings to stderr:

gcf-proxy: get_price_history              54.0KB -> 28.1KB (48% saved)gcf-proxy: get_ticker_info                10.0KB -> 7.4KB (26% saved)gcf-proxy: get_price_history              53.8KB -> 27.9KB (48% saved)
--- gcf-proxy session stats ---Tool calls rewritten:  3JSON bytes in:         117.8KBGCF bytes out:         63.4KBBytes saved:           54.4KB (46.2%)Est. tokens saved:     ~13.6K-------------------------------

Real live stock data from Yahoo Finance. 118KB of JSON reduced to 63KB. ~13,600 tokens saved in 3 tool calls.

Usage

Local server (stdio)

Add gcf-proxy in front of any MCP server command:

json
{  "mcpServers": {    "memory": {      "command": "gcf-proxy",      "args": ["npx", "-y", "@modelcontextprotocol/server-memory"]    }  }}

Remote server (HTTP)

Point --upstream at any Streamable HTTP MCP server:

json
{  "mcpServers": {    "remote": {      "command": "gcf-proxy",      "args": ["--upstream", "http://host:3000/mcp"]    }  }}

Supports JSON and SSE responses. Session ID tracking via Mcp-Session-Id is automatic.

Deploy as HTTP service

--http turns the proxy into a remote Streamable HTTP server:

bash
gcf-proxy --http :9090 --session your-mcp-server

Any MCP client that supports HTTP transport connects directly. Health check at /health. Chains with --upstream for fully remote deployments.

Both modes are bidirectional: server responses are encoded to GCF, GCF in tool call arguments is decoded to JSON. Neither side needs to change.

Flags

FlagDescription
--sessionEnable session dedup (bare refs for previously-transmitted symbols)
--cacheCache encoded responses for identical tool calls
--deltaSend only changed symbols when a tool's response changes slightly
--no-flattenUse expanded encoding for nested objects (open-weight models currently comprehend this form better; GCF still outperforms JSON either way)
--min-size NSkip encoding for responses smaller than N bytes (default: 100)
--stream-threshold NMin symbols before streaming mode activates (default: 5)
--stats-file PATHWrite JSON stats to file after each call
--upstream URLConnect to a remote MCP server over HTTP
--http ADDRServe MCP over Streamable HTTP
--no-progressDisable progress notifications
--verboseLog per-call savings to stderr

Responses: Server (JSON) -> LLM (GCF)

Before: {"tool":"context_for_task","symbols":[{"qualified_name":"pkg.Auth","kind":"function","score":0.78,...},...]}After:  GCF profile=graph tool=context_for_task budget=5000 tokens=1900 symbols=50 edges=20        ## targets        @0 fn pkg.Auth 0.78 lsp_resolved        ...

53-71% fewer input tokens.

Requests: LLM (GCF) -> Server (JSON)

If the LLM produces GCF in a tool call argument (63% fewer output tokens), the proxy decodes it to JSON before forwarding:

LLM sends:    {"tool": "process", "arguments": {"data": "GCF profile=generic\nname=Alice\nage=30\n"}}Server gets:  {"tool": "process", "arguments": {"data": {"name": "Alice", "age": 30}}}

Detection is a 4-byte prefix check (GCF ). Zero overhead. Non-GCF strings pass through untouched.

How it works

  1. Spawns your MCP server as a subprocess
  2. Proxies stdin/stdout between client and server
  3. Responses: intercepts JSON-RPC responses, re-encodes structured JSON as GCF
  4. Requests: scans tool call arguments for GCF strings, decodes to JSON
  5. Passes everything else through unchanged in both directions

Why not modify the server?

Sometimes you can't. The server is a third-party binary, or it's maintained by another team, or you just don't want to add a dependency. gcf-proxy gives you the token savings without touching server code.

If you control the server, use the GCF libraries directly for better control over session deduplication and delta encoding.

Benchmarks

100% general comprehension on every frontier model. 91.2% on adversarial code graphs (vs TOON 68.8%, JSON 54.1%). Wins 15/16 datasets on token benchmark.

EvalGCFTOONJSON
General comprehension100%100%100%
Adversarial code graphs (500 symbols)91.2%68.8%54.1%
Token efficiency (16 datasets)15/16 wins1/16baseline

Reproduce comprehension eval: git clone https://github.com/blackwell-systems/gcf-go && cd gcf-go/eval && GOWORK=off go test -run TestComprehension -v -timeout 0

Reproduce token benchmark: git clone https://github.com/blackwell-systems/toon && cd toon && git checkout gcf-comparison && cd benchmarks && pnpm install && pnpm benchmark:tokens

Links

More links

License

MIT - Dayna Blackwell / GCF

来源:README.md,提交 d912add

工具

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

版本历史

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

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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