Find pharmacogenomics guidelines, translate diplotypes, and retrieve prescribing recommendations.
One address for any MCP client. No sign-in needed on this server.
6 read
Grouped by tool name. At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
Find pharmacogenomics guidelines, translate diplotypes, and retrieve prescribing recommendations via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://pharmacogenomics-guidelines.caseyjhand.com/mcp
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.
| 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 |
pgx_search_pairs toolgeneSymbol, drugName (literal substring), drugId, rxnormId, atcId (exact code, no hierarchy expansion), cpicLevel, provisional, pgxTesting and usedForRecommendation.limit defaults to 25; positive safe integers above 100 clamp to 100 with a notice. Continue from page.nextOffset.Retired pairs appear only with includeRetired: true or cpicLevel: "Retired".pgx_get_guideline toolby: "id" with guidelineIdby: "gene" with geneSymbolby: "drug" with exactly one of drugName (exact, case-insensitive) or drugIdview: "summary" pages complete guideline records with exact drugCount and pairCount. view: "drugs" or "pairs" requires by: "id", retains the guideline descriptor, and pages the selected top-level collection; the other collection is omitted.limit defaults to 25; positive safe integers above 100 clamp to 100 with a notice. Follow page.nextOffset. Pages use a 24,000-byte soft budget across both response surfaces and enrichment, cutting only between complete rows. One indivisible oversized row sets oversizedRow: true with a notice.found: false. An ambiguous drug name returns paged candidates; page, shown and truncated then describe those candidates. Retry with a drugId from that list.pgx_lookup_diplotype toolgeneSymbol plus a source-supported diplotype, in either allele order:
*1/*2, *1x2/*4)*57:01 positive)c.1905+1G>A (*2A)/Reference)found, matchedDiplotype, guidance, and every matching source record with its gene result, activity score, EHR priority and lookup key.pgx_get_recommendations toolview or use view: "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 of drugName (exact, case-insensitive) or drugId.
geneSymbol or population, it browses (exploratory).phenotype or activityScore. These need geneSymbol when the drug's recommendations involve several genes.geneResults map: 1–10 genes, each { kind: "phenotype" | "activityScore" | "alleleStatus", value }.mode: "genotype" takes genotype: 1–10 gene → diplotype entries, each of which must resolve uniquely. An optional drug selector narrows the results.mode: "results" discovers across drugs from geneResults, or geneSymbol with one phenotype/activityScore. An optional drug selector narrows the results. Unrelated panel genes do not exclude a recommendation; conflicting results for its prerequisites do.lookupmethod determines accepted result kinds: PHENOTYPE permits phenotype; ACTIVITY_SCORE permits phenotype or activityScore; ALLELE_STATUS permits alleleStatus. Values are validated against source result/score fields. Phenotypes never become calculated scores. Inspect pgx_list_reference topics genes and phenotypes before matching.population, limit (default 10) and offset. Positive safe-integer limits above 50 clamp to 50 with a notice. incompleteLimit (default 25) independently clamps above 100; incompleteOffset pages missing-gene diagnostics through incompletePage.nextOffset.status is exploratory, matched, no_match, incomplete or unresolved. 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. incompleteMatches lists the rows that need more genes, with their missingGenes and without prescribing text.alerts, including ordered alerttext, singular phenotype, lookup keys, allele statuses, scores, populations and versions. No CDS, n/a, sparse fields and explicit source No Result rows remain intact. Omitted genetics never become No Result. Missing prerequisites appear only as { testAlertId, drugId, missingGenes } in incompleteAlerts, without alert text. items and incompleteMatches remain empty; page and incompletePage describe alerts and diagnostics. Default responses omit both alert fields.pgx_search_alleles toolgeneSymbol. name matches literally first, then retries a matching gene-prefixed star allele without that prefix. clinicalFunctionalStatus matches literal text case-insensitively. Returned source spelling stays unchanged; effectiveQuery shows the allele name used.limit defaults to 25; positive safe integers above 100 clamp to 100 with a notice. Nonpositive, fractional and unsafe limits fail before fetching. offset is a nonnegative safe integer.oversizedRow: true with a notice. Follow page.nextOffset to reconstruct the remaining rows.populationFrequencies. Frequencies stay as source fractions, missing values stay missing, and inferred frequencies are flagged as inferred.pgx_list_reference tooltopic is one of:
genes — optional geneSymbol filterphenotypes — requires geneSymbolcpic_levels, pgx_testing, classifications, input_formatsgenes, phenotypes) page with limit (default 25) and offset; 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.geneSymbol and carry a verificationDate.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:
Indeterminate. Phenotypes, decimal activity scores and HLA allele statuses are each checked against CPIC's own values.query_too_broad rather than returning partial results.Agent-friendly output:
requestIndex into requestUrls. API v1 names the interface, not a database release.status, per-gene geneResolutions, incompleteMatches, and typed error reasons with recovery text.content[] carries the complete result as JSON with one clickable link per distinct destination in each rendered block, matching structuredContent. effectiveQuery, notices and page (total, nextOffset) explain every result.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.
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.
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
https://api.cpicpgx.org. No API key is needed.git clone https://github.com/cyanheads/pharmacogenomics-guidelines-mcp-server.git
cd pharmacogenomics-guidelines-mcp-server
bun install
cp .env.example .env
# optional: adjust transport, logging, or telemetry settings
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.
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
| 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. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for logging, ctx.state for storageallToolDefinitions (src/mcp-server/tools/definitions/index.ts), which src/index.ts passes to createApp()Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.