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.0.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.0.0
File Size Uploaded Provenance Actions
erdos_renyi-0.0.0.tar.gz 13.3 kB Without provenance Details for erdos_renyi-0.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 25.6 kB

Release files / erdos_renyi-0.0.0.tar.gz

Download URL erdos_renyi-0.0.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
36cf5c1f13908e6563615c1281e1139f9588ac11db902b3d52365acfc97fd23f
BLAKE2b-256 checksum
How to use checksums
9f4a8c612ac8d5b75e7636b7b5e9f67c2e233b63c0a88e832cd82c0e835b3793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / erdos_renyi-0.0.0-py3-none-any.whl

Download URL erdos_renyi-0.0.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d706d0ecd150601dc7965f5cba40095f77cfb61baebad7607474562dfe70f041
BLAKE2b-256 checksum
How to use checksums
bf25ad1fe269ea2edd352a1e50a3172cbcb6627fabac1a8f34608dbd41acbca5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for erdos-renyi 0.0.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.

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.

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