MCP Claude Shell Server
A Node.js MCP server that wraps the Claude Code CLI to enable parallel execution of AI requests for code generation, editing, and refactoring. It features built-in retry logic, model selection, and JSON validation for structured outputs.
README
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
| Tool | Description |
|---|---|
claude_generate |
Generate code or text with retry and model selection |
claude_edit |
Edit files with retry and model selection |
claude_refactor |
Refactor code with retry and model selection |
claude_generate_json |
Generate JSON response with validation |
claude_edit_json |
Edit with JSON response validation |
Tool Parameters
All tools support these parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
string | required | The prompt to send to Claude |
model |
string | "haiku" | Model: haiku, sonnet, opus |
timeout |
number | 660 | Timeout in seconds |
maxRetries |
number | 3 | Maximum retry attempts |
maxTurns |
number | - | Maximum agent turns |
outputFormat |
string | "json" | Output format: text, json, stream-json |
systemPrompt |
string | - | Replace default system prompt |
appendSystemPrompt |
string | - | Append to default system prompt |
allowedTools |
string[] | - | Additional tools to allow |
disallowedTools |
string[] | - | Tools to disallow |
addDirs |
string[] | - | Additional directories to access |
verbose |
boolean | false | Enable 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.