{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Guides","type":"markdown"},"seo":{"title":"Connect OpenAI Codex to Treasure AI","description":"Connect OpenAI Codex CLI to Treasure AI's MCP server to query databases, build segments, and debug workflows from natural-language prompts in your terminal.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"connecting-openai-codex-to-treasure-ai","__idx":0},"children":["Connecting OpenAI Codex to Treasure AI"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://learn.chatgpt.com/docs/codex/cli"},"children":["OpenAI Codex"]}," is OpenAI's CLI coding agent. Connect it to Treasure AI's MCP Server (Platform) to query databases, build segments, and debug workflows from natural-language prompts in your terminal. This page covers installing the tdx CLI, registering it as an MCP server in Codex, and adding TD Skills for CDP-specific guidance."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Documentation Search"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Codex connects to MCP Server (Platform) for platform operations. MCP Server (Docs) (documentation search over HTTP) is not currently documented for Codex — the setup below covers platform access only."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://learn.chatgpt.com/docs/codex/cli"},"children":["OpenAI Codex CLI"]}," installed and authenticated"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Node.js and npm"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Treasure AI account with API access"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-and-authenticate-tdx","__idx":2},"children":["Install and Authenticate tdx"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install -g @treasuredata/tdx\ntdx auth setup\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"add-the-mcp-server-to-codex","__idx":3},"children":["Add the MCP Server to Codex"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"codex mcp add tdx -- tdx mcp\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To share the connection with your team, commit the server configuration to your repository instead of running the command per machine:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"toml","header":{"controls":{"copy":{}}},"source":"# .codex/config.toml — commit to your repo\n[mcp_servers.tdx]\ncommand = \"tdx\"\nargs = [\"mcp\"]\n","lang":"toml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each teammate still runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx auth setup"]}," individually to authenticate."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-td-skills","__idx":4},"children":["Install TD Skills"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TD Skills give Codex CDP-specific guidance for SQL, workflows, and segment/journey syntax."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"codex plugin marketplace add treasure-data/td-skills\ncodex plugin add tdx-skills@td-skills\ncodex plugin add sql-skills@td-skills\ncodex plugin add workflow-skills@td-skills\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start a new Codex session before using the installed skills. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/guide/td-skills"},"children":["TD Skills"]}," for the full skill catalog and additional plugins."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"try-it","__idx":5},"children":["Try It"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ask Codex a question that requires querying your data:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"> Which of our databases has last week's web events?\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":6},"children":["Next Steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/ai/mcp-server-platform"},"children":["MCP Server (Platform)"]}," — reference for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx_run"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx_search"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/commands/mcp"},"children":["tdx mcp command reference"]}," — full tool reference, blocked commands, and troubleshooting"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/guide/td-skills"},"children":["TD Skills"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Connect a different tool: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/ai/claude-code"},"children":["Claude Code"]}," · ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/ai/vscode-github-copilot"},"children":["VS Code and GitHub Copilot"]}," · ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/ai/cursor"},"children":["Cursor"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.treasure.ai/works-with/openai-codex"},"children":["Why teams pair OpenAI Codex with Treasure AI"]}]}]}]},"headings":[{"value":"Connecting OpenAI Codex to Treasure AI","id":"connecting-openai-codex-to-treasure-ai","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Install and Authenticate tdx","id":"install-and-authenticate-tdx","depth":2},{"value":"Add the MCP Server to Codex","id":"add-the-mcp-server-to-codex","depth":2},{"value":"Install TD Skills","id":"install-td-skills","depth":2},{"value":"Try It","id":"try-it","depth":2},{"value":"Next Steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"Connect OpenAI Codex to Treasure AI","description":"Connect OpenAI Codex CLI to Treasure AI's MCP server to query databases, build segments, and debug workflows from natural-language prompts in your terminal."}},"lastModified":"2026-07-17T06:11:14.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/getting-started/ai/openai-codex","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}