Train Horn SPL MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Train Horn SPL MCP Estimate SPL at 300 m for a train horn rated 120 dB at 1 m"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Train Horn SPL MCP
A small, open-source Model Context Protocol server that estimates how a train horn's sound-pressure level changes with distance.
The calculation is free-field only: inverse-square spreading (20 * log10 of the distance ratio) plus, when you give a frequency, ISO 9613-1 atmospheric absorption. It will not replace a calibrated sound level meter, and it does not model ground effect, barriers, wind, or reflections.
Portable, battery-powered train horn kits are often specified at one reference distance. This server is a working notebook for turning that figure into a first-order level at another distance, or for asking how far a chosen target level would fall. For product context on cordless and battery-powered train horns, see Horn Guns.
Tools
Tool | What it does |
| Estimate SPL at |
| Solve for the distance at which the estimated SPL equals |
| IEC 61672-1 A-weighting in dB at a single frequency. |
spl_at_distance / distance_for_target_spl arguments
source_spl_db(required): free-field level at the reference distance, in dBref_distance_m(required): that reference distance, in metrestarget_distance_mortarget_spl_db(required, depending on the tool)frequency_hz(optional): pure-tone frequency for ISO 9613-1 absorption. If omitted, only inverse-square spreading is applied.temperature_c(optional, default 20)humidity_pct(optional, default 70)pressure_kpa(optional, default 101.325)
Every result includes a caveats field stating the limits of the model.
Related MCP server: Personal Agent Auditory Acoustic Decibel Dosimeter Skill
Install and run
Requires Python 3.11+.
With uvx (no install)
uvx --from git+https://github.com/bosshorncom-cmd/train-horn-spl-mcp train-horn-spl-mcpWith pip
pip install git+https://github.com/bosshorncom-cmd/train-horn-spl-mcp
train-horn-spl-mcpThe process speaks MCP over stdio.
MCP config example
Claude Desktop, Cursor, or any MCP host that reads a mcpServers map:
{
"mcpServers": {
"train-horn-spl": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/bosshorncom-cmd/train-horn-spl-mcp",
"train-horn-spl-mcp"
]
}
}
}Equivalent pip form:
{
"mcpServers": {
"train-horn-spl": {
"command": "train-horn-spl-mcp"
}
}
}Caveats
Free-field point-source estimate only.
No ground effect, reflections, barriers, wind, turbulence, or temperature gradients.
ISO 9613-1 absorption is defined for a pure tone (or a narrow band). A train horn is broadband; a fuller estimate needs a spectrum.
A-weighting is returned at one frequency. An overall dB(A) level also needs that spectrum.
Not a substitute for a calibrated Type 1 or Type 2 sound level meter, or for a field measurement.
Development
git clone https://github.com/bosshorncom-cmd/train-horn-spl-mcp
cd train-horn-spl-mcp
uv sync --dev
uv run pytestLicense
MIT. Public contact: info@hornguns.com
Available Tools
3 toolsa_weightingA
Return the IEC 61672-1 A-weighting in decibels at one frequency.
Useful when converting a tonal component toward an A-weighted level.
A broadband train horn still needs a spectrum; this is not a complete
dB(A) calculation by itself.
Args:
frequency_hz: Frequency in hertz (must be > 0).
Inputs: frequency_hz (required). Returns: object
distance_for_target_splA
Estimate the free-field distance at which SPL equals a target level.
Solves the inverse of spl_at_distance numerically. Same model and caveats:
inverse-square spreading, plus ISO 9613-1 absorption when frequency_hz is
set.
Args:
source_spl_db: Free-field sound-pressure level at the reference
distance, in decibels.
ref_distance_m: Distance at which source_spl_db applies, in metres.
target_spl_db: Desired sound-pressure level, in decibels.
frequency_hz: Pure-tone frequency for ISO 9613-1 absorption. Leave
unset to apply spreading only.
temperature_c: Air temperature in degrees Celsius (default 20).
humidity_pct: Relative humidity in percent (default 70).
pressure_kpa: Atmospheric pressure in kilopascals (default 101.325).
Inputs: source_spl_db (required), target_spl_db (required), ref_distance_m (required), frequency_hz, +3 more. Returns: object
spl_at_distanceA
Estimate free-field SPL at a target distance.
Starts from a sound-pressure level already measured or specified at
ref_distance_m and applies inverse-square spreading (20 * log10 of the
distance ratio). If frequency_hz is set, also applies ISO 9613-1
atmospheric absorption over the path difference.
Args:
source_spl_db: Free-field sound-pressure level at the reference
distance, in decibels.
ref_distance_m: Distance at which source_spl_db applies, in metres.
target_distance_m: Distance at which to estimate the level, in metres.
frequency_hz: Pure-tone frequency for ISO 9613-1 absorption. Leave
unset to apply spreading only.
temperature_c: Air temperature in degrees Celsius (default 20).
humidity_pct: Relative humidity in percent (default 70).
pressure_kpa: Atmospheric pressure in kilopascals (default 101.325).
Inputs: source_spl_db (required), ref_distance_m (required), target_distance_m (required), frequency_hz, +3 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct operation: forward propagation (spl_at_distance), the numerical inverse (distance_for_target_spl), and a frequency-domain weighting helper (a_weighting). The argument signatures differ clearly (target_distance_m vs target_spl_db), so an agent can pick correctly without reading the bodies.
All three names are snake_case and follow a consistent 'quantity or model being returned' convention rather than verb_noun (spl_at_distance, distance_for_target_spl, a_weighting). This is predictable and readable, but the lack of a verb prefix makes it slightly less self-documenting than an ideal pattern.
Three tools is small but well-matched to a narrowly scoped acoustic calculator: forward model, inverse model, and a weighting utility. Every tool earns its place, with no filler or redundancy.
The core forward/inverse propagation pair is covered, but the domain surface is incomplete: there is no way to apply A-weighting across a spectrum or to chain weighting with propagation in one call, and the tool description itself admits a_weighting is not a complete dB(A) calculation. Ground reflection, barriers, and multi-band train-horn spectra are also unaddressed.
Maintenance
Related MCP Connectors
Earth curvature, horizon, flight, Sun and daylight calculators plus tested flat-earth claims.
Ocean acoustics: propagation models, bathymetry, sound speed, vessel noise, live AIS. Open.
Engine-calculated astronomy and calendar calculators, for reflection. No account; inputs not logged.
AI-callable calculators and engineering models with real formulas. No hallucinated math.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables auditing speech intelligibility and acoustical distraction risk, modeling working-memory throughput penalties, and synthesizing pink or brown noise masking profiles for focused work.7MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables calculation of NIOSH/OSHA cumulative noise dose, equivalent continuous sound level (Leq), 8-hour time-weighted average, and Ward-model temporary threshold shift recovery from acoustic exposure inputs.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables deterministic psychoacoustic modeling of dichotic hearing thresholds, interaural phase differences, brainstem processing scores, and cocktail-party speech-in-noise intelligibility through JSON-RPC tools.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables deterministic, zero-dependency audiological analysis of distortion-product emissions, SNR/clinical pass criteria, and outer hair cell fatigue scoring so agents can assess cochlear health and headphone noise overexposure.MIT