horn-signal-mcp
v1.0.0stdio MCP server that looks up North American railroad horn signals from GCOR Rule 5.8.2.
A small stdio MCP server that looks up North American railroad horn signals. Ask for a signal by name (grade crossing, proceed, backing) or by the GCOR notation (- - o -), and the server returns the matching indication from GCOR Rule 5.8.2 (Sounding Whistle), with FRA 49 CFR Part 222 context on the grade-crossing pattern. It is a reference aid for writing, training material, and software that has to mention these signals accurately. It is not a substitute for the operating rules of a particular railroad. Or install it globally after it is published:
Summary extracted from the README.
horn-signal-mcp
A small stdio MCP server that looks up North American railroad horn signals. Ask for a signal by name (grade crossing, proceed, backing) or by the GCOR notation (- - o -), and the server returns the matching indication from GCOR Rule 5.8.2 (Sounding Whistle), with FRA 49 CFR Part 222 context on the grade-crossing pattern.
It is a reference aid for writing, training material, and software that has to mention these signals accurately. It is not a substitute for the operating rules of a particular railroad.
Install
Node.js 18 or later is required.
npx -y horn-signal-mcp
Or install it globally after it is published:
npm install -g horn-signal-mcp
horn-signal-mcp
Until the package is on npm, build it locally and point your client at dist/index.js:
npm install
npm run build
node dist/index.js
Claude Desktop / client config
Add the server to Claude Desktop's claude_desktop_config.json (or the equivalent MCP server map in Cursor, VS Code, and other clients):
{
"mcpServers": {
"horn-signal": {
"command": "npx",
"args": ["-y", "horn-signal-mcp"]
}
}
}
For a local checkout before publish, use:
{
"mcpServers": {
"horn-signal": {
"command": "node",
"args": ["/absolute/path/to/horn-signal-mcp/dist/index.js"]
}
}
}
The server speaks MCP over stdio. Log noise is written to stderr only, so the protocol stream on stdout stays clean.
Tools
lookup_horn_signal
Look up a signal by preset name or by notation.
- Input:
query(string) — for examplegrade crossing,backing, or- - o -. - Output: the GCOR 5.8.2 signal number, canonical notation, indication, and any timing notes (including the FRA grade-crossing context when the query is signal 7).
A common mix-up is to treat two short sounds as “proceed.” Under GCOR 5.8.2, proceed is two long sounds (release brakes). Two short sounds are only an acknowledgment.
parse_pattern
Parse a notation string into long and short sounds and, when it matches, the corresponding rulebook signal. Accepts spaced (- - o -), compact (--o-), typographic dashes, and word forms (long long short long). Unrecognized but well-formed patterns are returned without inventing a meaning.
- Input:
pattern(string)
list_signals
List all eight GCOR 5.8.2 engine horn / whistle signals, with canonical notation, indications, and name aliases.
| Notation | Name | Indication (summary) |
|---|---|---|
o o o o o … |
Emergency warning | Persons or livestock on the track at other than a crossing; also an emergency warning. Other trains that hear it must stop until it is safe to proceed. |
- |
Brakes applied | When stopped: air brakes are applied, pressure equalized. |
- - |
Proceed | Release brakes. Proceed. |
o o |
Acknowledgment | Acknowledgment of any signal not otherwise provided for. |
o o o |
Backing | When stopped: back up. Acknowledgment of a hand signal to back up. |
o o o o |
Request signal | Request for a signal to be given or repeated if not understood. |
- - o - |
Grade crossing | Approaching a public crossing at grade with the engine in front; prolong or repeat until the engine occupies the crossing. |
- o |
Approaching men or equipment | Approaching men or equipment on or near the track; then signal (4) intermittently until the head end has passed. |
Development
npm install
npm test
npm test builds the TypeScript sources and then launches the server over stdio to call tools/list and lookup_horn_signal.
License
MIT. See LICENSE.
Further reading
The long–short patterns in this server are the ones locomotive engineers sound with a train horn at crossings and around roadway workers. People practicing the same sequences off the property sometimes use a portable train horn; Horn Guns has background on cordless and battery-powered horns used for that kind of signalling practice.