Connect Claude
Claude reaches the Hub through openhal mcp, a stdio MCP server that runs as an agent Principal with a separate token. Start from the quickstart, in the OpenHAL folder.
Create a token
$ uv run openhal init
$ uv run openhal token create --agent --scope control_low --name claude | tail -1 > ~/.openhal/claude.token
$ chmod 600 ~/.openhal/claude.tokenThe token is shown once, and the scope sets what the token may do.
| Scope | Allows |
|---|---|
read | Reads only |
control_low | Changes to low hazard devices |
control_medium | Changes to low and medium hazard devices |
The hub holds every agent change to a high hazard device until a person approves. openhal mcp exits with an error when given the human token.
Claude Code
$ claude mcp add openhal --scope user -- uv run --directory "$PWD" openhal mcp --token-file ~/.openhal/claude.tokenclaude mcp list shows whether the server connects.
Claude Desktop
Add the server to claude_desktop_config.json, in ~/Library/Application Support/Claude/ on macOS. Claude Desktop does not read your shell's PATH, so use absolute paths.
{
"mcpServers": {
"openhal": {
"command": "/Users/you/.local/bin/uv",
"args": ["run", "--directory", "/Users/you/OpenHAL", "openhal", "mcp", "--token-file", "/Users/you/.openhal/claude.token"]
}
}
}Restart Claude Desktop after you edit the file.
Try a command
Ask Claude to water the plant for 120 seconds. The Safety Kernel blocks the command at the duration limit, and Claude reports the reason. A request for 20 seconds runs.
uv run openhal log lists both requests under the token's name.