跳到正文
OpenAI Developers·· 2026-01-06精选AI 评分56

OpenAI Docs MCP 接入指南:让 Codex 检索官方开发文档

Docs MCP

AI 导读

OpenAI 介绍如何为 Codex 配置 Docs MCP,以只读方式搜索官方开发文档并将页面内容引入智能体上下文,不会代用户调用 OpenAI API。

推荐理由

通过共享配置接入文档服务并配合技能优先检索官方资料,这套方法可用于让智能体的产品与 API 回答更易追溯到原始文档。

正文 · 原文

OpenAI hosts a public Model Context Protocol (MCP) server for documentation on developers.openai.com, platform.openai.com, and learn.chatgpt.com.

Server URL (streamable HTTP): https://developers.openai.com/mcp

What it provides

  • Read-only access to OpenAI developer documentation (search + page content).
  • A way to pull documentation into your agent’s context while you work.

This MCP server is documentation-only. It does not call the OpenAI API on your behalf.

Quickstart

Choose an option

You can connect Codex to MCP servers in the CLI or IDE extension. The configuration is shared between both so you only have to set it up once.

Add the server using the Codex CLI:

codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp

Verify it’s configured:

codex mcp list

Alternatively, you can add it in ~/.codex/config.toml directly:

[mcp_servers.openaiDeveloperDocs]
url = "https://developers.openai.com/mcp"

To have Codex reliably use the MCP server, add this snippet to your AGENTS.md:

Always use the OpenAI developer documentation MCP server if you need to work with the OpenAI API, plugins, ChatGPT, Codex,… without me having to explicitly ask.

Tips

  • If you don’t have the snippet in the AGENTS.md file, you need to explicitly tell your agent to consult the Docs MCP server for the answer.
  • If you have more than one MCP server, keep server names short and descriptive to aid the agent in selecting the server.

OpenAI Docs Skill

If you use skills in your AI tooling, pair this MCP server with the OpenAI Docs Skill. It tells the agent to use Docs MCP tools first for OpenAI questions, then fall back to official OpenAI domains.

  1. Install the skill from the OpenAI skills repository.
  2. Confirm you configured this Docs MCP server at https://developers.openai.com/mcp.
  3. Enable the skill for your project or session in your agent tooling.
  4. Ask OpenAI product/API questions and request citations so answers stay traceable to docs sources.

来源:OpenAI Developers · developers.openai.com