kegg-mcp-server

kegg-mcp-server

An MCP server for querying the KEGG bioinformatics database, providing tools, resource templates, and guided prompts for pathways, genes, compounds, and more.

Category
访问服务器

README

kegg-mcp-server-python

PyPI Python 3.11–3.14 License: MIT CI

An unofficial Python Model Context Protocol (MCP) server for the KEGG bioinformatics database. It exposes 34 tools, 9 resource templates, and 4 guided prompts to any MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.). Developed by Elytron Biotech.

Built with FastMCP, returns structured Pydantic JSON (not raw text), and includes per-operation TTL caching, request retry with exponential backoff, KEGG-friendly concurrency limits, structured JSON stderr logging, and batch helpers out of the box. No API key required -- uses the free KEGG REST API.

Responses are token-aware by default: get_*_info tools return a compact EntrySummary (entry id, name, class, description, counts of linked entities) unless you pass detail_level="full". Errors are returned as a typed ErrorResult the model can reason about, not raised as exceptions.

Note: This is a community non-official project and is not affiliated with or endorsed by KEGG or Kanehisa Laboratories.


Quick start

With uvx (no install)

uvx kegg-mcp-server

With pip

pip install kegg-mcp-server
kegg-mcp-server

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "kegg": {
      "command": "uvx",
      "args": ["kegg-mcp-server"]
    }
  }
}

<details> <summary>Config file locations</summary>

OS Path
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/Claude/claude_desktop_config.json

</details>

Claude Code

claude mcp add kegg-mcp-server -- uvx kegg-mcp-server

Or install as a plugin (includes skill metadata):

claude plugin install Lucas-Servi/kegg-mcp-server-python

MCPB bundle (Claude Desktop, no Python required)

Download the latest .mcpb from the releases page and drag it onto Claude Desktop. The bundle vendors all Python dependencies and runs with Claude Desktop's embedded Python.


What's included

34 Tools

Category Tools Examples
Database get_database_info, list_organisms Get KEGG release stats, list all ~26k organisms
Pathways search_pathways, get_pathway_info, get_pathway_genes, get_pathway_compounds, get_pathway_reactions Search by keyword, get full pathway details
Genes search_genes, get_gene_info, get_gene_orthologs Find genes in any organism, cross-species orthologs
Compounds search_compounds, get_compound_info, get_compound_reactions Search by name/formula/mass, find reactions
Reactions search_reactions, get_reaction_info Equation, enzymes, pathways for any reaction
Enzymes search_enzymes, get_enzyme_info EC number lookup, substrates, genes
Diseases search_diseases, get_disease_info Disease genes, drugs, pathways
Drugs search_drugs, get_drug_info, get_drug_interactions Drug targets, DDI screening
Modules search_modules, get_module_info Functional module definitions
Orthology search_ko_entries, get_ko_info KEGG Orthology entries
Glycans search_glycans, get_glycan_info Glycan composition, reactions
BRITE search_brite, get_brite_info Functional hierarchies
Cross-database batch_entry_lookup, convert_identifiers, find_related_entries Bulk fetch (up to 50), ID mapping (UniProt, NCBI, ChEBI, PubChem)
Visualization render_pathway_ascii ASCII art rendering of pathway topology (chain or grid mode)

9 Resource Templates

Direct URI-based access to KEGG entities:

kegg://pathway/{pathway_id}        e.g. kegg://pathway/hsa00010
kegg://gene/{gene_id}              e.g. kegg://gene/hsa:1956
kegg://compound/{compound_id}      e.g. kegg://compound/C00002
kegg://reaction/{reaction_id}      e.g. kegg://reaction/R00756
kegg://disease/{disease_id}        e.g. kegg://disease/H00004
kegg://drug/{drug_id}              e.g. kegg://drug/D00001
kegg://organism/{org_code}         e.g. kegg://organism/hsa
kegg://pathway/{pathway_id}/ascii  e.g. kegg://pathway/hsa00010/ascii
kegg://search/{database}/{query}   e.g. kegg://search/compound/glucose

4 Guided Prompts

Prompt Arguments What it does
pathway_enrichment_analysis gene_list, organism Maps a gene list to KEGG IDs, aggregates pathway associations, identifies enriched pathways
drug_target_investigation drug_name Drug lookup, target identification, pathway mapping, DDI screening
metabolic_pathway_comparison pathway_id, organisms Compares gene/compound content of a pathway across species
visualize_pathway pathway_id, organism Renders pathway as ASCII art (chain + grid), annotates key steps

ASCII Pathway Renderer

The render_pathway_ascii tool converts KEGG pathway topology (from KGML XML) into LLM-friendly ASCII text. Two styles are available:

Chain mode (default) — linear reaction flow:

Glycolysis / Gluconeogenesis (hsa)
====================================

[alpha-D-Gl~] ──R01786──▶ [beta-D-Gl~] ──R01600──▶ [beta-D-F~]

Grid mode — 2D spatial layout using KGML coordinates:

Glycolysis / Gluconeogenesis (hsa)
====================================

  [Glc]────────▶[G6P]────────▶[F6P]
                  │
                  ▼
                [6PG]

Legend:
  [Glc] = alpha-D-Glucose (cpd:C00267)
  [G6P] = D-Glucose 6-phosphate (cpd:C00092)

Transport options

# stdio (default -- for Claude Desktop, Claude Code, uvx)
kegg-mcp-server

# Streamable HTTP (for web/API deployment)
kegg-mcp-server --transport streamable-http --host 0.0.0.0 --port 8080

# python -m also works
python -m kegg_mcp_server

Development

git clone https://github.com/Lucas-Servi/kegg-mcp-server-python
cd kegg-mcp-server-python
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Lint
ruff check src/ tests/

# Debug with MCP Inspector
mcp dev kegg-mcp-server

Project structure

src/kegg_mcp_server/
  server.py       FastMCP instance, lifespan (httpx client + TTL cache), CLI
  client.py       KEGGClient: async KEGG REST with retry/backoff + KEGG-politeness semaphore
  cache.py        Per-op TTL cache (info 24h, list 1h, entry ops 5min)
  parsers.py      KEGG flat-file and tab-delimited response parsers + summarize_flat_entry
  errors.py       KEGGAPIError exception type
  logging.py      JSON stderr logger (stdout is reserved for MCP stdio framing)
  resources.py    8 MCP resource templates
  prompts.py      3 bioinformatics workflow prompts
  models/         Pydantic models for all KEGG entity types + EntrySummary + ErrorResult
  tools/          13 tool modules, each with a register(mcp) function; _common.py has the
                  @kegg_tool error-boundary decorator and shared READ_ONLY annotations

Author

Developed by Lucas Servi (lucasservi@gmail.com) at Elytron Biotech using Claude Code.

Acknowledgments

License

MIT -- see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选