loading…
Search for a command to run...
loading…
An MCP server that provides access to the Kyoto Encyclopedia of Genes and Genomes (KEGG) database, offering 30 tools for searching and analyzing biological data
An MCP server that provides access to the Kyoto Encyclopedia of Genes and Genomes (KEGG) database, offering 30 tools for searching and analyzing biological data like pathways, genes, and compounds. It supports integration with LangChain and Ollama to enable LLMs to interact with comprehensive genomic and chemical datasets.
KEGG (Kyoto Encyclopedia of Genes and Genomes) 데이터베이스에 접근하기 위한 Model Context Protocol (MCP) 서버입니다.(unofficial)
pip install -r requirements.txt
.env.example 파일을 참고하여 .env 파일을 생성합니다:
cp .env.example .env
.env 파일을 편집하여 필요한 값을 설정합니다:
# OpenAI API 키 (OpenAI 모델 사용 시 필요)
# Ollama 사용 시에는 설정하지 않아도 됩니다
OPENAI_API_KEY=your_openai_api_key
# MCP 서버 URL (클라이언트에서 사용)
# 서버가 다른 호스트/포트에서 실행되는 경우 변경
KEGG_MCP_SERVER_URL=http://localhost:3000/mcp
# MCP 서버 설정 (서버 실행 시 사용, 선택사항)
# 기본값이 설정되어 있어 변경하지 않아도 됩니다
MCP_HOST=localhost
MCP_PORT=3000
MCP_PATH=/mcp
# Ollama 설정 (선택사항)
# Ollama가 다른 호스트/포트에서 실행되는 경우 변경
# OLLAMA_HOST=http://localhost:11434
참고:
OPENAI_API_KEY는 설정하지 않아도 됩니다. 현재 코드는 Ollama를 기본 모델로 사용합니다.OPENAI_API_KEY에 실제 API 키를 설정하고, langchain_integration.py에서 ChatOpenAI를 사용하도록 변경해야 합니다.MCP_HOST, MCP_PORT, MCP_PATH는 서버 실행 시 사용되며, 기본값이 설정되어 있어 변경하지 않아도 됩니다.OLLAMA_HOST를 설정할 수 있습니다.# 기본 설정으로 실행 (localhost:3000/mcp)
python kegg_mcp_server.py
# 또는 환경 변수로 설정
MCP_HOST=localhost MCP_PORT=3000 MCP_PATH=/mcp python kegg_mcp_server.py
서버가 실행되면 다음과 같은 메시지가 표시됩니다:
Starting KEGG MCP Server on http://localhost:3000/mcp
Transport: Streamable HTTP
# 기본 실행 (Streamable HTTP 사용)
python langchain_integration.py
# Ollama 연결 테스트만 실행
python langchain_integration.py --test
# stdio 사용 (선택사항, 별도 TypeScript 서버 필요)
# langchain_integration.py에서 use_http=False로 변경
# 참고: 현재는 Streamable HTTP 방식만 제공됩니다
get_database_info - 데이터베이스 정보 및 통계 조회list_organisms - 모든 KEGG 생물체 목록 조회search_pathways - 경로 검색get_pathway_info - 경로 상세 정보get_pathway_genes - 경로의 유전자 목록search_genes - 유전자 검색get_gene_info - 유전자 상세 정보 (서열 포함 옵션)search_compounds - 화합물 검색get_compound_info - 화합물 상세 정보search_reactions - 반응 검색get_reaction_info - 반응 상세 정보search_enzymes - 효소 검색get_enzyme_info - 효소 상세 정보search_diseases - 질병 검색get_disease_info - 질병 상세 정보search_drugs - 약물 검색get_drug_info - 약물 상세 정보get_drug_interactions - 약물 상호작용 조회search_modules - 모듈 검색get_module_info - 모듈 상세 정보search_ko_entries - KO 엔트리 검색get_ko_info - KO 상세 정보search_glycans - 글리칸 검색get_glycan_info - 글리칸 상세 정보search_brite - BRITE 계층 검색get_brite_info - BRITE 상세 정보get_pathway_compounds - 경로의 화합물 목록get_pathway_reactions - 경로의 반응 목록get_compound_reactions - 화합물의 반응 목록get_gene_orthologs - 유전자 직계동족 찾기batch_entry_lookup - 배치 엔트리 조회convert_identifiers - 데이터베이스 간 식별자 변환find_related_entries - 관련 엔트리 찾기import asyncio
from langchain_integration import create_kegg_client, load_and_display_tools, create_default_model, run_agent_query
from langchain.agents import create_agent
async def main():
# 클라이언트 생성 (Streamable HTTP)
client = create_kegg_client()
try:
# 도구 로드
tools = await load_and_display_tools(client)
# 모델 및 Agent 생성
model = create_default_model()
agent = create_agent(model=model, tools=tools)
# 쿼리 실행
await run_agent_query(
agent,
"인간의 당분해(glycolysis) 경로를 찾아주세요.",
"당분해 경로 검색"
)
finally:
if hasattr(client, 'close'):
try:
await client.close()
except:
pass
if __name__ == "__main__":
asyncio.run(main())
kegg-mcp-test/
├── kegg_mcp_server.py # Python MCP 서버 (Streamable HTTP)
├── langchain_integration.py # LangChain 통합 클라이언트
├── requirements.txt # Python 패키지 의존성
├── .env.example # 환경 변수 예제 파일
├── .gitignore # Git 무시 파일 목록
├── LICENSE # MIT 라이선스
└── README.md # 프로젝트 문서 (이 파일)
kegg_mcp_server.py)langchain_integration.py에서 use_http=False로 설정 시 사용 가능lsof -i :3000pip install -r requirements.txtKEGG_MCP_SERVER_URL 환경 변수ollama serveollama listollama pull gemma3:4b (또는 사용할 모델)MIT License
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"oh-my-kegg-mcp": {
"command": "npx",
"args": []
}
}
}