Token导航 LogoToken导航TokenDH.com
Commander MCP logo
AI代理stdio官方级别未说明来源级核验

Commander MCP

MCP Server

@modelcontextprotocol/inspector

commander-mcp是一个基于Rust构建的模型上下文协议(MCP)服务器,用于通过MCP协议运行、监控和管理后台进程。

工具数

6

提示词数

0

GitHub Stars

1

资源数

0
进程管理RustClaude跨平台Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

towry

提供方

towry

最后核验

2026/5/17 20:35

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @modelcontextprotocol/inspector commander-mcp

详细介绍

指挥-多点连接协议(或“主控-多点控制协议”,具体翻译可能根据上下文调整)

一个用于后台进程管理的模型上下文协议(MCP)服务器。commander-mcp 用 Rust 编写,提供了通过 MCP 协议使用 PMDaemon 运行、监控和管理后台进程的强大工具。

特点/功能

  • MCP协议支持基于官方构建 Rust MCP SDK(Minecraft协议兼容SDK,或根据具体上下文可译为“Rust版Minecraft协议客户端SDK”) (v0.7)
  • PMDaemon 集成内置监控和日志管理的强大流程管理功能
  • 流程管理工具运行、终止、重启和监控进程
  • 持久日志进程输出被保存到文件中,可以随时读取
  • 跨平台在Linux、Windows和macOS上均可运行
  • 标准输入输出传输通过标准输入/输出进行通信,便于集成
  • 异步运行时基于Tokio构建,实现高性能异步操作
  • 类型安全利用Rust的类型系统提高可靠性

快速入门

先决条件

  • Rust 1.70 或更高版本(用于从源代码构建)
  • Cargo(随 Rust 附带)

安装

使用安装脚本(推荐)

安装commander-mcp最简单的方法是使用安装脚本:

curl -fsSL https://raw.githubusercontent.com/towry/commander-mcp/main/install.sh | bash

或者先下载并检查脚本:

curl -fsSL https://raw.githubusercontent.com/towry/commander-mcp/main/install.sh -o install.sh
chmod +x install.sh
./install.sh

支持的平台:

  • macOS Apple Silicon(M1/M2/M3)- aarch64-apple-darwin
  • Linux x86_64 - x86_64-unknown-linux-gnu 翻译为中文是:“Linux x86_64 架构 - x86_64 未知 Linux GNU 系统”。不过,通常我们简化为“Linux x86_64(x86_64-unknown-linux-gnu)”或直接说“Linux x86_64 系统”,因为“x86_64-unknown-linux-gnu”更多是编译器或构建系统中用来指定目标平台的标识,实际表述时并不常提及

该脚本将:

  1. 自动检测您的平台
  2. 下载最新发布的二进制文件
  3. 将其安装到 /usr/local/bin
  4. 验证安装

从源代码构建

# Clone the repository
git clone https://github.com/towry/commander-mcp.git
cd commander-mcp

# Build the project
cargo build --release

# Run the server
cargo run --release

使用方法

MCP服务器通过标准输入/输出使用MCP协议进行通信。您可以使用以下方法对其进行测试: MCP 检测器:

# Install MCP Inspector (requires Node.js)
npm install -g @modelcontextprotocol/inspector

# If installed via install script
npx @modelcontextprotocol/inspector commander-mcp

# If running from source
npx @modelcontextprotocol/inspector cargo run --release

与Claude Desktop一起使用

要在Claude Desktop中使用此MCP服务器,请在您的Claude Desktop配置文件中添加以下内容:

macOS(苹果电脑操作系统)~/Library/Application Support/Claude/claude_desktop_config.json Linux~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "commander": {
      "command": "/usr/local/bin/commander-mcp"
    }
  }
}

或者如果从源代码运行:

{
  "mcpServers": {
    "commander": {
      "command": "cargo",
      "args": ["run", "--release", "--manifest-path", "/path/to/commander-mcp/Cargo.toml"]
    }
  }
}

可用工具

在后台执行命令。

描述在后台运行一个命令。工具在启动后等待1秒以检测早期故障。返回进程ID,该ID可用于其他工具,并附带初始日志。

参数

  • command (字符串):要运行的命令

示例

{
  "command": "npm run dev"
}

回应 (JSON):

{
  "process_id": "npm_run",
  "command": "npm run dev",
  "message": "Started process 'npm_run'",
  "logs": "... initial log output (if available) ..."
}

错误响应 (如果过程立即失败):

{
  "error": "Process 'npm_run' failed to start. Logs:\n... error logs ..."
}

注释

  • 该工具在启动过程后等待1秒以检测早期故障
  • 如果在此时间内进程进入错误状态或停止状态,则返回错误
  • 当有可用信息时,响应中会包含初始日志(最多100行)
  • 这有助于检测诸如“地址已被使用”等问题,而无需调用 read 单独使用工具

杀死

通过进程ID终止一个之前启动的进程。

参数

  • process_id (字符串):要终止的进程ID

示例

{
  "process_id": "npm_run"
}

回应 (JSON): (可翻译为)(JSON格式):

{
  "process_id": "npm_run",
  "message": "Stopped process 'npm_run'"
}

“kill_all”可以翻译为“全部杀死”或“全部终止”。这个短语通常用于计算机或编程领域,表示终止所有相关的进程或实例

终止所有正在运行的进程。

参数

示例调用时无需参数即可停止所有进程。

回应 (JSON): (JSON格式)

{
  "stopped_count": 3,
  "message": "Stopped 3 process(es)"
}

阅读

通过进程ID读取其标准输出(stdout)的内容。

描述返回最近的日志输出(默认:最后1000行)。

参数:

  • process_id (字符串):要从中读取输出的进程ID
  • lines (数字,可选):要返回的最大日志行数(默认:1000)

示例:

{
  "process_id": "npm_run",
  "lines": 500
}

回应 (JavaScript 对象表示法):

{
  "process_id": "npm_run",
  "logs": "... log output here ..."
}

重启

通过进程ID重启之前运行的进程。

参数

  • process_id (字符串):要重启的进程ID

示例:

{
  "process_id": "npm_run"
}

回应 (JSON):

{
  "process_id": "npm_run",
  "message": "Restarted process 'npm_run'"
}

列表

列出所有当前正在运行或已停止的进程。

参数

回应 (JSON): (表示“JSON格式”)

{
  "processes": [
    {
      "name": "npm_run",
      "status": "running",
      "pid": 12345,
      "started_at": "2025-10-03 17:14:55 UTC",
      "uptime_seconds": 120,
      "restarts": 0,
      "cpu_usage": 2.5,
      "memory_mb": 45
    }
  ]
}

返回一个包含所有进程及其状态、进程ID(PID)、启动时间戳、运行时间、CPU使用率、内存使用率和重启次数的列表。

它是如何工作的

  1. 流程管理使用了用Rust编写的高性能进程管理器PMDaemon
  2. 进程ID基于命令关键字自动生成(例如。, npm run devnpm_run)
  3. 持久日志所有处理输出均保存到日志文件中,可随时查看
  4. 实时监控跟踪CPU、内存使用情况以及进程状态
  5. 跨平台原生支持 Linux、Windows 和 macOS

主要特点

  • 持续日志管理日志被保存到文件中,可以随时读取(而不仅仅是实时输出)
  • 按进程访问日志可以读取特定进程的日志
  • 无外部依赖PMDaemon 是一个 Rust 库,无需外部二进制文件
  • 跨平台原生支持Windows、macOS和Linux系统
  • 内置监控包含CPU和内存追踪功能
  • 直接API通过Rust API进行程序化控制

发展

运行测试

# Run all tests
cargo test --all-features --verbose

# Run tests with output
cargo test -- --nocapture

代码质量

这个项目遵循了Rust的最佳实践,并使用了常规提交规范来实现自动化发布。

# Format code (REQUIRED before committing)
cargo fmt --all

# Check formatting
cargo fmt --all -- --check

# Run linting
RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets --all-features --verbose

仅使用命令

这个项目包括一个 justfile 便于开发:

# Format, lint, and test
just check

# Format code
just format

# Run linting
just lint

# Run tests
just test

# Build release binary
just build

项目结构

commander-mcp/
├── src/
│   ├── main.rs              # Entry point with MCP server setup
│   ├── process_server.rs    # MCP tools implementation
│   └── process_manager.rs   # PMDaemon wrapper for process management
├── Cargo.toml               # Project dependencies and metadata
└── README.md                # This file

相关的

目录标签

目录标签

进程管理RustClaude跨平台本地部署后台服务Rust工具日志管理

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@modelcontextprotocol/inspector

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

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

来源信息

继续浏览同类 MCP