mcp-linux-ops
Allows executing shell commands and performing file operations on a Linux system.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-linux-ops check disk usage for /var/log"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Linux 操作 MCP 服务器
这是一个 Model Context Protocol (MCP) 服务器,允许大模型在 Linux 机器上执行各种操作,包括执行命令、文件操作等。
功能特性
命令执行
execute_command: 在 Linux 系统上执行 shell 命令
支持指定工作目录
可配置超时时间
返回标准输出、标准错误和退出码
文件操作
read_file: 读取文件内容
write_file: 写入文件内容(支持追加模式)
list_directory: 列出目录内容
create_directory: 创建目录(支持递归创建)
delete_file: 删除文件或目录
file_exists: 检查文件或目录是否存在
get_file_info: 获取文件或目录的详细信息
copy_file: 复制文件或目录
move_file: 移动或重命名文件或目录
Related MCP server: mcp-dev-agent
安装
克隆或下载此项目
安装依赖:
npm install构建项目:
npm run build使用方法
在 Cursor 中配置
在 Cursor 的设置中添加 MCP 服务器配置。编辑你的 MCP 配置文件(通常在 ~/.cursor/mcp.json 或类似位置):
{
"mcpServers": {
"linux-ops": {
"command": "node",
"args": ["/path/to/mcp/dist/index.js"]
}
}
}或者如果你使用 npm 全局安装:
{
"mcpServers": {
"linux-ops": {
"command": "mcp-linux-ops"
}
}
}开发模式
在开发时,你可以使用 tsx 直接运行:
npm run dev工具说明
execute_command
执行 shell 命令并返回结果。
参数:
command(必需): 要执行的 shell 命令workingDirectory(可选): 执行命令的工作目录timeout(可选): 命令超时时间(秒,默认 30)
示例:
{
"command": "ls -la",
"workingDirectory": "/home/user",
"timeout": 10
}read_file
读取文件内容。
参数:
filePath(必需): 要读取的文件路径encoding(可选): 文件编码(默认 "utf-8")
write_file
写入文件内容。
参数:
filePath(必需): 要写入的文件路径content(必需): 要写入的内容encoding(可选): 文件编码(默认 "utf-8")append(可选): 是否追加模式(默认 false)
list_directory
列出目录内容。
参数:
directoryPath(必需): 要列出的目录路径includeHidden(可选): 是否包含隐藏文件(默认 false)
create_directory
创建目录。
参数:
directoryPath(必需): 要创建的目录路径recursive(可选): 是否递归创建父目录(默认 true)
delete_file
删除文件或目录。
参数:
path(必需): 要删除的文件或目录路径recursive(可选): 删除目录时是否递归(默认 false)
file_exists
检查文件或目录是否存在。
参数:
path(必需): 要检查的文件或目录路径
get_file_info
获取文件或目录的详细信息。
参数:
filePath(必需): 文件或目录路径
copy_file
复制文件或目录。
参数:
source(必需): 源文件或目录路径destination(必需): 目标路径recursive(可选): 复制目录时是否递归(默认 true)
move_file
移动或重命名文件或目录。
参数:
source(必需): 源文件或目录路径destination(必需): 目标路径
安全注意事项
⚠️ 警告: 此服务器允许执行任意 shell 命令,具有与运行用户相同的权限。请确保:
只在受信任的环境中使用
不要在生产环境中以 root 权限运行
考虑添加命令白名单或权限控制
限制可访问的文件系统路径
许可证
MIT
Available Tools
10 toolscopy_fileB
复制文件或目录
Inputs: source (required), destination (required), recursive.
create_directoryC
创建目录
Inputs: directoryPath (required), recursive.
delete_fileC
删除文件或目录
Inputs: path (required), recursive.
execute_commandB
在 Linux 系统上执行 shell 命令
Inputs: command (required), timeout, workingDirectory.
file_existsB
检查文件或目录是否存在
Inputs: path (required).
get_file_infoB
获取文件或目录的详细信息
Inputs: filePath (required).
list_directoryC
列出目录内容
Inputs: directoryPath (required), includeHidden.
move_fileA
移动或重命名文件或目录
Inputs: source (required), destination (required).
read_fileC
读取文件内容
Inputs: filePath (required), encoding.
write_fileC
写入文件内容
Inputs: content (required), filePath (required), append, encoding.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool maps to a distinct action (execute, read, write, list, create, delete, check, info, copy, move), with no overlap. Even though file and directory operations are combined in some tools, descriptions clarify that they handle both, eliminating ambiguity.
Most tools follow a consistent verb_noun pattern (e.g., read_file, create_directory, copy_file). The only exception is file_exists, which uses noun_verb, creating a minor inconsistency that prevents a perfect score.
10 tools is well within the ideal range for a Linux file operations server. Each tool covers a distinct operation with no redundancy, and the count feels appropriately scoped for the purpose.
The server covers the full lifecycle for files and directories: create, read, write, delete, list, copy, move, check existence, and get info, plus arbitrary command execution. This is a complete surface for the stated domain, with no obvious dead ends or missing critical operations.
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Linux VMs for AI agents: create VMs, run commands, edit files and open preview URLs.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Secure Linux sandboxes for AI agents, as MCP tools.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to remotely read/write files and execute commands on Linux servers via MCP protocol.9 npm1MIT
- FlicenseNot gradedqualityCmaintenanceProvides AI agents with shell execution and file management capabilities on a development VM, including running commands and editing files via tools like run_command, read_file, and edit_file.-
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to monitor system health, manage processes, execute shell commands, and inspect environment variables and directories.1MIT
- AlicenseBqualityBmaintenanceEnables AI agents to run commands, read and write files, inspect containers and services, and check system health on remote Linux hosts configured in ~/.ssh/config, while blocking dangerous operations by default.375 npmMIT