Skip to main content
MCP server CX Codex

GLM MCP — Claude Code MCP server: what it does, how to install

Offloads code editing and repo tasks to Zhipu GLM models via MCP, keeping expensive tokens focused on top-level orchestration.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add glm-mcp -e GLM_API_KEY=<GLM_API_KEY> -- npx -y glm-mcp
Open on GitHub

What GLM MCP does

This MCP server turns Zhipu GLM into a delegating subagent for environments like Claude Code, Codex, and Cursor. Your primary model plans and reviews code changes, while GLM handles file reading, writing, directory listing, and bash command execution through the Z.ai messages API.

The integration exposes four tools. glm_agent runs the file-editing loop, while glm_delegate handles plain text generation when enabled by GLM_DELEGATE=on. Local utilities include glm_recommend for engine guidance and glm_status for monitoring connection health and token counters logged to usage.jsonl.

Without a valid Zhipu credential in GLM_API_KEY, the server cannot execute any remote queries. If you need to inspect planned modifications before updating files, run tasks with dry_run: true to generate diff previews safely.

What it helps with

  • delegate file edits and terminal commands to a secondary model
  • inspect planned code modifications before writing via dry_run
  • track delegated token consumption in the local usage.jsonl file
  • check GLM engine recommendations without making remote API calls

Example prompts for the agent

  • Use glm_agent to refactor the database connector in ./backend
  • Run glm_agent with dry_run: true to inspect the planned migration diff
  • Check GLM token usage and system status with glm_status

How to install GLM MCP

Platform CLI

claude mcp add glm-mcp -e GLM_API_KEY=<GLM_API_KEY> -- npx -y glm-mcp

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about GLM MCP

How to install GLM MCP in Claude Code?

Run claude mcp add glm-mcp -e GLM_API_KEY=<GLM_API_KEY> -- npx -y glm-mcp. Replace <GLM_API_KEY> with your active Z.ai API key before launching.

What does GLM MCP do?

It lets your orchestrating agent offload direct repository edits and command execution to Zhipu GLM. GLM carries out file changes autonomously and reports back with status summaries and token counts.

Can GLM preview edits without touching files?

Yes, set dry_run: true when invoking glm_agent. The subagent produces a diff preview and exits without altering any files on disk.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor