Skip to main content
Glama
Sunalamye

MCP Claude Shell Server

by Sunalamye

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

Related MCP server: SystemPrompt Coding Agent

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

Available Tools

5 tools
claude_editC

Edit files via Claude Code CLI with retry and model selection

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesPrompt to pass to Claude CLI
modelNoModel to use (haiku, sonnet, opus). Default: haiku
timeoutNoTimeout in seconds. Default: 660
maxRetriesNoMaximum retry attempts. Default: 3
maxTurnsNoMaximum agent turns (iterations). Default: unlimited
outputFormatNoOutput format: text, json, stream-json. Default: json
systemPromptNoReplace default system prompt
appendSystemPromptNoAppend to default system prompt
allowedToolsNoAdditional tools to allow without asking
disallowedToolsNoTools to disallow
addDirsNoAdditional directories to access
verboseNoEnable verbose logging. Default: false
enableMcpNoEnable MCP servers in subprocess, allowing recursive calls. Max depth: 3. Default: false
mcpConfigPathNoCustom MCP config path. Default: auto-detect project .mcp.json

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions 'retry and model selection', it fails to describe critical behavioral aspects: what 'edit files' entails (e.g., file modifications, potential overwrites), how retries work, error handling, or output format details. For a tool with 14 parameters and no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Edit files via Claude Code CLI') and adds key features ('with retry and model selection'). There's no wasted verbiage, and it's appropriately sized for a tool with many parameters. However, it could be slightly more structured by explicitly separating purpose from features.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (14 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain what the tool returns, how edits are applied, error conditions, or interaction with sibling tools. While the schema covers parameters, the description fails to provide the holistic context needed for safe and effective use, especially for a file-editing operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, meaning all parameters are documented in the input schema. The description adds minimal value beyond the schema—it mentions 'retry' (hinting at maxRetries) and 'model selection' (hinting at the model parameter), but doesn't provide additional context or usage examples. With high schema coverage, the baseline is 3, and the description doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Edit files') and the mechanism ('via Claude Code CLI'), which is specific and actionable. It also mentions 'retry and model selection' as key features. However, it doesn't explicitly differentiate this tool from its siblings (claude_edit_json, claude_generate, claude_generate_json, claude_refactor), which would be needed for a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings or alternatives. It mentions 'retry and model selection' as features, but doesn't specify scenarios where this tool is preferred over claude_edit_json or claude_generate, nor does it mention any prerequisites or exclusions. This leaves the agent with insufficient context for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_edit_jsonC

Edit with JSON response validation and retry

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesPrompt to pass to Claude CLI
modelNoModel to use (haiku, sonnet, opus). Default: haiku
maxRetriesNoMaximum retry attempts for JSON validation. Default: 3
jsonSchemaNoJSON Schema to validate output against
systemPromptNoReplace default system prompt
appendSystemPromptNoAppend to default system prompt

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'JSON response validation and retry' which hints at some behavior, but doesn't explain what happens when validation fails, what the retry mechanism entails, whether this is a read or write operation, what permissions might be needed, or what the output looks like. For a tool with 6 parameters and no annotation coverage, this is insufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 6 words, with no wasted words or redundant information. It's front-loaded with the core concept. However, this conciseness comes at the cost of clarity - it's arguably too brief for a tool with 6 parameters and complex behavior involving validation and retry logic.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, JSON validation logic, retry mechanism) and the absence of both annotations and output schema, the description is incomplete. It doesn't explain what the tool actually produces, what validation errors look like, how retries work, or what the editing function entails. For a tool that presumably interacts with Claude AI models and performs JSON validation, this leaves critical gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema - it doesn't explain how parameters interact (e.g., systemPrompt vs appendSystemPrompt), provide examples, or clarify edge cases. The baseline of 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Edit with JSON response validation and retry' is vague and tautological - it essentially restates the tool name 'claude_edit_json' without specifying what is being edited or what resource is involved. While it mentions JSON validation and retry mechanisms, it doesn't clearly state the core function (editing what? Claude responses? code? documents?). It fails to distinguish from siblings like 'claude_edit' or 'claude_refactor'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. The description doesn't explain when JSON validation is needed versus using 'claude_edit' without validation, or when to choose this over 'claude_generate_json'. There's no mention of prerequisites, error conditions, or typical use cases that would help an agent select this tool appropriately.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_generateC

Generate code or text via Claude Code CLI with retry and model selection

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesPrompt to pass to Claude CLI
modelNoModel to use (haiku, sonnet, opus). Default: haiku
timeoutNoTimeout in seconds. Default: 660
maxRetriesNoMaximum retry attempts. Default: 3
maxTurnsNoMaximum agent turns (iterations). Default: unlimited
outputFormatNoOutput format: text, json, stream-json. Default: json
systemPromptNoReplace default system prompt
appendSystemPromptNoAppend to default system prompt
allowedToolsNoAdditional tools to allow without asking
disallowedToolsNoTools to disallow
addDirsNoAdditional directories to access
verboseNoEnable verbose logging. Default: false
enableMcpNoEnable MCP servers in subprocess, allowing recursive calls. Max depth: 3. Default: false
mcpConfigPathNoCustom MCP config path. Default: auto-detect project .mcp.json

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions 'retry and model selection' as features, it doesn't describe what 'Generate code or text' actually entails - whether this is a one-shot generation, conversational interaction, or something else. It doesn't mention authentication requirements, rate limits, cost implications, or what happens when the tool fails. For a complex tool with 14 parameters, this is a significant transparency gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point. It mentions the core action, the mechanism, and two key features. There's no wasted verbiage or unnecessary elaboration. However, it could be slightly more front-loaded by stating the primary purpose more prominently before mentioning implementation details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 14 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, how errors are handled, or the nature of the generation process. The agent must rely entirely on the parameter names and schema descriptions to understand this tool's behavior, which is insufficient for a generation tool that likely produces variable outputs and has significant configuration options.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already documents all 14 parameters thoroughly. The description adds minimal value beyond what's in the schema - it mentions 'retry' (which maps to maxRetries) and 'model selection' (which maps to model), but doesn't provide additional context about parameter interactions or best practices. The baseline of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Generate code or text') and the mechanism ('via Claude Code CLI'), which is specific and actionable. However, it doesn't explicitly differentiate this tool from its siblings (claude_edit, claude_edit_json, claude_generate_json, claude_refactor), which all appear to be Claude-related generation/editing tools. The description mentions 'retry and model selection' which are implementation details rather than core purpose differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings. There's no mention of when this generation tool should be chosen over claude_generate_json or claude_edit, nor any context about appropriate use cases. The agent must infer usage from tool names alone, which is insufficient for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_generate_jsonC

Generate JSON response with validation and retry

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesPrompt to pass to Claude CLI
modelNoModel to use (haiku, sonnet, opus). Default: haiku
maxRetriesNoMaximum retry attempts for JSON validation. Default: 3
jsonSchemaNoJSON Schema to validate output against
systemPromptNoReplace default system prompt
appendSystemPromptNoAppend to default system prompt

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'validation and retry', which hints at error handling and retry logic, but doesn't disclose key behavioral traits such as what happens on validation failure (e.g., error messages, retry behavior details), rate limits, authentication needs, or output format specifics. This leaves significant gaps for a tool with validation features.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Generate JSON response with validation and retry'. It's front-loaded and wastes no words, though it could be slightly more informative. Every word earns its place, making it appropriately concise for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 6 parameters, the description is incomplete. It doesn't explain the return values (e.g., JSON structure), error handling details, or how validation works with jsonSchema. For a tool focused on JSON generation with validation, more context is needed to understand its full behavior and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description adds no additional meaning beyond the schema, such as explaining interactions between parameters (e.g., how jsonSchema relates to validation) or usage examples. Baseline is 3 as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Generate JSON response with validation and retry', which indicates it generates JSON and includes validation/retry features. However, it doesn't specify what resource or content it generates JSON from (Claude's output), nor does it differentiate from siblings like claude_generate or claude_edit_json. The purpose is somewhat vague about the exact operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like claude_generate (which might generate non-JSON) or claude_edit_json (which might edit existing JSON). The description implies JSON generation with validation, but there's no explicit context or exclusions mentioned for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_refactorC

Refactor code via Claude Code CLI with retry and model selection

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesPrompt to pass to Claude CLI
modelNoModel to use (haiku, sonnet, opus). Default: haiku
timeoutNoTimeout in seconds. Default: 660
maxRetriesNoMaximum retry attempts. Default: 3
maxTurnsNoMaximum agent turns (iterations). Default: unlimited
outputFormatNoOutput format: text, json, stream-json. Default: json
systemPromptNoReplace default system prompt
appendSystemPromptNoAppend to default system prompt
allowedToolsNoAdditional tools to allow without asking
disallowedToolsNoTools to disallow
addDirsNoAdditional directories to access
verboseNoEnable verbose logging. Default: false
enableMcpNoEnable MCP servers in subprocess, allowing recursive calls. Max depth: 3. Default: false
mcpConfigPathNoCustom MCP config path. Default: auto-detect project .mcp.json

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions 'retry and model selection,' it doesn't explain what 'refactor' entails operationally, whether this modifies files in place, creates backups, requires specific permissions, or has rate limits. For a code modification tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality. It's appropriately sized for the tool's complexity, though it could be more front-loaded with the primary purpose before mentioning secondary features like retry and model selection.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex code refactoring tool with 14 parameters and no annotations or output schema, the description is inadequate. It doesn't explain what 'refactor' means operationally, what the expected inputs/outputs are, how errors are handled, or how this differs from sibling editing tools. The 100% schema coverage helps, but the description should provide more contextual guidance for proper tool selection and usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 14 parameters thoroughly. The description adds minimal value beyond what's in the schema - it mentions 'retry' (related to maxRetries) and 'model selection' (related to model parameter), but doesn't provide additional context about parameter interactions or usage patterns. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'refactor[s] code via Claude Code CLI' which provides a clear verb ('refactor') and resource ('code'), but it doesn't differentiate from sibling tools like claude_edit or claude_generate. The mention of 'retry and model selection' adds some specificity but doesn't clearly distinguish this as a refactoring-specific tool versus general code editing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like claude_edit or claude_generate. The description mentions 'retry and model selection' but doesn't explain when these features make this tool preferable. There's no mention of prerequisites, typical use cases, or comparison to sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updates
    • First observedclaude_edit
    • First observedclaude_edit_json
    • First observedclaude_generate
    • First observedclaude_generate_json
    • First observedclaude_refactor

TDQS

B3/5.0
Disambiguation3/5

The tools have clear distinctions in their primary functions (edit, generate, refactor), but there is significant overlap between the regular and JSON variants. For example, claude_edit and claude_edit_json both edit files, differing only in response validation, which could cause confusion about when to use each. Similarly, claude_generate and claude_generate_json overlap in purpose. This ambiguity is mitigated by descriptive names, but agents might still misselect between similar tools.

Naming Consistency5/5

All tool names follow a consistent snake_case pattern with a clear prefix 'claude_' and a verb (edit, generate, refactor) followed by an optional suffix (_json). This predictable naming scheme makes it easy to understand the tool's purpose and relationships, such as distinguishing between base operations and JSON-specific variants. There are no deviations in style or convention across the set.

Tool Count4/5

With 5 tools, the count is reasonable for a server focused on Claude Code CLI interactions, covering key operations like editing, generating, and refactoring. However, it feels slightly thin as it lacks tools for other common CLI tasks (e.g., running commands or managing files), but each tool earns its place within the defined scope. The number is well-scoped without being excessive or minimal.

Completeness3/5

The tool set covers core operations for interacting with Claude Code CLI (edit, generate, refactor), but there are notable gaps. For example, it lacks tools for executing or running code, managing project files, or handling non-JSON validation scenarios, which could limit agent workflows. The inclusion of JSON variants adds depth for validation, but the overall surface feels incomplete for a comprehensive shell or CLI server.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    An MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.
    15
    303
    MIT
  • F
    license
    B
    quality
    Not graded
    maintenance
    An MCP server for the OpenAI Codex CLI that provides coding assistance with multi-turn session management and reasoning depth control. It enables users to perform code analysis, generation, and refactoring through Claude with native resume support for conversational context.
    4
    765
    1
    -
  • A
    license
    A
    quality
    F
    maintenance
    An MCP server that integrates Codex CLI into Claude Code workflows for code writing, execution, and review with session management. It features real-time progress monitoring via a local HTTP dashboard and supports detailed configuration for various coding tools.
    6
    23
    166
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sunalamye/mcp-claude-node'

If you have feedback or need assistance with the MCP directory API, please join our Discord server