CTMS MCP Server
The CTMS MCP Server enables AI assistants to query clinical trial data using the Model Context Protocol. Connect your AI agent to explore cubes, run semantic queries, and get clinical trial KPIs with natural language.
Server Capabilities
With the MCP server, your agent can:
- Execute semantic queries against your clinical trial data warehouse
- Explore cubes, measures, and dimensions
- Get pre-defined clinical KPIs (enrollment, safety, compliance)
- Generate SQL for queries without execution
Example prompts:
- "Show me enrollment counts by study"
- "How many serious adverse events have been reported?"
- "Compare subject counts across all sites"
- "What cubes are available in the semantic layer?"
MCP Server integration is available in Enterprise editions.
Quick Start
- VS Code / Copilot
- Claude Desktop
- Web Client
Add to .vscode/mcp.json:
{
"servers": {
"ctms-cube": {
"command": "node",
"args": ["${workspaceFolder}/ctms-mcp-server/index.js"],
"env": {
"CUBE_API_URL": "https://cube.yourdomain.com/cubejs-api/v1"
}
}
}
}
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ctms-cube": {
"command": "node",
"args": ["/path/to/ctms-mcp-server/index.js"],
"env": {
"CUBE_API_URL": "https://cube.yourdomain.com/cubejs-api/v1"
}
}
}
}
Use the Agent Service REST API:
POST https://mcp-agent.yourdomain.com/chat/stream
Available Tools
The MCP server provides the following tools for AI assistants:
📁 list_entities
List all available data entities in your data warehouse
📁 describe_entity
Get detailed structure of a specific entity with measures and dimensions
📁 get_schema
Retrieve full semantic layer metadata including segments and joins
📁 analytics_query
Execute analytics queries with measures, dimensions, and filters
📁 preview_sql
Generate SQL for a query without executing it
📁 get_dashboard_kpis
Get pre-defined dashboard KPIs for reporting
Architecture
AI Assistant → MCP Server (Node.js) → Cube.dev API → PostgreSQL
For web clients, the Agent Service provides a REST bridge:
Web Client → Agent Service (REST) → MCP Server → Cube.dev