ModelMux

ModelMux is an open-source MCP (Model Context Protocol) server that lets Claude Code, Codex, and Perplexity call each other as tools — directly from the terminal, mid-session, without switching windows. Instead of copy-pasting between AI assistants, you can ask one to review another’s work, broker parallel opinions from several models at once, and pass in code, images, and PDFs by file path. It’s published under the Apache-2.0 license and available on npm.

What It Does

Both Claude Code and Codex support MCP natively. When you register ModelMux, it appears as a set of callable tools inside both agents. Invoking a tool makes a direct API call to the target AI and returns the response inline in your current session — so you can say things like “ask Codex to review this function and compare it to your approach,” or “use the broker to get Claude and Codex opinions on this architecture, then synthesize a recommendation.”

It runs on-demand only — the process starts when you open Claude Code or Codex and stops when you close them, with nothing running in the background. Calls go through your own Anthropic, OpenAI, and Perplexity API keys at pay-per-token rates, completely separate from any Claude Code or Codex subscription quota. Light use typically costs just a few dollars a month.

Features

  • ask_claude / ask_codex / ask_perplexity — send a prompt to any single model, optionally with a file and a role-setting system prompt
  • broker — query multiple AIs in parallel with the same prompt, then synthesize their answers into one recommendation (or view them side-by-side)
  • File support — pass code, text, images, and PDFs by local path; ModelMux reads, encodes, and forwards them automatically (up to 20 MB per file)
  • Web-grounded research — Perplexity integration brings in live web search for current best-practices questions
  • Zero dependencies — the server is a single file using only Node.js built-ins and native fetch; no npm install required to run it

Platform

macOS (Apple Silicon and Intel), Node.js v18 or higher, with Claude Code and/or the Codex CLI installed. Both terminal CLIs and the Claude/Codex desktop apps are supported.