commands-mcp

commands-mcp

An MCP server that lets you define and run custom shell commands via YAML templates, with built-in tools for flashing and serial communication in embedded development.

Category
访问服务器

README

commands-mcp .github/workflows/build.yml

license issues stars commits

Build MCP Server with command template.

Usage

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "commands": {
      "command": "/path/to/commands-mcp",
      "args": [
        "/path/to/your/project"
      ]
    }
  }
}

Example

A commands.yaml file should be placed in the root of your project. Here's an example:

# yaml-language-server: $schema=https://listenai.github.io/commands-mcp/schema/master/commands.json

commands:
  zephyr_build:
    description: Build the specified Zephyr application
    args:
      - name: board
        description: |
          The board identifier to build for. If it can't be determined from the
          context, it should be prompted for.
        required: true
      - name: source_dir
        description: |
          Path to the source directory of the Zephyr application to build.
          Defaults to the current working directory.
        default: .
      - name: pristine
        description: |
          If true, the build directory will be cleaned before building.
        default: false
    command: |
      source .venv/bin/activate
      west build -b {{board}} -s {{source_dir}} {{#if pristine}}--pristine{{/if}}

For code completion on the commands.yaml file, redhat.vscode-yaml extension is recommended.

The commands.yaml file

  • commands: The root key for command definitions.
    • <tool>: A tool named <tool>.
      • description: A description of what the command does.
      • args: A list of arguments for the command, if any.
        • name: The name of the argument.
        • description: A description of the argument.
        • type: The type of the argument (optional, accepts string, number, boolean, defaults to string).
        • required: Whether the argument is required (defaults to false).
        • default: The default value for the argument, if it is not required.
      • command: The command to run. Supports Handlebars templating for arguments.
      • shell: The shell used to execute the command. Defaults to "bash" on Unix-like systems and "powershell" on Windows. Also supports "python" for using Python script in the command.
      • venv: Optional path to a Python virtual environment to use. If specified, the command will be executed with the specified venv activated.

Python support

If the shell is set to python, the command will be executed using Python. If a virtual environment is specified in the venv field, it will be activated before executing the command.

commands:
  some_python_script:
    description: A python script that does something
    shell: python
    venv: .venv
    command: |
      import sys
      print(f"Running Python {sys.version} in virtual environment {sys.prefix}")

Built-in tools

In addition to the commands defined in commands.yaml, the MCP Server provides several built-in tools, which can be enabled in the commands.yaml file with corresponding configuration.

Flash tools

Built-in tools for flashing firmware to LISTENAI devices.

flash:
  enabled: true         # Enable flash tools
  chip: mars            # Chip model, can be '6', 'mars'
  baudrate: 1500000     # Baud rate for flashing, defaults to 1500000

Serial tools

Built-in tools for reading logs from connected serial devices.

serial:
  enabled: true         # Enable serial tools
  baudrate: 115200      # Baud rate for serial communication, defaults to 115200
  reset: dtr            # Method to reset the device before reading logs, can be
                        # 'dtr' or 'rts'. If not specified, no reset will be performed.
  reset_interval: 100   # Interval in milliseconds between the reset line is
                        # asserted and deasserted, defaults to 100ms.

Schematic tools

Built-in tools to help the AI better understand the hardware schematic of the board. For details about the schematic files, see the Schematic.

schematic:
  enabled: true                 # Enable schematic tools
  board: csk6_duomotai_devkit   # Board name, should match the board file defined
                                # in `boards_dir`.
  socs_dir: schematic/socs      # Directory containing SoC-level schematic
                                # definitions. Defaults to "schematic/socs".
  boards_dir: schematic/boards  # Directory containing board-level schematic
                                # definitions. Defaults to "schematic/boards".

License

Apache-2.0

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选