Skip to main content
Glama
SobieskiCodes

MCP-Claude Code Bridge

claude_code_task

Execute coding tasks using Claude Code CLI to build applications, create APIs, and debug scripts while maintaining interaction through Claude Desktop.

Instructions

Execute a coding task using Claude Code CLI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesThe coding task to execute
project_pathNoPath to the project directory

Implementation Reference

  • Tool schema definition for claude_code_task with input parameters (task: required string, project_path: optional string)
      name: "claude_code_task",
      description: "Execute a coding task using Claude Code CLI",
      inputSchema: {
        type: "object",
        properties: {
          task: {
            type: "string",
            description: "The coding task to execute"
          },
          project_path: {
            type: "string",
            description: "Path to the project directory",
            default: ""
          }
        },
        required: ["task"]
      }
    },
  • server.js:135-136 (registration)
    Registration case that routes claude_code_task calls to the executeClaudeCodeTask handler function
    case 'claude_code_task':
      return await this.executeClaudeCodeTask(args.task, args.project_path);
  • Main handler implementation that spawns claude-code CLI process with the task, captures stdout/stderr, and returns formatted results
    async executeClaudeCodeTask(task, projectPath = '') {
      return new Promise((resolve, reject) => {
        const fullPath = projectPath ? path.join(this.workingDir, projectPath) : this.workingDir;
        
        const claudeCode = spawn('claude-code', [task], {
          cwd: fullPath,
          stdio: ['pipe', 'pipe', 'pipe'],
          env: { ...process.env, ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY }
        });
    
        let stdout = '';
        let stderr = '';
    
        claudeCode.stdout.on('data', (data) => {
          stdout += data.toString();
        });
    
        claudeCode.stderr.on('data', (data) => {
          stderr += data.toString();
        });
    
        claudeCode.on('close', (code) => {
          if (code === 0) {
            resolve({
              content: [
                {
                  type: "text",
                  text: `Claude Code task completed successfully:\n\n${stdout}`
                }
              ]
            });
          } else {
            resolve({
              content: [
                {
                  type: "text",
                  text: `Claude Code task failed (exit code ${code}):\n\nSTDOUT:\n${stdout}\n\nSTDERR:\n${stderr}`
                }
              ]
            });
          }
        });
    
        claudeCode.on('error', (error) => {
          reject(new Error(`Failed to execute Claude Code: ${error.message}`));
        });
      });
    }
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states the tool executes a coding task but doesn't reveal critical traits like whether it's read-only or destructive, permission requirements, execution environment, or output format. This is inadequate for a tool that likely performs operations with side effects.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose, making it easy to parse quickly without unnecessary elaboration.

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 of executing coding tasks (potentially involving side effects), no annotations, and no output schema, the description is incomplete. It fails to address behavioral risks, output expectations, or how it differs from sibling tools, leaving significant gaps for an agent.

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 both parameters ('task' and 'project_path') adequately. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, meeting the baseline for high coverage.

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 ('Execute') and resource ('coding task using Claude Code CLI'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'run_command' which might also execute commands, so it doesn't fully distinguish its specific scope.

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 'run_command' or 'create_project'. The description lacks context about appropriate scenarios, prerequisites, or exclusions, leaving the agent without usage direction.

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

Install Server

Other Tools

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/SobieskiCodes/claude-desktop-mcp-to-claude-agent'

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