Back to MCP directory
publicPublicdnsLocal runtime

server-run-commands

一个基于MCP协议的服务器项目,用于在本地操作系统上运行命令,并将执行结果返回给LLM。

article

README

🚀 运行命令服务器

运行命令服务器是一个 MCP 服务器,可在本地操作系统上运行命令。该服务器的代码依据官方 MCP 指南编写,相关指南可参考:MCP 快速开始

✨ 主要特性

运行命令工具

  • 能够在本地操作系统上运行指定命令。
  • 输入为 command(字符串类型)。
  • 会将进程退出码和 stdout 回传给 LLM。

📦 安装指南

按照以下步骤进行安装:

  1. 克隆项目仓库:
git clone https://github.com/anton-107/server-run-commands.git
  1. 进入项目目录:
cd server-run-commands
  1. 安装依赖:
npm install
  1. 构建项目:
npm run build

💻 使用示例

在 Claude Desktop 中的使用

将以下内容添加到你的 claude_desktop_config.json 文件中:

{
  "mcpServers": {
    "run-commands": {
      "command": "<本地 NODE 路径>",
      "args": [
        "<GIT 克隆文件夹路径>/server-run-commands/build"
      ]
    }
  }
}
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client