UCSC Genome Browser MCP Server

UCSC Genome Browser MCP Server

Provides comprehensive access to the UCSC Genome Browser API, enabling queries of genomic data, DNA sequences, gene annotations, variants, and metadata across multiple species and assemblies.

Category
访问服务器

README

UCSC Genome Browser MCP Server

A Model Context Protocol (MCP) server that provides comprehensive access to the UCSC Genome Browser API. This server enables LLM applications to query genomic data, sequences, tracks, and metadata from the UCSC Genome Browser.

Features

This MCP server exposes 12 tools that cover all major UCSC Genome Browser API endpoints:

Listing & Discovery Tools

  • find_genome - Search for genomes using keywords, accession IDs, or organism names
  • list_public_hubs - List all available public track hubs
  • list_ucsc_genomes - List all UCSC database genomes
  • list_genark_genomes - List GenArk assembly hub genomes
  • list_hub_genomes - List genomes from a specific hub
  • list_files - List downloadable files for a genome
  • list_tracks - List data tracks in a genome or hub
  • list_chromosomes - List chromosomes in a genome or track
  • list_schema - Get schema/field definitions for a track

Data Retrieval Tools

  • get_sequence - Retrieve DNA sequences from genomes
  • get_track_data - Get track data (genes, variants, annotations, etc.)
  • search_genome - Search within a genome assembly

Installation

Prerequisites

  • Python 3.10 or higher
  • pip

Install from source

# Clone or download the repository
cd ucsc-genome-mcp-server

# Install in development mode
pip install -e .

Required Dependencies

  • mcp>=0.9.0 - Model Context Protocol SDK
  • httpx>=0.27.0 - HTTP client for API requests

Usage

Running the Server

The server communicates over stdio, following the MCP protocol:

python ucsc_genome_mcp_server.py

Configuration with Claude Desktop

Add this to your Claude Desktop configuration file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "ucsc-genome-browser": {
      "command": "/Users/You/.local/bin/uv",
      "args": [
        "--directory",
        "/Users/Path/To/Repository/ucsc-genome-mcp",
        "run",
        "ucsc-genome-mcp.py"
      ],
      "env": {},
      "metadata": {
        "description": "UCSC Genome Browser API",
        "version": "1.0.0"        
      }
  }
}

Tool Examples

1. Find Genomes

Search for dog genomes:

{
  "query": "dog"
}

Search with advanced operators:

{
  "query": "+white +rhino* -southern",
  "browser": "mustExist"
}

2. List Available Tracks

List all tracks for human genome (hg38):

{
  "genome": "hg38"
}

List tracks without container information:

{
  "genome": "hg38",
  "track_leaves_only": true
}

3. Get DNA Sequence

Get entire mitochondrial chromosome:

{
  "genome": "hg38",
  "chrom": "chrM"
}

Get specific region:

{
  "genome": "hg38",
  "chrom": "chrM",
  "start": 4321,
  "end": 5678
}

Get reverse complement:

{
  "genome": "hg38",
  "chrom": "chrM",
  "start": 4321,
  "end": 5678,
  "reverse_complement": true
}

4. Get Track Data

Get gene annotations for a region:

{
  "genome": "hg38",
  "track": "knownGene",
  "chrom": "chr1",
  "start": 47000,
  "end": 48000
}

Get track data from an assembly hub:

{
  "hub_url": "http://hgdownload.gi.ucsc.edu/hubs/mouseStrains/hub.txt",
  "genome": "CAST_EiJ",
  "track": "assembly",
  "chrom": "chr1"
}

5. Search Within a Genome

Search for BRCA1 in human genome:

{
  "search": "brca1",
  "genome": "hg38"
}

Search only in help documentation:

{
  "search": "bigBed",
  "genome": "hg38",
  "categories": "helpDocs"
}

API Details

Base URL

All requests go to: https://api.genome.ucsc.edu

Rate Limits

  • Recommended: Maximum 1 request per second
  • The API has a botDelay system to prevent overload
  • Excessive queries may result in restricted access

Coordinate Systems

  • Start coordinates: 0-based (first base is 0)
  • End coordinates: 1-based (exclusive)
  • Example: start=0, end=10 retrieves the first 10 bases

Supported Track Types

The get_track_data tool supports these track types:

  • bed, bigBed, bigWig
  • genePred, bigGenePred
  • bigChain, bigPsl, bigMaf
  • narrowPeak, bigNarrowPeak
  • wiggle/wig, barChart/bigBarChart
  • interact/bigInteract
  • And many more...

Advanced Features

Working with Large Datasets

For tracks with over 1 million items, use pagination:

  1. Query by chromosome:
{
  "genome": "hg19",
  "track": "knownGene",
  "chrom": "chr1"
}
  1. Use start/end coordinates for smaller regions:
{
  "genome": "hg19",
  "track": "knownGene",
  "chrom": "chr1",
  "start": 1000000,
  "end": 2000000
}

Working with Track Hubs

Track hubs allow accessing external genomic data:

{
  "hub_url": "http://hgdownload.gi.ucsc.edu/hubs/mouseStrains/hub.txt",
  "genome": "CAST_EiJ",
  "track": "ensGene",
  "chrom": "chr1"
}

Error Handling

The server handles various error conditions:

  • HTTP errors (404, 500, etc.)
  • Invalid parameters
  • Non-existent genomes/tracks/chromosomes
  • Request timeouts (30 second default)

Errors are returned as text responses with descriptive messages.

Use Cases

This MCP server enables LLM applications to:

  1. Genomic Research: Query gene locations, sequences, and annotations
  2. Variant Analysis: Retrieve SNP and variant data
  3. Comparative Genomics: Access data from multiple species
  4. Sequence Analysis: Get DNA/RNA sequences for analysis
  5. Data Discovery: Find available datasets and assemblies
  6. Educational: Learn about genomics through interactive queries

API Documentation

For complete API documentation, visit: https://genome.ucsc.edu/goldenpath/help/api.html

License

This project interfaces with the UCSC Genome Browser, which has its own terms of use: https://genome.ucsc.edu/conditions.html

Support

For issues with the UCSC Genome Browser API, contact UCSC. For issues with this MCP server, please file an issue in the repository.

Development

Project Structure

.
├── ucsc_genome_mcp_server.py  # Main server implementation
├── pyproject.toml             # Project metadata and dependencies
└── README.md                  # This file

Adding New Tools

To add new endpoints:

  1. Add the tool definition in list_tools()
  2. Add the handler in call_tool()
  3. Update this README with examples

Testing

Test individual endpoints manually:

# Using curl
curl -L 'https://api.genome.ucsc.edu/list/ucscGenomes'

# Using wget
wget -O- 'https://api.genome.ucsc.edu/getData/sequence?genome=hg38;chrom=chrM;start=4321;end=5678'

Changelog

Version 0.1.0

  • Initial release
  • Support for all major UCSC Genome Browser API endpoints
  • 12 tools covering listing, discovery, and data retrieval
  • Full documentation and examples

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选