Skip to main content
Glama
qifeng-peak

XR875 Build MCP

by qifeng-peak
README.md
# XR875 构建 MCP 服务器

这是一个提供 XR875 项目构建工具的 MCP (Model Context Protocol) 服务器。

## 功能特性

- **build_m33**: 编译 M33 核。
- **build_ota**: 编译 M33 OTA。
- **build_c906**: 编译 C906 核。
- **build_all**: 按顺序编译所有内容 (M33 -> OTA -> C906 -> Pack)。
- **pack_firmware**: 打包固件。

## 前置条件

- Python 3.10+
- 拥有 XR875 SDK 仓库的访问权限。
- **推荐使用 [uv](https://github.com/astral-sh/uv)** 进行环境管理。

## 安装 uv

如果您尚未安装 `uv`,可以使用以下命令进行安装:

### Linux / macOS

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

安装完成后,请确保将其添加到您的 PATH 中(通常脚本会自动处理,或者您需要重启终端)。

> [!NOTE]
> 在本系统中,`uv` 的绝对路径为 `/home/one/.local/bin/uv`。如果您在配置中遇到 "command not found",请优先使用此绝对路径。

## 安装步骤

### 使用 uv (推荐)

```bash
# 进入服务器目录
cd .agents/mcp_servers/xr875-build-mcp

# 安装依赖并创建虚拟环境
# 如果尚未创建虚拟环境,请先创建
/home/one/.local/bin/uv venv
# 同步安装依赖
/home/one/.local/bin/uv sync
```

### 使用 pip

```bash
cd .agents/mcp_servers/xr875-build-mcp
pip install .
```

## 配置说明

要将此服务器用于 MCP 宿主(如 Cline 或 Claude Desktop),您需要将其添加到配置中。

### 对于 Cline

在您的 `cline_mcp_settings.json` 中添加以下内容:

```json
{
  "mcpServers": {
    "xr875-build": {
      "command": "/home/one/.local/bin/uv",
      "args": [
        "--directory",
        "/home/one/workspace/xr875_single_repository/.agents/mcp_servers/xr875-build-mcp",
        "run",
        "xr875-build"
      ]
    }
  }
}
```

或者使用 Python 绝对路径:

```json
{
  "mcpServers": {
    "xr875-build": {
      "command": "/usr/bin/python3",
      "args": [
        "/home/one/workspace/xr875_single_repository/.agents/mcp_servers/xr875-build-mcp/src/xr875_build/server.py"
      ],
      "env": {
        "PYTHONPATH": "/home/one/workspace/xr875_single_repository/.agents/mcp_servers/xr875-build-mcp/src"
      }
    }
  }
}
```

## 使用方法

配置完成后,支持 MCP 的 AI 助手即可调用此服务器中定义的构建工具。

TDQS

A3.6/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose targeting specific build components or stages: build_all for sequential builds, build_c906 for C906 core, build_m33 for M33 core, build_ota for M33 OTA, and pack_firmware for packing. No ambiguity exists as each tool name directly corresponds to a unique build operation.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with 'build_' or 'pack_' prefixes and specific suffixes (e.g., build_all, build_c906, pack_firmware). This predictable naming scheme makes it easy to understand each tool's function at a glance.

Tool Count5/5

With 5 tools, this server is well-scoped for its build automation purpose. Each tool serves a distinct and necessary function in the build process, from individual component builds to sequential builds and packing, with no redundant or missing operations.

Completeness5/5

The tool set provides complete coverage for the build domain: it includes individual builds for all core components (M33, C906, OTA), a sequential build tool (build_all), and a packing tool (pack_firmware). This covers the entire build lifecycle from compilation to packaging with no obvious gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues