Token导航 LogoToken导航

MCP Server · 开发工具

MCP Shell Server (Mkusaka)

一个使用模型上下文协议(MCP)执行Shell命令的服务器,作为AI代理安全执行Shell命令的桥梁。

HTTP官方级别未说明来源级核验工具 1
开发工具TypeScriptClaude命令行工具CursorClineVS Code

快速开始

作者 / 组织
mkusaka
提供方
mkusaka
运行时
Node.js

工具数量

1

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

8

仓库热度

收录来源

3 个

MCP World

选型结论

MCP Shell Server (Mkusaka) 属于开发工具类 MCP Server,公开资料标注 1 个工具,通过HTTP 远程服务接入,适配 Claude、Cursor、Cline,有可以直接复制的安装命令;接入前先确认权限范围。

分类

开发工具

传输方式

HTTP

认证方式

无需认证

部署方式

仅本地运行

安装与配置

安装命令

npx mcp-shell-server

客户端配置示例

{
  "mcpServers": {
    "mcp-shell-server": {
      "command": "npx",
      "args": [
        "mcp-shell-server"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    确认访问方式

    这是HTTP 远程服务,本地不用装依赖;先确认服务地址、账号归属和额度,再决定接哪个客户端。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填服务地址;需要授权的先完成登录,再回到客户端刷新。

  4. 4

    验证是否可用

    连接成功后客户端会列出 1 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

MCP外壳服务器

使用模型上下文协议(MCP)执行shell命令的服务器。它作为一个桥梁,允许AI代理安全地执行shell命令。

特性

  • 执行shell命令(单行和多行支持)
  • 支持各种shell(bash、zsh、fish、powershell、cmd等)
  • 详细的错误处理和记录
  • MCP检查器兼容

安装

来自npm(作为用户)

# Using npm
npm install -g @mkusaka/mcp-shell-server

# Using yarn
yarn global add @mkusaka/mcp-shell-server

# Using pnpm
pnpm add -g @mkusaka/mcp-shell-server

来源(用于开发)

# Clone the repository
git clone https://github.com/mkusaka/mcp-shell-server.git
cd mcp-shell-server

# Install dependencies
pnpm install

# Build the project
pnpm build

MCP配置

光标配置

将以下内容添加到Cursor配置文件中(~/.cursor/config.json):

{
  "mcpServers": {
    "shell": {
      "command": "npx",
      "args": ["-y", "@mkusaka/mcp-shell-server"]
    }
  }
}

临床整合

克莱恩 是一个VS Code扩展,允许您将MCP服务器与Claude AI一起使用。要使用Cline设置此MCP shell服务器:

  1. 打开Cline MCP设置文件:

- macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - 窗户: %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

  1. 添加shell服务器MCP配置:
   {
     "mcpServers": {
       "shell": {
         "command": "npx",
         "args": ["-y", "@mkusaka/mcp-shell-server"],
         "disabled": false,
         "autoApprove": []
       }
     }
   }

或者,如果您想使用本地安装的软件包:

   {
     "mcpServers": {
       "shell": {
         "command": "node",
         "args": ["/path/to/mcp-shell-server/dist/index.js"],
         "disabled": false,
         "autoApprove": []
       }
     }
   }

规则配置

将以下内容添加到AI助手的规则或提示中:

You have MCP Shell tools at your disposal. Follow these rules regarding Shell tool usage:
1. ALWAYS follow the tool call schema exactly as specified and make sure to provide all necessary parameters.
2. **NEVER refer to tool names when speaking to me.** For example, instead of saying 'I need to use the shell_exec tool to run this command', just say 'I'll run that command for you'.
3. Only use Shell tools when they are necessary. If my task is general or you already know the answer, just respond without calling tools.
4. When I ask you to execute shell commands, use the appropriate tool to:
   - Run single-line commands
   - Run multi-line commands (using heredoc syntax when appropriate)
   - Execute file operations, git commands, or system utilities
   - Provide system information when relevant
5. Always be careful with shell commands that might modify the system, and explain what the command will do before executing it.
6. If a shell command produces an error, explain what went wrong in simple terms and suggest ways to fix it.

用法

直接执行

node dist/index.js
# or as an executable
./dist/index.js

开发模式

pnpm dev

MCP检验员测试

pnpm inspect

命令行参数

-s, --shell   Specify the path to the shell to use
-w, --working-dir   Specify the working directory for command execution
-h, --help           Display help message
-V, --version        Display version information

工具参考

shell-exec

在指定的shell中执行命令。

参数:

  • command (string,必填):要执行的shell命令
  • workingDir (string,可选):执行命令的工作目录。必须在$HOME下。

资源引用

服务器提供以下系统信息作为资源:

主机名

返回系统的主机名。

URI: hostname://

平台

返回操作系统平台。

URI: platform://

外壳

返回服务器正在使用的shell路径。

URI: shell://

用户名

返回当前用户名。

URI: username://

系统信息

以JSON格式返回全面的系统信息,包括:

  • 主机名
  • 平台
  • 外壳
  • 用户名
  • CPU计数
  • 总内存
  • 可用内存
  • 系统正常运行时间

使用示例

基本命令执行
{
  "name": "shell_exec",
  "parameters": {
    "command": "echo Hello, World!"
  }
}
多行命令(Heredoc)执行
{
  "name": "shell_exec",
  "parameters": {
    "command": "cat << EOF | grep 'example'\nThis is an example text.\nAnother line without the keyword.\nEOF"
  }
}

发展

项目结构

src/
├── index.ts                # Main entry point
└── shell-server/
    ├── index.ts            # Shell server implementation
    └── lib/
        └── logger.ts       # Logging configuration

日志记录

日志被写入 mcp-shell.log 文件。

许可证

麻省理工学院

工具与能力

工具数量

1

资源数量

0

提示词数量

0

能力标签

Shell命令执行TypeScript本地部署AI代理工具开发工具命令行工具系统管理

支持客户端

ClaudeCursorClineVS Code

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 只提供 1 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude、Cursor、Cline,换客户端不用重新研究配置。

先想清楚的地方

  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
MCP Shell Server (Mkusaka)

MCP World · 本页

1HTTP有3 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

MCP Shell Server (Mkusaka) 怎么安装?

公开资料给出的安装命令是 npx mcp-shell-server,运行环境为 Node.js。装完后按客户端要求写进 MCP 配置,重启客户端生效。

MCP Shell Server (Mkusaka) 怎么在 Claude Desktop、Cursor 里配置?

它是HTTP 远程服务,在客户端的 MCP 配置里填服务地址即可,不用本地装依赖;需要授权或 API Key 的,先在官方页面拿到凭据再填。

MCP Shell Server (Mkusaka) 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Shell Server (Mkusaka) 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

MCP Shell Server (Mkusaka) 支持哪些客户端?

公开资料标注支持 Claude、Cursor、Cline、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP