Hybrid Recursive Ladder MCP
Aggregate long time-series ranges with a handful of source requests instead of one per bucket.
An MCP server (stdio) for the Hybrid Recursive Ladder query planner. It splits a time range into complete calendar units — month, day, hour, minute — and reads each level once, so a ten-month range costs about five to seven source requests instead of 423,049 per-minute buckets.
Works with no configuration: the server exposes deterministic demo data, so every tool answers immediately. Point it at ThingsBoard or PostgreSQL when you have real data.
Install
uvx hybrid-recursive-ladder-mcp
or, with pip:
pip install hybrid-recursive-ladder-mcp
hybrid-recursive-ladder-mcp
Client configuration
{
"mcpServers": {
"hybrid-recursive-ladder": {
"command": "uvx",
"args": ["hybrid-recursive-ladder-mcp"]
}
}
}
Tools
| Tool | Reads | What it does |
|---|---|---|
ladder_meta |
local | Version, ladder levels, active source and store, demo range. |
ladder_decompose |
local | Split [start, end) into ordered, contiguous ladder segments. No I/O. |
ladder_sum |
source | Sum a range, optionally materializing raw points into the local store first. |
ladder_verify |
source | Compare the local copy against the source and report or repair drift. |
All four are annotated: ladder_meta and ladder_decompose are local and side-effect free, ladder_sum can write through materialize=True, and ladder_verify reaches the source.
Configuration
Set these as environment variables in the client config. All are optional.
| Variable | Meaning |
|---|---|
HL_SOURCE |
demo (default), thingsboard, or postgres. |
HL_TB_URL, HL_TB_USERNAME, HL_TB_PASSWORD |
ThingsBoard endpoint and credentials. |
HL_TB_TOKEN |
ThingsBoard access token, instead of username/password. |
HL_PG_DSN |
PostgreSQL DSN for the local store. |
HL_TIMEZONE |
IANA zone used for calendar boundaries (default Asia/Shanghai). |
HL_FINEST |
Finest ladder level: minute, hour, day, or month. |
When not to use it
The tool computes sums only in this version. It does not do averages (needs weighted sum plus count), meter deltas, or non-additive metrics, and it needs a source that supports interval aggregation.
Links
- Repository and full docs: https://github.com/MagicSquarekey/hybrid_recursive_ladder_algorithm
- Algorithm specification: https://github.com/MagicSquarekey/hybrid_recursive_ladder_algorithm/blob/main/docs/algorithm.md
- Benchmarks: https://github.com/MagicSquarekey/hybrid_recursive_ladder_algorithm/blob/main/docs/benchmarks.md
- Project site: https://magicsquarekey.github.io/hybrid_recursive_ladder_algorithm/
- License: MIT
Metadata
Release files for hybrid-recursive-ladder-mcp 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hybrid_recursive_ladder_mcp-0.0.6.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hybrid_recursive_ladder_mcp-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / hybrid_recursive_ladder_mcp-0.0.6.tar.gz
| Download URL | hybrid_recursive_ladder_mcp-0.0.6.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb892eae62dbcfac36f14e5302f54f4fb77a127c185b4326e17b89cd67d3470b
|
|
BLAKE2b-256 checksum How to use checksums |
ba3dcc03b1d6f1ba5ccb553cdb480023f77dac5e2669579616c58442d8a7cadd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / hybrid_recursive_ladder_mcp-0.0.6-py3-none-any.whl
| Download URL | hybrid_recursive_ladder_mcp-0.0.6-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
915473ee645f6b3fc749aba7949c30b486c0cac37f5054a3aace8ff0e5598c6d
|
|
BLAKE2b-256 checksum How to use checksums |
8971152f082aee589e97d503c44ee017015a2b3f786be27f3842816d1672ca33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Security for hybrid-recursive-ladder-mcp 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.