Summary
This issue tracks the implementation of LangChain tool wrappers around the Reactome MCP server, building on the MCP client foundation added in #127.
Background
PR #127 introduced the low-level MCP client (MCPClient) and process manager (MCPProcessManager) that handle JSON-RPC communication with the reactome-mcp Node.js server. However, those components are not yet connected to the LangGraph agent, so the chatbot cannot use them to answer questions.
Proposed Changes
New file - src/mcp/mcp_tools.py
create_mcp_tools() async factory function that starts the MCP server and returns LangChain StructuredTool wrappers
- Five tools wrapping the most impactful MCP server capabilities:
search_reactome - search for pathways, proteins, and genes
get_pathway - retrieve detailed pathway information by stable ID
analyze_identifiers - run pathway enrichment analysis on a gene/protein list
get_database_info - get current Reactome database version
get_species - list all species available in Reactome
Modified - src/agent/graph.py
- MCP server started in
initialize() via MCP_SERVER_PATH environment variable
- Graphs built individually per profile so React-to-Me receives
mcp_tools and Cross-Database is unaffected
- MCP server stopped cleanly in
close_pool() on app shutdown
Modified - src/agent/profiles/react_to_me.py
create_reactome_graph() and ReactToMeGraphBuilder accept optional mcp_tools parameter
- Tools bound to LLM once at init time via
bind_tools()
call_model implements tool-calling loop - LLM decides whether to call MCP tools or answer directly
- Falls back to existing
reactome_rag behaviour when no tools provided - zero behaviour change for existing deployments
Behaviour
When MCP_SERVER_PATH is not set the chatbot works exactly as before. When set the LLM gains access to live Reactome API data and can choose between ChromaDB retrieval and MCP tool calls depending on the question.
Related
Summary
This issue tracks the implementation of LangChain tool wrappers around the Reactome MCP server, building on the MCP client foundation added in #127.
Background
PR #127 introduced the low-level MCP client (
MCPClient) and process manager (MCPProcessManager) that handle JSON-RPC communication with thereactome-mcpNode.js server. However, those components are not yet connected to the LangGraph agent, so the chatbot cannot use them to answer questions.Proposed Changes
New file -
src/mcp/mcp_tools.pycreate_mcp_tools()async factory function that starts the MCP server and returns LangChainStructuredToolwrapperssearch_reactome- search for pathways, proteins, and genesget_pathway- retrieve detailed pathway information by stable IDanalyze_identifiers- run pathway enrichment analysis on a gene/protein listget_database_info- get current Reactome database versionget_species- list all species available in ReactomeModified -
src/agent/graph.pyinitialize()viaMCP_SERVER_PATHenvironment variablemcp_toolsand Cross-Database is unaffectedclose_pool()on app shutdownModified -
src/agent/profiles/react_to_me.pycreate_reactome_graph()andReactToMeGraphBuilderaccept optionalmcp_toolsparameterbind_tools()call_modelimplements tool-calling loop - LLM decides whether to call MCP tools or answer directlyreactome_ragbehaviour when no tools provided - zero behaviour change for existing deploymentsBehaviour
When
MCP_SERVER_PATHis not set the chatbot works exactly as before. When set the LLM gains access to live Reactome API data and can choose between ChromaDB retrieval and MCP tool calls depending on the question.Related