io.github.cyanheads/pharmacogenomics-guidelines-mcp-server
Find pharmacogenomics guidelines, translate diplotypes, and retrieve prescribing recommendations.
Que pouvez-vous faire avec io.github.cyanheads/pharmacogenomics-guidelines-mcp-server ?
- One lookup chain: reference values → pairs → guidelines → allele and diplotype evidence → recommendations
- CPIC evaluation levels, ClinPGx testing labels and recommendation classifications are kept separate. A testing label is not an FDA label, and an evaluated pair is not a recommendation.
- Matching uses only results you supply. An omitted gene is never assumed normal, negative or
Indeterminate. Phenotypes, decimal activity scores and HLA allele statuses are each checked against CPIC's own values. - Bounded workflows:
- Provenance: exact deduplicated request URLs, access timestamp, returned row versions, and license and policy links. Each version uses an RFC 6901 JSON Pointer into the result and a
requestIndexintorequestUrls. APIv1names the interface, not a d... - Explicit outcomes: recommendation
status, per-genegeneResolutions,incompleteMatches, and typed error reasons with recovery text. - Lossless text output:
content[]carries the complete result as JSON with one clickable link per distinct destination in each rendered block, matchingstructuredContent.effectiveQuery,noticesandpage(total,nextOffset) explain every res...
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
claude mcp add --transport http pharmacogenomics-guidelines-mcp-server 'https://pharmacogenomics-guidelines.caseyjhand.com/mcp'
{
"mcpServers": {
"pharmacogenomics-guidelines-mcp-server": {
"type": "http",
"url": "https://pharmacogenomics-guidelines.caseyjhand.com/mcp"
}
}
}
@cyanheads/pharmacogenomics-guidelines-mcp-serverclaude mcp add pharmacogenomics-guidelines-mcp-server -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/pharmacogenomics-guidelines-mcp-server@0.2.1
{
"mcpServers": {
"pharmacogenomics-guidelines-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/pharmacogenomics-guidelines-mcp-server@0.2.1"
],
"env": {
"MCP_LOG_LEVEL": "info"
}
}
}
}
Variables d'environnement
MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
@cyanheads/pharmacogenomics-guidelines-mcp-serverclaude mcp add pharmacogenomics-guidelines-mcp-server -e 'MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE>' -e 'MCP_HTTP_HOST=127.0.0.1' -e 'MCP_HTTP_PORT=3010' -e 'MCP_HTTP_ENDPOINT_PATH=/mcp' -e 'MCP_AUTH_MODE=none' -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/pharmacogenomics-guidelines-mcp-server@0.2.1
{
"mcpServers": {
"pharmacogenomics-guidelines-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/pharmacogenomics-guidelines-mcp-server@0.2.1"
],
"env": {
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"MCP_HTTP_HOST": "127.0.0.1",
"MCP_HTTP_PORT": "3010",
"MCP_HTTP_ENDPOINT_PATH": "/mcp",
"MCP_AUTH_MODE": "none",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Variables d'environnement
MCP_TRANSPORT_TYPESelects the HTTP transport.MCP_HTTP_HOSTThe hostname for the HTTP server.MCP_HTTP_PORTThe port to run the HTTP server on.MCP_HTTP_ENDPOINT_PATHThe endpoint path for the MCP server.MCP_AUTH_MODEAuthentication mode to use: 'none', 'jwt', or 'oauth'.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Sommaire
@cyanheads/pharmacogenomics-guidelines-mcp-server
Find pharmacogenomics guidelines, translate diplotypes, and retrieve prescribing recommendations via MCP. STDIO or Streamable HTTP.
6 Tools
Public Hosted Server: https://pharmacogenomics-guidelines.caseyjhand.com/mcp
Overview
Clinical pharmacogenomics evidence from the public CPIC Database API: evaluated gene–drug pairs, guidelines, allele function and frequency, diplotype-to-phenotype translation, and prescribing recommendations, with ClinPGx testing labels and guideline links. You can discover pairs, translate a patient's diplotype, and browse recommendations or match them against explicitly supplied gene results. All six tools are read-only, need no API key, and run as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
Tools
| Tool | Description |
|---|---|
pgx_search_pairs | Search evaluated gene–drug pairs by gene, drug, RxNorm/ATC identifier, CPIC level or testing label |
pgx_get_guideline | Retrieve guideline coverage by ID, gene or drug, with related drugs and pairs |
pgx_lookup_diplotype | Translate a diplotype or HLA allele status into its gene result, activity score and lookup key |
pgx_get_recommendations | Browse or match source prescribing recommendations and opt-in example CDS test alerts |
pgx_search_alleles | Inspect allele function, evidence, definition metadata and population frequencies |
pgx_list_reference | List genes, gene-specific results, controlled vocabulary and input formats |
Capability reference
pgx_search_pairs tool
- Optional filters, combined with AND:
geneSymbol,drugName(literal substring),drugId,rxnormId,atcId(exact code, no hierarchy expansion),cpicLevel,provisional,pgxTestingandusedForRecommendation. - RxNorm/ATC prefixes and ATC letters accept any casing in both advertised schemas and runtime validation. Outer whitespace is ignored; blank identifiers are unset.
limitdefaults to 25; positive safe integers above 100 clamp to 100 with a notice. Continue frompage.nextOffset.- Returns complete pair records, each with its drug record and guideline link.
Retiredpairs appear only withincludeRetired: trueorcpicLevel: "Retired".
pgx_get_guideline tool
- Three lookup modes; selectors from other modes are rejected:
by: "id"withguidelineIdby: "gene"withgeneSymbolby: "drug"with exactly one ofdrugName(exact, case-insensitive) ordrugId
- Default
view: "summary"pages complete guideline records with exactdrugCountandpairCount.view: "drugs"or"pairs"requiresby: "id", retains the guideline descriptor, and pages the selected top-level collection; the other collection is omitted. limitdefaults to 25; positive safe integers above 100 clamp to 100 with a notice. Followpage.nextOffset. Pages use a 24,000-byte soft budget across both response surfaces and enrichment, cutting only between complete rows. One indivisible oversized row setsoversizedRow: truewith a notice.- No coverage returns
found: false. An ambiguous drug name returns pagedcandidates;page,shownandtruncatedthen describe those candidates. Retry with adrugIdfrom that list.
pgx_lookup_diplotype tool
- Takes
geneSymbolplus a source-supporteddiplotype, in either allele order:- star alleles (
*1/*2,*1x2/*4) - HLA allele status (
*57:01 positive) - non-star notation (
c.1905+1G>A (*2A)/Reference)
- star alleles (
- Returns
found,matchedDiplotype,guidance, and every matching source record with its gene result, activity score, EHR priority and lookup key. - Several matching records are left ambiguous, never resolved to one. No result is calculated.
pgx_get_recommendations tool
- Omit
viewor useview: "recommendations"for prescribing recommendations.view: "test_alerts"selects CPIC's example CDS language with the same drug, genotype, result, population and paging selectors; it does not fetch recommendations or join guidelines. mode: "drug"takes exactly one ofdrugName(exact, case-insensitive) ordrugId.- On its own, or with
geneSymbolorpopulation, it browses (exploratory). - To match, add
phenotypeoractivityScore. These needgeneSymbolwhen the drug's recommendations involve several genes. - Alternatively, add a
geneResultsmap: 1–10 genes, each{ kind: "phenotype" | "activityScore" | "alleleStatus", value }.
- On its own, or with
mode: "genotype"takesgenotype: 1–10 gene → diplotype entries, each of which must resolve uniquely. An optional drug selector narrows the results.mode: "results"discovers across drugs fromgeneResults, orgeneSymbolwith onephenotype/activityScore. An optional drug selector narrows the results. Unrelated panel genes do not exclude a recommendation; conflicting results for its prerequisites do.- Source gene
lookupmethoddetermines accepted result kinds:PHENOTYPEpermitsphenotype;ACTIVITY_SCOREpermitsphenotypeoractivityScore;ALLELE_STATUSpermitsalleleStatus. Values are validated against source result/score fields. Phenotypes never become calculated scores. Inspectpgx_list_referencetopicsgenesandphenotypesbefore matching. - All modes accept an exact
population,limit(default 10) andoffset. Positive safe-integer limits above 50 clamp to 50 with a notice.incompleteLimit(default 25) independently clamps above 100;incompleteOffsetpages missing-gene diagnostics throughincompletePage.nextOffset. statusisexploratory,matched,no_match,incompleteorunresolved. Drug and results matching require at least one overlapping supplied gene, reject conflicts on overlapping prerequisites, and ignore unrelated validated panel genes. A row matches only when every gene in its lookup key has an explicit result.incompleteMatcheslists the rows that need more genes, with theirmissingGenesand without prescribing text.- Empty-result notices distinguish unresolved drugs, absent recommendation tables, population mismatches and past-end pages. Where source coverage exists, a no-table notice links the guideline for consultation.
- Alert view returns complete source records in
alerts, including orderedalerttext, singularphenotype, lookup keys, allele statuses, scores, populations and versions.No CDS,n/a, sparse fields and explicit sourceNo Resultrows remain intact. Omitted genetics never becomeNo Result. Missing prerequisites appear only as{ testAlertId, drugId, missingGenes }inincompleteAlerts, without alert text.itemsandincompleteMatchesremain empty;pageandincompletePagedescribe alerts and diagnostics. Default responses omit both alert fields.
pgx_search_alleles tool
- Requires
geneSymbol.namematches literally first, then retries a matching gene-prefixed star allele without that prefix.clinicalFunctionalStatusmatches literal text case-insensitively. Returned source spelling stays unchanged;effectiveQueryshows the allele name used. limitdefaults to 25; positive safe integers above 100 clamp to 100 with a notice. Nonpositive, fractional and unsafe limits fail before fetching.offsetis a nonnegative safe integer.- The 24,000-byte soft budget measures the entire serialized tool result, including both response surfaces and enrichment. It cuts only between complete alleles, keeping every frequency row. An indivisible oversized first row sets
oversizedRow: truewith a notice. Followpage.nextOffsetto reconstruct the remaining rows. - Returns allele function and evidence with definition metadata and
populationFrequencies. Frequencies stay as source fractions, missing values stay missing, and inferred frequencies are flagged as inferred.
pgx_list_reference tool
topicis one of:genes— optionalgeneSymbolfilterphenotypes— requiresgeneSymbolcpic_levels,pgx_testing,classifications,input_formats
- The two live topics (
genes,phenotypes) page withlimit(default 25) andoffset; positive safe-integer limits above 100 clamp to 100 with a notice. They return full gene and gene-result records, including distinct activity scores, frequencies and consultation text. - Static topics return their whole vocabulary without calling the CPIC API. They reject
geneSymboland carry averificationDate.
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:
- One lookup chain: reference values → pairs → guidelines → allele and diplotype evidence → recommendations
- CPIC evaluation levels, ClinPGx testing labels and recommendation classifications are kept separate. A testing label is not an FDA label, and an evaluated pair is not a recommendation.
- Matching uses only results you supply. An omitted gene is never assumed normal, negative or
Indeterminate. Phenotypes, decimal activity scores and HLA allele statuses are each checked against CPIC's own values. - Bounded workflows:
- 45-second deadline, at most 100 HTTP attempts, three concurrent requests, two retries per request
- Related scans stop at 2,000 rows (drug resolution 500). Guideline lists and detail views page at the source; related counts use exact source totals, with bounded scans only when totals are missing. Past a scan cap the call fails as
query_too_broadrather than returning partial results.
Agent-friendly output:
- Provenance: exact deduplicated request URLs, access timestamp, returned row versions, and license and policy links. Each version uses an RFC 6901 JSON Pointer into the result and a
requestIndexintorequestUrls. APIv1names the interface, not a database release. - Explicit outcomes: recommendation
status, per-genegeneResolutions,incompleteMatches, and typed error reasons with recovery text. - Lossless text output:
content[]carries the complete result as JSON with one clickable link per distinct destination in each rendered block, matchingstructuredContent.effectiveQuery,noticesandpage(total,nextOffset) explain every result.
Source attribution and clinical limitations
Data comes from the CPIC Database and ClinPGx. The CPIC data license and the ClinPGx usage policy cover the source data; this repository's Apache-2.0 license covers its code.
The database tables can omit guideline nuances or lag behind guideline updates, so check each linked guideline before clinical use. Results apply only to their stated genes, drugs, populations and indications, and treatment decisions remain with the clinician and patient. The server stores no patient records, but genetic queries are sent to the CPIC API, and the request URLs, which contain them, appear in responses.
Getting started
Public Hosted Instance
A public instance is available at https://pharmacogenomics-guidelines.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"pharmacogenomics-guidelines-mcp-server": {
"type": "streamable-http",
"url": "https://pharmacogenomics-guidelines.caseyjhand.com/mcp"
}
}
}
Queries to the hosted instance pass through its server on the way to the CPIC API. For patient data, run your own instance.
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, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bunx @cyanheads/pharmacogenomics-guidelines-mcp-server@latest
# Server listens at http://localhost:3010/mcp
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- Network access to
https://api.cpicpgx.org. No API key is needed.
Installation
- Clone the repository:
git clone https://github.com/cyanheads/pharmacogenomics-guidelines-mcp-server.git
- Navigate into the directory:
cd pharmacogenomics-guidelines-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# optional: adjust transport, logging, or telemetry settings
Configuration
No server-specific environment variables are required.
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_HOST | HTTP bind address. | 127.0.0.1 |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_HTTP_ENDPOINT_PATH | MCP endpoint path. | /mcp |
MCP_SESSION_MODE | HTTP session mode: stateless, stateful or auto. | stateless |
MCP_AUTH_MODE | Authentication: none, jwt or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.). | debug |
OTEL_ENABLED | Enable OpenTelemetry. | false |
See .env.example for the common framework overrides.
Running the server
Local development
- Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdio - Run checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Project structure
| Directory | Purpose |
|---|---|
src/mcp-server/tools/definitions | The six tool definitions and the allToolDefinitions registry. |
src/mcp-server/tools/shared | Paging schemas and lossless Markdown rendering. |
src/services/cpic | Fixed-host CPIC requests, source record schemas, discovery, evidence and recommendation matching. |
tests/unit | Service, tool contract, boundary and formatter tests. |
docs | 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 logic - Use
ctx.logfor logging,ctx.statefor storage - Register new tools in
allToolDefinitions(src/mcp-server/tools/definitions/index.ts), whichsrc/index.tspasses tocreateApp() - Wrap 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 test
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Questions fréquentes
Qu'est-ce que io.github.cyanheads/pharmacogenomics-guidelines-mcp-server ?
Find pharmacogenomics guidelines, translate diplotypes, and retrieve prescribing recommendations.
Comment installer io.github.cyanheads/pharmacogenomics-guidelines-mcp-server ?
Il fonctionne comme serveur distant. Dans Claude Code : claude mcp add --transport http pharmacogenomics-guidelines-mcp-server 'https://pharmacogenomics-guidelines.caseyjhand.com/mcp'. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour io.github.cyanheads/pharmacogenomics-guidelines-mcp-server ?
Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.
io.github.cyanheads/pharmacogenomics-guidelines-mcp-server est-il open source ?
Oui. Son code est sur GitHub sous licence Apache-2.0.
Qui maintient io.github.cyanheads/pharmacogenomics-guidelines-mcp-server ?
Il est publié par cyanheads. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.