Isolate agent environments, audit MCP configurations for security leaks, and synchronize engineering instructions between Claude Code and OpenAI Codex.
Also known as Hung2124/codex-multi-profile
- Stars
- 94
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Oct 28, 2026
- License
- MIT
What is codex-multi-profile MCP?
codex-multi-profile is an MCP server. Isolate agent environments, audit MCP configurations for security leaks, and synchronize engineering instructions between Claude Code and OpenAI Codex.
Summary generated from the project's README
About codex-multi-profile MCP server
Managing separate professional, open-source, and personal AI environments is what codex-multi-profile enables for developers and consulting engineers. It provides a way to isolate workspace profiles for Claude Code and OpenAI Codex, ensuring that settings and credentials remain distinct across different repositories and organizational identities. Users can switch between Enterprise SSO and personal accounts without the need to manually log out and re-authenticate.
The tool includes a security auditor that scans configuration files like .mcp.json and claude_desktop_config.json for hardcoded secrets or unsafe shell wrappers. It also features an instruction bridge to keep engineering rules synchronized between CLAUDE.md and AGENTS.md files. This server is used via a cross-platform CLI, a Node.js SDK, or through a native Windows desktop integration for the Microsoft Store Codex app. It requires Node.js 18 or higher and works on macOS, Linux, and Windows.
What you can do with it
- 1Audit MCP configurations for secretsRun a security check on your MCP configuration files to find hardcoded credentials or unsafe transport endpoints.
- 2Synchronize engineering instructionsKeep your project rules consistent by syncing documentation between Claude Code and OpenAI Codex.
- 3Isolate agent environmentsCreate and switch between distinct profiles for enterprise, open-source, or research work to keep settings separate.
- 4Switch Codex workspaces quicklyUse a dedicated menu in the Windows Codex app to swap between authorized accounts in seconds.
Written from the project's README. Every use case is checked against a quote from it.
How to install codex-multi-profile MCP
Formats verified 10 Nov 2026Install codex-multi-profile MCP in Claude Code
$ claude mcp add codex-multi-profile -- npx -y codex-multi-profileInstall codex-multi-profile MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"codex-multi-profile": {
"command": "npx",
"args": [
"-y",
"codex-multi-profile"
]
}
}
}Install codex-multi-profile MCP in VS Code
.vscode/mcp.json
{
"servers": {
"codex-multi-profile": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"codex-multi-profile"
]
}
}
}Install codex-multi-profile MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"codex-multi-profile": {
"command": "npx",
"args": [
"-y",
"codex-multi-profile"
]
}
}
}Install codex-multi-profile MCP in Codex
~/.codex/config.toml
[mcp_servers.codex-multi-profile] command = "npx" args = ["-y", "codex-multi-profile"]
Install codex-multi-profile MCP in Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"codex-multi-profile": {
"command": "npx",
"args": [
"-y",
"codex-multi-profile"
]
}
}
}Automated checks
Ran Nov 13, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubCodex Multi-Profile
Built for developers, open-source maintainers, and consulting engineers who work across separate authorized Enterprise SSO, Client, and Personal workspaces in Claude Code and OpenAI Codex.
Core Capabilities (v2.0)
| Module | What it solves |
|---|---|
Claude Code & Codex Profile Store (WorkspaceProfileStore) |
Isolate ~/.claude/settings.json, ~/.codex, and workspace .mcp.json profiles (enterprise, oss-maintainer, research) with atomic file swaps |
MCP Security & Isolation Auditor (mcp-audit) |
Statically audits .mcp.json and claude_desktop_config.json for hardcoded credentials (sk-ant-*, ghp_*), non-loopback HTTP/SSE endpoints, and unsafe shell wrappers |
Instruction Bridge (sync-docs) |
Deterministically synchronizes shared engineering rules between CLAUDE.md (Claude Code) and AGENTS.md (OpenAI Codex) across polyglot repositories |
| Windows Store Codex Workspace Switcher | Hot-switches authorized Enterprise, Team, and Personal workspaces in 2–3 seconds directly from the Microsoft Store Codex avatar menu |
Cross-Platform CLI & Node.js SDK (Claude Code, MCP & Codex)
Requires Node.js 18+ on macOS, Linux, or Windows:
# Install globally or invoke via npx
npm install -g codex-multi-profile
# 1. Audit .mcp.json for secret leakage and non-loopback MCP transports
npx codex-multi-profile mcp-audit .mcp.json
# 2. Synchronize CLAUDE.md <-> AGENTS.md instructions in a repository
npx codex-multi-profile sync-docs .
# 3. List isolated Claude Code (~/.claude) or Codex (~/.codex) profiles
npx codex-multi-profile profiles claude
Programmatic SDK Usage (Node.js / TypeScript)
const {
WorkspaceProfileStore,
auditMcpConfig,
syncWorkspaceInstructions
} = require("codex-multi-profile");
// 1. Audit an MCP configuration before activating a workspace profile
const audit = auditMcpConfig({
mcpServers: {
github: {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-github"],
env: { GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_PERSONAL_ACCESS_TOKEN}" }
}
}
});
if (!audit.valid) throw new Error("MCP security audit failed");
// 2. Save and activate an isolated Claude Code profile
const store = new WorkspaceProfileStore();
store.saveProfile("oss-maintainer", {
agent: "claude",
settings: { model: "claude-sonnet-4-5" }
});
store.activateProfile("oss-maintainer", { agent: "claude", workspaceDir: process.cwd() });
// 3. Keep CLAUDE.md and AGENTS.md aligned
syncWorkspaceInstructions(process.cwd(), { direction: "claude-to-codex" });
Native Windows Desktop Integration (Microsoft Store Codex App)
Click your avatar at the bottom-left of the Windows Store Codex app. Under your identity row there is an Accounts workspace section:
| In the menu | Does |
|---|---|
| Click a workspace profile | Switches to that workspace in 2-3 seconds; the Codex window stays open (from a sign-in screen Codex restarts, ~10 s) |
| Add account | Codex restarts on its sign-in screen; sign in with your other authorized workspace and save it under a profile label |
| Pencil / trash (hover a row) | Rename / remove a saved workspace profile (the active profile cannot be removed) |
1-9 while the menu is open |
Activate the workspace profile with that number |
Ctrl+Alt+A |
Open the workspace switcher from anywhere in Codex |
| Telemetry bars | Displays remaining session quota windows (5h and weekly windows) per workspace; hover for reset timestamp |
The menu follows the application's language (Vietnamese or English) and its light / dark theme.
Screenshots use synthetic profiles; rendered from switcher-inject.js with node tools/screenshots/capture.mjs.
Install (Windows Desktop Helper)
Requires Windows 10/11 and Codex from the Microsoft Store:
irm https://raw.githubusercontent.com/Hung2124/codex-multi-profile/main/install.ps1 | iex
Or via npm / npx (Node.js 18+):
npx codex-multi-profile install
This registers the currently signed-in workspace as main, places a Codex shortcut on the Desktop and Start menu, and starts a lightweight background watcher at sign-in (~25 MB, no window). -NoAutoStart skips the startup watcher.
Upgrading from the legacy 0.1–0.2 clone-based layout:
$env:CODEX_MP_REMOVE_LEGACY = '1'; irm https://raw.githubusercontent.com/Hung2124/codex-multi-profile/main/install.ps1 | iex
Good to know
- Use the profile menu instead of "Log out" when switching workspaces. Logging out inside the app revokes the active refresh token on the server.
- A saved session that expired shows the sign-in screen after switching; signing in again refreshes the stored profile automatically.
- Active streaming generations are stopped cleanly before swapping credentials.
- The local helper runs only while the app is open (~130 MB, near-zero CPU).
Command line (CI, agents, scripts)
# Cross-platform MCP & instruction tooling:
codex-multi-profile mcp-audit .mcp.json --json
codex-multi-profile sync-docs .
codex-multi-profile profiles claude --json
# Windows Desktop workspace profile management:
codex-multi-profile list --json
codex-multi-profile status
codex-multi-profile switch enterprise
# Or directly via PowerShell:
$cli = "$env:LOCALAPPDATA\CodexMultiProfile\CodexAccounts.ps1"
powershell -NoProfile -ExecutionPolicy Bypass -File $cli list # or: status | save -Name x | switch -Name x | rename -Name x -NewName y | remove -Name x | lang -Name vi
Uninstall
powershell -NoProfile -ExecutionPolicy Bypass -File "$env:LOCALAPPDATA\CodexMultiProfile\Uninstall-CodexMultiProfile.ps1" # add -RemoveAccounts to delete saved profiles
~\.codex and ~\.claude (conversations, project memory, and active settings) are never deleted.
Privacy and security
- Saved workspace profiles stay on disk (
%LOCALAPPDATA%\CodexMultiProfileon Windows or~/.config/codex-multi-profileon macOS/Linux). Nothing is transmitted externally. - The UI layer only ever receives masked emails (
ab***@example.com), never raw tokens. - The
mcp-auditcommand flags plaintext secrets in.mcp.jsonbefore they can be committed or loaded into an untrusted workspace. - Application binaries are never modified. See docs/architecture.md and SECURITY.md.
License
MIT
codex-multi-profile MCP questions
How do I add codex-multi-profile MCP to Claude Code?
Run claude mcp add codex-multi-profile -- npx -y codex-multi-profile in your terminal. Add --scope user to make it available in every project.
How do I add codex-multi-profile MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How can I audit my MCP configuration for security risks?
You can use the mcp-audit command to statically audit .mcp.json and claude_desktop_config.json for hardcoded credentials and unsafe shell wrappers.
Does this tool synchronize instructions between different AI agents?
Yes, the Instruction Bridge synchronizes shared engineering rules between CLAUDE.md for Claude Code and AGENTS.md for OpenAI Codex.
Is my data safe when using the workspace profiles?
Yes, saved workspace profiles stay on your local disk and nothing is transmitted externally; the UI only receives masked emails.
How fast can I switch workspaces on Windows?
The Windows Store Codex Workspace Switcher allows you to hot-switch authorized workspaces in 2–3 seconds.