Skip to content

Repository files navigation

QueryGaP MCP

Use QueryGaP with ChatGPT and Claude directly in your browser!

QueryGaP connects ChatGPT and Claude to structured biomedical metadata search and source-linked results.

No local installation. No QueryGaP account. No QueryGaP API key.

QueryGaP gives your assistant structured access to dbGaP, UK Biobank, and public All of Us documentation metadata. Use it to resolve dbGaP studies, find variables, datasets, and document metadata within an exact study accession, search or inspect UK Biobank fields, and navigate public All of Us variables with source identifiers and canonical links in the results.

The MCP client supplies the reasoning and decides which tools to call. QueryGaP handles study resolution, scoped retrieval, ranking, and provenance.

Connect

QueryGaP is a hosted remote MCP server. Use this URL in any compatible client:

https://mcp.querygap.org/mcp

The hosted public beta requires no QueryGaP account, access token, or user-supplied OpenAI key.

Use QueryGaP in a browser

Claude

  1. In Claude on the web, open Customize > Connectors.
  2. Select +, then Add custom connector.
  3. Enter QueryGaP and https://mcp.querygap.org/mcp, leaving the optional authentication fields blank.
  4. In a conversation, select + > Connectors and enable QueryGaP.

The same remote connector is also available in Claude Desktop. See Anthropic's custom connector guide. On managed Team and Enterprise accounts, an organization owner must add the connector before members can enable it.

ChatGPT

Where ChatGPT Developer mode is available:

  1. Open Settings > Security and login and enable Developer mode.
  2. Open ChatGPT Plugins, select +, and create a developer-mode app.
  3. Use https://mcp.querygap.org/mcp as the remote MCP URL and select no authentication.
  4. Enable the app from the conversation's Developer mode tools.

See the ChatGPT Developer mode guide.

Use QueryGaP with a coding agent

Codex

codex mcp add querygap --url https://mcp.querygap.org/mcp

Claude Code

claude mcp add --transport http --scope user querygap https://mcp.querygap.org/mcp

The user scope makes QueryGaP available across projects. See the Claude Code MCP guide.

For another MCP client, add the endpoint as a remote Streamable HTTP server with no authentication.

Try it

dbGaP

Resolve the Framingham Heart Study, then find variables related to systolic blood pressure. Return their exact dbGaP IDs, descriptions, parent datasets, and source links.

UK Biobank

Find UK Biobank fields related to kidney function. Inspect the most relevant field and return its exact field ID, title, category path, available instance summaries, and source link.

All of Us

Find All of Us EHR measurement variables for diastolic blood pressure. Focus on standard LOINC concepts, then inspect the best result's identifiers, relationships, and Data Browser link.

Tools

The hosted public beta currently exposes all seven read-only tools:

Tool Purpose
resolve_dbgap_study Resolve a study name, acronym, accession, or dbGaP URL to ranked candidates.
get_dbgap_study Retrieve metadata for an exact versioned dbGaP accession.
search_dbgap_catalog Search a resolved study's variables, datasets, or document-title metadata using keyword, semantic, or hybrid retrieval.
search_ukb_fields Search the UK Biobank field dictionary by concept, field ID, or stored aliases.
get_ukb_field Retrieve an exact UK Biobank field and optional instance summaries.
search_aou_catalog Search public All of Us metadata, optionally filtering by variable type and EHR domain, role, or vocabulary.
get_aou_item Retrieve one AoU result's identifiers, links, answer choices, scale membership, and concept relationships.

AoU results explicitly distinguish variables from contextual records. These tools never connect to participant-level All of Us Workbench data. EHR-specific filters require variable_type="ehr"; omitting filters searches the full public metadata catalog.

Self-hosted servers expose the five dbGaP and UK Biobank tools by default. They add the two AoU tools only when the isolated aou schema passes preflight and QG_MCP_AOU_ENABLED=1.

For dbGaP, QueryGaP resolves the study first and preserves the full versioned accession throughout retrieval. UK Biobank remains a separate, field-centric source.

Scope

QueryGaP searches public documentation metadata, not participant-level records. The hosted MCP is read-only and uses a catalog-only database separate from QueryGaP accounts, chats, credits, and billing data. Keyword search does not call a model provider; semantic and hybrid search use QueryGaP-funded query embeddings.

This repository contains the MCP runtime, retrieval implementation, ontology, tests, evaluation material, and security controls. It connects to the hosted QueryGaP catalog; the catalog snapshot and ingestion pipeline are separate.

Development

QueryGaP MCP supports Python 3.10 and newer. Unit tests use fakes, so they require neither a catalog database nor OpenAI access.

python -m venv .venv-mcp
.venv-mcp/bin/pip install -r requirements-mcp-dev.txt
.venv-mcp/bin/python -m pytest -q tests/mcp

Running a server against a real catalog requires a schema-compatible PostgreSQL database and the dedicated read-only role described in ops/querygap_mcp_ro.sql.

Documentation

Status and license

The hosted endpoint is live as a best-effort public beta with deliberate usage limits. QueryGaP MCP is licensed under the Apache License 2.0; see LICENSE. Use GitHub Issues for questions and follow SECURITY.md for vulnerability reports.

About

Use ChatGPT, Claude, or Codex to search public dbGaP, UK Biobank, and All of Us metadata through an open-source MCP.

Topics

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages