mcp-finance-agents

adam-j-baron/mcp-finance-agents

3.1

If you are the rightful owner of mcp-finance-agents and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Model Context Protocol (MCP) server provides financial data tools using a local Large Language Model (LLM) and a custom tool server.

Tools
1
Resources
0
Prompts
0

Financial AI Agent with MCP Tools

This repository contains an experimental and educational project demonstrating how to build a financial AI agent using a local Large Language Model (LLM) and a custom tool server.

The project consists of two main files:

  • mcp_server_yfinance.py: A Model Context Protocol (MCP) server that provides financial data tools.
  • mcp_client_yfinance.ipynb: A Jupyter Notebook that acts as a client to connect to the server, create a ReAct Agent, and perform financial analysis queries.

🚀 Getting Started

To run this project, you need to first start the MCP server, and then run the client notebook.

Step 1: Start the MCP Server

Open your terminal and run the Python server file. This will make the financial data tools available to your client.

python mcp_server_yfinance.py

Step 2: Run the Client Notebook

Open mcp_client_yfinance.ipynb in your Jupyter environment. You can then run the cells in the notebook sequentially to:

  • Connect to the MCP server.
  • Initialize the LLM (Ollama model).
  • Create the ReAct agent.
  • Ask questions and see the agent's financial analysis.

🔧 Project Details

This project uses the following key technologies:

  • MCP (Model Context Protocol): For building and communicating with the tool server.
  • yfinance: The library used by the server to fetch financial data.
  • ollama: A local LLM used to power the AI agent.
  • langgraph: A library for building agents with reasoning and action capabilities (ReAct).

This is a simplified setup intended for learning. It's not designed for production use, as noted in the notebook, due to the way connections are handled for ease of experimentation.