erdos-renyi
erdos-renyi is an MCP server providing the privacy-preserving handshake between Erdos and Reyni. Clinicians register fine-grained EHR cohort exports with Reyni, and agents rewrite Erdos predictive SQL queries against tokenized schema names (tok_…) without ever accessing raw cell values or PHI. Results are staged locally in Arrow IPC format, gated by k-anonymity for agent-visible counts, and rendered in a private localhost Marimo dashboard for clinician review.
Quickstart
# Install dependencies
uv sync --extra dev
# Run test suite
uv run pytest
# Run the MCP server over stdio
uv run er-mcp
Reyni Gateway Setup
Add erdos-renyi to ~/Library/Application Support/reyni/servers.toml (Windows: %APPDATA%\reyni\servers.toml):
[[server]]
name = "erdos"
launch = ["uv", "tool", "run", "--python", "3.12", "--from", "erdos-renyi", "er-mcp"]
phi_access = true
During local development, point --from to the local repository path:
[[server]]
name = "erdos"
launch = ["uv", "tool", "run", "--python", "3.12", "--from", "/path/to/erdos-renyi", "er-mcp"]
phi_access = true
Agent-visible Erdos tools: erdos__get_schema, erdos__stage_query. After staging, call reyni__register_dashboard (Reyni gateway). launch_dashboard is gateway-internal only.
Agent Workflow
reyni__list_datasets: Obtain thesafe_pathfor the tokenized twin export.erdos__get_schema(safe_path): Inspect column names and data types (no row values or samples).- Rewrite SQL: Adapt the Erdos predictive query to target the local schema. The table name in Polars SQL is always
cohort. erdos__stage_query(safe_path, sql): Sanitize and execute SQL. If the match count is below the k-anonymity threshold ($k < 5$), the exact count is withheld (below_threshold), but the session is staged for the clinician.reyni__register_dashboard(session_id): Reyni launches the Marimo dashboard internally, reads a clinician-only sidecar (session_{id}.launch.json), and stores the URL encrypted — the agent receives only adashboard_ref.
Security Guarantees
- Zero cell egress: MCP tools only return column metadata and aggregate match counts.
- SQL Sanitization: Enforces read-only
SELECTqueries, rejects external filesystem functions (read_csv,eval), and clampsLIMITto 1000 rows. - Localhost Enclave: Staging files use Arrow IPC; dashboards bind to
127.0.0.1. Launch URLs are written to mode-0600sidecars, not returned over MCP.
Metadata
Release files for erdos-renyi 0.1.0
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 | Actions |
|---|---|---|---|---|
| erdos_renyi-0.1.0.tar.gz | 13.2 kB | With provenance | Details for erdos_renyi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| erdos_renyi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for erdos_renyi-0.1.0-py3-none-any.whl |
Total release size: 25.5 kB
Release files / erdos_renyi-0.1.0.tar.gz
| Download URL | erdos_renyi-0.1.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
452d299fb72c6a31622ce0f3b0a1b079c7da1fa389f6a00d1ffca119a6a4c023
|
|
BLAKE2b-256 checksum How to use checksums |
0871357a975f6dff94b3ebcb079d8ff4e8688bde628e9eee19dfc758381cafea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logRelease files / erdos_renyi-0.1.0-py3-none-any.whl
| Download URL | erdos_renyi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
643c09ecf5dee2dd722e9e63bc061e603878452cb6d391374dc0aa9fe1e76246
|
|
BLAKE2b-256 checksum How to use checksums |
e5e1751bbcb02173168bc1520f5bb2b39774966c31e2362d23054cd1f6436498
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logSecurity for erdos-renyi 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for erdos_renyi-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logA 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.