feat(mcp): connect Reactome MCP server to LangGraph agent with LangChain tool wrappers - #137
GovindhKishore wants to merge 2 commits into
Conversation
|
This is the MCP PR we intend to take. #127 is closed as contained in it, and #142 as adding a second classifier beside the existing one. Sorry it has been quiet for six months. What is good here: separating the process manager from the client from the tool wrappers is the right shape. It is what makes the transport swappable, which matters more now than when you wrote it — Three things before it can land: 1. The package name 2. Five tools out of 53 is a choice worth making explicitly. 3. Where it fits: Thank you for this — it is the piece the design is being built on. |
|
Landed — in pieces, over #212, #216, #218 and #219, with credit in each commit. Closing this as superseded rather than unmerged. What came from hereThe three-layer shape — process manager, client, tool wrappers — is what The five curated tools. What changed on the wayThe package is Three protocol bugs, none of which fail loudly:
A second transport. Your version spawns Routing extends the existing classifier rather than adding a second one — the reason #142 was closed. It gained a What it does nowLive on beta as of today: Before this, that question was answered from the vector store: "primarily Homo sapiens... no indications of other species being included." Reactome has 96. The corpus is a sample of the content and the question is about the scope, so no amount of better retrieval was ever going to fix it — it needed exactly what you built. Thank you for this, and sorry it sat for six months before anyone told you it was the right shape. |
Summary
Integrates the Reactome MCP server into the LangGraph agent by wrapping MCP tools as LangChain
StructuredToolobjects and connecting them to the React-to-Me chat profile. Builds directly on the MCP client foundation from #127.Changes
New -
src/mcp/mcp_tools.pycreate_mcp_tools()async factory that starts the MCP server and returns LangChain tool wrapperssearch_reactome- search pathways, proteins, genes by keywordget_pathway- retrieve pathway details by stable ID (e.g. R-HSA-109582)analyze_identifiers- run pathway enrichment analysis on a gene/protein listget_database_info- get current Reactome release versionget_species- list all species available in Reactome([], None)when no server path provided - chatbot works unchanged without MCPModified -
src/agent/graph.pyinitialize()controlled byMCP_SERVER_PATHenvironment variablemcp_tools, Cross-Database unaffectedclose_pool()on app shutdownllm,embedding,profilesstored as instance variables soinitialize()can access themModified -
src/agent/profiles/react_to_me.pycreate_reactome_graph()andReactToMeGraphBuilderaccept optionalmcp_toolsparameterbind_tools()- not re-bound on every messagecall_modelimplements tool-calling loop with 15 iteration guard against infinite loopsreactome_ragbehaviour whenmcp_toolsis emptyHow It Works
Usage
Set
MCP_SERVER_PATHto the compiled MCP server entry point:Leave unset to run in existing RAG-only mode with zero behaviour change.
Relation to Previous Work
AI Transparency
AI Tools (Claude) were used to assist with drafting code and documentation. All changes were reviewed and verified by me.
closes #136