genomics-mcp

genomics-mcp

Provides programmatic access to curated SNP data by trait, enabling LLM-powered applications to search, interpret, and discover genetic variants.

Category
访问服务器

README

Genomics MCP Server

An MCP (Model Context Protocol) server that provides programmatic access to SNP (Single Nucleotide Polymorphism) data by trait. Enables LLM-powered applications to query curated genomics information through a standardized interface.

🌟 Features

  • 🧬 Search SNPs by trait - Find genetic variants associated with specific traits (e.g., "alzheimer_risk", "athletic_performance")
  • 🔍 Detailed SNP information - Get comprehensive data including genomic coordinates, genes, effects, and research sources
  • 🧪 Genotype interpretation - Understand what a specific genotype (e.g., "AG", "TT") means for a given SNP
  • 📋 Trait discovery - List all available traits with SNP counts, grouped by category, with optional pagination
  • 📊 Dataset metadata - Query server version, SNP count, trait count, and last-updated date via get_metadata
  • 📚 Evidence-based - All data includes source citations with URLs and study types
  • Fast lookups - In-memory indexing for sub-millisecond queries
  • 🔄 Database-ready - Repository pattern enables easy migration from JSON to SQL/NoSQL
  • 🌐 HTTP transport - Run as a standalone HTTP server (--transport http) in addition to the default stdio mode

📦 Installation

# Install dependencies
bun install

# Run the server (stdio transport — default)
bun start

# Run as HTTP server (port 3000 by default)
bun start -- --transport http

# HTTP on a custom port
bun start -- --transport http --port 8080

🚀 Quick Start

Testing with MCP Inspector

The MCP Inspector is the recommended way to test your server:

# Run the inspector (launches web UI)
bun run inspector

Then open the URL shown in your browser to interact with the tools.

Integration with an MCP Client

Add this server to your MCP client's configuration. For example, in a config.json:

{
  "mcpServers": {
    "genomics": {
      "command": "bun",
      "args": ["/absolute/path/to/genomics-mcp/src/index.ts"]
    }
  }
}

Note: Replace /absolute/path/to/genomics-mcp with the actual path to your installation. Consult your MCP client's documentation for the exact config file location and format.

🛠️ Available Tools

The server provides 5 MCP tools for querying genomics data:

Tool Description
search_by_trait Search for SNPs associated with one or more traits (supports "any"/"all" matching, pagination)
get_snp_details Get comprehensive information about a specific SNP by rsID
interpret_genotype Interpret what a specific genotype (e.g., "AG", "CT") means for a given SNP
list_traits List all available traits with SNP counts, grouped by category (supports filtering and pagination)
get_metadata Return dataset statistics (SNP count, trait count, last-updated) and server version

All tools support both markdown and json response formats.

👉 See Tool Reference for detailed documentation, parameters, and examples.

📊 Dataset

The dataset covers a broad range of well-studied SNPs across multiple trait categories, including:

  • Neurological: Alzheimer's risk (APOE), memory (BDNF), cognitive function (COMT), dopamine signaling (DRD2)
  • Behavioral: Social behavior (OXTR), addiction risk (DRD2), nicotine dependence (CHRNA3)
  • Cardiovascular: Heart disease risk (9p21), hypertension (AGT), HDL cholesterol (CETP), beta-blocker response (ADRB1)
  • Metabolic: Folate metabolism (MTHFR), obesity risk (FTO), triglyceride levels (APOA5)
  • Pharmacogenomics: Drug metabolism (CYP2C9, CYP2C19), warfarin sensitivity (VKORC1), fluorouracil toxicity (DPYD), hepatitis C treatment (IFNL3), abacavir hypersensitivity (HCP5)
  • Autoimmune & Immune: Celiac disease (HLA-DQA1), rheumatoid arthritis (STAT4), autoimmune risk (PTPN22)
  • Inflammation: IL-1β (IL1B), IL-10 (IL10), CRP levels (CRP)
  • Cancer & Developmental: Detoxification (NQO1), melanoma risk (TYR), lung cancer risk (CHRNA3)
  • Eye & Vision: Age-related macular degeneration (CFH, ARMS2)
  • Bone & Musculoskeletal: Bone density (COL1A1, ESR1), osteoporosis risk
  • Iron & Liver: Hemochromatosis (HFE), Gilbert syndrome (UGT1A1)
  • Physical Traits: Eye color (OCA2), skin pigmentation (TYR, MC1R)
  • Athletic: Sprint/endurance performance (ACTN3)
  • Nutrition & Metabolism: Lactose intolerance (MCM6), vitamin D levels (GC, VDR)
  • Circadian & Sleep: Circadian rhythm (CLOCK), sleep duration (DEC2)
  • Musculoskeletal & Uric Acid: Gout risk (ABCG2), uric acid levels (SLC2A9)

All SNPs include:

  • Genomic coordinates (chromosome, position)
  • Associated genes and traits
  • Genotype-specific effects with risk levels
  • Population frequencies
  • Research source citations with URLs

🏗️ Architecture

The server uses a layered architecture: Tools → Use Cases → Repository → Data, with in-memory indexing for sub-millisecond queries and a repository interface that makes database migration trivial.

👉 See Architecture Guide for diagrams, design patterns, data model, and technical details.

🧪 Development

# Install dependencies
bun install

# Run in development mode (auto-reload)
bun run dev

# Run automated tests
bun test

# Type-check (optional — Bun runs TypeScript directly)
bun run build

# Format code
bun run format

# Lint code
bun run lint

# Lint + format in one pass (auto-fixes)
bun run check

A pre-commit hook runs bun run check on staged files and then bun test before every commit.

📝 Adding New SNPs

To add new SNPs to the dataset:

  1. Edit src/repositories/data/snps.json
  2. Follow the schema with required fields:
    • rsid, genes, traits, description, chromosome, position
    • reference_allele, effects_by_genotype, sources, last_updated
  3. Restart the server — Zod validates on startup and will report any schema violations
  4. If the SNP introduces a new trait slug, add it to both the TRAIT_CATEGORIES map (for category grouping) and the TRAIT_DISPLAY_NAMES map (for the display label) in src/types/trait-categories.ts. Unlisted slugs fall back to Other and auto-generated Title Case respectively.
  5. Optionally run bun run build to type-check

The data is validated against Zod schemas on load, so any schema violations will be caught immediately.

📚 Resources

Data Sources

The curated SNP dataset draws on the following authoritative genomics databases:

  • dbSNP — NCBI reference database for SNP identifiers, genomic coordinates, and allele frequencies
  • ClinVar — NCBI archive of clinically relevant genomic variants and their interpretations
  • SNPedia — Community-curated wiki of SNP associations and genotype effects
  • PharmGKB — Pharmacogenomics knowledge base for drug–gene interactions
  • CPIC — Clinical Pharmacogenetics Implementation Consortium guidelines
  • GnomAD — Genome Aggregation Database for population allele frequencies

📄 License

MIT License - see LICENSE file for details


Note: This server provides educational genomics information only. It is not intended for clinical use or medical diagnosis. Always consult healthcare professionals for medical decisions.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选