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: - mygene.info — Gene annotation and query service - myvariant.info — Variant annotation and query service - mychem.info — Chemical compound annotation and query service 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 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) HTTP Streamable Mode (Web Server) SSE Mode (Server-Sent Events) The HTTP streamable 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.