Skip to main content
Glama
README.md
# @wangguanxiao/feiniunas-mcp

飞牛 fnOS NAS 管理 MCP 服务,通过小智 AI 对话即可管理 NAS。

## 功能

- **get_nas_status** — 获取 NAS 系统状态(主机名、运行时间、CPU 负载、内存、磁盘概况)
- **list_docker_containers** — 列出所有 Docker 容器及运行状态
- **get_disk_info** — 获取磁盘/存储详细信息
- **control_docker_container** — 启动/停止/重启/删除 Docker 容器

## 安装

```bash
npm install -g @wangguanxiao/feiniunas-mcp
```

## 使用

### 在 xiaozhi.config.json 中配置

```json
{
  "mcpServers": {
    "feiniunas": {
      "command": "npx",
      "args": ["-y", "@wangguanxiao/feiniunas-mcp"]
    }
  }
}
```

或本地开发模式:

```json
{
  "mcpServers": {
    "feiniunas": {
      "command": "node",
      "args": ["/path/to/feiniunas-mcp/run.js"]
    }
  }
}
```

### 示例对话

- "NAS 现在什么状态?" → 调用 get_nas_status
- "列出所有 Docker 容器" → 调用 list_docker_containers
- "磁盘还剩多少空间?" → 调用 get_disk_info
- "帮我重启 xxx 容器" → 调用 control_docker_container

## 开发

```bash
# 安装依赖
npm install

# 构建
npm run build

# 本地运行
node run.js

# 类型检查
npm run type-check
```

## 要求

- Node.js >= 18
- 运行在飞牛 NAS 或 Linux 环境上(依赖 `hostname`、`uptime`、`free`、`df`、`docker` 等系统命令)
- Docker 命令需要当前用户有执行权限

## 安全说明

- `control_docker_container` 对容器名做了字符校验,只允许字母数字和 `_-.:`
- 不支持 `exec`、`run` 等可能在容器内执行任意命令的操作
- 建议以非 root 用户运行,配合 Docker 用户组权限

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct concern: disk storage, system status, container listing, and container control. No overlap in purpose.

Naming Consistency5/5

All tool names follow a clear verb_noun snake_case pattern (get_disk_info, get_nas_status, list_docker_containers, control_docker_container). Verbs are consistent with actions.

Tool Count5/5

Four tools is well-scoped for a NAS management MCP, covering both monitoring and control without bloat.

Completeness4/5

Core NAS monitoring (disk, status) and Docker lifecycle (list, start/stop/restart) are covered. Minor gaps like container logs or network details could be added but are not critical.

Maintenance

ActivityStale
ResponsivenessNo issues