glm-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ZAI_API_KEY | No | Your z.ai API key. If not set, the server looks for ~/.config/zai/api-key. | |
| ZAI_BASE_URL | No | Base URL for z.ai API requests. Your key is sent to whatever host it names. | https://api.z.ai/api/anthropic |
| GLM_MCP_ROOTS | No | Colon-separated absolute paths that confine file reads. When unset, the server is confined to the directory it was started in. | |
| ZAI_MODELS_URL | No | URL for the glm_models endpoint. Does not follow ZAI_BASE_URL. | https://api.z.ai/api/paas/v4/models |
| GLM_MCP_MAX_DEPTH | No | Maximum directory depth for glob walks. | 24 |
| GLM_MCP_TIMEOUT_MS | No | Request timeout for the whole call, including retries. | 600000 |
| GLM_MCP_GLOB_IGNORE | No | Comma-separated list of directory names to skip during glob expansion. Replaces the default set; empty disables skipping. | node_modules,.git,dist,build,coverage,.next,.turbo,vendor,target |
| GLM_MCP_MAX_ENTRIES | No | Maximum directory entries examined per call. | 200000 |
| GLM_MCP_PROGRESS_MS | No | Heartbeat interval for MCP progress notifications on long calls. Only sent when the client provides a progress token. | 5000 |
| GLM_MCP_ALLOW_ANY_PATH | No | Set to '1' to turn off path confinement completely. Widens the roots; does not re-open credential files. | |
| GLM_MCP_CONTEXT_TOKENS | No | Overrides the context window used to derive the file character budget for every model at once. | |
| GLM_MCP_MAX_FILE_BYTES | No | Per-file size limit, checked before the file is read. | 5 MB |
| GLM_MCP_MAX_FILE_CHARS | No | Total context characters allowed for file content, headers and separators included. | derived per model (~2.9M for GLM-5.3) |
| GLM_MCP_ALLOW_ZCODE_KEY | No | Set to '1' to allow reading the z.ai key from ZCode's config (~/.zcode/v2/config.json). Opt-in only. | |
| GLM_MCP_GLOB_TIMEOUT_MS | No | Wall-clock budget for glob expansion, checked between operations. | 10000 |
| GLM_REVIEW_MIN_SUBSTANCE | No | Least analysis (in characters) a glm_review verdict must have besides the verdict line. Lower or missing substance causes refusal. | 200 |
| GLM_MCP_MAX_BRACE_EXPANSIONS | No | Total allowed {a,b} brace expansions in a single glob. | 1024 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| glm_askA | Send a prompt to a Z.ai GLM model (default GLM-5.3) and return its answer. GLM-5.3 is an independent frontier model with a million-token context window, so this is useful for a genuine second opinion from a different model, for cross-checking reasoning, and for analysing far more source material at once than fits in a normal context. Optionally pass file paths to include as context. Model and reasoning are the latency levers: thinking tokens are generated before the first character of the answer, and the thinking budget spans 2,048 at 'low' against 24,576 at 'max' — a twelve-fold spread. Route mechanical work (extract, summarise, reformat, classify) to glm-5.3-flash or glm-4.6 at 'low'; glm-4.6 alone can go further, to 'none' — glm-5.3-flash cannot run with reasoning off, so its 'none' is raised to 'low'. Keep GLM-5.3 at 'high' or 'max' for design review, cross-checking reasoning, and hunting a subtle bug. glm-4.6 and glm-4.7 accept reasoning 'none'; GLM-5.3 and glm-5.3-flash cannot, so 'low' is their shallowest setting. |
| glm_reviewA | Review a change with a Z.ai GLM model (default GLM-5.3) and return a VERDICT: the reply is the reviewer's analysis and always ends with a final line that is exactly VERDICT: PASS or VERDICT: CHANGES_REQUIRED — the same vocabulary bin/glm-review reads, so a shell pipeline can consume the result. Pass the change as a unified diff and the requirement it was meant to implement as spec: review against intent is what catches silent scope-narrowing, and the reviewer is warned off both recorded pathologies — findings that are padded or fabricated, and work that is stubbed, mocked or hardcoded rather than implemented. A reply that is a bare verdict with no analysis behind it comes back as an error, never as a clean review. This server never runs git and inspects no repository state on its own: the diff comes from the caller, and files resolve exactly as glm_ask resolves them. Reviews default to reasoning 'high' — the depth the glm_ask routing guidance reserves for review and bug-hunting — and a different model than the one that wrote the code is worth choosing where you can, because a model re-reading its own work reliably under-reports. |
| glm_modelsA | List the GLM model ids available on the configured Z.ai account, each with a one-line role; an id this server's model table does not know is listed bare. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 3 tools
glm_ask and glm_review both send prompts to GLM, which could cause some overlap, but glm_review's strict VERDICT format and diff/spec input make its purpose clearly distinct. glm_models is wholly separate.
glm_ask and glm_review follow a consistent verb-first pattern, while glm_models breaks it by using a noun instead of a verb like list_models. Minor deviation, but the prefix keeps the family recognizable.
Three tools is within the ideal 3-15 range and each tool earns its place: one for general prompting, one for structured review, and one for model discovery. The scope is tightly focused.
For a GLM-oriented server, the surface covers the core needs: asking questions, reviewing changes against a spec, and listing available models. No obvious dead ends or missing operations within the stated purpose.