Install
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
Windows / Linux path
%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"io-github-djerok-glm-mcp": {
"command": "npx",
"args": [
"-y",
"glm-mcp"
],
"env": {
"GLM_API_KEY": "<YOUR_VALUE>",
"GLM_CAP": "off",
"GLM_BASE_URL": "https://api.z.ai/api/anthropic",
"GLM_COST_BIAS": "1.5",
"GLM_MAX_TOKENS": "32768",
"GLM_PEAK_MODEL": "glm-5.2",
"GLM_PEAK_END_CN": "18",
"GLM_OFFPEAK_MODEL": "glm-5.2",
"GLM_PEAK_START_CN": "14",
"GLM_MAX_CONCURRENT": "1",
"GLM_AGENT_MAX_ITERS": "30",
"GLM_MAX_TOKENS_CEILING": "131072"
}
}
}
}
Restart Claude Desktop to activate the new server.
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
Windows / Linux path
.cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global).cursor/mcp.json (project) or ~/.cursor/mcp.json (global){
"mcpServers": {
"io-github-djerok-glm-mcp": {
"command": "npx",
"args": [
"-y",
"glm-mcp"
],
"env": {
"GLM_API_KEY": "<YOUR_VALUE>",
"GLM_CAP": "off",
"GLM_BASE_URL": "https://api.z.ai/api/anthropic",
"GLM_COST_BIAS": "1.5",
"GLM_MAX_TOKENS": "32768",
"GLM_PEAK_MODEL": "glm-5.2",
"GLM_PEAK_END_CN": "18",
"GLM_OFFPEAK_MODEL": "glm-5.2",
"GLM_PEAK_START_CN": "14",
"GLM_MAX_CONCURRENT": "1",
"GLM_AGENT_MAX_ITERS": "30",
"GLM_MAX_TOKENS_CEILING": "131072"
}
}
}
}
Cursor usually picks up config changes automatically; if the server does not appear, reload the window.
Add to .mcp.json (project) or ~/.claude.json (global)
Windows / Linux path
.mcp.json (project) or %USERPROFILE%\.claude.json (global).mcp.json (project) or ~/.claude.json (global){
"mcpServers": {
"io-github-djerok-glm-mcp": {
"command": "npx",
"args": [
"-y",
"glm-mcp"
],
"env": {
"GLM_API_KEY": "<YOUR_VALUE>",
"GLM_CAP": "off",
"GLM_BASE_URL": "https://api.z.ai/api/anthropic",
"GLM_COST_BIAS": "1.5",
"GLM_MAX_TOKENS": "32768",
"GLM_PEAK_MODEL": "glm-5.2",
"GLM_PEAK_END_CN": "18",
"GLM_OFFPEAK_MODEL": "glm-5.2",
"GLM_PEAK_START_CN": "14",
"GLM_MAX_CONCURRENT": "1",
"GLM_AGENT_MAX_ITERS": "30",
"GLM_MAX_TOKENS_CEILING": "131072"
}
}
}
}
The server will be available in the next Claude Code session.
Add to .vscode/mcp.json
Windows / Linux path
.vscode\mcp.json.vscode/mcp.json{
"servers": {
"io-github-djerok-glm-mcp": {
"command": "npx",
"args": [
"-y",
"glm-mcp"
],
"env": {
"GLM_API_KEY": "<YOUR_VALUE>",
"GLM_CAP": "off",
"GLM_BASE_URL": "https://api.z.ai/api/anthropic",
"GLM_COST_BIAS": "1.5",
"GLM_MAX_TOKENS": "32768",
"GLM_PEAK_MODEL": "glm-5.2",
"GLM_PEAK_END_CN": "18",
"GLM_OFFPEAK_MODEL": "glm-5.2",
"GLM_PEAK_START_CN": "14",
"GLM_MAX_CONCURRENT": "1",
"GLM_AGENT_MAX_ITERS": "30",
"GLM_MAX_TOKENS_CEILING": "131072"
}
}
}
}
Reload the VS Code window to activate.
Add to ~/.codeium/windsurf/mcp_config.json
Windows / Linux path
%USERPROFILE%\.codeium\windsurf\mcp_config.json~/.codeium/windsurf/mcp_config.json{
"mcpServers": {
"io-github-djerok-glm-mcp": {
"command": "npx",
"args": [
"-y",
"glm-mcp"
],
"env": {
"GLM_API_KEY": "<YOUR_VALUE>",
"GLM_CAP": "off",
"GLM_BASE_URL": "https://api.z.ai/api/anthropic",
"GLM_COST_BIAS": "1.5",
"GLM_MAX_TOKENS": "32768",
"GLM_PEAK_MODEL": "glm-5.2",
"GLM_PEAK_END_CN": "18",
"GLM_OFFPEAK_MODEL": "glm-5.2",
"GLM_PEAK_START_CN": "14",
"GLM_MAX_CONCURRENT": "1",
"GLM_AGENT_MAX_ITERS": "30",
"GLM_MAX_TOKENS_CEILING": "131072"
}
}
}
}
Restart Windsurf (or refresh its MCP servers panel) to activate the new server.
Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.
Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Windows / Linux path
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json{
"mcpServers": {
"io-github-djerok-glm-mcp": {
"command": "npx",
"args": [
"-y",
"glm-mcp"
],
"env": {
"GLM_API_KEY": "<YOUR_VALUE>",
"GLM_CAP": "off",
"GLM_BASE_URL": "https://api.z.ai/api/anthropic",
"GLM_COST_BIAS": "1.5",
"GLM_MAX_TOKENS": "32768",
"GLM_PEAK_MODEL": "glm-5.2",
"GLM_PEAK_END_CN": "18",
"GLM_OFFPEAK_MODEL": "glm-5.2",
"GLM_PEAK_START_CN": "14",
"GLM_MAX_CONCURRENT": "1",
"GLM_AGENT_MAX_ITERS": "30",
"GLM_MAX_TOKENS_CEILING": "131072"
}
}
}
}
Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.
Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.
Configuration
Environment variables this server reads. Secrets stay on your machine.
| Name | Required | Description |
|---|---|---|
| GLM_API_KEY secret | Yes | Your Z.ai API key with GLM Coding Plan access. Required. |
| GLM_CAP | No | Output-token cap. Off by default = generous (up to 131072 per call). Set on to enforce GLM_MAX_TOKENS. Default: off Default: off |
| GLM_BASE_URL | No | Anthropic-compatible endpoint. Default: https://api.z.ai/api/anthropic Default: https://api.z.ai/api/anthropic |
| GLM_COST_BIAS | No | How hard to favor GLM (it's ~10x cheaper). Higher = more GLM; 0 = decide on capability only. Default: 1.5 Default: 1.5 |
| GLM_MAX_TOKENS | No | The hard per-call limit applied only when GLM_CAP=on. Default: 32768 Default: 32768 |
| GLM_PEAK_MODEL | No | Model used during China peak. Default: glm-5.2 Default: glm-5.2 |
| GLM_PEAK_END_CN | No | Peak window end (China hour, UTC+8). Default: 18 Default: 18 |
| GLM_OFFPEAK_MODEL | No | Model used off-peak. Default: glm-5.2 Default: glm-5.2 |
| GLM_PEAK_START_CN | No | Peak window start (China hour, UTC+8). Default: 14 Default: 14 |
| GLM_MAX_CONCURRENT | No | GLM caps in-flight requests; keep at 1. Default: 1 Default: 1 |
| GLM_AGENT_MAX_ITERS | No | Max tool-loop turns for glm_agent. Default: 30 Default: 30 |
| GLM_MAX_TOKENS_CEILING | No | The generous default used when the cap is off. Default: 131072 Default: 131072 |