Run npx -y zephex setup --opencode — the wizard writes type local + npx -y zephex (same as writeOpenCodeConfig in setup.ts). Remote HTTP is optional only if you will pass github: paths for repo tools.
Official OpenCode MCP documentation: OpenCode MCP docs
Without MCP, your agent guesses project layout and misses supply-chain risk. Zephex connects one hosted endpoint so every session gets the same ten tools — no per-machine npm installs, no version drift across the team.
HTTP and stdio setups both need a key from your Zephex dashboard. OAuth-only flows (ChatGPT, Claude.ai web) sign you in in the browser instead — skip this section for those.
Matches the published CLI (mcp-proxy/src/commands/setup.ts). One command signs you in, writes the correct transport, and verifies 10 tools.
Account teardown: logout vs disconnect · Connect MCP walkthrough
Search docs for “where is my MCP file” — the answer is always: run list first, then open the path it prints.
Documented paths: ~/.config/opencode/opencode.json or <project>/opencode.json
OpenCode local type spawns npx -y zephex with ZEPHEX_API_KEY — remote-only HTTP cannot read your project tree.
Runs the same code as mcp-proxy/src/commands/setup.ts — OAuth in browser, creates a CLI key, writes your editor config, verifies tools.
npx -y zephex setup --opencodeSkip browser OAuth — paste a key from zephex.dev/dashboard/keys. Must start with mcp_prod_, mcp_dev_, or mcp_sk_.
npx -y zephex setup --opencode --api-key mcp_prod_your-key-heretype local + environment.ZEPHEX_API_KEY: Transport: stdio (see ~/.config/opencode/opencode.json or <project>/opencode.json).
{ "$schema": "https://opencode.ai/config.json", "mcp": { "zephex": { "type": "local", "command": ["npx", "-y", "zephex"], "enabled": true, "environment": { "ZEPHEX_API_KEY": "mcp_sk_your_key_here" } } }}After CLI install, fully restart the app if tools do not appear. Manual JSON/TOML blocks below are equivalent — use them when CLI commands are unavailable.
Full comparison: HTTP vs stdio · npx zephex reference
OpenCode uses type local stdio: command as ["npx","-y","zephex@latest"] + ZEPHEX_API_KEY in env — not type remote HTTP.
Replace mcp_sk_your_key_here with your key from Dashboard → API Keys. Copy the full key once at creation — paste into Authorization: Bearer … for HTTP configs, or into ZEPHEX_API_KEY for stdio/npx configs.
type: "local", command npx, environment.ZEPHEX_API_KEY — matches setup.ts.
{ "$schema": "https://opencode.ai/config.json", "mcp": { "zephex": { "type": "local", "command": ["npx", "-y", "zephex"], "enabled": true, "environment": { "ZEPHEX_API_KEY": "mcp_sk_your_key_here" } } }}type: "remote" + url — no local FS; use github:owner/repo in prompts for repo tools.
{ "$schema": "https://opencode.ai/config.json", "mcp": { "zephex": { "type": "remote", "url": "https://zephex.dev/mcp", "headers": { "Authorization": "Bearer mcp_sk_your_key_here" }, "enabled": true } }}Tip
Delete the entire old local zephex block when migrating — partial merges leave type: local active.
Note
Do not keep local and remote zephex entries at once.
Run these in a terminal when the editor UI is unclear — catches stale npm, wrong transport, and project shadows.
npx -y zephex@latest listnpx -y zephex@latest doctornpx -y zephex@latest repair# Fully quit the editor (Cmd+Q / Alt+F4), reopen, start a new agent sessionAfter saving your config, confirm Zephex is connected before you rely on it in real work.
Questions people ask when OpenCode does not show Zephex tools — indexed for docs search.
OpenCode 0 Zephex tools
Use mcp key with type local + command array. Run repair if doctor flags wrong shape. Restart OpenCode.
You do not call tools yourself — ask your agent in plain language. Try these once Zephex is connected:
“OpenCode session: get_project_context on the repo containing opencode.json.”
Remote mcp type confirms stack before OpenCode autonomous edits.
“find_code CLI argument parsing in cmd/*.”
Go/Rust/TS CLI repos — search finds the right entry files.
“check_package on a theme plugin before we add it to the project.”
Install guard for OpenCode-driven package changes.
“check_test: add shell completion for our CLI subcommands.”
Scoped generators and cmd files.
“check_package task=upgrade for our oclif major version bump.”
CLI framework migration risks spelled out.
“audit_headers on our CLI's documented API base URL.”
Validates the endpoint customers call.
OpenCode terminal sessions use the cwd when you launch opencode from a repo root. Remote mcp type needs no npx on PATH.
These situations usually mean the setup cannot work until you fix the underlying issue:
No MCP
Top-level mcp key with type local + command array ["npx","-y","zephex@latest"].
0 tools
ZEPHEX_API_KEY in env; run npx -y zephex@latest repair for shape fixes.
type remote HTTP
Setup writes type local stdio — delete remote block if migrating.
Schema error
Keep valid JSON; command must be array not separate command+args.
Wrong cwd
Launch opencode from repo root for get_project_context.
OpenCode remote mcp entry — ten tools for terminal sessions:
get_project_context
Reads your project structure, dependencies, scripts, env vars, and framework markers in one call. Replaces manually opening package.json, tsconfig, and multiple config files at the start of every session.
read_code
AST-based code extraction: pass a symbol name and get the implementation without reading entire files. Supports symbol lookup, batched file reads, and structural outlines for large files.
find_code
Ranked search across the repo for definitions, usages, and patterns. Faster than blind grep when the agent does not know where a symbol lives.
check_package
Live registry lookup for npm, PyPI, Cargo, and Go modules. Surfaces typosquat risk, maintainer changes, and suspicious version jumps before you run install.
explain_architecture
Generates Mermaid diagrams for auth flows, service boundaries, and module dependencies so the agent reasons about structure instead of guessing.
check_test
Turns a task description into the smallest file set to read or edit, with risk ratings and caller impact notes.
audit_headers
Grades a deployed URL for CSP, HSTS, TLS, cookies, and redirects. Returns fix snippets for common hosts (Vercel, Cloudflare, Nginx).
keep_thinking
Structured multi-step debugging: tracks hypotheses and conclusions so long investigations do not loop.
Zephex_dev_info
Expert patterns for authentication, databases, frontend frameworks, deployment, and mobile stacks when the agent needs vetted guidance.
project_memory
Persists decisions, gotchas, and conventions per project in ~/.zephex/memory (SQLite FTS5). recall before unfamiliar areas; remember after discoveries. Local stdio only on npx zephex.