A quick disclaimer: this is a casually written tutorial, so if there are any unreasonable parts, please point them out
1. Configure the related environment
After making sure that the nodejs and python environments are already installed
1. Install uv
Run the following command to install uv
2. Install mcpr-cli
Run the following command to install the mcpr-cli service
2. Configure MCP Router
1. Install mcp-router
Download the latest installer from https://github.com/mcp-router/mcp-router/releases and install it.

7eOSmKg2FXMTEctUbo12uX4dab2NqbSm.webp
2. How to add MCP
- Click MCP Servers on the left
- Click the plus sign on the right to add an MCP

duB7Op8Z1tFC84QzM7QrFy7pn9olrGPI.webp
- Click Manual
- Click Create Manually
- Enter the name of the MCP; it is recommended to name it
mcp_servers.xxxxxx - Enter the command for the MCP, usually
npxor something else - Enter the parameters for the MCP, usually the MCP name, etc.

Tb85CNwW7ZyVK6PRwihATGrJJ1o5dL7p.webp

hnjiqsMaQ36RPZi8Xvv0oBFlGdsGl1Jq.webp
Common configuration examples (Command + Arguments):
Tips:
- On Windows, path separators should use backslashes and be escaped as
\in TOML - The first time you use
npx, it will download dependencies, and the time required depends on your network - If command-line permissions are restricted, run the terminal as an administrator
3. My MCP list
| Server Name | Command | Arguments | Environment Variables | Purpose |
|---|---|---|---|---|
| mcp_servers.context7 | npx | -y @upstash/context7-mcp@latest | Official documentation aggregation and retrieval | |
| mcp_servers.desktop-commander | npx | -y @wonderwhy-er/desktop-commander | Local files/processes/search/editing/REPL | |
| mcp_servers.mcp-deepwiki | npx | -y mcp-deepwiki@latest | Supplemental retrieval for documentation repositories | |
| mcp_servers.playwright | npx | @playwright/mcp@latest | Page automation and screenshot verification |
4. Configure the connection with Codex
Since MCP Router does not yet have built-in Codex integration, it needs to be added manually.
- Click MCP APP Integrations on the left
- Enter any name you want, for example
codex - Click Add Custom App on the right to add it

QiBVWc8tkxhy6aQ0k2PJ2ToH3Fwjogs5.webp
Next, click the newly added App: the How To Use under codex to get the key required for Codex to connect to MCP Router.

TPlHiLAp5qptR4yZMfBWQBSYckYDPYHY.webp
8ek68e629SlnmBz8Jj3Zn9W6HKpEEN9t.webp
Security tips:
- Never expose real tokens in public repositories or screenshots
- It is recommended to store the token in the system "user environment variables" to avoid hardcoding
3. Codex configuration
First, open the Codex configuration directory, usually located at C:\Users\<你的用户名>\.codex

HtyKGINkOusiQu2BTdKc5fxORxlQV91g.webp
Open config.toml and add the MCP Router configuration (two ways are provided; only one is needed):
Option A: use an absolute path (more stable)
Option B: use node (more general, depends on PATH)
Notes:
- On Windows, backslashes must be written as
\so TOML can parse them correctly - The
nodemethod requires Node to be added to PATH; otherwise use Option A - The first connection will initialize dependencies and cache, and the time required depends on your network
4. Prompt optimization
A good prompt can make AI proactively use MCP. It is recommended to create a global AGENTS.md under C:\Users\<你的用户名>\.codex to emphasize MCP usage and calling strategies.
Minimum viable AGENTS.md example:
Compatibility and common issues (FAQ)
- Path escaping: in TOML, please use
\for Windows paths - Node version: if too old, it may cause
npx/dependency installation to fail; version 20+ is recommended - First
npx: it will download packages to the user cache directory, and the time required depends on your network - Permission issues: if you encounter access denied, run the terminal as an administrator
- Codex version: support for MCP may vary across different versions, so please watch the changelog
References and statement
- MCP Router: https://github.com/mcp-router/mcp-router
- Codex CLI: https://github.com/OpenAI/codex