Get the FREE Ultimate OpenClaw Setup Guide →

mcp-local-command

A TypeScript-based MCP server that executes commands and returns structured outputs.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio kentaro-mcp-local-command-server node build/index.js

How to use

This MCP server is a TypeScript-based utility that executes shell commands and returns structured outputs through the MCP protocol. It exposes a tool named execute_command, which accepts a required parameter command and runs it on the host, returning detailed results such as exit code, stdout, stderr, and execution duration. This enables you to automate command execution within the MCP framework and capture consistent output formats for downstream processing.

To use it, configure the MCP client to connect via stdio to the server binary (the built JavaScript entry point). After initialization, invoke the execute_command tool with the desired command string. The server will run the command, gather the results, and return a structured object that includes timing, exit status, and the command output, making it suitable for integration into automation pipelines or conversational assistants that rely on command execution results.

How to install

Prerequisites:

  • Node.js (LTS version) and npm installed on your system
  • Basic familiarity with MCP server configuration

Installation steps:

  1. Install dependencies npm install

  2. Build the TypeScript server npm run build

  3. (Optional) Run in development mode with auto-rebuild npm run watch

Configuration for Claude Desktop (example):

  1. Locate Claude's MCP config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
  2. Add or update the MCP server entry to point to the built entry file: { "mcpServers": { "local-command-server": { "command": "/path/to/mcp-local-command-server/build/index.js" } } }

Notes:

  • Ensure the path to build/index.js reflects your actual install location.
  • If you enable the inspector for debugging, you can run npm run inspector to launch debugging tools and obtain a debugging URL.

Additional notes

Tips and troubleshooting:

  • Since MCP servers communicate via stdio, many issues stem from incorrect path configurations or permission problems. Verify the path to build/index.js is correct and executable.
  • If the command you run occasionally hangs or returns huge outputs, consider implementing proper timeouts and output handling in your client configuration.
  • The provided inspector script helps diagnose protocol-level or runtime issues by exposing a debugging URL in your browser.
  • Environment variables can be added under env in the mcp_config if your server or commands require specific settings (e.g., PATH adjustments, credentials placeholders).
  • When deploying, ensure the Node.js version on the host matches the version used during development to avoid runtime incompatibilities.

Related MCP Servers

Sponsor this space

Reach thousands of developers