DSH ⇄ ChatGPT Fusion Gateway

DSH ⇄ ChatGPT Fusion Gateway

Enables DeepSeek Harness agents to use ChatGPT Web as an external, stateless reasoning provider while keeping DSH as the single agent runtime.

Category
访问服务器

README

DSH ⇄ ChatGPT Fusion Gateway

A minimal MCP bridge that keeps DeepSeek Harness (DSH) as the single agent and runtime, and uses ChatGPT Web only as a stateless, single-turn reasoning provider.

DSH owns agents, tools, permissions, sessions, compaction, subagents, workflows, goals, and real file/shell execution. The gateway simply relays one immutable DSH context snapshot to a ChatGPT "Brain" conversation, and relays back exactly one decision — a final answer, one action proposal, or a bounded read-only batch. The Gateway never executes the proposed action itself.

User
 ↓
DSH UI
 ↓
DSH Native Agent Loop  →  Context / Compaction
 ↓
ChatGPT Fusion LLM Adapter
 ↓
Fusion Reasoning Gateway          ← this repository
 ↓
ChatGPT Brain Worker              (a dedicated ChatGPT Web conversation + optional wake extension)
 ↓
final | action_proposal | readonly_batch
 ↓
Gateway validation
 ↓
DSH Permissions / ToolRuntime  →  DSH Native Tool  →  Next DSH Tick

Features

  • Strict one-result reasoning contract — every request carries one complete, immutable snapshot; the Brain returns exactly one terminal result (final, action_proposal, or a bounded readonly_batch of read/glob/grep).
  • Recoverable delivery — requests are journaled to disk; a crashed Gateway restores in-flight claims instead of losing them. Retries are idempotent via snapshot + nonce.
  • Multi-worker failover — several Brain conversations can back the same model route; a stalled claim is released and re-delivered to a healthy standby with a rotated nonce.
  • OAuth 2.0 (loopback) — optional authorization for the public ChatGPT connector (/brain-mcp), with rotating access/refresh tokens.
  • Cross-platform — the gateway and Node daemon run on Linux, macOS, and Windows.
  • Optional browser wake — a Chrome extension (browser-autowake/) polls loopback queue metadata and wakes a route-bound Brain tab when work is waiting.

Requirements

  • Node.js 18+ (uses the global fetch).
  • git (and, on Linux, your configured command user) for the workspace tools.

DSH itself must be available for the DSH-native agent loop and tool runtime; the gateway detects the DSH-bundled node_modules automatically, or you can point it there with the DSH_NODE_MODULES environment variable.

Quick start

git clone <your-repo-url>
cd dsh-chatgpt-mcp
npm install

Put real credentials into config.json and model-bindings.json (all values ship as REDACTED_* placeholders), then start:

npm run daemon:start     # background, supervised with auto-restart
npm run daemon:status

…or run in the foreground:

npm start                # node server.strict.cjs

The gateway binds http://127.0.0.1:7688. Detailed architecture and invariants live in ARCHITECTURE.md.

Configuration

config.json

Key Meaning
host / port Loopback bind address (default 127.0.0.1:7688).
workspaceRoot Project workspace the tools may access. . = the project root.
ownerPassword Owner password for OAuth authorization (≥ 16 chars).
staticToken Static bearer token for the loopback Brain MCP (≥ 32 chars).
allowedPrograms Executables the workspace run_command tool may launch.
commandUser Linux-only: user the sandboxed commands drop to via setpriv.

ownerPassword, staticToken, and the binding keys are required and must be filled in before use. On macOS/Windows there is no portable setuid helper, so sandboxed commands run as the current user and commandUser is ignored.

model-bindings.json

Maps each modelId + reasoningEffort route to a bindingKey. The bindingKey is the secret shared with the matching brain-worker-*.txt; keep both in sync.

Service control

Works identically on Linux, macOS, and Windows:

node scripts/daemon.mjs start      # start detached supervisor + server
node scripts/daemon.mjs stop
node scripts/daemon.mjs restart
node scripts/daemon.mjs status

These are also exposed as npm run daemon:start|stop|restart|status. Linux-only screen-based scripts remain in scripts/ (control.sh, public_quick.sh, …) for Cloudflare quick-tunnel and the headless Chrome worker pools.

Reasoning protocol (v4)

The gateways speaks a strict protocol to the ChatGPT "Brain":

fusion_wait_for_reasoning_request  →  one immutable snapshot + data-only action catalog
fusion_submit_reasoning_result     →  exactly one {final} | {action_proposal} | {readonly_batch}
fusion_fail_reasoning_request      →  terminal failure for the assigned snapshot

actionCatalog is data only — a description of the DSH native tools, never installed as ChatGPT/MCP tools. An action_proposal is a recommendation that DSH later executes under its own permission/sandbox policy; the Gateway does not run it.

The public endpoint is GET|POST /brain-mcp. The former /mcp and /fusion/tasks… routes return HTTP 410 (disabled).

Permissions

Uses the native three-level DSH model — read-only, workspace-write, danger-full-access — with workspace-write as the default.

Repository layout

server.strict.cjs        active gateway (strict v4; no legacy /mcp)
server.cjs               full gateway incl. workspace file/shell tools
config.json              runtime configuration (secrets are placeholders)
model-bindings.json      modelId → bindingKey map
scripts/daemon.mjs       cross-platform daemon (start/stop/restart/status)
scripts/*.sh             Linux deployment helpers (screen, cloudflared, Chrome workers)
brain-worker-*.txt       per-route prompts for dedicated Brain conversations
browser-autowake/        optional Chrome extension that wakes Brain tabs
tests/                   selftests and headless integration workers
state/  logs/            runtime artifacts (gitignored)

Testing

npm install
node tests/reasoning-contract-v4-selftest.mjs   # primary protocol test
# …plus oauth, worker-recovery, failover, context-overflow, payload-limit selftests

See the ## Verification section of the implementation notes for the full matrix.

Security notes

  • Bind to 127.0.0.1 by default; only the quick-tunnel script exposes a public URL.
  • Do not commit config.json or model-bindings.json with real secrets — this repository ships placeholders for that reason.
  • /bin/setpriv is used on Linux to drop sandboxed commands to commandUser; on other platforms commands run as the current user.

DSH ⇄ ChatGPT Fusion is a community bridge and is not affiliated with or endorsed by OpenAI or DeepSeek. Use of ChatGPT is subject to OpenAI's terms of service.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选