Work with AI
Use this page to connect Claude Code, Codex or OpenCode to your Reflex server.
What your AI tool can do
Section titled “What your AI tool can do”- Write Lua scripts against the typed libraries.
- Run them on your local machine or on your project’s agents.
- Read why a run failed, with logs, page evidence and the replay.
- Debug a paused run and try a fix.
- Propose a locator fix to the heal inbox.
A person stays in charge. Accepting a heal is a human decision, and your AI tool can only do what your project role and the token’s scopes allow.
Set it up
Section titled “Set it up”Install the CLI first, then run this in your repository:
reflex setup ai --server https://<server> --project owner/project --tool claudeUse --tool codex, --tool opencode or --tool all. Without --tool, Reflex detects the tools you use. Setup signs in (you approve the login in a browser), links the project, installs the Reflex skills, writes the MCP configuration and runs reflex doctor.
Then sign in to the MCP server from your AI tool. Setup never stores a token in project files.
--tool claude installs the skills under .claude/skills/ and writes .mcp.json.
To connect by hand:
claude mcp add --transport http reflex https://<server>/mcpOpen /mcp in Claude Code and choose Authenticate.
--tool codex installs the skills under .agents/skills/ and writes .codex/config.toml (in a trusted project).
To connect by hand, add this to your Codex config:
[mcp_servers.reflex]url = "https://<server>/mcp"Then run codex mcp login reflex.
--tool opencode installs the skills under .agents/skills/ (OpenCode reads that folder, as Codex does) and writes opencode.json in the repository root. An existing file is merged. To skip the setup command, put this in opencode.json yourself:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "reflex": { "type": "remote", "url": "https://<server>/mcp", "enabled": true } }}Then run opencode mcp auth reflex to sign in. To install only the skills, run reflex skills install --target codex.
Profile → API tokens on your server shows these commands with your server’s address filled in.
Secrets stay out of the chat
Section titled “Secrets stay out of the chat”Your AI tool never sees a secret value. When it needs one, it gives you a link, and you type the value into a Reflex form yourself (how it works).