zai
MCP server from Zrald1/zai-mcp-server
claude mcp add --transport stdio zrald1-zai-mcp-server npx -y zai-mcp-server@latest \ --env MODEL="deepseek/deepseek-r1-0528:free" \ --env GEMINI_API_KEY="YOUR_GEMINI_API_KEY" \ --env DEEPSEEK_API_KEY="YOUR_DEEPSEEK_API_KEY" \ --env ANTHROPIC_API_KEY="YOUR_ANTHROPIC_API_KEY" \ --env OPENROUTER_API_KEY="YOUR_OPENROUTER_API_KEY(s)"
How to use
ZAI is a free multi-provider MCP (Model Context Protocol) server that aggregates multiple AI providers (OpenRouter, Anthropic, DeepSeek, Gemini, etc.) and enables automatic failover, AI-to-AI loops, and smart data collection. The server exposes a unified interface that can route requests to different models and providers, rotate API keys for high availability, and support voting/consensus strategies when multiple models participate. With the included configuration, you can specify per-provider models, API keys, and preferred defaults. To get started, supply your provider API keys and desired model(s), then launch the MCP server using the provided command. The system will handle switching between providers as needed to maintain availability and quality of responses.
How to install
Prerequisites:
- Node.js v18+ (npm comes bundled with Node.js)
- Basic familiarity with running CLI commands
Step-by-step installation:
- Install Node.js 18+ from https://nodejs.org/ (includes npm)
- Create a configuration file for the MCP server (example below) and save as mcp_config.json:
{
"mcpServers": {
"zai-mcp-server": {
"command": "npx",
"args": ["-y", "zai-mcp-server@latest"],
"env": {
"OPENROUTER_API_KEY": "YOUR_OPENROUTER_API_KEY(s)",
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY",
"DEEPSEEK_API_KEY": "YOUR_DEEPSEEK_API_KEY",
"GEMINI_API_KEY": "YOUR_GEMINI_API_KEY",
"MODEL": "deepseek/deepseek-r1-0528:free"
}
}
}
}
- Run the MCP server using npx (as shown in the config):
npx -y zai-mcp-server@latest
- Optional: if you prefer not to run directly via npx each time, install the package locally and run your own startup script that loads mcp_config.json and launches the server accordingly.
- Validate the server is up by querying the MCP endpoint you expose (e.g., HTTP API or local port) and verify you receive responses from the configured providers.
Additional notes
Tips and common considerations:
- Keep your provider API keys secure and do not commit them to public repos.
- The MODEL value should reflect the specific provider/model you intend to use; you can mix and match models across providers for failover strategies.
- If you see rate limits or quota issues, rotate API keys or add additional keys to the provider’s key list where supported.
- The configuration supports multiple providers and can enable consensus/voting strategies when combining results from different models.
- Monitor response latency and error rates to adjust the provider order or enable automatic backoff.
- Ensure network access to external APIs is allowed from the host running the MCP server (firewalls, VPNs, etc.).