mcp-local-command
A TypeScript-based MCP server that executes commands and returns structured outputs.
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:
-
Install dependencies npm install
-
Build the TypeScript server npm run build
-
(Optional) Run in development mode with auto-rebuild npm run watch
Configuration for Claude Desktop (example):
-
Locate Claude's MCP config file:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%/Claude/claude_desktop_config.json
-
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
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.