Skip to main content
Glama
2025ashore

DSH ⇄ ChatGPT Fusion Gateway

by 2025ashore

DSH ⇄ ChatGPT Fusion Gateway

DeepSeek Harness(DSH)を単一のエージェント兼ランタイムとして維持し、ChatGPT Webをステートフル実行ではなく、ステートレスな単一ターンの推論プロバイダーとしてのみ使用する、最小限のMCPブリッジです。

DSHはエージェント、ツール、権限、セッション、コンパクション、サブエージェント、ワークフロー、目標、そして実際のファイル/シェル実行を所有します。GWゲートウェイは、1つの不変なDSHコンテキストスナップショットをChatGPTの「Brain」会話へ中継するだけで、返ってくるのは唯一の決定(最終回答、1つのアクション提案、または制限付きの読み取り専用バッチ)だけです。ゲートウェイ自身が提案されたアクションを実行することはありません。

本文書の内容は開発途上であり、本文書の原文での構成を保ちます。

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

特徴

  • 厳密な1結果推論コントラクト — 各リクエストには、完全かつ不変のスナップショットが1つ同梱され、Brainはfinal、action_proposal、またはread/glob/grep による制限付きreadonly_batchのいずれか1つの終端結果だけを返します。

  • 復旧可能な配信 — リクエストはディスクにジャーナルされます。クラッシュしたゲートウェイは、in-flightクレームを失うのではなく復元します。retryはスナップショット+nonceにより冪等です。

  • マルチワーカーのフェイルオーバー — 複数のBrain会話が同じモデルルートをバックアップできます。停滞したクレームは解放され、ローテーションされたnonceと共に健全な予備ワーカーへ再配信されます。

  • OAuth 2.0(loopback) — 公開されたChatGPTコネクタ(/brain-mcp)へのオプション認証で、アクセストークンとリフレッシュトークンをローテーションします。

  • クロスプラットフォーム — ゲートウェイとNodeデーモンは、Linux・macOS・Windowsで動作します。

  • オプションのブラウザウェイク — Chrome拡張機能(browser-autowake/)がループバックキューのメタデータをポーリングし、作業が待っている場合にルート紐付けのBrainタブをウェイクアップします。

Related MCP server: antigravity-with-chatgpt

要件

  • Node.js 18+(グローバルのfetchを使用します)。

  • ワークスペースツール用のgit(Linuxでは、設定済みのコマンドユーザーも利用します)。

DSH自体が、DSHネイティブのエージェントループとツールランタイムに利用可能でなければなりません。GWはDSH同梱のnode_modulesを自動的に検出します。DSH_NODE_MODULES環境変数で場所を指定することもできます。

クイックスタート

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

実際の認証情報をconfig.jsonとmodel-bindings.jsonに入力します(すべての値はREDACTED_*プレースホルダとして同梱されています)。その後、起動します:

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

…または、フォアグラウンドで実行します:

npm start                # node server.strict.cjs

ゲートウェイはhttp://127.0.0.1:7688にバインドします。詳細なアーキテクチャと不変条件はARCHITECTURE.mdにあります。

構成

config.json

Key

意味

host / port

ループバックのバインド先アドレス(既定値 127.0.0.1:7688)。

workspaceRoot

ツールがアクセスできるプロジェクトのワークスペース。.=プロジェクトのルート。

ownerPassword

OAuth認証用のオーナーパスワード(16文字以上)。

staticToken

ループバックのBrain MCP用の静的ベアラートークン(32文字以上)。

allowedPrograms

ワークスペースのrun_commandツールが起動できる実行ファイル。

commandUser

Linuxのみ:サンドボックス化したコマンドがsetprivで権限を下げるユーザー。

ownerPassword、staticToken、およびバインドキーは必須です。使用前に充填する必要があります。macOS/Windowsにはポータブルなsetuidヘルパーがないため、サンドボックス化したコマンドは現在のユーザーとして実行され、commandUserは無視されます。

model-bindings.json

各modelIdとreasoningEffortのルートをbindingKeyにマッピングします。bindingKeyは、対応するbrain-worker-*.txtと共有されるシークレットです。両者の同期を維持してください。

サービスの制御

Linux・macOS・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

これらはnpm run daemon:start|stop|restart|statusとしても公開されています。Linux専用のscreenベースのスクリプトは、Cloudflare Quick-TunnelとヘッドレスChromeワーカープール向けにscripts/ディレクトリ(control.sh、public_quick.sh、…)に残されています。

推論プロトコル (v4)

ゲートウェイは、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はデータのみです。DSHネイティブのツールの説明であり、ChatGPT/MCPツールとしてインストールされることは決してありません。action_proposalは提案だけであり、DSHが後で独自の権限・サンドボックスポリシーの下で実行します。ゲートウェイが自身で実行することはありません。

公開エンドポイントはGET|POST /brain-mcpです。旧来の/mcpと/fusion/tasks…の各ルートは、HTTP 410(ダウン)を返します。

権限

DSHネイティブの三層モデル(read-only・workspace-write・danger-full-access)を使用し、既定はworkspace-writeです。

リポジトリ構成

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)

テスト

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

テストの詳細は、実装ノートの「Verification」セクションを参照してください。

セキュリティの注意

  • 既定では127.0.0.1にバインドします。公開URLを公開するのは、クイックトンネルスクリプトのみです。

  • 実際のシークレットを含むconfig.jsonやmodel-bindings.jsonをコミットしないでください — このため、このリポジトリにはプレースホルダが同梱されています。

  • Linuxではサンドボックス化されたコマンドを/bin/setprivを使用してcommandUserに切り替え、その他のプラットフォームでは現在のユーザーとして実行されます。


DSH ⇄ ChatGPT Fusionは、コミュニティブリッジであり、OpenAIまたはDeepSeekとは提携も承認もされていません。ChatGPTの利用には、OpenAIのサービス利用規約が適用されます。

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables hosts like Claude Code, Codex, Antigravity, and Grok to dispatch work to full DeepSeek Harness agent sessions that appear as native subagents with live progress, tier/effort presets, failure escalation, and workspace-cycle guardrails. Also lends a text-only harness multimodal abilities by describing pasted images and generating images through DeepSeek's vision model, existing CLIs, or a custom endpoint.
    354 npm
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables hosts like Claude Code, Codex, Antigravity and Grok to dispatch tasks to DeepSeek Harness agents while still showing them as native subagents with live progress, tier/effort presets, escalation, dispatch guardrails and a jobs board. Also lends text-only harnesses vision and image generation through DeepSeek's VL model or existing CLIs and custom OpenAI-compatible endpoints.
    354 npm
    MIT