claude-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-mcp-server Review the recent changes for bugs and suggest fixes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-mcp-server
MCP server that builds Claude CLI commands with mode defaults resolved. Returns a shell command string for the calling agent to execute via Cursor's Shell tool.
Install
One command — no clone needed:
bash <(curl -fsSL https://raw.githubusercontent.com/tal-hason/claude-mcp-server/main/install.sh)Prerequisites: Node.js >= 20, jq, curl, Claude CLI
Install from source
git clone https://github.com/tal-hason/claude-mcp-server.git
cd claude-mcp-server
./setup.shCustom install location
CLAUDE_MCP_DIR=~/my-tools/claude-mcp bash <(curl -fsSL https://raw.githubusercontent.com/tal-hason/claude-mcp-server/main/install.sh)Uninstall
rm -rf ~/.local/share/claude-mcp-server
jq 'del(.mcpServers["claude-cli"])' ~/.cursor/mcp.json > /tmp/mcp.json && mv /tmp/mcp.json ~/.cursor/mcp.jsonRelated MCP server: claude-bridge
How it works
┌──────────────────────────────────────────────────────────────┐
│ 1. Agent calls claude_models to inspect available models │
│ 2. Agent calls claude_prompt via MCP │
│ → MCP server resolves mode defaults, builds command │
│ → Returns JSON { command, cwd } │
│ 3. Agent executes command via Shell tool │
│ 4. Formatted stream output renders in terminal │
└──────────────────────────────────────────────────────────────┘Agent queries
claude_modelsto verify available models for EnMaaS or Vertex AI projects.Agent calls
claude_promptwith prompt + chosen mode/model/effort.MCP server resolves mode defaults (effort, appended system prompt, gateway routing).
Returns
{ command, cwd }— a heredoc-based shell command with ANSI stream formatting.Agent executes via Shell tool (
block_until_ms: 0for long tasks).
No child process management, no WebSocket bridge, no timeouts — the MCP server is a pure function.
Usage
Two tools:
claude_models: Discovers available models for EnMaaS and Vertex AI projects before dispatching.claude_prompt: Builds the execution command with resolved mode defaults, routing, and failover.
Model discovery
CallMcpTool: user-claude-cli / claude_models
{ "provider": "all", "project": "my-vertex-project" }Parameters:
provider:"all"(default),"enmaas", or"vertex"project: Optional GCP project ID to query specific Vertex AI quotas/models. Auto-detects fromVERTEX_PROJECT_ID,ANTHROPIC_VERTEX_PROJECT_ID, orCLOUDSDK_CORE_PROJECTenvironment variables if omitted; explicitprojectparameter takes precedence.
Returns real-time models for EnMaaS (e.g. rits/zai-org/glm-5-3, rits/deepseek-ai/DeepSeek-V4.1-Flash-1017) and supported Claude aliases (sonnet, opus, haiku) per Vertex AI project.
Quick exploration
CallMcpTool: user-claude-cli / claude_prompt
{ "prompt": "What dependencies does server.js import?", "mode": "explorer", "cwd": "/path/to/repo" }Parse the response JSON, then execute the command field via the Shell tool.
Long-running review (backgrounded)
CallMcpTool: user-claude-cli / claude_prompt
{ "prompt": "<full review prompt>", "mode": "reviewer", "model": "opus" }Execute the returned command with block_until_ms: 0 to background it. Read the terminal file when done.
Modes
Mode | Default model | Default effort | Role |
|
| high | Architecture analysis — boundaries, coupling, gaps |
|
| high | Plan creation — incremental steps, acceptance criteria |
|
| max | Code review — multi-lens, severity-graded |
|
| low | Quick research — concise, evidence-cited |
|
| high | Implementation — hexagonal, small batches |
Without mode, the tool builds a raw command (caller controls everything).
Failover & Resilience
Built-in multi-tier failover ensures uninterrupted execution across cloud and gateway outages:
Failover Triggers:
Quota exhaustion: HTTP 429,
RESOURCE_EXHAUSTED, Rate limit, credit balance, budget exceeded.Gateway, Infra & Tier Policy/Model errors: HTTP 500, 502, 503, 504, 529,
ECONNRESET,ETIMEDOUT, socket hang up,UNAVAILABLE, Vertex org-policyallowedModelsconstraints, EnMaaS model authorization (model is not authorized), model deployment availability, and unset subshellENMAAS_KEY.Process timeouts: Exit code 124 or 137 (controlled via
CLAUDE_TIMEOUT, default 1800s).
User Error Veto: Genuine client errors (HTTP 400
invalid_request_error, 401Unauthorized, non-model 403Forbidden) immediately exit with the failure code without triggering failover, preventing wasteful quota consumption on unrecoverable caller errors.Per-Tier
--settingsOverride: Every Vertex tier explicitly passes--settings '{"env":{...}}'with its project and credentials so usersettings.jsonenvironment defaults never hijack project routing.Shared-Quota Bypass (Cross-Provider): When Tier 1 (EnMaaS) exhausts shared enterprise quota (429), the cascade bypasses Tier 2 (shared GCP project) and routes directly to Tier 3 (isolated dedicated quota). If Tier 3 fails, it gracefully falls back to Tier 2.
Project Deduplication: Identical project IDs across primary, secondary, and tertiary tiers are automatically deduplicated and promoted to prevent redundant invocations against the same project quota. Note that
primaryProjecttakes precedence over the legacyprojectparameter.Prompt Size Guard: The combined byte length of
promptandsystemPrompt(and any mode-appended prompt) is capped at 100KB to prevent argument buffer overflow and enforce clean streaming via temporary files (E2BIGprevention). When failover is enabled, system prompts are safely injected via temporary file redirection ("$(< "$_spfile")") rather than raw command-line argument expansion.Automated Stderr Redaction: All error logs and terminal failure outputs across both failover cascades and single-tier commands are filtered through stream-level
sed -Eredaction to strip Bearer, Basic, and Token authorization headers, API keys, JWTs, JSON cookies, and multi-line PEM blocks prior to emitting to stderr. Redaction applies strictly to stderr error logs; successful model output on stdout is buffered and delivered unmodified.
Parameters
Param | Required | Description |
| Yes | The prompt to send (combined prompt + systemPrompt <= 100KB) |
| No | Dispatch mode (see table above) |
| No | Exact model name (e.g. |
| No | Fallback model name for cross-provider failover (defaults to |
| No | Tertiary model name for 3-tier cascade fallback (defaults to |
| No |
|
| No | Inference provider: |
| No | Primary GCP project ID for Vertex AI execution |
| No | Secondary GCP project ID for Vertex failover (Tier 2) |
| No | Tertiary GCP project ID for 3-tier cascade failover (Tier 3) |
| No | Path to primary GCP service account credentials JSON |
| No | Path to secondary GCP service account credentials JSON |
| No | Path to tertiary GCP service account credentials JSON |
| No | System prompt override |
| No | Resume a previous session |
| No | Working directory for Claude CLI |
Files
File | Purpose |
| MCP entry point — thin wiring, delegates to command-builder |
| Pure logic — shellQuote, buildCommand, mode resolution |
| CLI streaming output formatter — strips ANSI, parses events, formats for UI |
| Failover logic — Vertex quota retry, cross-provider, & 3-tier cascade failover |
| Shell script generation — heredoc templates, sticky markers, signal traps, and redaction |
| Provider routing & environment variables configuration |
| Dispatch mode definitions (effort + system prompt per role) |
| Dynamic model discovery and capability probing ( |
| From-source setup: deps + MCP registration & |
| Curl-pipeable installer: download release + register |
Environment & Configuration
Variable | Default | Purpose |
|
| Path to Claude CLI binary |
|
| Per-tier execution timeout in seconds |
|
| Install location (install.sh only) |
|
| Base URL for Red Hat EnMaaS AI Gateway |
| (empty) | API key / token for EnMaaS authentication (recommended via shell env) |
| (empty) | Default primary GCP project ID |
| (empty) | Secondary GCP project ID for failover |
| (empty) | Tertiary GCP project ID for 3-tier cascade failover (alias: |
| (empty) | Primary GCP service account JSON credentials file |
| (empty) | Secondary GCP service account JSON credentials file |
| (empty) | Tertiary GCP service account JSON credentials file (alias: |
Configuration CLI (setup.sh --configure)
Configure or update MCP credentials and failover settings. To protect sensitive credentials from process listing exposure (ps aux), export ENMAAS_KEY in your environment rather than passing it as a CLI flag:
export ENMAAS_KEY="<your-secret-key>"
./setup.sh --configure \
--primary-project "<PRIMARY_PROJECT_ID>" \
--secondary-project "<SECONDARY_PROJECT_ID>" \
--tertiary-project "<TERTIARY_PROJECT_ID>" \
--primary-credentials "/path/to/primary-sa.json" \
--secondary-credentials "/path/to/secondary-sa.json" \
--tertiary-credentials "/path/to/tertiary-sa.json" \
--gateway-url "https://api.enmaas.example.com"Available Tools
2 toolsclaude_modelsA
List available models for Red Hat EnMaaS AI Gateway and GCP Vertex AI projects with cost and tier tags. INSTRUCTION: Call this tool FIRST to inspect supported models before generating a command with claude_prompt. Returns real-time models for EnMaaS (free GLM 5.3) and supported canonical Claude models (sonnet, opus, haiku, claude-sonnet-5, claude-opus-4-8) per Vertex AI project.
Inputs: project, provider.
claude_promptA
Build a Claude CLI command with intelligent work-to-model mode defaults, gateway routing, and 3-tier failover cascade. INSTRUCTION: Call claude_models first to discover supported models before calling this tool. Supports Red Hat EnMaaS AI Gateway (free GLM 5.3) and GCP Vertex AI (canonical sonnet, opus, claude-sonnet-5, claude-opus-4-8) with shared-quota bypass and tertiary fallback. Returns JSON { command, cwd, description, block_until_ms } for agent shell execution.
Inputs: prompt (required), cwd, mode, model, +14 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly separate roles: claude_models performs discovery/listing, while claude_prompt constructs a CLI command. The descriptions even encode an explicit call-order dependency (models first, then prompt), leaving no realistic path to misselection.
Both tools follow a consistent 'claude_<noun>' prefix convention, which is predictable and readable. The only minor weakness is that the names are noun-based rather than verb_noun, so 'claude_prompt' alone doesn't immediately convey that it builds a command rather than sends a prompt.
Two tools is a deliberately minimal surface, but each fills a genuine role (discover models, then generate a routed command). It is slightly under the typical 3-15 range, yet not padded with redundant operations.
The pair covers the full intended workflow: discover supported models and emit a JSON command payload for the agent to execute, with gateway/failover logic baked in. Minor gaps exist around validating or introspecting generated commands, but the core lifecycle is closed since execution is intentionally delegated to the shell.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA server implementation for the Model Context Protocol (MCP) that allows Claude AI to execute commands through a command-line interface, enabling direct system interactions from within Claude.-
- AlicenseAqualityDmaintenanceAn MCP server that lets host-side Claude Cowork dispatch work into Claude Code running inside your devcontainer over stdio.1691 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server wrapping the Cursor CLI agent, enabling Claude Code and other MCP clients to delegate tasks to Cursor's AI agent for file writing, bash commands, and codebase queries.-
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that provides a bridge to Anthropic's Claude CLI. It allows MCP-compliant clients like Claude Desktop or Gemini to start new chat sessions or continue existing ones.2108 npmISC