Work with Val Town in Codex using our CLI or MCP server. You can ask Codex to:
- List or examine your vals and read your sqlite data, logs, and almost any of your Val Town data
- Edit your vals and even agentically iterate, viewing the output and logs until it’s done
- Install OpenAI Codex and log in
- Install the Val Town CLI and log in
deno install -grAf jsr:@valtown/vtvt create,vt remix, orvt clonea val. Select “Yes” to add editor files*cdinto your val’s directoryvt checkout -b <branch>to isolate changes (optional)vt watchto sync with Val Towncodexto start your Codex session
* Running vt create|remix|clone will prompt you to add editor files, including AGENTS.md with our system prompt, which Codex should recognize.
- Install OpenAI Codex and log in
- Connect Codex to the Val Town MCP server
codex mcp add val-town --url https://api.val.town/v3/mcp- Set up a Val Town API token in
~/.codex/config.tomland export it (or persist in~/.zshrcor equivalent)
[mcp_servers.val-town]url = "https://api.val.town/v3/mcp"bearer_token_env_var = "VAL_TOWN_API_TOKEN"export VAL_TOWN_TOKEN="vtwn_..."- Run
codex