- Home
- MCP servers
- Oh My KEGG
Oh My KEGG
- python
4
GitHub Stars
python
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can access KEGG data through a dedicated MCP server that exposes 30 analytical tools for biological data, offers streamable HTTP transport, integrates with LangChain, and supports local LLMs with Ollama. This server lets you search and analyze KEGG data such as pathways, genes, compounds, diseases, drugs, and more using a consistent MCP interface from your applications or agents.
How to use
You can connect to the KEGG MCP server using either the built-in HTTP transport or a local stdio workflow. The HTTP option is the recommended approach for web-friendly clients and LangChain integrations. The stdio option provides a local, self-contained setup suitable for secure environments or offline testing.
Before you start, ensure the server is running and reachable at the MCP URL you configured. You can then load the available tools into your client, create a model or agent, and start querying KEGG data. Use the server to fetch database information, search for pathways, genes, compounds, reactions, enzymes, diseases, and drugs, and perform advanced analyses like pathway–compound lookups or gene ortholog lookups.
If you choose the HTTP method, your client will send requests to the MCP URL such as http://localhost:3000/mcp by default. If you prefer a local, self-contained workflow, you can run the server in stdio mode and interact directly via the provided client scripts.
How to install
Prerequisites you need before installing the server:
- Python 3.11 or newer (recommended)
- pip for Python package installation
Step 1: Install required Python packages per the project setup.
pip install -r requirements.txt
Step 2: Create and configure environment variables. Copy the example file and edit values as needed.
cp .env.example .env
Step 3: Customize environment values. You can set an OpenAI API key if you plan to use OpenAI models, or omit it if you rely on Ollama for local models.
# OpenAI API key (needed if using OpenAI models)
OPENAI_API_KEY=your_openai_api_key
# MCP server URL (used by clients)
KEGG_MCP_SERVER_URL=http://localhost:3000/mcp
# MCP server configuration (server startup). Defaults are provided; change if needed
MCP_HOST=localhost
MCP_PORT=3000
MCP_PATH=/mcp
# Ollama host (if using local models)
# OLLAMA_HOST=http://localhost:11434
Step 4: Start the MCP server in HTTP mode using the default command shown. The server prints the accessible URL when it starts.
python kegg_mcp_server.py
Starting KEGG MCP Server on http://localhost:3000/mcp Transport: Streamable HTTP
## Additional notes on configuration and usage
The server supports two primary operation modes. Use streaming HTTP for broad compatibility and web integration. If you want to run everything locally without network exposure, you can operate in stdio mode with a local Python command and interact through the client.
If you are integrating with LangChain, you can load the KEGG tools via a Python client and create an agent that executes biological queries against KEGG data. You can also test Ollama-based local models by pointing the client to a local Ollama instance.
Environment variable configuration is flexible: you can set the MCP host, port, and path to match your deployment. If you run Ollama on a non-default port or host, adjust OLLAMA\_HOST accordingly.
## Troubleshooting and tips
If the server fails to start, verify that the port is not in use and that Python 3.11+ is installed. Check for missing dependencies in the requirements and re-install if needed.
If the client cannot connect, confirm the KEGG\_MCP\_SERVER\_URL matches the actual server URL and that any firewalls allow traffic to the configured port.
For Ollama-related issues, ensure Ollama is running, the requested model is installed, and that you have network access to retrieve models if needed.
## Available tools
### get\_database\_info
Retrieve database information and statistics for KEGG data.
### list\_organisms
List all organisms available in KEGG.
### search\_pathways
Search for biological pathways based on keywords or terms.
### get\_pathway\_info
Get detailed information about a specific pathway.
### get\_pathway\_genes
List genes involved in a given pathway.
### search\_genes
Search for genes by name or identifier.
### get\_gene\_info
Get detailed gene information, including sequence when available.
### search\_compounds
Search for chemical compounds.
### get\_compound\_info
Get detailed information about a compound.
### search\_reactions
Search for biochemical reactions.
### get\_reaction\_info
Get detailed information about a reaction.
### search\_enzymes
Search for enzymes.
### get\_enzyme\_info
Get detailed information about an enzyme.
### search\_diseases
Search for diseases.
### get\_disease\_info
Get detailed information about a disease.
### search\_drugs
Search for drugs.
### get\_drug\_info
Get detailed information about a drug.
### get\_drug\_interactions
Retrieve known drug interactions.
### search\_modules
Search for module entries.
### get\_module\_info
Get module details.
### search\_ko\_entries
Search KO (orthology) entries.
### get\_ko\_info
Get KO details.
### search\_glycans
Search for glycans.
### get\_glycan\_info
Get glycan details.
### search\_brite
Search BRITE hierarchy.
### get\_brite\_info
Get BRITE entry details.
### get\_pathway\_compounds
List compounds in a pathway.
### get\_pathway\_reactions
List reactions in a pathway.
### get\_compound\_reactions
List reactions involving a compound.
### get\_gene\_orthologs
Find orthologous genes.
### batch\_entry\_lookup
Perform batch lookups of multiple entries.
### convert\_identifiers
Convert identifiers between databases.
### find\_related\_entries
Find related KEGG entries.