Skip to main content
Glama

PGS Catalog MCP

An MCP server for the PGS Catalog REST API — the EMBL-EBI catalog of published polygenic scores, their traits, publications, evaluation samples, and reported performance metrics.

Built with the official TypeScript SDK (@modelcontextprotocol/sdk) over stdio. It covers the full REST surface (v1.8.6): score, publication, trait, performance metric, sample/cohort, release, and info endpoints.

Quick start

npm install
npm run build
npm run setup          # detect the MCP clients on this machine and print the config

setup figures out which harnesses are installed, prints the exact config each one expects (JSON, or YAML for Hermes), and tells you what it would change. Nothing is written until you add --write. See Setup below.

For Claude Desktop, add to claude_desktop_config.json:

{
  "mcpServers": {
    "pgs-catalog": {
      "command": "node",
      "args": ["<absolute-path-to>/dist/index.js"]
    }
  }
}

For VS Code Copilot, add to .vscode/mcp.json — note this file uses the servers key, not mcpServers:

{
  "servers": {
    "pgs-catalog": {
      "type": "stdio",
      "command": "node",
      "args": ["${workspaceFolder}/dist/index.js"]
    }
  }
}

For OpenCode, add to opencode.json (project) or ~/.config/opencode/opencode.json (global). OpenCode wants the command and its arguments as one array, and environment variables under environment:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "pgs-catalog": {
      "type": "local",
      "command": ["node", "<absolute-path-to>/dist/index.js"]
    }
  }
}

For Hermes, add to ~/.hermes/config.yaml, which is YAML. hermes mcp add pgs-catalog --command node --args <absolute-path-to>/dist/index.js does the same thing and also probes the connection:

mcp_servers:
  pgs-catalog:
    command: node
    args:
      - <absolute-path-to>/dist/index.js
    enabled: true

Related MCP server: europepmc-mcp-server

Setup: installing into a client

pgscatalog-mcp setup writes the server entry into a client's own config file, or prints it as JSON. It supports Claude Code, Claude Desktop, Cursor, VS Code / GitHub Copilot, GitHub Copilot CLI, Gemini CLI, OpenCode, and Hermes.

npm run setup                       # detect installed clients, preview every change
npm run setup -- --write           # apply them
npm run setup -- --harness cursor  # one client only
npm run setup:json                 # print just the JSON, for piping or pasting

Positional harness names work too (pgscatalog-mcp setup cursor gemini), as do aliases like claude or desktop.

Flag

Effect

--write

Merge the entry into the client's config file. Without it, nothing is written.

--dry-run

Show what would change, explicitly.

--json

Print only JSON — one merged document, or a map keyed by harness when several are targeted. With --write, a YAML client is still written as YAML.

--print

Human-readable preview (the default).

--scope project|user

Which config file to touch. Each client has its own sensible default.

--all

Every supported client, installed or not.

--force

Replace an existing pgs-catalog entry that differs.

--no-backup

Skip the .bak copy written before modifying a file.

--command auto|npx|"..."

How to launch the server. auto uses an absolute node /abs/dist/index.js when the build exists, otherwise npx -y pgs-catalog-mcp.

--path <file>

Write somewhere other than the client's default config.

--env KEY=VALUE

Environment for the server process. --base-url, --rate-limit, --timeout are shortcuts for the matching PGS_CATALOG_* variables.

Safety rules, all deliberate:

  • Nothing is written without --write. The default action is a preview.

  • Files are merged, never rewritten. Other servers, other top-level settings, and key order are preserved. Only pgs-catalog is added or replaced.

  • A differing existing entry is left alone and reported as a conflict (exit code 1) unless you pass --force.

  • A file that is not valid JSON — or not valid YAML, for Hermes — is never overwritten — the tool stops and says so.

  • Hermes' config.yaml is edited in place. Only its mcp_servers section changes; every other setting, comment, and line is copied through byte for byte.

  • A modified file is copied to <file>.bak first, unless --no-backup.

  • Re-running is a no-op. An identical entry is reported as unchanged and the file is not touched.

Where each client's config lives:

Harness

Project scope

User scope

Top-level key

Claude Code

.mcp.json

~/.claude.json

mcpServers

Claude Desktop

—

~/Library/Application Support/Claude/claude_desktop_config.json

mcpServers

Cursor

.cursor/mcp.json

~/.cursor/mcp.json

mcpServers

VS Code / Copilot

.vscode/mcp.json or .mcp.json

VS Code user mcp.json

servers / mcpServers

Copilot CLI

.copilot/mcp-config.json

~/.copilot/mcp-config.json

mcpServers

Gemini CLI

.gemini/settings.json

~/.gemini/settings.json

mcpServers

OpenCode

opencode.json

~/.config/opencode/opencode.json

mcp

Hermes

—

~/.hermes/config.yaml (YAML)

mcp_servers

VS Code is the odd one out among the JSON clients: .vscode/mcp.json and the user profile file use servers, while the portable .mcp.json uses mcpServers. setup prefers whichever shape the folder already uses. Claude Code needs a type field on a stdio entry, and reads a url entry without one as stdio, so type is written explicitly there and for VS Code.

OpenCode and Hermes differ more sharply:

  • OpenCode keeps servers under mcp, merges command and args into a single array, and calls environment variables environment. It also merges its own config files, so a project opencode.json overrides the global one. OpenCode 1.x accepts only mcp.<name>; OpenCode 2 also offers mcp.servers.<name>, and setup warns if a config already uses that shape.

  • Hermes is the only client whose config is YAML. setup edits only its mcp_servers section and copies every other line through untouched, comments included. Hermes has one config per home, so it has no project scope.

After writing, reload the client: restart Claude Desktop, reload the VS Code window, start a new OpenCode session, run /reload-mcp in a Hermes session, or run claude mcp list / gemini mcp list to confirm the server registered.

Tools

Tool

REST endpoint

What it gives you

search_scores

/rest/score/search, /rest/score/all

Scores by trait ID, PGP ID, PubMed ID, or a known list of PGS IDs

get_score

/rest/score/{pgs_id}

Scoring-file URLs (incl. harmonized GRCh37/GRCh38), method parameters, variant count, weight type, ancestry distribution, license

search_publications

/rest/publication/search, /rest/publication/all

Publications by author, PMID, or associated score

get_publication

/rest/publication/{pgp_id}

Citation plus the PGS IDs developed and evaluated by that paper

search_traits

/rest/trait/search, /rest/trait/all

Resolve a condition name, category, synonym, or mapped term (ICD10/OMIM) into an ontology ID

get_trait

/rest/trait/{trait_id}

Trait definition, synonyms, categories, associated PGS IDs, child terms

list_trait_categories

/rest/trait_category/all

The high-level groups (Cancer, Cardiovascular disorder, …) and their traits

search_performance_metrics

/rest/performance/search, /rest/performance/all

Odds ratios, hazard ratios, C-index/AUC, variance explained — with confidence intervals, covariates, and evaluation samples

get_performance_metric

/rest/performance/{ppm_id}

One metric record in full

search_sample_sets

/rest/sample_set/search, /rest/sample_set/all

Participant counts, ancestry breakdowns, age/follow-up data, cohorts

get_sample_set

/rest/sample_set/{pss_id}

One sample set in full

list_cohorts

/rest/cohort/all

Cohorts (UK Biobank, NHS, ABCFS, …) and the scores that used them

get_cohort

/rest/cohort/{cohort_symbol}

One cohort by short symbol

get_release

/rest/release/current, /rest/release/{date}

Release date and newly added content

list_releases

/rest/release/all

All releases, most recent first

get_catalog_info

/rest/info

API version, catalog counts, and the PGS Catalog citation (DOI/PMID) for attribution

get_ancestry_categories

/rest/ancestry_categories

Decode EUR, AFR, MAE, … before interpreting any ancestry field

get_api_versions

/rest/api_versions

REST API version history

get_scores_from_gwas_study

/rest/gwas/get_score_ids/{gcst_id}

Trace a GWAS Catalog study (GCST) into the scores derived from it

list_ftp_scores

FTP site root

List all PGS score directories on the FTP site (PGS000001, PGS000002, …)

list_ftp_score_directory

FTP site, {pgs_id}/

List a score's FTP directory (ScoringFiles/, Metadata/, …)

list_ftp_scoring_files

FTP site, {pgs_id}/ScoringFiles/

List downloadable scoring files for a score

list_ftp_metadata_files

FTP site, {pgs_id}/Metadata/

List downloadable metadata files for a score

get_ftp_file

FTP site, any path

Download a file's contents from the FTP site

All tools are read-only and marked as such via MCP tool annotations.

How to use it well

Resolve trait IDs before searching scores. Ontology IDs are remapped between catalog releases, and IDs quoted in the upstream API docs (for example EFO_0000305) can return zero results. Search by name first:

search_traits { "term": "breast cancer" }        -> MONDO_0007254, MONDO_0004989, ...
search_scores { "trait_id": "MONDO_0004989" }    -> 145 scores

Compact by default. PGS records are large, so tools return a curated projection. Narrow it further with fields (dotted paths are supported and reproduce the original nesting):

get_score { "pgs_id": "PGS000001", "fields": "id,name,variants_number,publication.title" }

Set full: true when you need the complete upstream record.

Page with next_offset. List results are capped at 250 per call (the API maximum). When a response includes next_offset and a hint, call again with that offset to continue.

Configuration

Environment variables, all optional:

Variable

Default

Purpose

PGS_CATALOG_BASE_URL

https://www.pgscatalog.org/rest

Point at a mirror or a staging instance

PGS_CATALOG_RATE_LIMIT

90

Client-side requests per minute (the API allows 100)

PGS_CATALOG_TIMEOUT_MS

30000

Per-request timeout

The client enforces a sliding-window rate limit below the documented 100 req/min ceiling, retries transient 5xx and 429 responses with backoff, and handles the API's quirks: unknown IDs return HTTP 200 with {} (surfaced as a clear not_found), and malformed requests can return an HTML error page rather than JSON.

Development

npm run build       # compile to dist/
npm run dev         # watch mode
npm test            # unit tests (88) against the compiled output
npm run test:e2e    # end-to-end: spawns the server over stdio and exercises every tool against the live API

test/setup.test.mjs covers the setup command: config paths and wrapper keys per harness, entry shape, merge behaviour, conflict handling, argument parsing, and runSetup end-to-end against a temporary directory — it never writes to a real client config. The YAML path is covered too: appending a section, preserving comments and unrelated keys, leaving an unchanged entry byte-identical, and refusing to overwrite a file it cannot parse.

scripts/verify-config.mjs closes the loop the other way: it reads a config file setup generated — JSON or Hermes' YAML, mcpServers / servers / mcp / mcp_servers, string or array command — launches the server exactly as that config describes, and checks the MCP handshake and tool count. Run it with:

node dist/index.js setup --harness cursor --json --path /tmp/c.json > /tmp/c.json
node scripts/verify-config.mjs /tmp/c.json

spec/pgscatalog-rest-openapi.yaml is the upstream OpenAPI 3.0.3 document this server was built against, kept for reference.

Data and attribution

PGS Catalog data is © EMBL-EBI and distributed under the EBI Terms of Use. Call get_catalog_info to retrieve the current citation (DOI and PubMed ID) when publishing results derived from these tools. Individual scores may carry additional license restrictions, reported in each score's license field.

This server code is licensed under Apache-2.0.

Available Tools

24 tools
get_ancestry_categoriesDecode ancestry category codesA
Read-only

Map the three-letter ancestry symbols used in PGS Catalog data (EUR, AFR, EAS, SAS, AMR, GME, MAE, MAO, …) to their full display names and underlying categories. Use this before interpreting any ancestry_distribution field.

Inputs: no named parameters.

get_api_versionsGet REST API version historyA
Read-only

List the current and previous PGS Catalog REST API versions with their dates and changelogs.

Inputs: no named parameters.

get_catalog_infoGet PGS Catalog info and citationA
Read-only

Get PGS Catalog metadata: REST API version and changelog, latest release date, counts of scores/traits/publications, the PGS Catalog citation (title, DOI, PubMed ID, authors, journal, year), the Ensembl version used for harmonized scoring files, and the terms of use. Use this to cite the catalog correctly.

Inputs: no named parameters.

get_cohortGet a cohort by symbolA
Read-only

Look up a cohort by short symbol (e.g. ABCFS, NHS, UKB). Cohort symbols are not guaranteed to be unique, so this may return several matches with their full names and associated PGS IDs.

Inputs: cohort_symbol (required), limit, offset.

get_ftp_fileDownload a file from the FTP siteA
Read-only

Download the raw text content of a file from the PGS Catalog FTP site. Provide a path relative to the FTP root, e.g. PGS000001/ScoringFiles/PGS000001.txt.gz or PGS000001/Metadata/PGS000001_metadata_scores.csv. Binary files (e.g. .gz) are returned as base64-encoded text; text files (e.g. .csv) are returned as-is.

Inputs: path (required).

get_performance_metricGet a performance metric by PPM IDA
Read-only

Retrieve one reported performance metric by PPM ID (e.g. PPM000001): metric estimates with confidence intervals and standard errors, the trait and phenotyping method, covariates, the associated score, and the evaluation samples.

Inputs: ppm_id (required), full, fields.

get_publicationGet a publication by PGP IDA
Read-only

Retrieve one PGS Catalog publication by PGP ID (e.g. PGP000001): title, journal, DOI, PubMed ID, authors, dates, and the PGS IDs associated with it split into development and evaluation.

Inputs: pgp_id (required), full, fields.

get_releaseGet a PGS Catalog releaseA
Read-only

Get release details: release date and the counts and IDs of newly added scores, publications, performance metrics, and traits. Omit release_date to get the current release.

Inputs: full, fields, release_date.

get_sample_setGet a sample set by PSS IDA
Read-only

Retrieve one sample set by PSS ID (e.g. PSS000070): every sample with participant counts, ancestry, cohorts, phenotyping details, and follow-up information.

Inputs: pss_id (required), full, fields.

get_scoreGet a polygenic score by IDA
Read-only

Retrieve one polygenic score by PGS ID (e.g. PGS000001): scoring-file URLs including harmonized GRCh37/GRCh38 files, publication citation, reported and mapped traits, variant-development and training samples, ancestry distribution at each stage, method parameters, and license terms.

Inputs: pgs_id (required), full, fields.

get_scores_from_gwas_studyFind scores built from a GWAS studyA
Read-only

Given an NHGRI-EBI GWAS Catalog study ID (GCST), return the PGS IDs that used that study as the source of variant associations. Useful for tracing a GWAS finding into the polygenic scores derived from it.

Inputs: gcst_id (required).

get_traitGet a trait by ontology IDA
Read-only

Retrieve one trait by ontology ID (e.g. MONDO_0004989): label, description, synonyms, external mapped terms, trait categories, and the PGS IDs associated with it (and optionally its child terms).

Inputs: trait_id (required), full, fields, include_children.

list_cohortsList cohortsA
Read-only

List study cohorts referenced by the PGS Catalog (for example UK Biobank, NHS, ABCFS, ESTHER, PROFILE) with their full names and the PGS IDs that used them for development or evaluation. Provide cohort_symbols to look up specific cohorts.

Inputs: limit, offset, cohort_symbols.

list_ftp_metadata_filesList a score's metadata filesA
Read-only

List the downloadable metadata files in a score's Metadata/ directory (e.g. PGS000001/Metadata/). Returns file names, sizes, and modification dates. Metadata includes CSVs for cohorts, EFO traits, evaluation sample sets, performance metrics, publications, score development samples, and scores, plus a metadata archive and Excel workbook. Use get_ftp_file to download a file's contents.

Inputs: pgs_id (required).

list_ftp_score_directoryList a score's FTP directory contentsA
Read-only

List the subdirectories and files inside a score's FTP directory (e.g. PGS000001/). Returns the ScoringFiles/ and Metadata/ subdirectories and any other entries. Use list_ftp_scoring_files or list_ftp_metadata_files to enumerate the actual downloadable files.

Inputs: pgs_id (required).

list_ftp_scoresList PGS score directories on the FTP siteA
Read-only

List all PGS score directories available on the PGS Catalog FTP site (https://ftp.ebi.ac.uk/pub/databases/spot/pgs/scores/). Each directory is named after a PGS ID (PGS000001, PGS000002, …) and contains ScoringFiles/ and Metadata/ subdirectories. Use this to discover which scores have scoring files available for download.

Inputs: no named parameters.

list_ftp_scoring_filesList a score's scoring filesA
Read-only

List the downloadable scoring files in a score's ScoringFiles/ directory (e.g. PGS000001/ScoringFiles/). Returns file names, sizes, and modification dates. Harmonized files live in the Harmonized/ subdirectory. Use get_ftp_file to download a file's contents.

Inputs: pgs_id (required).

list_releasesList PGS Catalog releasesA
Read-only

List all PGS Catalog releases, most recent first, with counts and IDs of newly added content.

Inputs: limit, offset.

list_trait_categoriesList trait categoriesA
Read-only

List the higher-level trait categories used to group traits in the PGS Catalog (for example Cancer, Cardiovascular disorder, Neurological disorder) together with the ontology terms in each category. A good starting point for exploratory questions such as 'what polygenic scores exist for cancer'.

Inputs: limit, offset.

search_performance_metricsSearch reported performance metricsA
Read-only

Search reported PGS performance metrics (odds ratio, beta, hazard ratio, C-index/AUC, variance explained, …) by score, publication, or PubMed ID. Each result includes the metric estimates with confidence intervals, the samples used for evaluation with their ancestry and cohorts, and the covariates that were adjusted for.

Inputs: full, pmid, limit, fields, +4 more.

search_publicationsSearch PGS Catalog publicationsA
Read-only

Search publications in the PGS Catalog by author name, PubMed ID, or an associated score ID. Returns citation data plus the PGS IDs each publication developed and evaluated.

Inputs: full, pmid, limit, author, +4 more.

search_sample_setsSearch sample setsA
Read-only

Search PGS sample sets (the groups of participants used to evaluate a score) by score, publication, or PubMed ID. Each sample set lists participant counts, ancestry breakdowns, age and follow-up data, and the cohorts involved.

Inputs: full, pmid, limit, fields, +4 more.

search_scoresSearch polygenic scoresA
Read-only

Search the PGS Catalog for polygenic scores by publication (PGP ID or PubMed ID) or by trait ontology ID (EFO/HP/MONDO). Provide pgs_ids alone to fetch a known set of scores directly. Returns scores with traits, publication citation, variant counts, weight type, ancestry distribution, license, and the FTP scoring-file URL.

Inputs: full, pmid, limit, fields, +4 more.

search_traitsSearch traits (ontology terms)A
Read-only

Search PGS Catalog traits by name, trait category, synonym, ontology ID, or external mapped term (e.g. 'breast cancer', 'Neurological disorder', 'ICD10:I25', 'OMIM:605526'). Always use this first to resolve a human-readable condition into the exact EFO/MONDO/HP ID that search_scores expects — ontology IDs change between catalog releases, so do not assume an ID from documentation or memory. Child ontology terms are included by default.

Inputs: full, term, exact, limit, +6 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 24 tools

    Disambiguation4/5

    Most tools have clearly distinct resource-plus-action purposes, and the descriptions carefully distinguish similar tools such as the FTP directory and file-listing operations. The only mild risk of confusion is among the several FTP listing variants, but their nested scopes are explicitly explained.

    Naming Consistency5/5

    The tool set follows a strong verb_noun convention throughout: list_*, search_*, and get_* are used consistently. Singular/plural distinctions are also predictable, such as search_scores/get_score and list_cohorts/get_cohort.

    Tool Count4/5

    At 24 tools, the surface is somewhat heavy but reasonable for a catalog covering many entity types: scores, publications, traits, performance metrics, sample sets, cohorts, releases, and FTP files. Each tool appears to serve a distinct lookup or browsing need.

    Completeness5/5

    The tool set provides broad coverage of the PGS Catalog domain, including search and retrieval for all major entities, release and version metadata, FTP access, ancestry interpretation, and cross-linking from GWAS studies. Since the catalog is a read-only resource, the absence of create/update/delete tools is appropriate rather than a gap.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      MCP server for polygenic risk score analysis, wrapping just-prs to enable catalog search, PRS computation, VCF normalization, percentile and risk estimation, and quality assessment.
      20
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables searching and retrieving biomedical literature from Europe PMC, including abstracts, full-text (JATS XML), text-mined annotations, citations, references, and database cross-links, through natural language queries and automated data staging.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for querying the GWAS Catalog (EBI/NHGRI), a curated catalog of genome-wide association studies. It enables AI agents to search and retrieve study data via natural language or direct tool calls.
      127 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables searching ENA's public sequencing data by organism, study, platform, country or date, retrieving FASTQ/BAM download URLs and checksums, and discovering available result types and fields.
      146 npm
      MIT