
Openai Docs Skill
Query OpenAI developer documentation via a bash CLI that talks to the public OpenAI Docs MCP endpoint for search, fetch, and OpenAPI snippets.
Overview
OpenAI Docs Skill is an agent skill most often used in Build integrations (also Ship security, Launch geo) that searches and fetches OpenAI developer documentation through an MCP-backed CLI.
Install
npx skills add https://github.com/am-will/codex-skills --skill openai-docs-skillWhat is this skill?
- CLI subcommands: init, tools, search, list, fetch, endpoints, openapi
- POST JSON-RPC to MCP_URL (default https://developers.openai.com/mcp) via curl with SSE-style response parsing
- Search and paginate docs with optional limit and cursor
- Fetch specific doc URLs with optional anchor fragments
- openapi helper for endpoint URLs with language filters and code-only mode
- 7 CLI command families: init, tools, search, list, fetch, endpoints, openapi
Adoption & trust: 1.2k installs on skills.sh; 941 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are coding against OpenAI APIs from memory and risk wrong parameters, deprecated endpoints, or missing official examples.
Who is it for?
Indie builders using Claude Code or Codex who want a repeatable shell bridge to developers.openai.com during API integration work.
Skip if: Projects that do not call OpenAI APIs or teams that forbid outbound network from agent sandboxes.
When should I use this skill?
Implementing or debugging OpenAI API integrations and you need current docs, endpoint listings, or OpenAPI-oriented examples via MCP.
What do I get? / Deliverables
Your agent runs documented MCP search and fetch commands so answers cite live OpenAI developer docs and OpenAPI-oriented snippets.
- Search results and fetched doc excerpts for cited API work
- Endpoint listings or openapi-derived code hints for a target URL
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Accurate OpenAI API usage is decided while integrating models and tools during Build; this skill is the canonical integrations shelf. The skill wraps MCP tools/call against developers.openai.com for search, list, fetch, endpoints, and openapi—integration-facing doc retrieval.
Where it fits
Run search and fetch against the MCP URL while implementing a new OpenAI endpoint in your SaaS backend.
Pull anchored doc sections into your internal README so co-maintainers see the same official wording.
Cross-check authentication and data-handling docs before you expose a new model route to production traffic.
Ground marketing copy about AI features in fetched developer docs so claims match supported APIs.
How it compares
Docs retrieval CLI tied to OpenAI’s MCP endpoint—not a general-purpose web scraper or your app’s runtime SDK.
Common Questions / FAQ
Who is openai-docs-skill for?
Solo developers and agent users integrating OpenAI products who need searchable, fetchable official documentation from the terminal.
When should I use openai-docs-skill?
During Build integrations while implementing endpoints, at Ship when validating API changes pre-release, or at Launch when drafting accurate integration docs for customers.
Is openai-docs-skill safe to install?
It performs network calls to the configured MCP_URL; review the Security Audits panel on this page and confirm the endpoint and curl usage match your security policy.
SKILL.md
READMESKILL.md - Openai Docs Skill
#!/usr/bin/env bash set -euo pipefail MCP_URL="${MCP_URL:-https://developers.openai.com/mcp}" usage() { cat <<'EOF' OpenAI Docs MCP (CLI) Usage: openai-docs-mcp.sh init openai-docs-mcp.sh tools openai-docs-mcp.sh search <query> [limit] [cursor] openai-docs-mcp.sh list [limit] [cursor] openai-docs-mcp.sh fetch <url> [anchor] openai-docs-mcp.sh endpoints openai-docs-mcp.sh openapi <endpoint-url> [lang1,lang2] [code-only] Environment: MCP_URL Override the MCP endpoint (default: https://developers.openai.com/mcp) EOF } require_cmd() { command -v "$1" >/dev/null 2>&1 || { echo "Missing required command: $1" >&2 exit 1 } } mcp_request() { local payload="$1" curl -s -N \ -H 'Accept: application/json, text/event-stream' \ -H 'Content-Type: application/json' \ -X POST "$MCP_URL" \ -d "$payload" \ | sed -n 's/^data: //p' \ | tail -n 1 } mcp_call() { local method="$1" local params="${2:-null}" local payload if [[ "$params" == "null" ]]; then payload=$(jq -n --arg method "$method" '{jsonrpc:"2.0",id:1,method:$method}') else payload=$(jq -n --arg method "$method" --argjson params "$params" '{jsonrpc:"2.0",id:1,method:$method,params:$params}') fi mcp_request "$payload" } mcp_tool_call() { local name="$1" local args_json="$2" local payload payload=$(jq -n --arg name "$name" --argjson args "$args_json" '{jsonrpc:"2.0",id:1,method:"tools/call",params:{name:$name,arguments:$args}}') mcp_request "$payload" } ensure_ok() { local resp="$1" if echo "$resp" | jq -e '.error' >/dev/null; then echo "$resp" | jq -r '.error' >&2 exit 1 fi } is_int() { [[ "$1" =~ ^[0-9]+$ ]] } require_cmd curl require_cmd jq if [[ $# -lt 1 ]]; then usage exit 1 fi cmd="$1" shift case "$cmd" in init) resp="$(mcp_call "initialize" "$(jq -n '{protocolVersion:"2025-03-26",capabilities:{},clientInfo:{name:"openai-docs-mcp-cli",version:"1.0.0"}}')")" ensure_ok "$resp" echo "$resp" | jq ;; tools) resp="$(mcp_call "tools/list")" ensure_ok "$resp" echo "$resp" | jq ;; search) query="${1:-}" limit="${2:-}" cursor="${3:-}" if [[ -z "$query" ]]; then usage exit 1 fi if [[ -n "$limit" ]] && ! is_int "$limit"; then echo "limit must be an integer" >&2 exit 1 fi args="$(jq -n --arg query "$query" --arg limit "${limit:-}" --arg cursor "${cursor:-}" \ '{query:$query} + (if ($limit | length) > 0 then {limit: ($limit|tonumber)} else {} end) + (if ($cursor | length) > 0 then {cursor: $cursor} else {} end)')" resp="$(mcp_tool_call "search_openai_docs" "$args")" ensure_ok "$resp" echo "$resp" | jq -r '.result.content[0].text | fromjson' ;; list) limit="${1:-}" cursor="${2:-}" if [[ -n "$limit" ]] && ! is_int "$limit"; then echo "limit must be an integer" >&2 exit 1 fi args="$(jq -n --arg limit "${limit:-}" --arg cursor "${cursor:-}" \ '(if ($limit | length) > 0 then {limit: ($limit|tonumber)} else {} end) + (if ($cursor | length) > 0 then {cursor: $cursor} else {} end)')" resp="$(mcp_tool_call "list_openai_docs" "$args")" ensure_ok "$resp" echo "$resp" | jq -r '.result.content[0].text | fromjson' ;; fetch) url="${1:-}" anchor="${2:-}" if [[ -z "$url" ]]; then usage exit 1 fi args="$(jq -n --arg url "$url" --arg anchor "${anchor:-}" \ '{url:$url} + (if ($anchor | length) > 0 then {anchor: $anchor} else {} end)')" resp="$(mcp_tool_call "fetch_openai_doc" "$args")" ensure_ok "$resp" echo "$resp" | jq -r '.result.content[0].text' ;; endpoints) resp="$(mcp_tool_call "list_api_endpoints" "$(jq -n '{}')")" ensure_ok "$resp" echo "$resp" | jq -r '.result.content[0].text | fromjson' ;; openapi) url="${1:-}" langs="${2:-}" code_only="${3:-}" if [[ -z "$url" ]]; then usage exit 1 fi