JMRI voice/chat control for DCC model railroads
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
License & attribution β please read before reusing this work. This project is Β© HO44 PROJECT (MrJ) and licensed under AGPL-3.0-or-later (see LICENSE). If you redistribute, modify, or republish any part of this project β
jmri-core,jmri-cli,jmri-mcp, the.mcpb/.codex.zipbundles, or the documentation β on this repository or anywhere else (a fork, another platform, a package registry, a video, a write-up), you must:
- keep the original author credit (MrJ / HO44 PROJECT) and a link back to this repository, and
- keep the same AGPL-3.0-or-later license on any redistributed or modified version.
Removing or hiding this attribution is not just bad etiquette β under AGPL-3.0 it is a license violation, and it will be treated as one. See NOTICE.md for details.
Questions or general discussion: use GitHub Discussions. Bug reports and feature requests: use Issues.
Talk to your model railroad.
Bring AI to your JMRI powered layout. Connect your favorite AI assistant and control your DCC model railroad using natural language through voice or chat.
Drive locomotives, control turnouts, operate signals, manage layout accessories, and more β just by asking.
Compatible with MCP clients such as Claude Desktop, Claude Code, xiaozhi, and other MCP-compatible AI assistants.
MrJ JMRI AI Assistant provides:
jmri-cli) for direct control, scripting, and automationSee the complete MCP tools reference in mcp-tools.md.
The goal is simple: make advanced JMRI control accessible to every model railroader, from casual operators to automation enthusiasts.
This project was developed against a real DCC++ layout with multiple command stations, and several of its behaviors exist specifically because live hardware doesn't always behave the way the JMRI API documentation implies:
DccSystem custom attribute
(set in JMRI's own Roster Entry β Edit β Attributes tab, e.g. DccSystem = T), and
throttle acquisition reads it automatically to target the right station.OT23 β ohara (turnouts)) alongside its
raw hardware address where JMRI exposes one (turnouts and lights; signal masts don't
expose theirs via any JMRI API today, so that field is honestly reported as unknown
rather than guessed).Pick the page that matches what you want to do β each links to the next. Available in English and French:
The conductor/tinkerer/engineer split is borrowed from DCC-EX, who came up with this framing first.
Getting started is designed to be simple.
See the installation guide for every install combination (CLI, Claude Desktop .mcpb, Kira bridge), configuration, and first commands.
Prefer a step-by-step walkthrough with screenshots? See the community Instructable: Control Your JMRI Railroad by Chatting With Claude.
jmri-cli is a full-featured command-line client for your layout, talking to JMRI
directly with no AI assistant or MCP client required β everything the MCP tools can do,
a human can do too, from a terminal.
Run it bare with no arguments to open an interactive shell: a single persistent
connection that keeps locomotives moving, lit, and acquired between commands (unlike a
one-shot invocation, which releases every throttle the instant it exits). The shell
adds real command-line ergonomics on top: up/down arrow command history persisted
across sessions (~/.jmri-cli/shell_history), TAB completion across the entire
command tree, ;-separated multi-command lines, a wait command to sequence a
--hold and a following command, and a friendlier natural-language-ish sentence
syntax for speed/direction (speed Autorail at 30 for 30 up 5 down 6 forward)
alongside the regular flag-based form. Exiting always leaves the layout safe: any
locomotive still in motion gets a ramp-down-and-release prompt, and active functions
(lights) are turned off before the connection closes, rather than being abandoned.
Every command also works one-shot from a plain terminal for scripting, automation, and quick manual checks or troubleshooting against a real layout.
See the CLI reference.
The MCP server currently exposes 52 tools covering the main JMRI capabilities.
See the complete reference:
v1.0
The project is fully functional and actively maintained.
Future improvements, feature requests, and roadmap items are tracked in the project board and the issues.
See docs/install.md for installation details.
.mcpb, Kira bridge), configuration, and first commandsjmri-cli command reference| Variable | Default | Description |
|---|---|---|
JMRI_URL | http://localhost:12080 | Base URL of the JMRI Web Server |
EXHIBITION_PASSWORD | this is sparta | Password required to exit exhibition mode. See Exhibition mode. |
EXHIBITION_ALLOWED_ADDRESSES | (none) | Comma-separated DCC addresses locomotives are restricted to while exhibition mode is on. |
EXHIBITION_START_ON | (off) | If set to 1/true/yes/on, the server starts already in exhibition mode. |
Built and maintained by MrJ.
Questions, bugs, and feature requests are welcome via issues.
Chosen deliberately over a permissive license (MIT/Apache) so that anyone who modifies this project and offers it as a network service (not just redistributes the code) must also publish their modified source.
See the license text for the exact terms, and NOTICE.md for what attribution is required when reusing this project.
xiaozhi_wrapper (part of the jmri-mcp package) is adapted from the MCP pipe example in xiaozhi-esp32 (MIT License, Copyright (c) 2025 Shenzhen Xinzhi Future Technology Co., Ltd. and Project Contributors).
See the package documentation:
packages/jmri-mcp/src/xiaozhi_wrapper/__init__.py
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/jmri-mcp)<a href="https://allmcps.com/mcp/jmri-mcp"><img src="https://allmcps.com/api/badge/jmri-mcp?style=directory" alt="JMRI MCP on AllMCPs" /></a>