commands-mcp

LISTENAI/commands-mcp

3.3

If you are the rightful owner of commands-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

commands-mcp is a tool for building MCP Servers using command templates.

commands-mcp .github/workflows/build.yml

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=http://listenai.github.io/commands-mcp/schema/master.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.

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.

License