Cover image
Try Now
2025-04-14

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

🦜🔗 MCPFinanceStream

MCPFinanceStream is a Streamlit web application powered by LangChain and FastMCP. It combines GPT-4o with a finance-oriented toolset that lets you analyze stock data interactively using MCP agents via SSE (Server-Sent Events).


📦 Features

  • 💬 Natural language queries using Azure OpenAI (GPT-4o)
  • 🔌 MCP integration using fastmcp and langchain-mcp-adapters
  • 📈 Real-time stock data with yFinance
  • 📊 Automatic data analysis using quarterly and annual financials
  • 🚀 SSE-based architecture (no CLI or subprocess launch needed)

🏗️ Requirements

Make sure the following are installed (you can also use the requirements.txt):

streamlit
openai
langchain
langchain-openai
yfinance
pandas
langchain-mcp-adapters
langgraph
fastmcp

Python 3.9+ is recommended.


🚀 How to Run

Step 1: Start the MCP Server

python mcp_server.py

This starts your SSE-enabled server at http://localhost:8002/sse.


Step 2: Run the Streamlit App

streamlit run MCPFinanceStreamlit_app.py

Then open http://localhost:8501 in your browser.


📘 Example Query

Analyze how revenue of MSFT is changing over time.

The agent will call tools like fetch_quarterly_financials and fetch_annual_financials and generate a summary based on Microsoft's historical revenue.


⚙️ MCP Tools

  • fetch_stock_info(symbol: str)
  • fetch_quarterly_financials(symbol: str)
  • fetch_annual_financials(symbol: str)

You can expand the toolset by modifying mcp_server.py.


🤖 Architecture

[Streamlit UI]
    ↓
[LangChain Agent (GPT-4o)]
    ↓
[MultiServerMCPClient → SSE]
    ↓
[FastMCP Server → yFinance]

🙋 FAQ

Q: What if I see raw ToolMessage or debug info? A: You’re seeing the full agent trace. We now extract only the final assistant message for a clean output.

Q: Does this use subprocesses? A: No! It's powered by SSE (asyncio) for smoother integration.

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • dmayboroda
  • 带有可配置容器的本地对话抹布

  • paulwing
  • 使用MCP服务创建的测试存储库

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

    Reviews

    2.7 (3)
    Avatar
    user_bppTZwRb
    2025-04-23

    MCPFinanceStream by Hesamalian is an exceptional financial tool that has revolutionized my investment strategies. Its user-friendly interface and comprehensive data analytics provide a seamless experience for tracking market trends. The prompt welcome message and intuitive URL navigation make accessing information quick and efficient. Highly recommended for anyone looking to enhance their financial decision-making process!

    Avatar
    user_lSQl5DfX
    2025-04-23

    I have been using MCPFinanceStream by Hesamalian for a few months, and it has significantly improved my financial tracking and planning. The interface is user-friendly, and the features are comprehensive yet easy to navigate. This tool has become an essential part of my daily financial management. Highly recommend for anyone looking to streamline their finances!

    Avatar
    user_8cNG9J3X
    2025-04-23

    As a dedicated user of MCPFinanceStream by Hesamalian, I find this tool exceptionally valuable for all my financial analysis needs. The seamless interface and robust features have streamlined my finance workflow, making it easier to track and manage investments. Highly recommend for anyone looking to enhance their financial monitoring and analysis experience!