Skip to content

LISTENAI/commands-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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=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.

License

Apache-2.0

About

使用命令模板构建 MCP Server

Topics

Resources

License

Stars

Watchers

Forks

Languages