Demo Python
A demonstration of an MCP client and server wrapped in Detect. Local MCP server using stdout and FastMCP.
Ask AI about Demo Python
Powered by Claude · Grounded in docs
I know everything about Demo Python. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
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_checkStatusdetect_deidentify_string,skyflow_reidentify_stringrun_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)
- Go to Tools → click
detect_deidentify_string. - Enter text:
Hi, I am Devanshu→ Run Tool. - You should see
processed_textwith a token like[NAME_GIVEN_XXXX].
B. Call mocked domain tools (de-id on the fly)
Try these in Tools:
crm_lookupMemberwith:{"member_id": "SM123456789"}insurance_getPolicywith:{"policy_number": "SILV-P-778845"}claims_checkStatuswith:{"claim_id": "CLM-987654"}hospital_getBillingwith:{"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 withinput_text,processed_text(tokens),entities, and anyerrordraft— 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). Usemcp dev server_gateway.py. -
HTTP 400 from Skyflow
Usually input formatting or credentials. Verify:VAULT_URL,VAULT_ID,SKYFLOW_ACCOUNT_IDmatch your tenantSKYFLOW_TOKENis fresh (tokens expire)- Try a simple string with
detect_deidentify_stringto confirm auth
-
HTTP 401/403
Token expired or wrong account/vault mapping. RefreshSKYFLOW_TOKEN. -
I want to keep emails redacted, show names
Use theformatin re-identify. The demo tools set:{ "plaintext": ["name", "name_given", "name_family"], "redacted": ["email_address"], "masked": [] }
