Skilllibrary mcp-chatgpt-app-bridge
Connect an MCP server to ChatGPT as an MCP App or integrate with OpenAI's Codex agent. Use when building MCP servers that ChatGPT or Codex will consume, configuring OpenAI Apps SDK MCP integration, or adapting an existing MCP server for the ChatGPT/Codex host requirements.
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/07-mcp/mcp-chatgpt-app-bridge" ~/.claude/skills/merceralex397-collab-skilllibrary-mcp-chatgpt-app-bridge && rm -rf "$T"
manifest:
07-mcp/mcp-chatgpt-app-bridge/SKILL.mdsource content
Purpose
Bridge an MCP server into OpenAI's ecosystem — either as a ChatGPT MCP App (via the OpenAI Apps SDK) or as a tool source for OpenAI Codex. This covers the specific requirements, transport constraints, and configuration patterns for OpenAI hosts.
When to use this skill
- Building an MCP server intended for ChatGPT consumption
- Configuring OpenAI Codex to use MCP servers
- Adapting an existing MCP server to meet OpenAI host requirements
- Debugging MCP tool visibility or invocation issues in ChatGPT or Codex
Do not use this skill when
- The target host is Claude, VS Code, or another non-OpenAI host → use
mcp-host-integration - Building a general MCP server with no specific OpenAI integration → use
mcp-builder - The task is about OpenAI function calling (not MCP) → this skill does not cover native function calling
Operating procedure
Phase 1 — Understand the OpenAI MCP surface
OpenAI supports MCP in two contexts:
ChatGPT MCP Apps (OpenAI Apps SDK):
- MCP servers are deployed as remote Streamable HTTP endpoints
- ChatGPT discovers tools via standard MCP
tools/list - The server must support Streamable HTTP transport (not stdio)
- OAuth 2.1 is used for authentication
- The app is registered via the OpenAI developer dashboard
OpenAI Codex (CLI agent):
- Codex supports MCP servers via stdio transport (local) or Streamable HTTP (remote)
- Configuration goes in the project's
or via CLI flags.codex/config.json - Codex discovers available tools and uses them during code generation tasks
Phase 2 — Implement for the target host
For ChatGPT MCP Apps:
- Build the MCP server with Streamable HTTP transport (see
)mcp-auth-transports - Implement OAuth 2.1 auth flow (ChatGPT acts as the OAuth client)
- Deploy to a publicly accessible HTTPS endpoint
- Register the app on the OpenAI developer platform
- Declare your MCP endpoint URL and supported scopes
Key constraints for ChatGPT:
- MUST use Streamable HTTP transport (stdio not supported for remote ChatGPT apps)
- MUST implement OAuth 2.1 with Dynamic Client Registration
- Tools MUST have clear, descriptive names and descriptions (ChatGPT's model uses these for tool selection)
- Tool responses SHOULD be concise — ChatGPT has context limits
For OpenAI Codex:
Configure MCP servers in the Codex sandbox:
{ "mcpServers": { "my-server": { "command": "node", "args": ["dist/index.js"], "env": { "API_KEY": "..." } } } }
For remote servers, use the URL form:
{ "mcpServers": { "my-remote-server": { "url": "https://my-server.example.com/mcp", "headers": { "Authorization": "Bearer <token>" } } } }
Phase 3 — Validate
- For ChatGPT: Use the Apps SDK testing tools to verify tool discovery and invocation
- For Codex: Run
and verify tools appear in the tool listcodex --mcp-server my-server - Test that tool responses render correctly in the host UI
- Verify error responses include
with actionable messagesisError: true
Decision rules
- ChatGPT MCP Apps require Streamable HTTP + OAuth. No exceptions for production.
- Codex supports both stdio (local) and Streamable HTTP (remote). Default to stdio for local dev.
- Tool descriptions are critical for ChatGPT — the model selects tools based on description text. Write descriptions as if explaining the tool to a human assistant.
- Use tool annotations:
,readOnlyHint
,destructiveHint
to help the host make safe decisions.idempotentHint - Keep tool count manageable — hosts with many tools may have degraded tool selection accuracy.
Output requirements
- MCP server with correct transport for the target host
- Auth implementation matching host requirements
- Host configuration file (Codex config or Apps SDK registration)
- Verification that tools are discovered and callable from the host
Related skills
— OAuth and transport implementation detailsmcp-auth-transports
— non-OpenAI host integration patternsmcp-host-integration
— designing tools that work well across hostsmcp-tool-design
— comprehensive MCP server development guidemcp-builder
Failure handling
- If ChatGPT cannot discover tools, verify: (a) endpoint is publicly reachable, (b) CORS/Origin headers are correct, (c)
response includesinitialize
capabilitytools - If Codex cannot connect, check: (a) command path is absolute, (b) server builds without errors, (c) no stdout pollution
- If tools are discovered but invocation fails, check
validity — ChatGPT validates arguments against the schema before callinginputSchema