Skip to main content

Python SDK for the Medigami MCP — outcome-labeled healthcare claim intelligence as simple method calls, with Ed25519-attested responses.

Project description

medigami — Python SDK

Call the Medigami MCP as plain Python methods. Every response is wrapped in an AttestedResponse with easy access to the attestation envelope + verifier.

pip install medigami

Quick start

from medigami import Medigami

# Public SKU — free, no auth, PHI-free
m = Medigami()
r = m.scan_bill_for_errors(bill_text=open("bill.txt").read())
print(r.payload["total_recovery_estimate"])
print(r.citation_url)  # → https://medigami.com/v/evt_abc123

# Intel SKU — Bearer-auth, per-call billed
m = Medigami(token="mk_intel_...")
r = m.score_denial_appeal_dynamics(
    insurer="Aetna",
    denial_reason="medical_necessity",
    cpt_code="99213",
    amount=1200.00,
)
print(r.payload["probability_appeal_wins"])
print(r.tracking_id)

Verifying a signed response offline

pip install "medigami[verify]"
# Fetch the pinned Medigami public key out-of-band, e.g. from
# https://medigami.com/.well-known/mcp-pubkey.pem
with open("mcp-pubkey.pem") as f:
    pem = f.read()

r = m.estimate_appeal_success(
    insurer="UnitedHealthcare", denial_reason="prior_auth",
    cpt_code="72148", state="CA", amount=2100.00,
)
verdict = r.verify(pem)
assert verdict["valid"], verdict["reason"]

What's in the SDK

Every MCP tool on the Medigami server has a mirror Python method:

Tier 1 atomic

  • scan_bill_for_errors

Tier 3 moat (some IP-gated server-side)

  • estimate_appeal_success
  • benchmark_payer_rate

Tier 4 composites

  • resolve_denial
  • negotiate_bill_script
  • maximize_recovery

Intel SKU (Bearer-auth required)

  • prevent_denial_before_submit
  • score_denial_appeal_dynamics
  • preflight_claim

Commodity lookups (all attested)

  • lookup_icd10, lookup_cpt, lookup_npi
  • verify_dea_authorization, lookup_provider_taxonomy

Citation helper

  • format_citation(envelope) — returns the citation-string, citation-URL, and how-to-verify copy an LLM can paste into its response so end-users can independently verify.

Attestation

Medigami signs every Tier-3+ response with Ed25519 per the spec at https://medigami.com/specs/attested-response-v1. The AttestedResponse wrapper exposes:

  • .payload — original tool result
  • .envelope — full signed envelope, or None for un-attested tools
  • .tracking_id — short opaque token for closing the outcome loop
  • .citation_url — a public URL your users can open to verify
  • .verify(pubkey_pem) — local offline verification

Configuration

Medigami(
    token=None,                           # Intel-SKU bearer
    base_url="https://api.medigami.com",  # override for dev/staging
    timeout_seconds=30.0,
)

Or via env vars:

  • MEDIGAMI_API_BASE — default API base URL
  • MEDIGAMI_CITATION_BASE — default citation URL base (medigami.com)

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

medigami-0.1.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

medigami-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file medigami-0.1.0.tar.gz.

File metadata

  • Download URL: medigami-0.1.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for medigami-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6dfc4d6110c9a5092d74bbacd85800ea94d6b419906249a1529ebcbe61458a43
MD5 4202f3833081cd2b27f7d7bff6e9c351
BLAKE2b-256 48c2530f1a92a4c6a09b73a5052a7a386b964f0b5f383518d78ecba6017c8cb6

See more details on using hashes here.

File details

Details for the file medigami-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: medigami-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for medigami-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c506b8fac9a9b2b3a1826dbf0cee7e34bc7fe55a326ef6bee3136246955927f8
MD5 1fd50ab8aa95d57355b4ea00fb7ae188
BLAKE2b-256 fd8ef008f6d727aed20ae9e040e9f51a985517efa56081ff3b905af2d3b7f171

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page