sanskruti0ise/finance-mcp-server
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.
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
- User Input: You type a query in the Chainlit UI.
- Agent Orchestration: The
agent-with-ui.py
script receives the query and passes it to the LangGraph agent. - Tool Selection: The Mistral AI model analyzes the query and decides which financial tool (e.g.,
emi
,sip
) to use. - Tool Execution: The agent communicates with the FastMCP server, which runs the selected toolβs function and returns the result.
- Final Response: The agent synthesizes the result into a conversational answer and displays it back to you in the Chainlit UI.