Linux Command MCP (Model Context Protocol)
MCP server and client for running Linux commands
Overview
Linux Command MCP (Model Context Protocol) is a remote command execution system that allows users to securely and standardizedly execute Linux commands from a client to a server.
To use Linux Command MCP, set up the server by configuring the claude_desktop_config.json file, start the server using PM2, and then use the client to execute commands.
- Secure remote execution of Linux commands - Standardized command execution through a client-server model - Support for various command types, including listing directories and checking system information
- Executing Linux commands remotely in a secure environment.
- Automating system checks and diagnostics.
- Providing a controlled interface for users to interact with Linux systems without direct access.
Add to your AI client
Use these steps to connect Linux Command MCP (Model Context Protocol) in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"linux-command-mcp-xkiranj": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-linux-command-mcp-xkiranj"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"linux-command-mcp-xkiranj": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-linux-command-mcp-xkiranj"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"linux-command-mcp-xkiranj": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-linux-command-mcp-xkiranj"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"linux-command-mcp-xkiranj": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-linux-command-mcp-xkiranj"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"linux-command-mcp-xkiranj": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-linux-command-mcp-xkiranj"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"linux-command-mcp-xkiranj": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-linux-command-mcp-xkiranj"
]
}
}
}FAQ
Can I run interactive commands like `sudo`?
No, the Linux Command MCP server cannot execute interactive commands like `sudo`. You need to run such commands manually on the server.
What should I do if I encounter issues?
Check if PM2 is running, verify server logs, and ensure that both server and client builds are correct.
Is there a way to contribute to the project?
Yes! You can contribute by adding more command examples, enhancing documentation, or suggesting improvements.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":1400,"uuid":"e5ff7483-bcc6-4487-a9b2-a3e991303ff0","name":"linux-command-mcp","title":"Linux Command MCP (Model Context Protocol)","description":"MCP server and client for running Linux commands","avatar_url":"https://avatars.githubusercontent.com/u/77735317?v=4","created_at":"2025-02-20T15:37:23.610Z","updated_at":"2025-02-23T07:20:27.706Z","status":"created","author_name":"xkiranj","author_avatar_url":"https://avatars.githubusercontent.com/u/77735317?v=4","tags":"linux-command,remote-execution,command-line","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/xkiranj/linux-command-mcp","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]