finance-mcp-server

sanskruti0ise/finance-mcp-server

3.2

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

Agentic Finance AI is a Model Context Protocol (MCP) server that provides financial calculation tools, powered by an intelligent agent.

Tools
3
Resources
0
Prompts
0

Agentic Finance AI

Agentic Finance AI is a Model Context Protocol (MCP) server that provides financial calculation tools, powered by an intelligent agent.
This project uses a modular architecture, allowing the agent to dynamically access and execute specialized functions for tasks like EMI, SIP, and loan calculations.

The front-end is a clean, conversational chat interface built with Chainlit, which communicates with a LangGraph agent that orchestrates the use of the financial tools.


✨ Features

  • Modular Architecture: Uses the FastMCP framework to expose financial tools as a service.
  • Intelligent Agent: An AI agent powered by Mistral AI selects and uses the appropriate tool to answer user queries.
  • Core Financial Tools:
    • emi.py: Calculates Equated Monthly Installments.
    • sip.py: Provides details on Systematic Investment Plans.
    • loan.py: Handles loan-related calculations.
  • Conversational UI: A modern, web-based chat interface built with Chainlit.

βš™οΈ Technologies

  • Python 3.10+
  • FastMCP: Multi-Client Protocol framework
  • LangChain / LangGraph: Agent orchestration
  • Mistral AI: Large Language Model for agent intelligence
  • Chainlit: Conversational UI framework

πŸ“‚ Project Structure

.
β”œβ”€β”€ mcps/
β”‚   └── server.py         # The FastMCP server script
β”œβ”€β”€ tools/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ emi.py            # EMI calculation tool
β”‚   β”œβ”€β”€ sip.py            # SIP calculation tool
β”‚   └── loan.py           # Loan calculation tool
β”œβ”€β”€ .env                  # Environment variables (e.g., API keys)
β”œβ”€β”€ .gitignore            # Git ignore file
β”œβ”€β”€ agent-with-ui.py      # The Chainlit agent UI
β”œβ”€β”€ requirements.txt      # Project dependencies
└── README.md             # This file

πŸš€ Getting Started

Follow these steps to get a local copy of the project up and running.

1. Clone the repository

git clone https://github.com/sanskruti0ise/finance-mcp-server.git
cd finance-mcp-server

2. Set up the Python Environment

It is highly recommended to use a virtual environment.

# Create a virtual environment
python -m venv venv

# Activate the virtual environment
# On macOS/Linux:
source venv/bin/activate

# On Windows:
.env\Scripts\Activate

3. Install Dependencies

Install all the required Python packages:

pip install -r requirements.txt

4. Configure API Keys

Create a file named .env in the root directory of the project and add your Mistral AI API key:

echo 'MISTRAL_API_KEY="YOUR_MISTRAL_API_KEY"' > .env

Note: Replace YOUR_MISTRAL_API_KEY with your actual key.


πŸƒ Running the Application

This project uses a single command to run both the Chainlit UI and the FastMCP server.

From the root directory of your project, run:

chainlit run agent-with-ui.py -w

This will automatically:

  • Launch a local web server for the Chainlit UI
  • Start the FastMCP server in a separate process
  • Open a browser window with the conversational chat interface

You can now ask your agent questions like:

What is the EMI for a loan of 500000 at an interest rate of 8.5% for 12 months?

πŸ—ΊοΈ How It Works

  1. User Input: You type a query in the Chainlit UI.
  2. Agent Orchestration: The agent-with-ui.py script receives the query and passes it to the LangGraph agent.
  3. Tool Selection: The Mistral AI model analyzes the query and decides which financial tool (e.g., emi, sip) to use.
  4. Tool Execution: The agent communicates with the FastMCP server, which runs the selected tool’s function and returns the result.
  5. Final Response: The agent synthesizes the result into a conversational answer and displays it back to you in the Chainlit UI.