Linux Command MCP is a remote command execution system built using the Model Context Protocol (MCP), allowing secure and standardized execution of Linux commands.
The MCP servers are configured in the claude_desktop_config.json
file, typically located at ~/.config/Claude/claude_desktop_config.json
.
"mcpServers": {
"server-name": {
"command": "node|npx|uvx",
"args": ["server-specific-arguments"],
"env": {
"OPTIONAL_ENVIRONMENT_VARIABLES": "value"
}
}
}
"linux-command": {
"command": "node",
"args": [
"/full/path/to/linux-command-mcp/server/dist/index.js"
]
}
"command"
: Specifies the executor (node
, npx
, uvx
)"args"
: Full path to the server's executableindex.js
git clone <repository-url>
cd linux-command-mcp
cd server
npm install
npm run build
cd ../client
npm install
npm run build
cd server
npm run pm2:start
Available Commands:
Execute commands directly:
# In the client directory
npm start
exec "ls -l"
exec "list /home"
exec "uname -a"
Important Note: The Linux Command MCP server CANNOT execute interactive commands like sudo
.
When you need to run a sudo command:
pm2 list
pm2 logs linux-command-mcp-server
Here are some safe, generic examples of how you can ask Claude to run Linux commands:
Check System Information
$ uname -r
List Directory Contents
$ ls ~
Check Available Disk Space
$ df -h
View System Uptime
$ uptime
Check Network Interfaces
$ ip addr
System Memory Information
$ free -h
❌ Do NOT run commands that:
User: "Can you check the Linux kernel version?"
Claude: Certainly! I'll run the command to show the Linux kernel version.
$ uname -r
5.15.0-91-generic
This kernel is running Ubuntu 22.04.3 LTS.
Improve and expand the Linux Command MCP by:
MIT license
Email: xkiranj.1980@gmail.com
Blockchain: 0xkiran.eth
Seamless access to top MCP servers powering the future of AI integration.