biothings-mcp

biothings-mcp

Model Context Protocol server for structured biomedical data access.

23
Stars
4
Forks
23
Watchers
0
Issues
Implements a Model Context Protocol (MCP) server designed to provide standardized, type-safe API interfaces to authoritative biomedical data sources such as mygene.info, myvariant.info, and mychem.info. Offers seamless integration with AI assistants and clients via natural language queries, supporting multiple communication modes including HTTP, STDIO, and SSE. Local file saving, output directory management, and inspection tools are included for flexible workflows. Utilizes the biothings-typed-client library, ensuring validated and structured data transactions.

Key Features

Model Context Protocol (MCP) compliant server
Structured access to biomedical databases
Supports HTTP, STDIO, and SSE communication modes
Type-safe queries using biothings-typed-client
Annotation services for genes, variants, and chemicals
Local file saving and output management
Download tools for NCBI Entrez and sequence data
Automatic directory and unique filename generation
Integration with AI assistants and model clients
Configurable client JSON files for local and remote servers

Use Cases

Building AI-powered biomedical research assistants
Providing programmatic access to gene, variant, and chemical annotations
Integrating biomedical data pipelines with AI context-aware agents
Running standardized natural language biomedical queries
Automating download and preprocessing of sequence data
Annotating genomic and proteomic datasets for research
Exploring biomedical data via tool inspection interfaces
Type-safe data retrieval for clinical and translational studies
Context enrichment for language models in bioinformatics
Deploying custom biomedical knowledge servers for healthcare applications

README

MseeP.ai Security Assessment Badge

biothings-mcp

Tests PyPI version

MCP (Model Context Protocol) server for Biothings.io

This server implements the Model Context Protocol (MCP) for BioThings, providing a standardized interface for accessing and manipulating biomedical data. MCP enables AI assistants and agents to access specialized biomedical knowledge through structured interfaces to authoritative data sources. Supported BioThings data sources include:

If you want to understand more what is Model Context Protocol and how to use it more efficiently you can take DeepLearning AI Course or just search for MCP videos on YouTube.

About MCP (Model Context Protocol)

MCP is a protocol that bridges the gap between AI systems and specialized domain knowledge. It enables:

  • Structured Access: Direct connection to authoritative biomedical data sources
  • Natural Language Queries: Simplified interaction with specialized databases
  • Type Safety: Strong typing and validation through biothings-typed-client
  • AI Integration: Seamless integration with AI assistants and agents

Available API Interfaces

This server provides dedicated API interfaces for different BioThings data types, leveraging the biothings-typed-client library. These interfaces are implemented using the following tool handlers:

  • Gene Interface: GeneTools (wraps GeneClientAsync)
  • Variant Interface: VariantTools (wraps VariantClientAsync)
  • Chemical Interface: ChemTools (wraps ChemClientAsync)
  • Taxon Interface: TaxonTools (wraps TaxonClientAsync)
  • Download Interface: DownloadTools (provides file download and sequence analysis capabilities)

Local File Saving Features

The server includes local file saving capabilities through the DownloadTools interface, which provides:

Download Tools

  • download_entrez_data: Download data from NCBI Entrez databases (returns content as string)
  • download_entrez_data_local: Download data from NCBI Entrez databases and save to local file

Output Directory Management

  • Default Location: Files are saved to biothings_output/ directory in the current working directory
  • Custom Location: Use --output-dir parameter to specify a custom output directory
  • Automatic Creation: Output directories are created automatically if they don't exist
  • Unique Filenames: Auto-generated filenames include UUID prefixes to avoid conflicts

Supported File Formats

  • FASTA: .fasta extension for sequence data
  • GenBank: .gb extension for GenBank format data
  • Alignment: .aln extension for alignment results
  • JSON: .json extension for structured data
  • Text: .txt extension for general text data

Quick Start

Installing uv

bash
# Download and install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Verify installation
uv --version
uvx --version

uvx is a very nice tool that can run a python package installing it if needed.

Running with uvx

You can run the biothings-mcp server directly using uvx without cloning the repository:

STDIO Mode (for MCP clients that require stdio, can be useful when you want to save files)

bash
# Run the server in STDIO mode (default mode)
uvx biothings-mcp

# Or explicitly specify stdio mode
uvx --from biothings-mcp stdio

HTTP Mode (Web Server)

bash
# Run the server in streamable HTTP mode on default ( 3001 ) port
uvx biothings-mcp

# Run on a specific port
uvx biothings-mcp server --port 8000

SSE Mode (Server-Sent Events)

bash
# Run the server in SSE mode
uvx biothings-mcp sse

The HTTP mode will start a web server that you can access at http://localhost:3001/mcp (with documentation at http://localhost:3001/docs). The STDIO mode is designed for MCP clients that communicate via standard input/output, while SSE mode uses Server-Sent Events for real-time communication.

Configuring your (Anthropic Claude Desktop, Cursor, Windsurf, etc.)

We provide stdio configuration using the proxy (might need npx to run):

  • mcp-config-remote.json - for remote configuration
  • mcp-config-stdio.json - stdio configuration for localhost for MCP clients which do not support

Inspecting Biothings MCP server

If you want to inspect the methods provided by the MCP use npx (you may need to install nodejs and npm)

Test your MCP setup with the MCP Inspector.

If you want to inspect local streamable-http server you use:

bash
npx @modelcontextprotocol/inspector --config mcp-config.json --server biothings-mcp

Add -remote suffix for the remote server.

If you want to inspect stdio local server you should use

bash
npx @modelcontextprotocol/inspector --config mcp-config-stdio.json --server biothings-mcp

You can also run inspector manually and put server parameters in the interface:

npx @modelcontextprotocol/inspector

After that you can explore its methods with MCP Inspector at http://127.0.0.1:6274

Repository setup

bash
# Clone the repository
git clone git@github.com:longevity-genie/biothings-mcp.git
cd biothings-mcp
uv sync

Running the MCP Server

If you already cloned the repo you can run the server with uv

bash
# Start the MCP server locally
uv run server

Integration with AI Systems

To integrate this server with your MCP-compatible AI client, you can use one of the preconfigured JSON files provided in this repository:

  • For connecting to a locally running server: Use mcp-config.json. Ensure the server is running first, either via uv run server (see Running the MCP Server) or docker-compose up (see Docker Deployment).
  • For connecting to the publicly hosted server: Use mcp-config-remote.json. This connects to https://biothings.longevity-genie.info/mcp and doesn't require you to run anything locally.

Simply point your AI client (like Cursor, Windserve, ClaudeDesktop, VS Code with Copilot, or others) to use the appropriate configuration file.

Here's an example of how the tools might appear in an MCP client like Cursor after configuration:

Cursor Usage Example

KNOWN ISSUES

The library is beta-quality. The major problem right now is that LLM-s are often stupid and do not know how to put valid gene and gene variant symbols. We plan to mitigrate it by extending comments and providing additional method for entity resolution.

Testing & Verification

Run tests for the API endpoint:

bash
uv run pytest -vvv -s

You can use MCP inspector with locally build MCP server same way as with uvx

Note: Using the MCP Inspector is optional. Most MCP clients (like Cursor, Windsurv, etc.) will automatically display the available tools from this server once configured. However, the Inspector can be useful for detailed testing and exploration.

If you choose to use the Inspector via npx, ensure you have Node.js and npm installed. Using nvm (Node Version Manager) is recommended for managing Node.js versions.

This opens a web interface where you can explore and test all available tools.

Documentation

For detailed documentation about the MCP protocol and its implementation, refer to:

License

This project is licensed under the MIT License.

Acknowledgments

  • BioThings for the REST API and original client library

  • MCP Protocol for the protocol specification

  • Pydantic for the data validation framework

  • FastAPI-MCP for the MCP server implementation

  • This project is part of the Longevity Genie organization, which develops open-source AI assistants and libraries for health, genetics, and longevity research.

We are supported by:

HEALES

HEALES - Healthy Life Extension Society

and

IBIMA

IBIMA - Institute for Biostatistics and Informatics in Medicine and Ageing Research

Star History

Star History Chart

Repository Owner

longevity-genie
longevity-genie

Organization

Repository Details

Language Python
Default Branch main
Size 958 KB
Contributors 2
License MIT License
MCP Verified Sep 2, 2025

Programming Languages

Python
99.63%
Dockerfile
0.37%

Tags

Topics

bioinformatics biothings genetic-variants genetics mcp-server

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • mindsdb

    mindsdb

    Connect, unify, and query data at scale with an open-source AI platform.

    MindsDB enables seamless connection to and unification of data from hundreds of enterprise sources, allowing for highly accurate responses across large-scale federated systems. It provides an open-source server with built-in support for the Model Context Protocol (MCP) to facilitate standardized interaction with AI-driven question answering over diverse data sets. The platform offers tools for preparing, organizing, and transforming both structured and unstructured data via knowledge bases, views, and scheduled jobs. Its agent framework and SQL interface empower users to configure data-centric agents, automate workflows, and interact with data conversationally.

    • 35,487
    • MCP
    • mindsdb/mindsdb
  • mcp

    mcp

    Universal remote MCP server connecting AI clients to productivity tools.

    WayStation MCP acts as a remote Model Context Protocol (MCP) server, enabling seamless integration between AI clients like Claude or Cursor and a wide range of productivity applications, such as Notion, Monday, Airtable, Jira, and more. It supports multiple secure connection transports and offers both general and user-specific preauthenticated endpoints. The platform emphasizes ease of integration, OAuth2-based authentication, and broad app compatibility. Users can manage their integrations through a user dashboard, simplifying complex workflow automations for AI-powered productivity.

    • 27
    • MCP
    • waystation-ai/mcp
  • mcp-server-js

    mcp-server-js

    Enable secure, AI-driven process automation and code execution on YepCode via Model Context Protocol.

    YepCode MCP Server acts as a Model Context Protocol (MCP) server that facilitates seamless communication between AI platforms and YepCode’s workflow automation infrastructure. It allows AI assistants and clients to execute code, manage environment variables, and interact with storage through standardized tools. The server can expose YepCode processes directly as MCP tools and supports both hosted and local installations via NPX or Docker. Enterprise-grade security and real-time interaction make it suitable for integrating advanced automation into AI-powered environments.

    • 31
    • MCP
    • yepcode/mcp-server-js
  • 1mcp-app/agent

    1mcp-app/agent

    A unified server that aggregates and manages multiple Model Context Protocol servers.

    1MCP Agent provides a single, unified interface that aggregates multiple Model Context Protocol (MCP) servers, enabling seamless integration and management of external tools for AI assistants. It acts as a proxy, managing server configuration, authentication, health monitoring, and dynamic server control with features like asynchronous loading, tag-based filtering, and advanced security options. Compatible with popular AI development environments, it simplifies setup by reducing redundant server instances and resource usage. Users can configure, monitor, and scale model tool integrations across various AI clients through easy CLI commands or Docker deployment.

    • 96
    • MCP
    • 1mcp-app/agent
  • mcpmcp-server

    mcpmcp-server

    Seamlessly discover, set up, and integrate MCP servers with AI clients.

    mcpmcp-server enables users to discover, configure, and connect MCP servers with preferred clients, optimizing AI integration into daily workflows. It supports streamlined setup via JSON configuration, ensuring compatibility with various platforms such as Claude Desktop on macOS. The project simplifies the connection process between AI clients and remote Model Context Protocol servers. Users are directed to an associated homepage for further platform-specific guidance.

    • 17
    • MCP
    • glenngillen/mcpmcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results