- Home
- MCP servers
- CCGLM
CCGLM
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"nosolosoft-ccglm-mcp": {
"command": "python3",
"args": [
"/home/manu/IA/ccglm-mcp/ccglm_mcp_server.py"
],
"env": {
"GLM_BASE_URL": "https://api.z.ai/api/anthropic",
"GLM_AUTH_TOKEN": "YOUR_API_TOKEN"
}
}
}
}The CCGLM MCP Server lets Claude Code invoke another Claude Code instance that uses Z.AI’s GLM backend, all from your main Claude Code environment. It routes prompts through a dedicated MCP tool to the GLM-backed model, enabling code generation, analysis, and general queries without altering your primary settings.
How to use
You interact with the server through the MCP tool named glm_route. Use this tool to send your prompt and receive responses from the GLM-4.6 backend via Claude CLI. You can perform code generation, deep analysis, and general inquiries. When you want to run it from Claude Code, call the MCP tool with your prompt. You can also use the hashtag style commands to trigger specific tasks.
How to install
Prerequisites: Python and pip must be available on your system.
- Install dependencies.
cd ~/IA/ccglm-mcp
pip install -r requirements.txt
Additional configuration and usage details
Register the MCP server by adding the following to your Claude settings so the MCP framework can start the local server.
{
"mcpServers": {
"ccglm_mcp": {
"command": "python3",
"args": ["/home/manu/IA/ccglm-mcp/ccglm_mcp_server.py"],
"timeout": 300000
}
}
}
Optional alias and environment setup
Optionally, configure an alias to simplify usage and pass credentials automatically.
# Z.AI GLM Integration
export GLM_API_TOKEN="5951e8ffb37b4f038ba9a47f49e86ff4.ZYOeeSK1MWARJ8YB"
alias ccglm='ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic ANTHROPIC_AUTH_TOKEN=$GLM_API_TOKEN claude --dangerously-skip-permissions -c'
Recharge your shell with:
source ~/.zshrc
Testing the server
Run the test suite to verify file tracking, log sanitization, and basic prompt handling.
cd ~/IA/ccglm-mcp
python3 test_server.py
Security and logging
Keep the GLM credentials in a protected environment file and ensure logs sanitize tokens. Logs are sent to stderr to avoid interfering with the MCP protocol.
Configuration notes
Timeouts are defined in the server code with a default of 600 seconds and a maximum of 2400 seconds. Claude CLI runs with specific flags to streamline non-interactive usage.
Troubleshooting
If the Claude CLI is not found, ensure the Claude CLI is installed and accessible in your PATH.
If GLM authentication fails, verify the token in your environment and its active status.
For timeouts, adjust the server timeouts in the configuration file and restart Claude Code.
Usage from the terminal
Beyond the MCP, you can invoke GLM directly from the terminal using the configured alias.
# Interactive use
ccglm
# Prompt-based use
echo "Explain recursion" | ccglm
Updating
To update the server, pull the latest changes and reinstall dependencies, then restart Claude Code to apply the updates.
cd ~/IA/ccglm-mcp
git pull # if this directory is a git repo
pip install -r requirements.txt --upgrade
Restart Claude Code to reload the MCP server."
## Notes
This server is designed to route prompts to the GLM-4.6 backend via Claude CLI and the Z.AI GLM API, using your main Claude Code environment without changing its core settings.
## Available tools
### glm\_route
Enables routing of prompts to GLM-4.6 via Claude CLI, supporting code generation, deep analysis, and general queries while excluding internal project files from tracking.