MCP cover image
See in Github
2025-04-14

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.

相关推荐

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

  • langgenius
  • Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.

  • av
  • Effortlessly run LLM backends, APIs, frontends, and services with one command.

  • alibaba
  • an easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.

  • 1Panel-dev
  • 🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.

  • microsoft
  • Python tool for converting files and office documents to Markdown.

  • rulego
  • ⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.

  • mindsdb
  • AI's query engine - Platform for building AI that can answer questions over large scale federated data. - The only MCP Server you'll ever need

  • hkr04
  • Lightweight C++ MCP (Model Context Protocol) SDK

  • nbonamy
  • Witsy: desktop AI assistant / universal MCP client

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(视频生成、Agent、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

  • labring
  • FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.

    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!