# glm-mcp

> glm-mcp is an open-source MCP server for ai models and llm tooling. MCP server that hands coding tasks from Claude, Copilot or Codex to cheaper GLM models. It is available on CLI, VS Code, API and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, VS Code, API, Self-hosted
- **Repository:** https://github.com/djerok/glm-mcp
- **GitHub stars:** 8
- **License:** MIT
- **Categories:** [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

glm-mcp lets a main AI coding assistant pass the bulk of its work to GLM models from Zhipu / Z.ai while keeping the main model for planning and review. It runs as a Model Context Protocol server with four tools, and its glm_agent tool lets GLM read, write, edit and run commands inside a chosen repository through its own tool loop.

Each GLM call is logged to a local usage ledger with model and token counts, and a summary block reports tokens and estimated cost after every agent run. A dry-run mode previews the diff without writing files, and real runs print a git checkpoint line for reverting changes.

The project is aimed at developers who already use Claude Code, GitHub Copilot in VS Code or Codex and want to cut token spend on routine coding work. Installers are provided for each of those three environments, and the server can also be added to any MCP client by hand.

## Features

- **Delegated coding agent:** GLM runs a tool loop over read, write, edit, list and bash commands inside a specified working directory.
- **Dry-run previews:** A dry_run option shows the proposed diff without modifying any files.
- **Usage ledger:** Every GLM call is recorded locally with model name and input and output token counts.
- **Peak-aware model routing:** Model selection adjusts for the China peak pricing window and can be tuned with a cost bias setting.
- **Live progress updates:** Progress notifications report iteration count, token count and tokens per second while a run is active.
- **Revertable changes:** After a real run the server prints a git checkpoint revert command when the workdir is a git repository.

## Good for

- Offloading routine code edits from an expensive main model to cheaper GLM tokens
- Previewing an agent's proposed changes as a diff before applying them
- Tracking how much GLM usage and spend a coding session generated
- Running delegated coding work from Claude Code, Copilot or Codex without changing their workflow

## Tools

From the tool list in its README, going by the names, 1 of 4 tools reads data; 3 names don't say. From the server's own tool labels and tool names; not verified by us.

- `glm_agent`: GLM as a coding agent in your repo, with read, write, edit and run capabilities and optional dry run.
- `glm_delegate`: Pure text generation, hidden by default and enabled with GLM_DELEGATE=on.
- `glm_recommend`: Advisory output on whether GLM or the main model should handle a task, with no GLM call.
- `glm_status` (name suggests: reads): Shows peak window, active model, usage ledger totals and configuration health, with no GLM call.

## FAQ

### Which main coding agents does glm-mcp support?

The project provides one-command installers for Claude Code, GitHub Copilot in VS Code and Codex, and the standalone package works with any MCP client.

### Do I need an API key to install glm-mcp?

The server starts and answers MCP introspection without a key, but GLM calls require a Z.ai GLM Coding Plan key set as GLM_API_KEY.

### What does the dry run mode do?

With dry_run set to true, GLM proposes a full diff and writes nothing, so changes can be approved before they are applied.

### Where does the code go when GLM runs?

GLM traffic is sent to Z.ai servers in China, so the project recommends keeping sensitive or regulated code on the main model.

### Is glm-mcp free?

Yes. glm-mcp is open source, so you can use and self-host it for free.

### What are the best alternatives to glm-mcp?

The closest alternatives to glm-mcp are MCP Glm, LLM CLI Gateway, Ai Cli MCP, LLM Provider MCP and Proxima.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [MCP Glm](https://ai-powered.com/mcp/mcp-glm): MCP Glm is an MCP server for ai models and llm tooling.
- [LLM CLI Gateway](https://ai-powered.com/mcp/llm-cli-gateway): LLM CLI Gateway is an open-source MCP server for ai models and llm tooling.
- [Ai Cli MCP](https://ai-powered.com/mcp/ai-cli-mcp): Ai Cli MCP is an open-source MCP server for ai models and llm tooling.
- [LLM Provider MCP](https://ai-powered.com/mcp/llm-provider-mcp): LLM Provider MCP is an open-source MCP server for ai models and llm tooling.
- [Proxima](https://ai-powered.com/mcp/proxima): Proxima is a freemium MCP server for ai models and llm tooling.
- [Antigravity MCP](https://ai-powered.com/mcp/antigravity-mcp): Antigravity MCP is an open-source MCP server for developer tools.
- [model-worker-mcp](https://ai-powered.com/mcp/model-worker-mcp): model-worker-mcp is an open-source MCP server for developer tools.
- [Multi-MCP](https://ai-powered.com/mcp/multi-mcp): Multi-MCP is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/glm-mcp-2
