Sponsored by Deepsite.site

biothings-mcp

Created By
longevity-genie7 months ago
MCP (Model Context Protocol) server for biothings
Content

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 mixins:

  • Gene Interface: GeneRoutesMixin (wraps GeneClientAsync)
  • Variant Interface: VariantsRoutesMixin (wraps VariantClientAsync)
  • Chemical Interface: ChemRoutesMixin (wraps ChemClientAsync)
  • Taxon Interface: TaxonRoutesMixin (wraps TaxonClientAsync)

Quick Start

Installing uv

# 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)

# 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)

# 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)

# 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:

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

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

# 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

# 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:

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

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
DeepChatYour AI Partner on Desktop
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.