Glm MCP logo

Glm MCP

by djerok

Delegates repository coding tasks to Z.ai GLM through four MCP tools, with routing, dry runs, progress, and usage tracking.

Install Glm MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "djerok-glm-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "glm-mcp-claude"
      ],
      "env": {
        "GLM_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y glm-mcp-claude

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

djerok/glm-mcp MCP server connects MCP clients to Z.ai's Anthropic-compatible GLM endpoint and runs GLM as a repository-level coding sub-agent. Its main agent loop can read, write, edit, list files, and run Bash commands, while the MCP server returns a summary and usage statistics. Supporting tools provide model-routing advice, local status data, and optional text-only delegation. Reach for it when a primary coding agent should delegate implementation work to GLM while retaining review, diff, and revert oversight.

Use cases

  • Delegate repository implementation tasks to GLM
  • Preview coding changes before writing them
  • Review GLM-generated diffs from a primary agent
  • Track GLM tokens and estimated call costs
  • Ask for local model-routing recommendations

Key features

  • Repository-level GLM agent loop
  • Read, write, edit, list, and Bash tools
  • Dry-run diff preview and Git revert guidance
  • Peak-aware model routing
  • Live progress notifications
  • JSONL usage ledger and status reporting

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

31/31 checks healthy over the last 112d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · glm-mcp-claude (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars8Stargazers on the source repository.
npm downloads658Package downloads in the last 30 days.
Last commit4mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity14 viewsConfig copies, upvotes, and views on AllMCPs.

How Glm MCP works

What djerok/glm-mcp MCP server does

djerok/glm-mcp MCP server exposes Z.ai GLM to an MCP-compatible coding workflow. Its central glm_agent tool accepts a task and an absolute repository working directory, then lets GLM operate through an agent loop rather than making one isolated completion request. The loop can inspect files, modify them, enumerate directories, and execute Bash commands in the target repository.

The server is designed for a main agent such as Claude Code, GitHub Copilot, or Codex to delegate work and review the result. After the delegated run, the main agent receives a concise summary and a GLM STATS block containing the selected model, token counts, and estimated cost. Every GLM call is also appended to a usage.jsonl ledger.

How it works

When glm_agent is called, a peak-aware router selects a GLM model and sends the request to Z.ai's Anthropic-compatible /v1/messages endpoint. GLM handles the tool loop against the supplied repository, and the MCP server relays the result to the orchestrating client. A cost bias keeps GLM as the default engine in the routing behavior described by the project.

The tool supports dry_run: true, which previews a diff without writing changes. A completed real run prints a Git checkpoint revert line, giving the primary agent a way to review or undo changes. Progress notifications report the current iteration, token count, and token rate. Cancellation stops the run promptly, although partial changes may remain and need review or reversion.

Setup and configuration

For a general MCP client, install the published glm-mcp package with npx -y glm-mcp. Configure it as a stdio server and provide GLM_API_KEY with a Z.ai key. The server can start and answer MCP introspection requests without a key, but actual GLM calls require one.

The repository also provides separate installers for Claude Code, GitHub Copilot in VS Code, and Codex. Those installers add client-specific subagents, hooks, skills, or configuration in addition to registering the same underlying MCP server. The documented installer packages are glm-mcp-claude, glm-mcp-copilot, and glm-mcp-codex.

GLM_DELEGATE=on exposes the optional text-only delegation tool. max_tokens defaults to auto, or the orchestrating agent can provide a numeric limit. The default stall timeout is controlled by GLM_STALL_TIMEOUT_MS; client tool-call limits can also involve MCP_TOOL_TIMEOUT or CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT.

Tools and capabilities

The djerok/glm-mcp MCP server provides four tools:

  • glm_agent: delegates repository work to GLM, including read, write, edit, directory listing, and Bash execution.
  • glm_delegate: performs text-in/text-out generation and is hidden unless GLM_DELEGATE=on is set.
  • glm_recommend: gives a free local recommendation about GLM versus the main model, including model choice, confidence, and reasons.
  • glm_status: reports the peak window, active model, usage-ledger totals, and configuration health without making a GLM request.

Limitations and notes

The delegated agent can mutate files and run commands in the supplied repository, so the main agent should inspect its output and diffs. A dry run avoids writes, but normal execution can leave partial changes if cancelled. GLM usage requires the user's Z.ai GLM Coding Plan key, and a hybrid main-agent workflow still consumes tokens for orchestration and review.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Glm MCP

Run `npx -y glm-mcp` through an MCP client's stdio configuration and set `GLM_API_KEY` to your Z.ai key.

Yes.

It provides `glm_agent`, `glm_delegate`, `glm_recommend`, and `glm_status`. The text-only `glm_delegate` tool is hidden unless `GLM_DELEGATE=on` is set.

A `GLM_API_KEY` is required for actual GLM calls. The server can answer MCP introspection requests without a key.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGlm MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/djerok-glm-mcp?style=directory)](https://allmcps.com/mcp/djerok-glm-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/djerok-glm-mcp"><img src="https://allmcps.com/api/badge/djerok-glm-mcp?style=directory" alt="Glm MCP on AllMCPs" /></a>