Skip to main content
Glama

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.sh

Custom 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.json

Related 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              │
└──────────────────────────────────────────────────────────────┘
  1. Agent queries claude_models to verify available models for EnMaaS or Vertex AI projects.

  2. Agent calls claude_prompt with prompt + chosen mode/model/effort.

  3. MCP server resolves mode defaults (effort, appended system prompt, gateway routing).

  4. Returns { command, cwd } — a heredoc-based shell command with ANSI stream formatting.

  5. Agent executes via Shell tool (block_until_ms: 0 for 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" }

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": "claude-opus-4-8" }

Execute the returned command with block_until_ms: 0 to background it. Read the terminal file when done.

Modes

Mode

Default effort

Role

architect

high

Architecture analysis — boundaries, coupling, gaps

planner

high

Plan creation — incremental steps, acceptance criteria

reviewer

max

Code review — multi-lens, severity-graded

explorer

low

Quick research — concise, evidence-cited

executor

high

Implementation — hexagonal, small batches

Without mode, the tool builds a raw command (caller controls everything).

Parameters

Param

Required

Description

prompt

Yes

The prompt to send

mode

No

Dispatch mode (see table above)

model

No

Exact model name (e.g. claude-opus-4-8, rits/zai-org/glm-5-3)

secondaryModel

No

Fallback model name for cross-provider failover (defaults to Sonnet)

effort

No

low / medium / high / xhigh / max

provider

No

Inference provider: auto (default), enmaas, or vertex

primaryProject

No

Primary GCP project ID for Vertex AI execution

secondaryProject

No

Secondary GCP project ID for Vertex failover

primaryCredentials

No

Path to primary GCP service account credentials JSON

secondaryCredentials

No

Path to secondary GCP service account credentials JSON

systemPrompt

No

System prompt override

sessionId

No

Resume a previous session

cwd

No

Working directory for Claude CLI

Files

File

Purpose

server.js

MCP entry point — thin wiring, delegates to command-builder

command-builder.js

Pure logic — shellQuote, buildCommand, mode resolution

failover.js

Failover logic — Vertex quota retry & EnMaaS-to-Vertex subshell failover

providers.js

Provider routing & environment variables configuration

modes.js

Dispatch mode definitions (effort + system prompt per role)

setup.sh

From-source setup: deps + MCP registration & --configure CLI

install.sh

Curl-pipeable installer: download release + register

Environment & Configuration

Variable

Default

Purpose

CLAUDE_BIN

claude

Path to Claude CLI binary

CLAUDE_MCP_DIR

~/.local/share/claude-mcp-server

Install location (install.sh only)

ENMAAS_BASE_URL

https://api.enmaas.example.com

Base URL for Red Hat EnMaaS AI Gateway

ENMAAS_KEY

(empty)

API key / token for EnMaaS authentication

VERTEX_PRIMARY_PROJECT

(empty)

Default primary GCP project ID

VERTEX_SECONDARY_PROJECT

(empty)

Secondary GCP project ID for failover

VERTEX_PRIMARY_CREDENTIALS

(empty)

Primary GCP service account JSON credentials file

VERTEX_SECONDARY_CREDENTIALS

(empty)

Secondary GCP service account JSON credentials file

Configuration CLI (setup.sh --configure)

Configure or update MCP credentials and failover settings:

./setup.sh --configure \
  --primary-project "<PRIMARY_PROJECT_ID>" \
  --failover-project "<SECONDARY_PROJECT_ID>" \
  --primary-credentials "/path/to/primary-sa.json" \
  --failover-credentials "/path/to/secondary-sa.json" \
  --gateway-url "https://api.enmaas.example.com" \
  --enmaas-key "secret-key"

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A 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.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      An 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.
      -