API Overview
Patient Memory exposes two API surfaces: MCP tools for AI agent integration and a REST API for direct HTTP access.
API Overview
Patient Memory exposes two API surfaces backed by the same underlying data.
Base URL
https://api.<workspace-id>.clinia.cloudReplace <workspace-id> with your workspace identifier.
REST API
The REST API provides direct HTTP access plus ingest endpoints:
| Endpoint group | Purpose |
|---|---|
GET /patients | List all registered patients |
GET /patients/:id | Patient metadata and stats |
GET /patients/:id/vfs | Browse the VFS |
GET /patients/:id/read | Read VFS content |
GET /patients/:id/resolution | Audit entity resolution decisions |
GET /patients/:id/reconciliation | View pipeline reconciliation summary |
POST /patients/:id/ingest/* | Ingest FHIR, CDA, or documents |
DELETE /patients/:id | Remove a patient from the registry |
Use REST for server-side integrations, dashboards, or when you need ingest endpoints.
MCP Tools
The MCP endpoint at /mcp is designed for AI agent integration. It exposes the Virtual File System as four tools:
| Tool | Purpose |
|---|---|
browse_patient | Navigate the VFS directory structure |
read_patient | Read content from a VFS path |
search_patient | Full-text search across all patient data |
get_patient_info | Patient demographics and pipeline statistics |
Use MCP when building AI agents with the Model Context Protocol SDK. The server uses HTTP transport with SSE for streaming.
MCP Client Setup
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
const transport = new SSEClientTransport(new URL("https://api.<workspace-id>.clinia.cloud/mcp"));
const client = new Client({ name: "my-agent", version: "1.0.0" });
await client.connect(transport);Sessions are tracked via the Mcp-Session-Id header. Each connected client has its own session; all sessions share the same loaded patients.
The patient ID in VFS paths (the registry key) is set by you at ingest time via the :patientId
URL parameter. It may differ from the FHIR Patient.id inside the bundle.