Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skyflow MCP Demo (End-to-End)

This demo shows an MCP Gateway server that:

  • De-identifies PII using Skyflow Detect (string),
  • Calls mocked domain sources (CRM, Hospital, Insurance, Claims),
  • Drafts a response with tokens,
  • Re-identifies selected fields back to plaintext.

You can run it interactively with the MCP Inspector UI and call tools like:

  • crm_lookupMember, hospital_getBilling, insurance_getPolicy, claims_checkStatus
  • detect_deidentify_string, skyflow_reidentify_string
  • run_full_demo (one-shot final answer)
  • run_full_demo_trace (full step-by-step transcript)

✨ What’s in here

  • server_gateway.py — MCP server exposing tools and calling Skyflow APIs.
  • dev_demo_skyflow.py — Single-file, non-MCP script that runs the whole flow (optional).
  • (Optional) quick_client.py — Minimal Python CLI to call a tool without the UI.

1) Prerequisites

  • Python 3.10+ (works with 3.11/3.12/3.13)
  • A Skyflow Vault URL, Vault ID, Account ID, and Bearer token
  • Internet access from your machine

2) Install

python -m venv env
source env/bin/activate
pip install -U pip
pip install httpx "mcp[cli]" python-dotenv

mcp[cli] installs the MCP Inspector (mcp dev) we’ll use as the UI.


3) Configure environment

Export these vars (replace with your values):

export VAULT_URL="<vault_URL>"
export VAULT_ID="<your_vault_id>"
export SKYFLOW_TOKEN="<your_bearer_token>"
export SKYFLOW_ACCOUNT_ID="<your_account_id>"

Tokens expire; if you see 401/400 errors, refresh SKYFLOW_TOKEN.

You can also put them in a .env file and source .env.


4) Start the MCP Server

python server_gateway.py

This starts a stdio MCP server (it won’t print output—it waits for clients).


5) Open the UI (MCP Inspector)

In a new terminal (keep the server running in the first one):

mcp dev server_gateway.py

This launches MCP Inspector in your browser. It will:

  • Start/attach to the server for you
  • Show tabs for Tools, Resources, Prompts, etc.

6) Use the Tools in the UI

A. Quick sanity check (string de-id)

  1. Go to Tools → click detect_deidentify_string.
  2. Enter text: Hi, I am DevanshuRun Tool.
  3. You should see processed_text with a token like [NAME_GIVEN_XXXX].

B. Call mocked domain tools (de-id on the fly)

Try these in Tools:

  • crm_lookupMember with:
    {"member_id": "SM123456789"}
  • insurance_getPolicy with:
    {"policy_number": "SILV-P-778845"}
  • claims_checkStatus with:
    {"claim_id": "CLM-987654"}
  • hospital_getBilling with:
    {"mrn": "MRN20250718001"}

Each returns a processed_text containing Skyflow tokens plus an entities array.

C. One-shot answer (final text only)

Use run_full_demo:

  • Input:
    {"question": "Why was my SilverMoat CT claim denied?"}
  • Output: a single user-ready sentence (re-identified where allowed).

D. Full transcript (perfect for demos)

Use run_full_demo_trace:

  • Input:
    {"question": "Why was my SilverMoat CT claim denied?"}
  • Output (JSON):
    • steps[] — each tool call with input_text, processed_text (tokens), entities, and any error
    • draft — Step 8 LLM draft (still has tokens)
    • final_text — Step 9 re-identified answer

You can expand/collapse the Structured Content pane to show everything live during a presentation.


7) Troubleshooting

  • Server shows “no response”
    That’s normal: it’s waiting for an MCP client (Inspector or CLI). Use mcp dev server_gateway.py.

  • HTTP 400 from Skyflow
    Usually input formatting or credentials. Verify:

    • VAULT_URL, VAULT_ID, SKYFLOW_ACCOUNT_ID match your tenant
    • SKYFLOW_TOKEN is fresh (tokens expire)
    • Try a simple string with detect_deidentify_string to confirm auth
  • HTTP 401/403
    Token expired or wrong account/vault mapping. Refresh SKYFLOW_TOKEN.

  • I want to keep emails redacted, show names
    Use the format in re-identify. The demo tools set:

    {
      "plaintext": ["name", "name_given", "name_family"],
      "redacted": ["email_address"],
      "masked": []
    }

About

A demonstration of an MCP client and server wrapped in Detect. Local MCP server using stdout and FastMCP.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages