Skip to main content

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

  1. reyni__list_datasets: Obtain the safe_path for the tokenized twin export.
  2. erdos__get_schema(safe_path): Inspect column names and data types (no row values or samples).
  3. Rewrite SQL: Adapt the Erdos predictive query to target the local schema. The table name in Polars SQL is always cohort.
  4. 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.
  5. 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 a dashboard_ref.

Security Guarantees

  • Zero cell egress: MCP tools only return column metadata and aggregate match counts.
  • SQL Sanitization: Enforces read-only SELECT queries, rejects external filesystem functions (read_csv, eval), and clamps LIMIT to 1000 rows.
  • Localhost Enclave: Staging files use Arrow IPC; dashboards bind to 127.0.0.1. Launch URLs are written to mode-0600 sidecars, 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)

Source distribution for erdos-renyi 0.1.0
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)

Table of built distributions (wheels) for erdos-renyi 0.1.0
File Interpreter ABI Platform Actions
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 log

Release 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 log

Security 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.

Select from 2 files

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 log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page