A Model Context Protocol server that enables remote execution of shell commands across different operating systems, automatically handling platform-specific differences between Windows and Unix-like systems.
A Model Context Protocol (MCP) server that enables remote command execution across different operating systems. This server provides a unified interface to execute shell commands, automatically handling platform-specific differences between Windows and Unix-like systems.
git clone https://github.com/deepsuthar496/Remote-Command-MCP cd remote-command-server
npm install
npm run build
For Claude Desktop (claude_desktop_config.json
):
{ "mcpServers": { "remote-command": { "command": "node", "args": ["path/to/remote-command-server/build/index.js"], "disabled": false, "autoApprove": [] } } }
For VSCode Cline Extension (cline_mcp_settings.json
):
{ "mcpServers": { "remote-command": { "command": "node", "args": ["path/to/remote-command-server/build/index.js"], "disabled": false, "autoApprove": [] } } }
The server provides a single tool called execute_remote_command
that can execute ANY valid shell command on the host machine. This includes:
Parameters:
command
(required): Any valid shell command that can be executed on the host OScwd
(optional): Working directory for command executionremote-command execute_remote_command { "command": "systeminfo" // Windows // or "uname -a" // Linux }
remote-command execute_remote_command { "command": "npm list -g --depth=0" // List global NPM packages }
remote-command execute_remote_command { "command": "netstat -an" // Show all network connections }
remote-command execute_remote_command { "command": "git status", "cwd": "/path/to/repo" }
remote-command execute_remote_command { "command": "ls -la", // List files with details "cwd": "/path/to/directory" }
remote-command execute_remote_command { "command": "ps aux" // List all running processes (Unix) // or "tasklist" // Windows equivalent }
remote-command execute_remote_command { "command": "systemctl status nginx" // Check service status (Linux) // or "sc query nginx" // Windows equivalent }
Since this server can execute any system command, please consider the following security practices:
cwd
parameter to restrict command execution to specific directoriesThe server automatically handles platform-specific differences:
Command Translation:
ls
⟷ dir
(automatically converted based on platform)Shell Selection:
cmd.exe
/bin/sh
The server provides detailed error messages and includes both stdout and stderr in the response. If a command fails, you'll receive an error message with details about what went wrong.
Example error response:
{ "content": [ { "type": "text", "text": "Command execution error: Command failed with exit code 1" } ], "isError": true }
remote-command-server/
├── src/
│ └── index.ts # Main server implementation
├── package.json
├── tsconfig.json
└── README.md
npm run build
This will compile the TypeScript code and create the executable in the build
directory.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!