# Codex and OpenCode + Jev

> Use Jev with Codex and OpenCode to judge tool calls and pick a route. MCP setup, skills, and a router that fails open if Jev errors.

jev-judge on the CLI, evaluate setup, and routers that treat Jev as traffic control.

## Answer

Codex and OpenCode spend quota on big models for small forks in the road. Jev classifies the next step, scores skill relevance, or judges evidence before you pay for another full reasoning pass.

## What Codex and OpenCode are

OpenAI Codex is a coding agent with CLI and desktop clients that support MCP servers via config (for example ~/.codex/config.toml). OpenCode is an open agent stack with mcp add helpers and opencode.jsonc configuration. Both can load stdio MCP servers and agent skills from SKILL.md directories.

## jev-judge-mcp install

gecm0/jev-judge-mcp documents first-class Codex and OpenCode lines. Register stdio npx -y jev-judge-mcp, install the jev skill, and add typesafe-ai as a companion skill.

```bash
codex mcp add jev -- npx -y jev-judge-mcp
opencode mcp add jev -- npx -y jev-judge-mcp

npx skills add gecm0/jev-judge-mcp --skill jev
npx skills add typesafe-ai/skills --skill typesafe-ai
```

## Example Codex MCP table

If you configure by hand, Codex uses a [mcp_servers.jev] table. Prefer environment export for secrets instead of literals when your client version allows it.

```toml
[mcp_servers.jev]
command = "npx"
args = ["-y", "jev-judge-mcp"]
# Codex may require env literals in some versions; exporting TYPESAFE_API_KEY in the parent shell is safer.
```

## typesafe-mcp evaluate

The Go evaluate CLI can register the same MCP server with Codex in one step: TYPESAFE_API_KEY=... evaluate setup mcp. OpenRouter keys work when documented in the README.

## jev-codex-router

0xNatoshi/jev-codex-router is a Codex Router extension that classifies each turn with Jev and selects model plus reasoning effort, fail-open on errors. It is separate from jev-judge-mcp but shows the same pattern: Jev on the routing edge, native Codex execution behind it.

## Using judge well

The bundled jev skill teaches the one-second test: ask factors Jev can answer at a glance, fan out parallel questions, and compose the final decision in code. judge rejects obvious generative requests; supply evidence, not homework for Jev to write.

## Environment keys

Create a key at https://console.typesafe.ai/ (or route through Vercel AI Gateway / OpenRouter where the integration documents it). Export TYPESAFE_API_KEY in the environment for Codex and OpenCode launch environment. Some MCP clients accept AI_GATEWAY_API_KEY when using gateway-hosted Jev models; follow that integration's README. Never commit keys into repos or paste them into chat logs.

```bash
export TYPESAFE_API_KEY="tsk_..."
# Optional pin:
export TYPESAFE_MODEL="jev-latest"
```

## Pitfalls

Restart the client after MCP changes so judge appears in the tool list. TYPESAFE_MODEL pins a version; jev-latest follows TypeSafe's moving alias. Without a key, jev-judge-mcp lists the tool but fails fast with a clear error. Do not confuse OpenCode demo projects in the showcase with official OpenCode MCP docs; verify commands on github.com/gecm0/jev-judge-mcp.

## In the directory

- [All agent guides](https://jev.aitools.fyi/guides/jev-with-ai-agents)
- [System One primer](https://jev.aitools.fyi/learn/system-one)
- [Agent tooling](https://jev.aitools.fyi/categories/agent-tooling)
- [jev-codex-router](https://jev.aitools.fyi/tools/0xnatoshi-jev-codex-router)
- [typesafe-mcp](https://jev.aitools.fyi/tools/itsmostafa-typesafe-mcp)
- [jevwire](https://jev.aitools.fyi/tools/brainwires-jevwire)

## FAQ

### Claude Code plugin vs Codex mcp add?

Claude uses marketplace plugins; Codex uses codex mcp add or TOML. The same jev-judge-mcp package backs both via stdio.

### OpenCode v2 config shape?

jev-judge-mcp README references opencode.jsonc with mcp.servers.jev and type local. Use opencode mcp add when available so the CLI writes the correct shape for your version.

### Can Jev write code for me in Codex?

No. judge is for typed judgments over supplied evidence. Let Codex's primary model generate code.

### What is jev/auto in jev-codex-router?

The router exposes a curated model entry that forwards through a local Jev classification server before selecting native Codex models. See the router README for ports and kill switch behavior.

## Sources

Directory copy checked 2026-09-30. Primary sources:

- [jev-judge-mcp README](https://github.com/gecm0/jev-judge-mcp?ref=jev.aitools.fyi)
- [typesafe-mcp README](https://github.com/itsmostafa/typesafe-mcp?ref=jev.aitools.fyi)
- [jev-codex-router README](https://github.com/0xNatoshi/jev-codex-router?ref=jev.aitools.fyi)
- [typesafe-ai/skills](https://github.com/typesafe-ai/skills?ref=jev.aitools.fyi)

Canonical: https://jev.aitools.fyi/guides/jev-with-ai-agents/codex-and-opencode
Markdown: https://jev.aitools.fyi/guides/jev-with-ai-agents/codex-and-opencode.md
