feat(mcp): connect Reactome MCP server to LangGraph agent with LangChain tool wrappers#137
Open
GovindhKishore wants to merge 2 commits intoreactome:mainfrom
Open
feat(mcp): connect Reactome MCP server to LangGraph agent with LangChain tool wrappers#137GovindhKishore wants to merge 2 commits intoreactome:mainfrom
GovindhKishore wants to merge 2 commits intoreactome:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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