OpenAI Docs
Provide authoritative, current guidance from OpenAI developer docs using the developers.openai.com MCP server. Always prioritize the developer docs MCP tools over web.run for OpenAI-related questions. Only if the MCP server is installed and returns no meaningful results should you fall back to web search.
Quick start
- Use
mcp__openaiDeveloperDocs__search_openai_docs to find the most relevant doc pages.
- Use
mcp__openaiDeveloperDocs__fetch_openai_doc to pull exact sections and quote/paraphrase accurately.
- Use
mcp__openaiDeveloperDocs__list_openai_docs only when you need to browse or discover pages without a clear query.
OpenAI product snapshots
- Apps SDK: Build ChatGPT apps by providing a web component UI and an MCP server that exposes your app's tools to ChatGPT.
- Responses API: A unified endpoint designed for stateful, multimodal, tool-using interactions in agentic workflows.
- Chat Completions API: Generate a model response from a list of messages comprising a conversation.
- Codex: OpenAI's coding agent for software development that can write, understand, review, and debug code.
- gpt-oss: Open-weight OpenAI reasoning models (gpt-oss-120b and gpt-oss-20b) released under the Apache 2.0 license.
- Realtime API: Build low-latency, multimodal experiences including natural speech-to-speech conversations.
- Agents SDK: A toolkit for building agentic apps where a model can use tools and context, hand off to other agents, stream partial results, and keep a full trace.
If MCP server is missing
If MCP tools fail or no OpenAI docs resources are available:
In Codex:
- Run:
codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp
- If it fails due to permissions/sandboxing, retry with escalated permissions.
- Ask the user to restart Codex, then re-run doc search/fetch.
In Claude Code:
- Add the MCP server to
~/.claude/settings.json under "mcpServers":{
"mcpServers": {
"openaiDeveloperDocs": {
"type": "url",
"url": "https://developers.openai.com/mcp"
}
}
}
- Restart Claude Code, then re-run doc search/fetch.
In other agents: Ask the user to configure the MCP server per their agent's documentation.
Workflow
- Clarify the product scope (Codex, OpenAI API, or ChatGPT Apps SDK) and the task.
- Search docs with a precise query.
- Fetch the best page and the specific section needed (use
anchor when possible).
- Answer with concise guidance and cite the doc source.
- Provide code snippets only when the docs support them.
Quality rules
- Treat OpenAI docs as the source of truth; avoid speculation.
- Keep quotes short and within policy limits; prefer paraphrase with citations.
- If multiple pages differ, call out the difference and cite both.
- If docs do not cover the user’s need, say so and offer next steps.
Tooling notes
- Always use MCP doc tools before any web search for OpenAI-related questions.
- If the MCP server is installed but returns no meaningful results, then use web search as a fallback.
- When falling back to web search, restrict to official OpenAI domains (developers.openai.com, platform.openai.com) and cite sources.
Examples
OpenAI API Guidance
User says: "How do I use tool calls with the Responses API?"
What happens:
- Search OpenAI docs MCP for "Responses API tools".
- Fetch the most relevant section.
- Return implementation guidance with citations.
Codex Capability Check
User says: "Does Codex support read-only review workflows?"
What happens:
- Query Codex docs via MCP.
- Fetch flag/sandbox references.
- Answer with source-backed guidance and constraints.
Troubleshooting
| Problem |
Cause |
Solution |
| MCP docs search returns nothing |
MCP server not installed |
Install openaiDeveloperDocs MCP, restart Codex, retry search |
| Results are stale/unclear |
Query too broad |
Narrow query by product + feature, then fetch exact page section |
| Need citation-ready answer |
Source not fetched |
Fetch specific doc section before answering |
| Docs do not cover question |
Gap in official docs |
State gap explicitly and provide safe best-effort guidance |
Reference Documents
- references/openai-docs.feature — Executable spec: search official docs, fetch+quote exact sections, doc-grounded not from-memory (soc-qk4b)
1---2name: openai-docs-23description: Use official OpenAI docs.4---5# OpenAI Docs
6
7Provide authoritative, current guidance from OpenAI developer docs using the developers.openai.com MCP server. Always prioritize the developer docs MCP tools over web.run for OpenAI-related questions. Only if the MCP server is installed and returns no meaningful results should you fall back to web search.
8
9## Quick start
10
11- Use `mcp__openaiDeveloperDocs__search_openai_docs` to find the most relevant doc pages.
12- Use `mcp__openaiDeveloperDocs__fetch_openai_doc` to pull exact sections and quote/paraphrase accurately.
13- Use `mcp__openaiDeveloperDocs__list_openai_docs` only when you need to browse or discover pages without a clear query.
14
15## OpenAI product snapshots
16
171. Apps SDK: Build ChatGPT apps by providing a web component UI and an MCP server that exposes your app's tools to ChatGPT.
182. Responses API: A unified endpoint designed for stateful, multimodal, tool-using interactions in agentic workflows.
193. Chat Completions API: Generate a model response from a list of messages comprising a conversation.
204. Codex: OpenAI's coding agent for software development that can write, understand, review, and debug code.
215. gpt-oss: Open-weight OpenAI reasoning models (gpt-oss-120b and gpt-oss-20b) released under the Apache 2.0 license.
226. Realtime API: Build low-latency, multimodal experiences including natural speech-to-speech conversations.
237. Agents SDK: A toolkit for building agentic apps where a model can use tools and context, hand off to other agents, stream partial results, and keep a full trace.
24
25## If MCP server is missing
26
27If MCP tools fail or no OpenAI docs resources are available:
28
29**In Codex:**
301. Run: `codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp`
312. If it fails due to permissions/sandboxing, retry with escalated permissions.
323. Ask the user to restart Codex, then re-run doc search/fetch.
33
34**In Claude Code:**
351. Add the MCP server to `~/.claude/settings.json` under `"mcpServers"`:
36 ```json
37 {
38 "mcpServers": {
39 "openaiDeveloperDocs": {
40 "type": "url",
41 "url": "https://developers.openai.com/mcp"
42 }
43 }
44 }
45 ```
462. Restart Claude Code, then re-run doc search/fetch.
47
48**In other agents:** Ask the user to configure the MCP server per their agent's documentation.
49
50## Workflow
51
521. Clarify the product scope (Codex, OpenAI API, or ChatGPT Apps SDK) and the task.
532. Search docs with a precise query.
543. Fetch the best page and the specific section needed (use `anchor` when possible).
554. Answer with concise guidance and cite the doc source.
565. Provide code snippets only when the docs support them.
57
58## Quality rules
59
60- Treat OpenAI docs as the source of truth; avoid speculation.
61- Keep quotes short and within policy limits; prefer paraphrase with citations.
62- If multiple pages differ, call out the difference and cite both.
63- If docs do not cover the user’s need, say so and offer next steps.
64
65## Tooling notes
66
67- Always use MCP doc tools before any web search for OpenAI-related questions.
68- If the MCP server is installed but returns no meaningful results, then use web search as a fallback.
69- When falling back to web search, restrict to official OpenAI domains (developers.openai.com, platform.openai.com) and cite sources.
70
71## Examples
72
73### OpenAI API Guidance
74
75**User says:** "How do I use tool calls with the Responses API?"
76
77**What happens:**
781. Search OpenAI docs MCP for "Responses API tools".
792. Fetch the most relevant section.
803. Return implementation guidance with citations.
81
82### Codex Capability Check
83
84**User says:** "Does Codex support read-only review workflows?"
85
86**What happens:**
871. Query Codex docs via MCP.
882. Fetch flag/sandbox references.
893. Answer with source-backed guidance and constraints.
90
91## Troubleshooting
92
93| Problem | Cause | Solution |
94|---------|-------|----------|
95| MCP docs search returns nothing | MCP server not installed | Install `openaiDeveloperDocs` MCP, restart Codex, retry search |
96| Results are stale/unclear | Query too broad | Narrow query by product + feature, then fetch exact page section |
97| Need citation-ready answer | Source not fetched | Fetch specific doc section before answering |
98| Docs do not cover question | Gap in official docs | State gap explicitly and provide safe best-effort guidance |
99
100## Reference Documents
101
102- [references/openai-docs.feature](references/openai-docs.feature) — Executable spec: search official docs, fetch+quote exact sections, doc-grounded not from-memory (soc-qk4b)