Build MCP Server with command template.
Add the following to your claude_desktop_config.json
:
{
"mcpServers": {
"commands": {
"command": "/path/to/commands-mcp",
"args": [
"/path/to/your/project"
]
}
}
}
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.
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, acceptsstring
,number
,boolean
, defaults tostring
).required
: Whether the argument is required (defaults tofalse
).default
: The default value for the argument, if it is not required.
command
: The command to run. Supports Handlebars templating for arguments.