Pharmacogenomics Guidelines MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Pharmacogenomics Guidelines MCP Serverlook up prescribing recommendations for CYP2D6 and codeine"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Overview
Pharmacogenomics evidence from the public CPIC Database API, with clinical source context from ClinPGx. Discover evaluated gene–drug pairs, inspect guideline coverage and allele evidence, translate source-supported diplotypes, and browse or match source prescribing recommendations. All six tools are read-only and require no API key.
Tools
Tool | Description |
| Discover evaluated gene–drug pairs and their source identifiers |
| Retrieve guideline coverage and related drugs and pairs |
| Resolve source-supported diplotypes or allele-specific statuses |
| Browse recommendations or match explicitly supplied genetic results |
| Inspect allele function, definition metadata and population frequencies |
| List genes, source results, controlled vocabulary and input formats |
Related MCP server: clingen-link
Capability reference
pgx_search_pairs tool
Optional
geneSymbol, literaldrugNamesubstring, exactdrugId,rxnormIdoratcId,cpicLevel,provisional,pgxTesting, andusedForRecommendation; all filters combine with AND. RxNorm and ATC prefixes are optional; ATC matching is exact membership, without hierarchy expansion.Complete pair and drug records with guideline links. Retired pairs are excluded unless
includeRetired: trueorcpicLevel: "Retired"; an evaluated pair is not a prescribing recommendation.limit1–100 (default 25),offsetdefault 0; continue withpage.nextOffset.
pgx_get_guideline tool
by: "id"requiresguidelineId;by: "gene"requiresgeneSymbol;by: "drug"requires exactly onedrugNameordrugId. Drug names are exact and case-insensitive; omit selectors from other modes.Returns every matching guideline with complete related drug/pair lists, source versions, links and clinical caveat. Missing coverage returns
found: false; ambiguous drug names returncandidatesfor a retry withdrugId.
pgx_lookup_diplotype tool
Requires
geneSymboland source-supporteddiplotype: star alleles such as*1/*2, named HLA allele status such as*15:02 positive, or non-star sequence notation. Exact lookup precedes bounded reverse-order and status aliases; it does not interpret arbitrary variants.Returns
found,matchedDiplotype, complete sourcerecordsandguidance. Multiple records remain ambiguous; activity scores and missing results are never calculated.
pgx_get_recommendations tool
mode: "drug"requires exactly onedrugName(exact, case-insensitive) ordrugId. Drug-only browsing isexploratory, including optionalgeneSymbol/populationfilters. To match results, supply eitherphenotypeoractivityScore(withgeneSymbolunless the drug has exactly one recommendation gene), orgeneResultsfor 1–10 genes as{ "GENE": { "kind": "phenotype" | "activityScore" | "alleleStatus", "value": "source value" } }; the map excludes scalar result fields.mode: "genotype"requiresgenotypewith 1–10 gene/diplotype entries, optionally one drug selector; scalar results andgeneResultsare excluded. Every supplied genotype must resolve uniquely. Both modes accept an exactpopulationfilter andlimit1–50 (default 10),offsetdefault 0.statusisexploratory,matched,no_match,incompleteorunresolved. Matched rows require every source genetic prerequisite;incompleteMatcheslists identifiers andmissingGeneswithout prescribing text. Omitted genes are never assumed normal or negative. Complete records retain populations, activity scores, allele statuses,No Recommendationandn/a; phenotype matching can retain several distinct scores.
pgx_search_alleles tool
Requires
geneSymbol; optional exactnameandclinicalFunctionalStatusfilters.limit1–100 (default 25),offsetdefault 0; continue withpage.nextOffset.Complete allele evidence, embedded definition metadata and
populationFrequencies. Definitions do not promise defining variants; frequency fractions stay fractions, missing values are not zero, inferred frequencies are not observed measurements, and population frequencies do not establish individual risk.
pgx_list_reference tool
topic:genes,phenotypes,cpic_levels,pgx_testing,classificationsorinput_formats.phenotypesrequiresgeneSymbol;genesoptionally filters by it. Live topics acceptlimit1–100 (default 25) andoffset(default 0).Live gene/result records retain distinct scores, consultation text and versions. Static topics return their complete vocabulary without an upstream request, reject gene filters and report
verificationDateinstead of a live access timestamp.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
CPIC-specific:
A source lookup workflow: inspect reference values → discover pairs → retrieve guidelines → inspect allele/diplotype evidence → browse or match recommendations.
CPIC evaluation levels, ClinPGx testing labels and prescribing recommendation classifications remain separate. ClinPGx testing labels are not FDA labels.
Bounded requests: a 45-second workflow deadline, at most 100 HTTP attempts, three concurrent requests and two retries per request. Related scans cap at 2,000 rows (drug resolution at 500, guidelines at 100);
query_too_broadfails instead of silently returning an incomplete scan.
Agent-friendly output:
Provenance — exact request URLs, access timestamps, row versions and source license/policy links; API
v1identifies the interface, not a database release or atomic snapshot.Explicit outcomes — recommendation
status, per-gene resolution diagnostics, missing prerequisites and actionable recovery guidance.Complete data —
content[]andstructuredContentcarry the same source data, including links and clinical text;effectiveQuery,noticesand page metadata explain the result.page.totalis null when a source count is unavailable.
Source attribution and clinical limitations
Data comes from the CPIC Database and ClinPGx. Consult the CPIC data license and ClinPGx usage policy for source terms; this repository's Apache-2.0 license covers its code.
Database/API tables may omit guideline nuances or lag updates. Consult each linked guideline and its updates before clinical use. Results apply only to their stated genes, drugs, populations and indications; treatment decisions remain with the clinician and patient. The tools retrieve source evidence and match explicit results; they do not infer clinical results, calculate personal risk or synthesize patient-specific dosing. No patient record is stored by the service; genetic queries are sent to the upstream API and request URLs appear in responses.
Getting started
Self-Hosted / Local
Add the following to your MCP client configuration file:
{
"mcpServers": {
"pharmacogenomics-guidelines-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/pharmacogenomics-guidelines-mcp-server@latest"],
"env": { "MCP_TRANSPORT_TYPE": "stdio", "MCP_LOG_LEVEL": "info" }
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"pharmacogenomics-guidelines-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/pharmacogenomics-guidelines-mcp-server@latest"],
"env": { "MCP_TRANSPORT_TYPE": "stdio", "MCP_LOG_LEVEL": "info" }
}
}
}Or with Docker:
{
"mcpServers": {
"pharmacogenomics-guidelines-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/pharmacogenomics-guidelines-mcp-server:latest"]
}
}
}For Streamable HTTP:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bunx @cyanheads/pharmacogenomics-guidelines-mcp-server@latest
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher, or Node.js v24+.
Network access to
https://api.cpicpgx.org; no API key is needed.
Installation
git clone https://github.com/cyanheads/pharmacogenomics-guidelines-mcp-server.git
cd pharmacogenomics-guidelines-mcp-server
bun install
cp .env.example .envConfiguration
No server-specific environment variables are required.
Variable | Description | Default |
| Transport: |
|
| HTTP bind address. |
|
| HTTP server port. |
|
| MCP endpoint path. |
|
| HTTP session mode: |
|
| Authentication: |
|
| Log level ( |
|
| Enable OpenTelemetry. |
|
See .env.example for the common framework overrides.
Running the server
Local development
Build and run the production version:
bun run rebuild bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck bun run test
Project structure
Directory | Purpose |
| Six read-only tool definitions. |
| Paging schemas and lossless Markdown rendering. |
| Fixed-host API requests, source records, discovery, evidence and matching. |
| Service, tool contract, boundary and formatter tests. |
| Design contract and generated directory tree. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools and resources in the
createApp()arrays insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Pharmacogenomics for AI agents: cited drug–gene, gene and rsID lookups plus a medication screen.
DrugBank MCP — wraps the DrugBank Clinical API (api.drugbank.com)
RxNorm MCP — wraps the NLM RxNav REST API (free, no auth)
CIViC — Clinical Interpretation of Variants in Cancer.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables real-time pharmacogenomics analysis, including variant clinical significance, drug-gene interactions, and dosing guidelines, by connecting to ClinVar, PharmGKB, gnomAD, and other databases.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables querying ClinGen curated evidence for gene-disease validity, dosage, actionability, and variant pathogenicity via MCP tools.MIT
- AlicenseNot gradedqualityAmaintenanceRead-only biomedical MCP server connecting PubMed, ClinicalTrials.gov, ClinVar, gnomAD, OncoKB, Reactome, KEGG, UniProt, PharmGKB, CPIC, OpenFDA, Monarch Initiative, GWAS Catalog, and more. One command grammar for all biomedical entities — genes, variants, diseases, drugs, trials, articles, phenotypes, pathways, proteins, diagnostics, and adverse events. 27 tools. Apache-2.0 license.1Apache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables querying the CIViC database for clinical interpretations of cancer variants through tools like get_variant_evidence and get_variant_assertions.1-