Skip to main content
Glama

Logo

Unofficial GTEx Portal MCP Server

A comprehensive Model Context Protocol (MCP) server providing access to the GTEx (Genotype-Tissue Expression) Portal API. This server enables AI assistants to query and analyze genomics data from the GTEx project through 25 specialized tools across three categories.

Developed by Augmented Nature

Overview

The GTEx Portal contains gene expression and regulatory data from 54 non-diseased tissue sites across nearly 1000 individuals. This MCP server provides structured access to:

  • Expression Analysis: Gene expression patterns and tissue specificity (7 tools)

  • Association Analysis: eQTL/sQTL analysis and genetic associations (6 tools)

  • Reference/Dataset: Gene/variant lookups and metadata (12 tools)

Related MCP server: Omics AI MCP Server

🧬 Complete Tool Suite (25/25 Implemented)

Expression Analysis Tools (7 tools)

  • get_gene_expression - Get gene expression data across tissues for specific genes

  • get_median_gene_expression - Get median gene expression levels across tissues

  • get_top_expressed_genes - Get top expressed genes in specific tissues

  • get_tissue_specific_genes - Get genes with tissue-specific expression patterns

  • get_clustered_expression - Get clustered gene expression data for visualization

  • calculate_expression_correlation - Calculate Pearson correlation between genes across tissues

  • get_differential_expression - Get differential gene expression between tissue groups

Association Analysis Tools (6 tools)

  • get_eqtl_genes - Get genes with eQTL associations for genomic regions

  • get_single_tissue_eqtls - Get single-tissue eQTL results for genes

  • calculate_dynamic_eqtl - Calculate dynamic eQTL effects across tissues

  • get_multi_tissue_eqtls - Get multi-tissue eQTL meta-analysis results

  • get_sqtl_results - Get splicing QTL (sQTL) results for genes

  • analyze_ld_structure - Analyze linkage disequilibrium structure around variants

Reference/Dataset Tools (12 tools)

  • search_genes - Search for genes by symbol, name, or description

  • get_gene_info - Get detailed information about specific genes

  • get_variants - Get genetic variants in genomic regions

  • get_tissue_info - Get information about GTEx tissues and sample counts

  • get_sample_info - Get GTEx sample metadata and demographics

  • get_subject_phenotypes - Get subject phenotype data and demographics

  • validate_gene_id - Validate and normalize gene identifiers

  • validate_variant_id - Validate variant identifiers and genomic coordinates

  • get_dataset_info - Get information about available GTEx datasets

  • search_transcripts - Search for gene transcripts and isoforms

  • get_gene_ontology - Get Gene Ontology annotations for genes

  • convert_coordinates - Convert between genomic coordinate systems (hg19/hg38)

πŸš€ Installation

  1. Clone or download the server files

  2. Install dependencies:

cd gtex-server
npm install
  1. Build the server:

npm run build

Usage

Running the Server

Start the server for testing:

npm run dev

Use the MCP inspector for development:

npm run inspector

Integrating with Claude Desktop

Add the server to your Claude Desktop configuration file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "gtex-server": {
      "command": "node",
      "args": ["/path/to/gtex-server/build/index.js"]
    }
  }
}

Replace /path/to/gtex-server with the actual path to your server installation.

πŸ“Š Example Usage

Search for Genes

Search for genes related to "BRCA1" or "insulin signaling"

Gene Expression Analysis

Get median gene expression for ENSG00000012048.20 (BRCA1) across all tissues

Tissue-Specific Analysis

Find tissue-specific genes in Brain_Cortex and compare with Muscle_Skeletal

eQTL Analysis

Find genes with eQTL associations in genomic region chr17:43000000-43200000

Expression Correlation

Calculate expression correlation between BRCA1 and BRCA2 across tissues

Coordinate Conversion

Convert genomic coordinates from hg38 to hg19: chr1:1500000

πŸ”¬ Scientific Applications

This server enables comprehensive genomics research including:

  • Tissue Expression Profiling: Identify genes with tissue-specific or tissue-enriched expression

  • Co-expression Analysis: Find genes with correlated expression patterns

  • eQTL Mapping: Discover expression quantitative trait loci and regulatory variants

  • Comparative Genomics: Compare expression across different tissue types

  • Functional Annotation: Link genes to biological processes via Gene Ontology

  • Variant Analysis: Explore genetic variation and its impact on gene expression

πŸ—„οΈ API Data Source

This server connects to the GTEx Portal API v2:

πŸ“‹ Data Types and Formats

Gene Identifiers

  • GENCODE IDs: e.g., ENSG00000012048.20 (BRCA1)

  • Gene Symbols: e.g., BRCA1, TP53, INSR

Tissue Identifiers

  • Tissue Site Detail IDs: e.g., Muscle_Skeletal, Brain_Cortex, Heart_Left_Ventricle

  • Use get_tissue_info tool to see all 54 available tissues

Genomic Coordinates

  • Chromosome: e.g., chr17, chrX, chrY

  • Positions: 1-based genomic coordinates

  • Genome Build: GRCh38/hg38 (with hg19 conversion available)

Expression Values

  • Units: TPM (Transcripts Per Million)

  • Statistics: Mean, median, standard deviation across samples

  • Detection: Percentage of samples with detectable expression

⚑ Performance & Reliability

  • Error Handling: Comprehensive validation and graceful error recovery

  • Rate Limiting: Automatic handling of API rate limits

  • Timeouts: 30-second timeouts with retry logic

  • Caching: Intelligent caching to improve response times

  • Pagination: Automatic handling of large result sets

  • Validation: Input parameter validation and normalization

πŸ› οΈ Development

Project Structure

gtex-server/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts                      # Main MCP server with tool registration
β”‚   β”œβ”€β”€ types/gtex-types.ts          # Complete TypeScript type definitions
β”‚   β”œβ”€β”€ utils/api-client.ts          # GTEx API client with comprehensive methods
β”‚   └── handlers/
β”‚       β”œβ”€β”€ expression-handlers.ts    # 7 expression analysis tools
β”‚       β”œβ”€β”€ association-handlers.ts   # 6 eQTL/sQTL analysis tools  
β”‚       └── reference-handlers.ts     # 12 reference/lookup tools
β”œβ”€β”€ build/                           # Compiled JavaScript output
β”œβ”€β”€ test-complete-server.js         # Comprehensive testing script
β”œβ”€β”€ package.json                     # Dependencies and build scripts
└── tsconfig.json                    # TypeScript configuration

Development Commands

# Build the project
npm run build

# Run in development mode with auto-reload
npm run dev

# Watch for changes during development
npm run watch

# Test all 25 tools
node test-complete-server.js

Technical Implementation

  • Language: TypeScript with ES modules

  • Framework: Model Context Protocol SDK v0.6.0

  • Architecture: Modular design with separate handler classes

  • API Client: Axios with comprehensive error handling

  • Data Processing: Statistical analysis and data formatting

  • Type Safety: Complete type definitions for all GTEx API responses

πŸ“š References

🎯 Status: Production Ready

βœ… All 25 tools implemented and tested
βœ… Complete TypeScript implementation
βœ… Comprehensive error handling
βœ… Live GTEx Portal API integration
βœ… MCP 1.0 compliant
βœ… Ready for genomics research

πŸ“„ License

MIT License - Feel free to use, modify, and distribute for research and commercial applications.


This server bridges the GTEx Portal's extensive genomics database with the Model Context Protocol, enabling powerful genomics analysis through AI assistants.

Available Tools

25 tools
analyze_ld_structureB

Analyze linkage disequilibrium structure around eQTL variants

Inputs: chr (required), position (required), windowSize, population.

calculate_dynamic_eqtlC

Calculate dynamic eQTL effects across tissues

Inputs: gencodeId (required), snpId (required), tissueSiteDetailIds (required), datasetId.

calculate_expression_correlationC

Calculate expression correlation between genes across tissues

Inputs: gencodeIds (required), datasetId.

convert_coordinatesC

Convert between different genomic coordinate systems

Inputs: chr (required), position (required), fromBuild, toBuild.

get_clustered_expressionC

Get clustered gene expression data for visualization

Inputs: gencodeIds (required), datasetId.

get_dataset_infoC

Get information about available GTEx datasets

Inputs: datasetId.

get_differential_expressionC

Get differential gene expression between tissue groups

Inputs: gencodeId (required), comparisonGroups (required), datasetId.

get_eqtl_genesC

Get genes with eQTL associations for a genomic region

Inputs: chr (required), start (required), end (required), tissueSiteDetailId, +1 more.

get_gene_expressionC

Get gene expression data across tissues for a specific gene

Inputs: gencodeId (required), datasetId.

get_gene_infoC

Get detailed information about a specific gene

Inputs: gencodeId, geneSymbol.

get_gene_ontologyC

Get Gene Ontology annotations for a gene

Inputs: gencodeId (required), ontologyType.

get_median_gene_expressionC

Get median gene expression levels across tissues

Inputs: gencodeId (required), datasetId.

get_multi_tissue_eqtlsC

Get multi-tissue eQTL meta-analysis results

Inputs: gencodeId (required), datasetId.

get_sample_infoB

Get GTEx sample metadata and demographics

Inputs: tissueSiteDetailId, datasetId.

get_single_tissue_eqtlsB

Get single-tissue eQTL results for a gene

Inputs: gencodeId (required), tissueSiteDetailId (required), datasetId.

get_sqtl_resultsC

Get splicing QTL (sQTL) results for a gene

Inputs: gencodeId (required), tissueSiteDetailId, datasetId.

get_subject_phenotypesC

Get subject phenotype data and demographics

Inputs: subjectId, datasetId.

get_tissue_infoC

Get information about GTEx tissues and sample counts

Inputs: datasetId.

get_tissue_specific_genesC

Get genes with tissue-specific expression patterns

Inputs: tissueSiteDetailId (required), selectionCriteria, datasetId.

get_top_expressed_genesC

Get top expressed genes in a specific tissue

Inputs: tissueSiteDetailId (required), filterMtGenes, sortBy, sortDirection, +1 more.

get_variantsC

Get genetic variants in a genomic region

Inputs: chr (required), start (required), end (required), datasetId.

search_genesC

Search for genes by symbol, name, or description

Inputs: query (required), species, page, pageSize.

search_transcriptsC

Search for gene transcripts and isoforms

Inputs: gencodeId (required), transcriptType.

validate_gene_idC

Validate and normalize gene identifiers

Inputs: geneId (required).

validate_variant_idC

Validate variant identifiers and genomic coordinates

Inputs: variantId, chr, position.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 25 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific data types or analyses (e.g., get_gene_expression vs. get_eqtl_genes vs. get_sample_info), with clear boundaries. However, some overlap exists between get_gene_info and search_genes, and between get_subject_phenotypes and get_sample_info, which could cause minor confusion.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, primarily using 'get_' for data retrieval, 'calculate_' for computations, and 'analyze_'/'search_'/'validate_' for other operations. All names use snake_case uniformly, making them predictable and readable.

    Tool Count3/5

    With 25 tools, the count is borderline high for a single server, leaning toward heavy but not extreme. This is reasonable given the broad scope of GTEx data analysis, but it may overwhelm agents with many similar-sounding retrieval tools.

    Completeness5/5

    The tool set provides comprehensive coverage for GTEx data analysis, including data retrieval (genes, variants, expression, eQTLs, samples), computations (correlation, dynamic eQTLs), searches, and validations. It supports full workflows from data access to analysis without obvious gaps.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to query genetic variant data, gene constraints, and population genetics information from the gnomAD (Genome Aggregation Database) through its GraphQL API. Supports searching for genes and variants, retrieving constraint scores, analyzing population frequencies, and accessing genomic coverage data.
      9
      10
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to conversationally interact with genomics research networks for data analysis and discovery across multiple Omics AI Explorer platforms. It provides tools for exploring data collections, examining table schemas, and executing SQL queries against datasets like Viral AI and Neuroscience AI.
      6
      1
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      Provides AI-powered access to major biological databases for GWAS and bioinformatics research. Enables natural language queries for protein, gene, variant, pathway, and drug discovery analysis.
      44
      1
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      Enables AI assistants to query gene annotations, expression, pathways, variants, and more via the MyGene.info API, supporting batch operations and multiple biological data sources.
      26
      MIT