gpt-subagents-api
Enables Claude to delegate tasks to OpenAI expert models (GPT-5.3-Codex and GPT-5.5) as subagents, with orchestration patterns for safe and effective use.
README
gpt-subagents-api
An MCP server that lets Claude Code delegate to OpenAI "expert" models as subagents — and ships a small, extensible library of orchestration patterns that teach the calling agent how to use those experts well.
Claude orchestrates; GPT gives a second opinion from a different model family (different blind spots). The patterns make that second opinion parallel, context-cheap, and ground-truth-checked.
The subagent tool
There's one tool — ask_gpt. You choose the model, write the instructions (its system
prompt), supply a prompt, and optionally set reasoning_effort and context.
There's no separate "worker" and "architect" tool: that distinction is just which orchestration pattern you apply, plus the model and effort you pick —
| Role | How | Pattern |
|---|---|---|
| Worker — routine coding, patches, debugging, tests, repo inspection | ask_gpt with a fast model (e.g. gpt-5.3-codex) |
worker-orchestrator |
| Architect — hard reasoning, architecture, security / threat modeling, review of large/high-risk changes | ask_gpt with a strong model (e.g. gpt-5.5) + reasoning_effort: "high" |
two-layer-cross-model-expert |
model, instructions, and prompt are required (any valid OpenAI model id is accepted — the server
hardcodes none). Inbound instructions, prompt, and context are run through a sanitizeContext
pass that redacts obvious secrets before they leave your machine — a backstop, not a guarantee; avoid
pasting secrets.
Orchestration patterns
Patterns are reusable playbooks (Markdown files in patterns/) that describe how to
drive the expert tools — splitting work, bundling context, calling the expert, verifying its
output against ground truth, and aggregating results.
Two tools expose them to the agent:
list_patterns— catalog of every pattern (name, title, summary, when to use).get_pattern("<name>")— the full text of one pattern.
Patterns are read from disk at call time, so adding or editing one needs no rebuild. The
server's startup instructions nudge the agent to consult patterns before any non-trivial
ask_gpt work — or any review, audit, or large-document analysis.
Shipped patterns
| name | what it does |
|---|---|
two-layer-cross-model-expert |
Wrap the GPT expert in verifying Claude subagents so the orchestrator only ever sees parallel, context-cheap, ground-truth-checked conclusions. |
worker-orchestrator |
Fan concrete work out to the GPT worker through cheap Sonnet wrapper subagents — validated by execution, not a verification gate. |
Both patterns ship a rendered, styled diagram under
patterns/html/ — open one in a browser for the visual walkthrough.
See patterns/README.md to add your own.
Setup
Requirements: Node 18+ and an OpenAI API key.
# 1. Install dependencies
npm install
# 2. Add your key (this file is gitignored and must never be committed)
cp .env.example .env
# then edit .env and set OPENAI_API_KEY=sk-...
# 3. Build
npm run build
This compiles to dist/. The server loads .env from the project root (one level up from
dist/server.js), or falls back to an inherited OPENAI_API_KEY in the environment.
Register with Claude Code
claude mcp add gpt-subagents-api -- node /absolute/path/to/gpt-subagents-api/dist/server.js
Or add it to your MCP client config manually:
{
"mcpServers": {
"gpt-subagents-api": {
"command": "node",
"args": ["/absolute/path/to/gpt-subagents-api/dist/server.js"]
}
}
}
Once connected, the server advertises three tools: ask_gpt, list_patterns, and get_pattern.
Project layout
gpt-subagents-api/
├── server.ts # MCP server: the ask_gpt tool + server instructions
├── gptAgents.ts # The OpenAI call (ask_gpt) and secret sanitization
├── patterns.ts # Loads/parses pattern Markdown from patterns/
├── patterns/ # Orchestration patterns (one Markdown file each)
│ ├── README.md
│ ├── two-layer-cross-model-expert.md
│ └── worker-orchestrator.md
├── .env.example # Placeholder; copy to .env (gitignored)
└── dist/ # Build output (gitignored)
Security notes
.envis gitignored and never tracked — only the.env.exampleplaceholder is committed. Local agent/editor state (.mempalace/,.claude/,CLAUDE.local.md, IDE folders) is gitignored too, so dev-environment data doesn't leak into the repo.sanitizeContextredactssk-…keys andOPENAI_API_KEY=/ANTHROPIC_API_KEY=assignments from outbound context. It's a backstop, not a guarantee — keep secrets out of prompts.- Verify expert output against ground truth. The
two-layer-cross-model-expertpattern is the recommended way to driveask_gpt(architect-style) so its output is checked before you act on it.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。