Skip to content

Instantly share code, notes, and snippets.

@whit3rabbit
Last active April 14, 2026 01:41
Show Gist options
  • Select an option

  • Save whit3rabbit/5fbee839c81f44c877aa5278489d9636 to your computer and use it in GitHub Desktop.

Select an option

Save whit3rabbit/5fbee839c81f44c877aa5278489d9636 to your computer and use it in GitHub Desktop.
zai with claude code
# Get coding plan
https://z.ai/subscribe
You then go generate an API key.
# use an isolated version of claude code with z.ai support
# https://github.com/numman-ali/cc-mirror
# Z.ai (GLM-5/4.7/4.5-Air)
npx cc-mirror quick --provider zai --api-key "$Z_AI_API_KEY_HERE"
# Install Z.AI mcp server
npm install -g @z_ai/mcp-server
# Add MCP servers
~/.cc-mirror/zai/config/.claude.json
"mcpServers": {
"zai-mcp-server": {
"command": "npx",
"args": ["-y", "@z_ai/mcp-server"],
"env": {
"Z_AI_API_KEY": "Z_AI_API_KEY_HERE",
"Z_AI_MODE": "ZAI"
}
}
},
# MCP servers (require auth header)
┌──────────────────┬─────────────┬───────────────────────────────────────┐
│ Server │ Type │ URL │
├──────────────────┼─────────────┼───────────────────────────────────────┤
│ zai-mcp-server │ stdio (npx) │ local │
├──────────────────┼─────────────┼───────────────────────────────────────┤
│ web-search-prime │ http │ api.z.ai/api/mcp/web_search_prime/mcp │
├──────────────────┼─────────────┼───────────────────────────────────────┤
│ web-reader │ http │ api.z.ai/api/mcp/web_reader/mcp │
├──────────────────┼─────────────┼───────────────────────────────────────┤
│ zread │ http │ api.z.ai/api/mcp/zread/mcp │
└──────────────────┴─────────────┴───────────────────────────────────────┘
# Run "zai" for claude code with zai support
zai
# Show MCP server
/mcp
❯ zai-mcp-server · ✔ connected
# Show status
/status
Anthropic base URL: https://api.z.ai/api/anthropic
Model: glm-5
MCP servers: 3 connected · /mcp
Setting sources: User settings, Project local settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment