glm-mcp-codex
v1.3.0
Published
GLM (Zhipu/Z.ai) as a safe, cost-aware delegate for Codex: MCP tools, a custom glm agent, a delegation skill, and optional routing hooks.
Maintainers
Readme
GLM MCP for Codex
Use the shared glm-mcp server as a cost-aware delegate in Codex. The package adds a Codex MCP
registration, a glm custom agent, a glm-delegate skill, and optional advisory routing hooks. It
does not duplicate the MCP core: it depends on the same published [email protected] runtime used by the
other editions.
Install
From this repository:
cd codex
npm install
node install-codex.mjs --key YOUR_ZAI_KEYFrom npm:
npm install -g glm-mcp-codex
glm-mcp-codex --key YOUR_ZAI_KEYThe installer writes only its marker-delimited section in ~/.codex/config.toml, stores credentials
in ~/.codex/glm-mcp/.env, adds ~/.codex/agents/glm.toml, and adds the user skill at
~/.agents/skills/glm-delegate. It configures a 30-minute tool timeout and prompts before mutating
GLM tools. It also pins the shared runtime under ~/.codex/glm-mcp, so clearing an npx cache does
not break the registered server. glm_status and glm_recommend are pre-approved because they are
local read-only calls.
Restart Codex, review the optional hook with /hooks, and run glm_status. The ChatGPT desktop app,
Codex CLI, and IDE extension share the same MCP configuration.
Project-scoped install
node install-codex.mjs --project C:\path\to\project --key YOUR_ZAI_KEYThis writes .codex/config.toml, .codex/agents/glm.toml, .codex/hooks/, and
.agents/skills/glm-delegate inside that project. Codex must trust the project before using its
configuration.
Use
- Ask Codex to use the glm agent for an explicit, self-contained subtask.
- Call
mcp__glm__glm_agentfor coding work. Always pass an absoluteworkdir; usedry_run: truewhen reviewing a proposed change first. - Text-only work also goes through
mcp__glm__glm_agent(mcp__glm__glm_delegateis opt-in: start the server withGLM_DELEGATE=on). - Call
mcp__glm__glm_recommendwhen unsure; it does not call the GLM API.
Keep secrets, proprietary or security-sensitive material, images, architecture, highly parallel work,
very large context, and long dependent loops on Codex. Codex sandboxing does not automatically confine
an external MCP process, so grant glm_agent approval deliberately.
Hook and plugin
The installer enables an advisory UserPromptSubmit/PreToolUse hook by default. It never blocks or
auto-runs GLM; it only suggests delegation. Use --no-hook to omit it.
plugin/glm-mcp-codex/ is a valid Codex plugin bundle for the skill and hook. The npm installer remains
the runtime installation path because it manages the shared glm-mcp dependency and private credential
file. The plugin has no embedded credentials and must be trusted before its hook runs.
Remove
node uninstall-codex.mjs
node uninstall-codex.mjs --remove-data # also delete the private .env and usage dataUninstall removes only files and configuration marked as owned by glm-mcp-codex.
