ClinGate
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ClinGateclassify risk of ordering ABG for patient 123"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ClinGate
MCP Gateway for Clinical AI Agent Oversight
Why this exists
ClinGate is an open-source MCP (Model Context Protocol) gateway that sits between any AI agent framework and the clinical tools it calls. It classifies every action by risk in real time, and forces a human decision before anything irreversible reaches a patient record. Clinical AI agents are moving from answering questions to taking actions, but most multi-agent frameworks lack the built-in capability to enforce who is allowed to approve what, and how it gets logged. This is an infrastructure and dev-tool project, not a medical device. It acts as a governance layer any agent framework can sit behind, with clinical policy rules as the first shipped example.
Related MCP server: promptspeak-mcp-server
Architecture Pipeline
graph TD
Agent[Agent Orchestrator] -->|MCP Tool Calls| Gateway[ClinGate MCP Gateway Server]
Gateway --> RuleEngine{Deterministic Rule Engine}
RuleEngine -->|No match| LLM{LLM Risk Classifier}
RuleEngine -->|Match| DecisionBranch
LLM --> DecisionBranch
DecisionBranch{Decision State} -->|AUTO_CLEAR| RealTool[Real Downstream Tool API]
DecisionBranch -->|ESCALATE| Queue[Escalation Queue & Dashboard]
DecisionBranch -->|BLOCK| Blocked[Blocked Action]
Queue -->|Human Approves| RealTool
Queue -->|Human Rejects| Blocked
Queue -.->|Logs to| Ledger[(SQLite Audit Ledger)]
DecisionBranch -.->|Logs to| LedgerRequest Lifecycle (order_medication)
sequenceDiagram
participant A as Agent
participant G as ClinGate Gateway
participant F as openFDA API
participant R as Rule Engine
participant L as Audit Log
A->>G: order_medication(drug="Adderall")
G->>F: GET api.fda.gov/drug/label.json
F-->>G: DEA Schedule II
G->>R: Evaluate Policies (clinical-default.yaml)
R-->>G: Match: block_controlled_substances -> BLOCK
G->>L: Append row (BLOCK, reason: "Controlled substance")
G-->>A: Call intercepted and held for review. Status: BLOCK.Regulatory Grounding
This gateway directly addresses the human-oversight patterns expected by modern regulatory frameworks:
Requirement | Article / Guidance | How ClinGate addresses it |
Human oversight capability | EU AI Act Art. 14 | Escalation queue with hard stop before execution |
Record-keeping / logging | EU AI Act Art. 12 | Structured, exportable audit ledger per action |
Deployer oversight assignment | EU AI Act Art. 26 | Reviewer role explicitly modeled, not implicit |
Risk management system | EU AI Act Art. 9 | Configurable risk taxonomy + policy rules as first-class artifact |
AI as Medical Device oversight | UK MHRA guidance | Same interception pattern maps directly to SaMD change-control expectations |
Vendor oversight evidence | NHS DTAC | Dashboard + audit export is the artifact a DTAC assessor asks for |
Real Data Sources
The single biggest thing that separates this from a toy demo is that the risk classification pipeline reasons over real, live, public data rather than a hard-coded drug list. Four public sources are wired in:
Source | What it provides | Endpoint (public, no key required for demo volume) | Used for |
openFDA Drug Label API | Structured drug labeling including DEA schedule where present |
| Real-time controlled-substance detection — replaces a static keyword list with an actual regulatory field lookup |
RxNorm (NLM RxNav) | Normalized drug names, RxCUI identifiers, ingredient relationships |
| Normalizes whatever string the agent used ("tylenol" → acetaminophen RxCUI) before the rule engine matches it, so policy rules match on the real ingredient, not on string luck |
ClinicalTrials.gov API v2 | Live registry of recruiting trials by condition |
| Grounds the |
HAPI FHIR public R4 sandbox | Real FHIR R4 |
| Populates the demo's patient context with genuine FHIR-shaped records, not a hand-typed JSON blob |
Quickstart
Clone the repository
git clone https://github.com/vilsee/clingate.git
cd clingateSetup Environment Variables
cp .env.example .env(Note: CLASSIFIER_MODE=mock is the safe default requiring no Anthropic API key. If you have an Anthropic API key, set CLASSIFIER_MODE=live and supply your key).
Run the application (While a Docker Compose configuration is provided, it has not yet been verified end-to-end. We recommend running locally with Uvicorn for development and testing.)
pip install -r requirements.txt
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reloadThe FastAPI MCP server and the static Next.js/HTML dashboard will be available at http://localhost:8000.
Screenshots
TODO:
(The Reviewer Queue showing an ESCALATE item pending with a Classifier Disagreement badge)TODO:
(The raw JSON audit ledger showing the final_status and classifier_disagreement flags)TODO:
(The demo.html page showing live API degradation)
Implemented vs Roadmap
As per the Product Requirements Document (PRD), the MVP milestone requires two differentiating features to be fully implemented, with the remaining four explicitly stubbed for the roadmap.
Implemented Features
1. Classifier Disagreement Signal
Status: Implemented
Description: Logs when the deterministic rule engine and the fallback LLM risk classifier would have made different decisions.
Implementation Details: Evaluated inside the interception loop (
main.py). If the rule engine falls through, the LLM is queried. If the LLM returns an escalation or block (disagreeing with the implicit rule engine fall-through of AUTO_CLEAR), theclassifier_disagreementboolean flag in the SQLite audit table is set toTrue.
2. SLA Breach Failsafe
Status: Implemented
Description: A background daemon that automatically transitions unreviewed
ESCALATEitems intoBLOCK(or a specific SLA breach state) if human reviewers fail to act within a defined timeframe.Implementation Details: Implemented as an asynchronous background task
sla_breach_monitorinmain.py. It loops every 60 seconds and updates anyPENDINGintercept call older than 5 minutes toSLA_BREACH_BLOCKin the database.
Roadmap Stubs (To Be Implemented)
These features have been explicitly documented as stubs in the backend/main.py source code to facilitate future roadmap development.
3. Clinical Trials Context Matching
Status: Stubbed (
stub_feature_1_clinical_trials_matching)Description: Would automatically query ClinicalTrials.gov and attach currently recruiting, localized trials to any blocked medication order to provide alternatives to the reviewer. (Note: ClinicalTrials.gov data is currently retrieved and attached for referrals as a baseline integration, but this advanced matching/suggestion algorithm is deferred).
4. FHIR Resource Validation
Status: Stubbed (
stub_feature_2_fhir_resource_validation)Description: Would validate outgoing tool arguments against active FHIR R4 profiles to ensure payload schema compliance before the call ever reaches the real system.
5. Reviewer Delegation Rules
Status: Stubbed (
stub_feature_3_reviewer_delegation_rules)Description: Would route specific
ESCALATEitems to specific specialist queues (e.g., Oncology-related referrals route only to boarded oncologists) rather than a global reviewer pool.
6. Agent Feedback Loop
Status: Stubbed (
stub_feature_4_agent_feedback_loop)Description: Would send natural language explanations of a
BLOCKdecision back to the autonomous agent, giving it the opportunity to self-correct and try a different tool call without human intervention.
Tech Stack
Gateway server: Python, FastAPI, MCP Python SDK
Rule engine: custom YAML DSL +
pydanticvalidationLLM classification: Anthropic API (Claude) via structured JSON output
Audit store: SQLite (migratable to PostgreSQL)
Dashboard: HTML/CSS/JS (vanilla stack matching a Next.js aesthetic)
External APIs: openFDA, RxNorm, ClinicalTrials.gov, HAPI FHIR
License & Contributing
Licensed under the Apache 2.0 License. Want to add your own YAML policy pack? See CONTRIBUTING.md.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceHuman-in-the-Loop authorization gateway for AI Agents. Securely pause MCP workflows and route high-risk actions to human approvers via Slack or Email.Last updated511MIT
- AlicenseBqualityDmaintenancePre-execution governance for AI agents. 45 MCP tools for hold queues, audit trails, risk scoring, and policy enforcement. Validates agent actions before they execute.Last updated45931MIT
- Alicense-qualityBmaintenanceA fail-closed cryptographic gate for the MCP tool-call boundary that intercepts tools/call requests, evaluates a policy, and either forwards or denies the call with signed receipts, providing tamper-evident evidence for AI agent actions.Last updated52Apache 2.0
- Flicense-qualityCmaintenanceHuman-in-the-loop approval gate for MCP agents, classifying tool calls by risk and requiring Slack-based human approval for medium/high risk actions.Last updated
Related MCP Connectors
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Six-gate governance for AI agents: PROCEED/PAUSE/HALT decisions with hash-chained audit trails.
Runtime AI governance: decision gates, human approval, hash-chained audit, compliance mapping.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vilsee/clingate'
If you have feedback or need assistance with the MCP directory API, please join our Discord server