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.
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.
- OpenAI Codex CLI installed and authenticated
- Node.js and npm
- A Treasure AI account with API access
npm install -g @treasuredata/tdx
tdx auth setupcodex mcp add tdx -- tdx mcpTo share the connection with your team, commit the server configuration to your repository instead of running the command per machine:
# .codex/config.toml — commit to your repo
[mcp_servers.tdx]
command = "tdx"
args = ["mcp"]Each teammate still runs tdx auth setup individually to authenticate.
TD Skills give Codex CDP-specific guidance for SQL, workflows, and segment/journey syntax.
codex plugin marketplace add treasure-data/td-skills
codex plugin add tdx-skills@td-skills
codex plugin add sql-skills@td-skills
codex plugin add workflow-skills@td-skillsStart a new Codex session before using the installed skills. See TD Skills for the full skill catalog and additional plugins.
Ask Codex a question that requires querying your data:
> Which of our databases has last week's web events?- MCP Server (Platform) — reference for
tdx_runandtdx_search - tdx mcp command reference — full tool reference, blocked commands, and troubleshooting
- TD Skills
- Connect a different tool: Claude Code · VS Code and GitHub Copilot · Cursor
- Why teams pair OpenAI Codex with Treasure AI