How shreyasgaikwad-04/mcp-based-financial-research-agent works
This is a compact financial-research assistant: users ask company or market questions through Streamlit or the FastAPI endpoint, and the LangGraph workflow plans tool calls, gathers financial/news evidence, checks coverage, and produces a grounded answer with sources. The MCP client connects to a reusable MCP server, which dispatches market, fundamentals, and news tools. The README documents Yahoo Finance, Tavily, and optional Langfuse; sampled tool code confirms Yahoo Finance and Tavily use, while tracing wiring is not shown, so it is omitted. Workflow detail is based on partial excerpts.
Main entry points: graph.py LangGraph workflow · server.py MCP server · main.py FastAPI API · streamlit_app.py Streamlit UI
Components 18
User interfaces
- Streamlit UI
ui/streamlit_app.py - FastAPI API
app/main.py - Answer and sources
Research workflow
- LangGraph workflow
app/graph.py - Research planner
app/graph.py - Research executor
app/graph.py - Evidence aggregation
app/graph.py - Evidence verification
app/graph.py - Grounded answer
app/graph.py
MCP tool layer
- MCP client
app/mcp_client.py - MCP server
mcp_server/server.py - Market tools
mcp_server/tools/market.py - Fundamentals tools
mcp_server/tools/fundamentals.py - News search
mcp_server/tools/research.py
External data and AI
- Yahoo Finance
- Tavily
- OpenAI model
Other components
- Research user
Connections 25
- Research user → Streamlit UI: asks question
- Streamlit UI → LangGraph workflow: runs research
- LangGraph workflow → Streamlit UI: returns answer
- Research user → FastAPI API: submits question
- FastAPI API → LangGraph workflow: runs research
- FastAPI API → Answer and sources: returns response
- LangGraph workflow → Research planner: starts at
- Research planner → MCP client: lists tools
- Research planner → OpenAI model: plans with
- Research planner → Research executor: dispatches plan
- Research executor → MCP client: calls tools
- MCP client → MCP server: MCP requests
- MCP server → Market tools: dispatches market
- MCP server → Fundamentals tools: dispatches fundamentals
- MCP server → News search: dispatches news
- Market tools → Yahoo Finance: fetches market data
- Fundamentals tools → Yahoo Finance: fetches financials
- News search → Tavily: searches news
- Research executor → Evidence aggregation: passes tool results
- Evidence aggregation → Evidence verification: passes evidence
- Evidence verification → Research executor: requests more research
- Evidence verification → Grounded answer: sufficient evidence
- Grounded answer → OpenAI model: writes with
- Grounded answer → Answer and sources: returns answer
- Grounded answer → LangGraph workflow: updates final state