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 execution<use_mcp_tool>
<server_name>remote-command</server_name>
<tool_name>execute_remote_command</tool_name>
<arguments>
{
"command": "systeminfo" // Windows
// or "uname -a" // Linux
}
</arguments>
</use_mcp_tool>
<use_mcp_tool>
<server_name>remote-command</server_name>
<tool_name>execute_remote_command</tool_name>
<arguments>
{
"command": "npm list -g --depth=0" // List global NPM packages
}
</arguments>
</use_mcp_tool>
<use_mcp_tool>
<server_name>remote-command</server_name>
<tool_name>execute_remote_command</tool_name>
<arguments>
{
"command": "netstat -an" // Show all network connections
}
</arguments>
</use_mcp_tool>
<use_mcp_tool>
<server_name>remote-command</server_name>
<tool_name>execute_remote_command</tool_name>
<arguments>
{
"command": "git status",
"cwd": "/path/to/repo"
}
</arguments>
</use_mcp_tool>
<use_mcp_tool>
<server_name>remote-command</server_name>
<tool_name>execute_remote_command</tool_name>
<arguments>
{
"command": "ls -la", // List files with details
"cwd": "/path/to/directory"
}
</arguments>
</use_mcp_tool>
<use_mcp_tool>
<server_name>remote-command</server_name>
<tool_name>execute_remote_command</tool_name>
<arguments>
{
"command": "ps aux" // List all running processes (Unix)
// or "tasklist" // Windows equivalent
}
</arguments>
</use_mcp_tool>
<use_mcp_tool>
<server_name>remote-command</server_name>
<tool_name>execute_remote_command</tool_name>
<arguments>
{
"command": "systemctl status nginx" // Check service status (Linux)
// or "sc query nginx" // Windows equivalent
}
</arguments>
</use_mcp_tool>
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.
{
"mcpServers": {
"remote-command": {
"env": {},
"args": [
"path/to/remote-command-server/build/index.js"
],
"command": "node"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.