CIViC

CIViC

Cloudflare Workers-based MCP server providing GraphQL-to-SQL CIViC data querying via Durable Objects.

2
Stars
2
Forks
0
Releases

Overview

A Cloudflare Workers-based MCP server that enables querying the CIViC API by converting GraphQL responses into queryable SQLite tables using Cloudflare Durable Objects for efficient data staging and querying. The server implements MCP 2025-06-18 with structured tool output, protocol version headers, human-friendly tool titles, and extensive _meta metadata, along with robust error handling. It exposes a two-tool pipeline: civic_graphql_query to execute GraphQL queries and stage large datasets, and civic_query_sql to analyze staged data via SQL. Dataset management endpoints are provided at GET /datasets (list datasets) and DELETE /datasets/:id (remove a dataset). The system features automatic GraphQL-to-SQL conversion, smart response handling that bypasses staging for small responses, errors, and schema introspection queries, and a focus on fast, cache-friendly data processing. Tool annotations exist for client guidance (GraphQL and SQL tools), though full SDK integration is pending. Pending work includes a streamable HTTP transport (SSE currently used), OAuth 2.1 authorization, and removal of JSON-RPC batching (already implemented and then removed in the current spec).

Details

Owner
QuentinCody
Language
JavaScript
License
Other
Updated
2025-12-07

Features

GraphQL to SQL Conversion

Automatically converts CIViC API GraphQL responses into structured SQLite tables for analysis.

Efficient Data Storage with Durable Objects

Uses Cloudflare Durable Objects and SQLite for data staging and fast querying.

Smart Response Handling

Bypasses staging for small responses, errors, and schema introspection queries to improve performance.

Two-Tool Pipeline

civic_graphql_query stages large datasets from CIViC; civic_query_sql enables SQL-based analysis of staged data.

MCP Compliance (2025-06-18)

Implements MCP features including structured tool output, _meta fields, protocol headers, titles, and error handling.

Dataset Management Endpoints

Provides GET /datasets and DELETE /datasets/:id to list and remove staged datasets.

Tool Annotations Reference

Comprehensive tool annotations for GraphQL and SQL tools; annotations defined though SDK integration is pending.

Audience

Bioinformatics researchersAccess CIViC clinical interpretations and genomic evidence for cancer research via SQL queries.
AI developersIntegrate CIViC data into AI assistants via GraphQL-to-SQL workflows for analysis.
Claude Desktop usersConfigure and run MCP tools using Claude Desktop for CIViC data querying.

Tags

CIViCGraphQLSQLSQLiteCloudflare WorkersDurable ObjectsMCPGraphQL-to-SQL