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

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.1
File Size Uploaded Provenance Actions
erdos_renyi-0.1.1.tar.gz 13.2 kB With provenance Details for erdos_renyi-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for erdos-renyi 0.1.1
File Interpreter ABI Platform Actions
erdos_renyi-0.1.1-py3-none-any.whl Python 3 none any Details for erdos_renyi-0.1.1-py3-none-any.whl

Total release size: 25.5 kB

Release files / erdos_renyi-0.1.1.tar.gz

Download URL erdos_renyi-0.1.1.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
17aaf440eda7a546114d934562994c54822cc50770bfcb81d5f1cbe9c580436a
BLAKE2b-256 checksum
How to use checksums
b624f4a080257848b12dbba7b75408a3c7097d51637f45497ea2a5ecdab117b7
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.1-py3-none-any.whl

Download URL erdos_renyi-0.1.1-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94d235c8e07f95d2bd447b71411b25d53cb3cf5c4c4237d8313cc962da406077
BLAKE2b-256 checksum
How to use checksums
125d92552c99c0fee02f80fa45d358ad708f7f43df2637c6ac4c6554b49dfa80
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.1

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