OpenAI Codex CLI Configuration Guide
After configuration, you can directly operate CloudBase services in OpenAI Codex CLI conversations.
For example:
- "Create user table" - AI automatically creates database collection
- "Deploy this function" - AI automatically uploads and configures cloud function
- "Deploy frontend to CDN" - AI automatically uploads files and configures hosting
No need to switch to cloud console, all operations can be completed in command line using natural language.
Prerequisites
Before starting configuration, please ensure the following conditions are met:
Node.js environment and CloudBase environment are ready
Node.js Environment: Ensure Node.js v18.15.0 or higher is installed:
node --version
If not installed, please download and install from Node.js official website.
CloudBase Environment: Please refer to the documentation Create CloudBase Environment. New users can sign up for free.
Configure your MCP client to connect with your CloudBase environment
Step 1: Configure CloudBase MCP
前置步骤:
npm i @cloudbase/cloudbase-mcp -g根据运行系统在终端中运行指令:
MacOS, Linux, WSL:
codex mcp add cloudbase --env INTEGRATION_IDE=CodeX -- cloudbase-mcpWindows Powershell:
codex mcp add cloudbase --env INTEGRATION_IDE=CodeX -- cmd /c cloudbase-mcpStep 2: Chat with AI
After configuration, enter the following in your AI chat:
检查 CloudBase MCP 工具是否可用, 下载 CloudBase AI 开发规则到当前项目Common Questions
Q: MCP connection failed? A: Check if command is executed correctly, restart OpenAI Codex CLI, confirm network connection is normal.
Q: Tool count shows 0? A: Please refer to FAQ.
More questions please check: Complete FAQ