MCP server for analyzing Zephyr/West workspace directories and verifying Kconfig options
npm install mcp-zephyrbash
npm install -g mcp-zephyr
`
Or install locally in your project:
`bash
npm install mcp-zephyr
`
Setup for Claude Desktop
$3
The easiest way to add this MCP server to Claude Desktop:
`bash
claude mcp add mcp-zephyr
`
$3
To manually configure this MCP server with Claude Desktop:
1. Open your Claude Desktop configuration file:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
- Linux: ~/.config/Claude/claude_desktop_config.json
2. Add the MCP Zephyr server to the mcpServers section:
If installed globally:
`json
{
"mcpServers": {
"mcp-zephyr": {
"command": "mcp-zephyr",
"env": {}
}
}
}
`
If installed locally:
`json
{
"mcpServers": {
"mcp-zephyr": {
"command": "npx",
"args": ["mcp-zephyr"],
"env": {}
}
}
}
`
3. Restart Claude Desktop for the changes to take effect.
Available Tools
Once configured, the following tools will be available in Claude:
$3
Performs a complete analysis of a West workspace directory.
Parameters:
- path (string): Path to the West workspace directory (containing .west folder)
- westPath (string, optional): Custom path to the .west directory (defaults to path/.west)
Returns: Comprehensive analysis including version info, modules, boards, and build configuration.
$3
Extracts the Zephyr RTOS version from a workspace.
Parameters:
- path (string): Path to the West workspace directory
- westPath (string, optional): Custom path to the .west directory (defaults to path/.west)
Returns: Version information including major, minor, patch, and full version string.
$3
Lists all modules discovered in the workspace.
Parameters:
- path (string): Path to the West workspace directory
- westPath (string, optional): Custom path to the .west directory (defaults to path/.west)
Returns: List of modules with their paths, categories, and capabilities (CMake/Kconfig support).
$3
Retrieves and parses the West manifest information.
Parameters:
- path (string): Path to the West workspace directory
- westPath (string, optional): Custom path to the .west directory (defaults to path/.west)
Returns: Manifest details including remotes, projects, and defaults.
$3
Finds all available hardware boards in the workspace.
Parameters:
- path (string): Path to the West workspace directory
- westPath (string, optional): Custom path to the .west directory (defaults to path/.west)
Returns: List of boards grouped by architecture or vendor.
$3
Gets build system information including CMake and Kconfig files.
Parameters:
- path (string): Path to the West workspace directory
- westPath (string, optional): Custom path to the .west directory (defaults to path/.west)
Returns: Lists of Kconfig files, CMake modules, and toolchain configurations.
$3
Verifies if specified Kconfig options are available in the workspace before implementation. This prevents coding against non-existent configurations and provides alternatives and suggestions.
Parameters:
- path (string): Path to the West workspace directory
- kconfigs (array): List of Kconfig option names to verify (e.g., ["BT_PERIPHERAL", "BT_NUS", "BT_AUDIO"])
- westPath (string, optional): Custom path to the .west directory (defaults to path/.west)
Returns: Comprehensive verification report including:
- ✅ Available configs with source files, descriptions, and dependencies
- ❌ Missing configs with alternatives and implementation suggestions
- ⚠️ Warnings about deprecated or conditional configs
- 📋 Implementation recommendations
Example Usage:
`
"Please verify if these BLE Kconfigs are available: BT_PERIPHERAL, BT_NUS, BT_AUDIO, BT_HRS"
`
Usage Examples
After setup, you can ask Claude to analyze your Zephyr workspace:
`
"Can you analyze my Zephyr workspace at /home/user/zephyrproject?"
"What version of Zephyr is in /path/to/workspace?"
"List all the boards available in my West workspace"
"Show me the modules in my Nordic Connect SDK project"
`
$3
If your .west directory is not located in the standard workspace/.west location, you can specify a custom path:
`
"Analyze my workspace at /home/user/project with the .west directory at /home/user/custom/.west"
`
The tools accept an optional westPath parameter for non-standard West configurations.
Testing
You can test the MCP server directly:
`bash
If installed globally
mcp-zephyr
If installed locally
npx mcp-zephyr
`
The server will start and wait for MCP protocol messages via stdin/stdout.
Project Structure
`
mcp-zephyr/
├── src/
│ ├── index.js # MCP server implementation
│ └── analyzer.js # West workspace analyzer
├── package.json # Node.js dependencies and metadata
├── LICENSE # MIT license
└── README.md # This documentation
`
How It Works
1. Workspace Validation: Checks for .west/config to confirm a valid West workspace
2. Configuration Parsing: Reads West configuration to understand workspace structure
3. Manifest Analysis: Parses west.yml to identify projects and dependencies
4. Component Discovery: Scans for:
- Zephyr version files
- SDK versions (Nordic Connect SDK, etc.)
- Hardware board definitions
- Module directories
- Build system files (Kconfig, CMake)
5. Structured Output: Returns organized information for AI consumption
Supported Workspace Types
- Zephyr RTOS standalone workspaces
- Nordic Connect SDK (NCS) workspaces
- Custom West-managed projects
- Multi-repository Zephyr projects
Troubleshooting
$3
- Ensure Node.js is installed: node --version
- Verify the package is installed: npm list -g mcp-zephyr (for global) or npm list mcp-zephyr (for local)
- Check your Claude Desktop configuration syntax (valid JSON)
$3
- Confirm the workspace has a .west directory
- Check that the workspace was initialized with west init
- Ensure you're pointing to the workspace root, not a subdirectory
$3
- Restart Claude Desktop after configuration changes
- Check the configuration file syntax (valid JSON)
- Try using claude mcp list` to see if the server is registered