Skip to main content
Glama
SobieskiCodes

MCP-Claude Code Bridge

run_command

Execute shell commands within project directories to manage development tasks, automate processes, and interact with codebases directly from the Claude interface.

Instructions

Run a shell command in the project directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesCommand to execute
project_pathNoDirectory to run command in

Implementation Reference

  • The main runCommand handler function that executes shell commands using Node.js exec() with proper path resolution and output formatting
    async runCommand(command, projectPath = '') {
      return new Promise((resolve) => {
        const fullPath = projectPath ? path.join(this.workingDir, projectPath) : this.workingDir;
        
        exec(command, { cwd: fullPath }, (error, stdout, stderr) => {
          let output = '';
          if (stdout) output += `STDOUT:\n${stdout}\n\n`;
          if (stderr) output += `STDERR:\n${stderr}\n\n`;
          if (error) output += `Error: ${error.message}`;
          
          resolve({
            content: [
              {
                type: "text",
                text: output || 'Command executed with no output'
              }
            ]
          });
        });
      });
    }
  • Tool registration with name, description, and input schema defining the command and optional project_path parameters
      name: "run_command",
      description: "Run a shell command in the project directory",
      inputSchema: {
        type: "object",
        properties: {
          command: {
            type: "string",
            description: "Command to execute"
          },
          project_path: {
            type: "string",
            description: "Directory to run command in"
          }
        },
        required: ["command"]
      }
    }
  • server.js:147-148 (registration)
    Switch case that routes 'run_command' tool calls to the runCommand handler method
    case 'run_command':
      return await this.runCommand(args.command, args.project_path);
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. It states what the tool does but fails to describe critical traits like security implications, permission requirements, error handling, or output format. For a shell command execution tool, this omission is significant and leaves the agent with insufficient information about operational risks and behaviors.

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 that directly states the tool's function without any redundant or unnecessary information. It is appropriately sized and front-loaded, making it easy to parse quickly.

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 shell commands (which involves security, permissions, and output handling) and the absence of both annotations and an output schema, the description is incomplete. It fails to address critical aspects like what the tool returns, error conditions, or safety considerations, making it inadequate for informed tool invocation.

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 ('command' and 'project_path') adequately. The description adds no additional semantic context beyond what the schema provides, such as examples of valid commands or path formats, resulting in a baseline score.

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 ('run a shell command') and the context ('in the project directory'), which provides a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from potential sibling tools like 'claude_code_task' which might also execute commands, leaving room for ambiguity.

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 alternatives like 'claude_code_task' or other file-related siblings. It lacks any mention of prerequisites, constraints, or typical use cases, offering minimal contextual direction for tool selection.

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