positioning-mcp
This MCP server lets AI coding agents run reproducible indoor-positioning experiments against the engine and inspect the resulting metrics.
List simulation scenarios and describe venue layouts, walls, levels, hardware, and beacon positions.
Inspect effective engine configs for presets (
pf,pf-nomap,ekf,wcl) and test JSON config patches.Simulate synthetic IMU/BLE/barometer/ground-truth traces, including scenario overrides such as dead or moved beacons.
Replay scenarios, trace files, or real phone recordings through filters and get accuracy metrics plus a
run_id.Break down error windows, find nearest truth/estimate beacons, and plot floor plans with true/estimated tracks and error over time.
Compare filters over multiple seeds and A/B test config changes across scenarios with per-scenario verdicts.
Benchmark real walks and run the engine's CI accuracy regression gates.
Access engine documentation and latest-results resources.
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., "@positioning-mcp why is the blue dot jumping in office_field_issue?"
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.
positioning-agent-tools
An MCP server that lets AI coding agents (Claude Code, Cursor, Codex) run experiments on the indoor-positioning-engine instead of reasoning about positioning accuracy from code alone.
An agent asked "why is the blue dot jumping in this venue?" can simulate the venue, replay it through each filter, find the time window where the error spikes (or the estimate is on the wrong floor), see which beacons sit next to the wrong estimate, change one fault in the scenario to test a hypothesis, A/B test a fix across every scenario on identical seeds, and check it on real phone walks. Every tool returns numbers that come from the engine's own replay and metrics code, so the agent's claims can be checked.
Tools
Tool | What it does |
| Scenarios, their venue, and the real-world fault each one injects |
| Size, walls, levels, stairs and lifts, mapped wall and slab loss, transmitter positions |
| Effective config of a preset ( |
| Config files shipped with the engine ( |
| Real phone walks that can be replayed, and the tune/holdout manifests if the dataset is converted |
| Synthetic IMU/BLE/barometer/ground-truth trace, with scenario overrides (e.g. kill one beacon) |
| One scenario, real recording or trace file through one filter; metrics plus a |
| Windows where error exceeded a threshold or the floor was wrong, with the beacons nearest the truth and the estimate |
| PNG of each visited floor plan, true and estimated tracks, and error over time with wrong-floor intervals |
| Several filters on one scenario, averaged over seeds |
| Config change vs defaults on every scenario, same seeds; verdict per scenario: better, worse, mixed or same |
| Real walks through each filter, per floor; medians over walks |
| The engine's CI accuracy gates: simulated scenarios, held-out real walks, or both |
Resources: ipe://docs/agents (the engine's AGENTS.md), ipe://docs/formats, ipe://docs/design,
ipe://docs/experiments, ipe://docs/real_data, ipe://results/latest.
On multi-floor venues CEP only counts fixes on the correct floor, so the tools report floor_accuracy
next to it, and ab_test counts a floor-accuracy change of more than 3 points (the engine's regression
tolerance) like a CEP change. coverage95 (share of fixes inside the reported 95% ellipse) appears where
the filter reports a covariance.
The server instructions tell the agent how to use them: never judge a change from one seed, report regressions in other scenarios, separate model problems from data problems, check real walks before claiming field accuracy, tune on the tune walks and report on holdout, and never regenerate a regression baseline to make the gate pass.
Related MCP server: Sentinel MCP
Setup
Build the engine's command-line tools (unit tests are not needed here):
git clone https://github.com/Yusufss4/indoor-positioning-engine
cmake -S indoor-positioning-engine -B indoor-positioning-engine/build -DCMAKE_BUILD_TYPE=Release -DIPE_BUILD_TESTS=OFF
cmake --build indoor-positioning-engine/build -j
git clone https://github.com/Yusufss4/positioning-agent-tools
cd positioning-agent-tools
python3 -m venv .venv && .venv/bin/pip install -e '.[dev]'If the two repositories are checked out side by side, the server finds the engine on its own. Otherwise
set IPE_ROOT (engine checkout), and optionally IPE_BUILD (default $IPE_ROOT/build) and
IPE_WORKDIR (scratch space for traces and runs, default ~/.cache/positioning-agent-tools).
Claude Code
claude mcp add positioning -e IPE_ROOT=/path/to/indoor-positioning-engine -- /path/to/positioning-agent-tools/.venv/bin/positioning-mcpCursor (.cursor/mcp.json in the engine checkout, or ~/.cursor/mcp.json)
{
"mcpServers": {
"positioning": {
"command": "/path/to/positioning-agent-tools/.venv/bin/positioning-mcp",
"env": { "IPE_ROOT": "/path/to/indoor-positioning-engine" }
}
}
}Codex (~/.codex/config.toml)
[mcp_servers.positioning]
command = "/path/to/positioning-agent-tools/.venv/bin/positioning-mcp"
env = { IPE_ROOT = "/path/to/indoor-positioning-engine" }Example: investigating a field issue
examples/investigate_field_issue.py scripts the sequence of tool
calls an agent makes on office_field_issue (two dead beacons, one installed in the wrong room), using
the particle filter configuration from before the engine fix. Output, abridged:
compare_filters (5 seeds): the map-aware particle filter is worse than the map-free one, which
should not happen.
filter | mean [m] | CEP50 [m] | CEP95 [m] | converged [s] | cov95 |
pf | 1.35 | 0.80 | 5.41 | 5.9 | 80% |
pf-nomap | 1.17 | 0.97 | 2.42 | 3.5 | 77% |
ekf | 1.27 | 0.86 | 4.09 | 16.1 | 75% |
error_breakdown finds one window, t = 31.0-39.4 s, peak error 18 m. The truth is 1.9 m from
beacon N3; the estimate is 4.2 m from beacon S3. That points to S3 being somewhere other than where the
map says.
compare_filters with scenario_overrides={"ble": {"moved_beacons": null}} puts S3 back. The
map-aware filter's CEP95 drops from 5.41 to 2.88 m, which confirms the hypothesis.
ab_test of the pre-fix config (B) against the current defaults (A) shows the engine fix is a
trade-off, not a free win:
scenario | filter | CEP50 A -> B | CEP95 A -> B | floor acc A -> B | B is |
airport_hall_sparse | pf | 1.38 -> 1.55 | 8.26 -> 6.58 | - | mixed |
baro_drift_long | pf | 0.65 -> 0.64 | 2.04 -> 1.76 | 100% -> 100% | better |
office_device_offset | pf | 0.65 -> 0.75 | 1.82 -> 2.40 | - | worse |
office_elevator | pf | 0.62 -> 0.63 | 1.67 -> 1.50 | 99% -> 99% | better |
office_field_issue | pf | 0.76 -> 0.80 | 2.42 -> 5.41 | - | worse |
office_floor_bleed | pf | 0.85 -> 0.76 | 4.42 -> 2.93 | 96% -> 98% | better |
office_mag_disturbance | pf | 1.06 -> 0.98 | 2.65 -> 2.51 | - | better |
office_nlos_heavy | pf | 0.64 -> 0.66 | 2.23 -> 2.03 | - | better |
office_nominal | pf | 0.60 -> 0.61 | 1.37 -> 1.37 | - | same |
office_stairs_up_down | pf | 0.79 -> 0.77 | 3.32 -> 2.08 | 99% -> 99% | better |
office_step_scale | pf | 0.62 -> 0.55 | 1.75 -> 1.51 | - | better |
With 5 seeds several of these deltas are within noise. The engine's experiment log repeats the comparison with 20 seeds. The multi-floor scenarios were added after the fix, and the pre-fix config does better on all four of them (office_floor_bleed CEP95 4.42 -> 2.93 m), which is worth a second look at the fix on those venues.
Example: real phone walks
The simulator and the filters share one radio model, so simulated numbers are optimistic. The engine ships held-out walks from two shopping malls (Microsoft Indoor Location dataset, Wi-Fi positioning, ground truth only at the surveyor's waypoints):
list_recordingslists them with their recommendedconfig_file(msil_wifi).run_replay(recording="site1_F2_5dda5afc")applies that config by default: CEP50 2.65 m, CEP95 4.49 m over 19 waypoints. Withconfig_file="none"(engine defaults) CEP95 is 17.89 m. In both casescoverage95is around 0.2: the filter is far more confident than it should be.error_breakdown(threshold_m=4)returns four single-waypoint windows of 4.0-4.8 m and says that the track between waypoints (8.4 s apart) is unknown.benchmark_recordings(manifest="holdout")needs the converted dataset (datasets/msil/fetch.sh, see the engine'sdocs/real_data.md;manifest="demo"works without it). On the 109 held-out walks:
group | filter | walks | median CEP50 [m] | median CEP95 [m] |
all | pf | 109 | 7.07 | 9.50 |
all | wcl | 109 | 8.15 | 14.53 |
Development
.venv/bin/pytest -qThe tests call the real engine binaries (they are skipped if the engine is not built). They exercise the
tools directly, through the server's MCP dispatch, and end to end by spawning positioning-mcp and
talking to it over stdio with the MCP client, as an agent would. Real-data tests use only the walks
committed in the engine's data/real; the full held-out gate is exercised only for its "skipped" path.
CI builds the engine from source and runs them on every push.
License
MIT
Available Tools
10 toolsab_testB
A/B test a configuration change across scenarios on identical seeds.
A = current defaults, B = defaults + config_patch (JSON merge patch, e.g. {"pf": {"num_particles": 500}}). Returns per-scenario CEP deltas with a verdict for B (better, worse, mixed or same) and a summary. "mixed" means CEP50 and CEP95 moved in opposite directions; treat it as a trade-off, not a win.
Inputs: config_patch (required), seeds, presets, scenarios.
compare_filtersB
Mean CEP50/CEP95/convergence of several filters on one scenario, averaged over seeds.
scenario_overrides (JSON merge patch on the scenario; null deletes a key) lets you remove or add a
single fault to test a hypothesis, e.g. {"ble": {"moved_beacons": null}}.
Inputs: scenario (required), seeds, filters, config_patch, +1 more.
describe_venueC
Floor size, wall count, mapped wall attenuation and beacon positions of a venue (e.g. 'office_floor').
Inputs: venue (required).
engine_configA
Effective engine configuration for a preset (pf, pf-nomap, ekf, wcl), optionally with a JSON merge patch.
Use this to discover tunable parameter names before writing a config_patch.
Inputs: preset, config_patch.
error_breakdownB
Time windows where the error stayed above a threshold, with the true and estimated position at the peak and the beacons nearest to each. Useful for spotting moved beacons and divergence.
Inputs: run_id (required), threshold_m, min_duration_s.
list_scenariosA
List simulation scenarios with the venue they use and the real-world effect each one injects.
Inputs: no named parameters. Returns: result
plot_runA
Render the floor plan with the true and estimated tracks, plus error over time, as a PNG.
Inputs: run_id (required).
run_regressionC
Run the CI accuracy gate: every scenario and preset against tests/regression/baseline.json.
Inputs: seeds.
run_replayA
Run one scenario (simulated in memory) or a recorded trace file through a filter.
Returns accuracy metrics (CEP50/CEP95/mean/convergence) and a run_id for error_breakdown and plot_run. One run is one sample: use ab_test or compare_filters for conclusions.
Inputs: seed, trace, venue, filter, +3 more.
simulate_scenarioC
Generate a synthetic trace (IMU, BLE, ground truth) for a scenario.
overrides is merged into the scenario JSON, e.g. {"ble": {"dead_beacons": ["C3"]}} or
{"ble": {"device_offset_db": -6}}, to test one hypothesis at a time.
Inputs: scenario (required), seed, overrides.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct stage or artifact in the positioning workflow: scenario discovery, venue metadata, engine config, simulation, replay, diagnostics, plotting, filter comparison, regression, and A/B testing. The closest pairs (simulate_scenario vs run_replay and compare_filters vs ab_test) are explicitly differentiated in their descriptions by input type and comparison scope.
All names use snake_case consistently and are readable. Most are verb_noun or clear action phrases, but a few noun phrases such as engine_config, error_breakdown, and ab_test deviate from a strict verb_noun pattern.
Ten tools is well within the expected range for a simulation and analysis server. Each tool covers a meaningful workflow step and none appears redundant or trivial.
The surface covers the core workflow well: discover scenarios and venues, simulate or replay, diagnose errors, visualize, compare filters/configs, and run regression checks. Minor gaps exist around explicit scenario/trace management or historical run listing, but these are not blocking for the stated analysis purpose.
Related MCP Connectors
Plan, run and inspect AI-agent drills with synthetic users, hosted tools and cloud worlds.
Evaluate, benchmark, and simulate AI agents on the VerifyAX agent-evaluation platform.
Launch and verify high-fidelity mobile simulations from an AI agent.
Crash-test your AI agent on real professional decisions, graded against what actually happened.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create, run, and debug 2D games in a sandboxed engine, providing tools for simulation, state inspection, and quality validation.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents and software engineers to investigate and resolve realistic distributed-system incidents using safe MCP-based diagnostic tools for code, logs, metrics, traces, database, and deployments.Apache 2.0
- AlicenseAqualityCmaintenanceEnables reproducible evaluation of AI agents on multi-source evidence investigation tasks, providing Docker-based scenarios, MCP tools, and automated scoring for payout reconciliation, performance-claim verification, and incident reconstruction.14MIT
- AlicenseNot gradedqualityCmaintenanceEnables simulating deterministic tool failures and evaluating agent workflows against effect invariants, with action replay for reproducible fault analysis.MIT