MCP Hub
Back to servers

MCP Claude Shell Server

A Node.js MCP server that wraps the Claude Code CLI to perform parallelized code generation, editing, and refactoring with robust retry logic and JSON validation.

Tools
5
Updated
Nov 30, 2025

MCP Claude Shell Server (Node.js)

A Node.js implementation of an MCP (Model Context Protocol) server that wraps the Claude Code CLI, enabling parallel execution of Claude AI requests.

Features

  • Parallel Execution: Multiple requests are processed concurrently using Promise-based async handling
  • Retry Logic: Automatic retry with configurable attempts and timeouts
  • Model Selection: Support for Haiku, Sonnet, and Opus models
  • JSON Validation: Built-in JSON response validation for structured outputs
  • Full Claude CLI Options: Support for all Claude CLI parameters including system prompts, tool permissions, and more

Installation

npm install
npm run build

Usage

As MCP Server

Add to your Claude Code configuration:

claude mcp add --transport stdio claude-shell -- node /path/to/mcp-claude-node/dist/index.js

Or manually add to ~/.claude.json:

{
  "mcpServers": {
    "claude-shell": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/mcp-claude-node/dist/index.js"]
    }
  }
}

Development

# Run in development mode
npm run dev

# Build for production
npm run build

# Run tests
npx tsx test-client.ts

Available Tools

ToolDescription
claude_generateGenerate code or text with retry and model selection
claude_editEdit files with retry and model selection
claude_refactorRefactor code with retry and model selection
claude_generate_jsonGenerate JSON response with validation
claude_edit_jsonEdit with JSON response validation

Tool Parameters

All tools support these parameters:

ParameterTypeDefaultDescription
promptstringrequiredThe prompt to send to Claude
modelstring"haiku"Model: haiku, sonnet, opus
timeoutnumber660Timeout in seconds
maxRetriesnumber3Maximum retry attempts
maxTurnsnumber-Maximum agent turns
outputFormatstring"json"Output format: text, json, stream-json
systemPromptstring-Replace default system prompt
appendSystemPromptstring-Append to default system prompt
allowedToolsstring[]-Additional tools to allow
disallowedToolsstring[]-Tools to disallow
addDirsstring[]-Additional directories to access
verbosebooleanfalseEnable verbose logging

Architecture

src/
├── index.ts          # Entry point
├── server.ts         # MCP Server main logic
├── claude-cli.ts     # Claude CLI wrapper with retry
├── tools.ts          # Tool definitions
├── types.ts          # TypeScript types
└── utils.ts          # Utility functions

License

MIT

Reviews

No reviews yet

Sign in to write a review