Building a Multi-Agent AI Finance Assistant (LangChain, MCP, Ollama, Flask) — Part 3.6
Finance Stock Helper is a project designed to support individuals in making better-informed stock investment decisions. The system is built…
Building a Multi-Agent AI Finance Assistant (LangChain, MCP, Ollama, Flask) — Part 3.6 Quick Market Analysis Agent to MCP

Finance Stock Helper is a project designed to support individuals in making better-informed stock investment decisions. The system is built on a multi-agent architecture and powered entirely by local large language models (LLMs) running through Ollama.
Ollama enables the use of lightweight language models that can operate efficiently on consumer-grade hardware. When combined with Model Context Protocol (MCP) and a set of prebuilt tools, this architecture allows anyone to run a personal stock analysis assistant directly on their home device — without relying on cloud-based AI services.
Story Articles
1.0 Strategy Saver Agent 1.6 Strategy Saver Agent to MCP 1.8 Strategy Saver Agent to MCP, Client 2.0 Roouting Agent 2.6 Distribute Agent to MCP 2.8 Distribute Agent to MCP, Client 3.0 Quick Market Analysis Agent 3.2 Quick Market Analysis Agent, support Toolset 3.6 Quick Market Analysis Agent to MCP 3.8 Quick Market Analysis Agent to MCP, Client …
Quick Market Analysis Agent to MCP
The next core component of the Finance Stock Helper is the Quick Market Analysis Agent. Its primary role is to provide a fast, real-time assessment of market conditions for a cryptocurrency that the user is interested in.
Upon receiving a request, the Quick Market Analysis Agent is tasked to analyze the market and produce a fast conclusion back to the user. The agent was developed on the Article: 3.0 Quick Market Analysis Agent

To achieve the same results, while we stay on the small LLMs, with low response time and high accuracy, the agent had to be developed in the tool as seen on the above diagramm. The MCP_Server_Basic_Tools had a tool, the tool will initialize and use a second agent, as the client Quick Market Analysis,powered by a small LLM. The Client will use the new MCP_Server_Quick_Market_Analysis. The new MCP server has the appropriate tools described at 3.2 Quick Market Analysis Agent, support Toolset. Thus the tools creating a Structured Report, merged by the client, details at 3.8 Quick Market Analysis Agent to MCP, Client, are wrapped to return the Merged Structured Report back to the MCP_Server_Basic_Tools.
Below is the deployment of the Agent into an MCP toolbox:
1. MCP_Server_Basic_Tools.py changes
from Backend.Connectors.Clients.Client_Analysis_Market import MCPClientMarketAnalysis
...
@app.tool()
async def quick_market_analysis(user_query: str, ctx: Context) -> str:
"""Analyze the market.
user_query: Pass the user query as is."""
analysis_client = MCPClientMarketAnalysis()
await analysis_client.setup()
answer = await analysis_client.generate_answer(query=user_query)
return answer
a. Importing changes: A new package is imported, the package consists of the client described at 3.8 Quick Market Analysis Agent to MCP, Client.
b. tool: Declaration of the tool and docstring, so the LLM-agent is ready to use the tool. Initialize the new Client and then await for the structured answer.
2. MCP_Server_market_analysis.py
from fastmcp import FastMCP, Context
from fastmcp.client.sampling import SamplingMessage, SamplingParams, RequestContext
from langchain_core.prompts import PromptTemplate
from Backend.Connectors.LLM_Connector import (LLMConnector)
from Backend.Connectors.Binance_Toolset.Strategy_Indication import produce_conclusion
from Backend.Connectors.Binance_Toolset.Binance_Tools import BinancePairCheck
from Backend.Connectors.News_Fetcher.Google_news_fetch import get_crypto_news
Importing: Components from the tools descriped at 3.2 Quick Market Analysis Agent, support Toolset and LLM_connector will be used. Also langchain framework, and the FastMCP will be used to create the server.
app = FastMCP("market_analysis_server",
sampling_handler=basic_sampling_handler)
@app.tool(
meta = {
"raw_output": True,
"report_title": "Trending Articles",
}
)
async def article_report_creation(crypto_name: str,
ctx: Context,
number_of_articles: int = 5)
-> str:
"""Creates a report, based on most trending articles.
crypto_name: Cryptocurrency of interest.
number_of_articles: Number of articles to report."""
report= market_report(crypto_name)
answer = await ctx.sample("",
system_prompt=f"Read the Article titles."
f"Crete a brief report,"
f"focusing mainly on the general sentiment."
f"Article titles:\n{report}", )
report = answer.text
return report
@app.tool(
meta = {
"raw_output": True,
"report_title": "On-Chain Analysis",
}
)
async def on_chain_report(crypto_name: str, ctx: Context) -> str:
"""Creates a report, from on chain analysis.
crypto_name: Cryptocurrency of interest."""
report = onchain_report(crypto_name)
return report
Creating the server:
a. initialize app: The server app is initialized using the basic sampler as described at 1.6 Strategy Saver Agent to MCP. The servers will run in parallel a new name describing the current must be used.
b. article_report_creation: Declaration of the tool and docstring, so the LLM-agent is ready to use the tool. The ‘meta’ data is declared and will be used by the appropriate client. Sampling is used to produce a report based on the article titles.
c. on_chain_report: Declaration of the tool and docstring, so the LLM-agent is ready to use the tool. The ‘meta’ data is declared and will be used by the appropriate client. Report is produced at a structured level and can be parsed at once.
if __name__ == '__main__':
app.run(transport="http", port=8001)
Example: Above is an example to run the server. Keep in mind to change the port, because the 8000 is reserved for the MCP_Server_Basic_Tool
메타데이터
- post_id
- 63e5c29073cc
- slug
- finance-helper-using-multi-agentic-system-langchain-langgraph-mcp-ollama-flask-3-6-63e5c29073cc
- url
- https://medium.com/@papanikst/finance-helper-using-multi-agentic-system-langchain-langgraph-mcp-ollama-flask-3-6-63e5c29073cc
- canonical_url
- https://medium.com/@papanikst/finance-helper-using-multi-agentic-system-langchain-langgraph-mcp-ollama-flask-3-6-63e5c29073cc
- author_url
- https://medium.com/@papanikst
- status
- ok
- fetched_at
- 2026-07-10 13:32:34