Integrates with LangChain agents to allow LLMs to search and analyze biological data from the KEGG database, including pathways, genes, compounds, and reactions.
Supports local LLM integration through Ollama, enabling models to interact with KEGG biological databases for data retrieval and analysis.
Enables the use of OpenAI models to query and process KEGG database information such as genomic pathways, diseases, and drug interactions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Oh My KEGG MCPFind the human glycolysis pathway and list its genes."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Oh My KEGG MCP
KEGG (Kyoto Encyclopedia of Genes and Genomes) 데이터베이스에 접근하기 위한 Model Context Protocol (MCP) 서버입니다.(unofficial)
주요 기능
30개의 KEGG 도구: 경로, 유전자, 화합물, 반응, 효소, 질병, 약물 등 다양한 생물학적 데이터 검색 및 분석
Streamable HTTP Transport: 웹 환경에서 사용 가능한 HTTP 기반 통신
LangChain 통합: LangChain Agent와 완벽하게 통합되어 LLM이 KEGG 데이터를 활용할 수 있음
Ollama 지원: 로컬 LLM 모델과 함께 사용 가능
설치
1. 필수 패키지 설치
2. 환경 변수 설정
.env.example 파일을 참고하여 .env 파일을 생성합니다:
.env 파일을 편집하여 필요한 값을 설정합니다:
참고:
Ollama 사용 시:
OPENAI_API_KEY는 설정하지 않아도 됩니다. 현재 코드는 Ollama를 기본 모델로 사용합니다.OpenAI 사용 시:
OPENAI_API_KEY에 실제 API 키를 설정하고,langchain_integration.py에서ChatOpenAI를 사용하도록 변경해야 합니다.서버 설정:
MCP_HOST,MCP_PORT,MCP_PATH는 서버 실행 시 사용되며, 기본값이 설정되어 있어 변경하지 않아도 됩니다.Ollama 호스트: Ollama가 기본 포트(11434)가 아닌 다른 포트에서 실행되는 경우
OLLAMA_HOST를 설정할 수 있습니다.
사용 방법
1. 서버 실행
서버가 실행되면 다음과 같은 메시지가 표시됩니다:
2. 클라이언트 실행
사용 가능한 도구
Database Information & Statistics (2개)
get_database_info- 데이터베이스 정보 및 통계 조회list_organisms- 모든 KEGG 생물체 목록 조회
Pathway Analysis (3개)
search_pathways- 경로 검색get_pathway_info- 경로 상세 정보get_pathway_genes- 경로의 유전자 목록
Gene Analysis (2개)
search_genes- 유전자 검색get_gene_info- 유전자 상세 정보 (서열 포함 옵션)
Compound Analysis (2개)
search_compounds- 화합물 검색get_compound_info- 화합물 상세 정보
Reaction & Enzyme Analysis (4개)
search_reactions- 반응 검색get_reaction_info- 반응 상세 정보search_enzymes- 효소 검색get_enzyme_info- 효소 상세 정보
Disease & Drug Analysis (5개)
search_diseases- 질병 검색get_disease_info- 질병 상세 정보search_drugs- 약물 검색get_drug_info- 약물 상세 정보get_drug_interactions- 약물 상호작용 조회
Module & Orthology Analysis (4개)
search_modules- 모듈 검색get_module_info- 모듈 상세 정보search_ko_entries- KO 엔트리 검색get_ko_info- KO 상세 정보
Glycan Analysis (2개)
search_glycans- 글리칸 검색get_glycan_info- 글리칸 상세 정보
BRITE Hierarchy Analysis (2개)
search_brite- BRITE 계층 검색get_brite_info- BRITE 상세 정보
Advanced Analysis Tools (5개)
get_pathway_compounds- 경로의 화합물 목록get_pathway_reactions- 경로의 반응 목록get_compound_reactions- 화합물의 반응 목록get_gene_orthologs- 유전자 직계동족 찾기batch_entry_lookup- 배치 엔트리 조회
Cross-References & Integration (2개)
convert_identifiers- 데이터베이스 간 식별자 변환find_related_entries- 관련 엔트리 찾기
예제
기본 사용 예제
프로젝트 구조
통신 방식
Streamable HTTP (권장)
장점: 웹 환경 지원, 확장성 좋음, 표준 HTTP 프로토콜
사용: Python 서버 (
kegg_mcp_server.py)포트: 기본 3000 (환경 변수로 변경 가능)
stdio (로컬 전용, 선택사항)
장점: 최고의 보안, 낮은 오버헤드, 간단한 설정
사용:
langchain_integration.py에서use_http=False로 설정 시 사용 가능제한: 로컬 실행만 가능, 별도 TypeScript 서버 필요
문제 해결
서버가 시작되지 않는 경우
포트가 이미 사용 중인지 확인:
lsof -i :3000필요한 패키지가 설치되었는지 확인:
pip install -r requirements.txtPython 버전 확인: Python 3.11 이상 필요
클라이언트 연결 실패
서버가 실행 중인지 확인
서버 URL이 올바른지 확인:
KEGG_MCP_SERVER_URL환경 변수방화벽 설정 확인
Ollama 연결 실패
Ollama가 실행 중인지 확인:
ollama serve모델이 설치되었는지 확인:
ollama list모델 다운로드:
ollama pull gemma3:4b(또는 사용할 모델)
라이선스
MIT License