MCP-Finance-Server
Provides financial data for Apple (AAPL), including current price, daily change, market cap, and trading volume.
Provides financial data for Bitcoin (BTC-USD), including current price, daily change, market cap, and trading volume.
Provides financial data for Ethereum (ETH-USD), including current price, daily change, market cap, and trading volume.
Provides financial data for Google (GOOG), including current price, daily change, market cap, and trading volume.
Provides financial data for Infosys (INFY), including current price, daily change, market cap, and trading volume.
Provides financial data for Tesla (TSLA), including current price, daily change, market cap, and trading volume.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-Finance-ServerWhat's the current price of Apple?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-Powered Financial Intelligence Server
A lightweight financial intelligence server built with Python and FastAPI that exposes financial-data capabilities as modular tools. The project combines a tool-based architecture with an interactive agent that interprets user queries, selects the appropriate financial tool, resolves company names to stock/crypto symbols, and retrieves market information using Yahoo Finance.
๐ Features
Financial Data Retrieval โ Fetch current price, daily percentage change, market state, market capitalization, and trading volume.
Intelligent Tool Selection โ Determines which financial tool should handle a user's query.
Company & Ticker Resolution โ Converts common company names such as
AppleorTeslainto their corresponding symbols using fuzzy matching.Stock & Cryptocurrency Support โ Supports selected equities and cryptocurrencies such as Apple, Tesla, Microsoft, Infosys, Bitcoin, and Ethereum.
Specific Metric Extraction โ Retrieve individual metrics such as price, market cap, volume, or daily change.
REST API โ Financial capabilities are exposed through FastAPI endpoints.
Interactive CLI Agent โ Query the server through a simple command-line interface.
Basic Tool Demonstration โ Includes greeting, addition, and multiplication tools to demonstrate modular tool integration.
Error Handling โ Handles invalid symbols, unavailable metrics, and external API/network errors.
Related MCP server: FinanceKit MCP
๐๏ธ Architecture
User Query
โ
โผ
โโโโโโโโโโโโโโโ
โ Agent โ
โ agent.py โ
โโโโโโโโฌโโโโโโโ
โ
Select Financial Tool
โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโ
โผ โผ
FinancialDataFinder GetFinancialMetric
โ โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โผ
Symbol Resolution
RapidFuzz
โ
โผ
Financial Data Fetch
yfinance
โ
โผ
Structured Response
โ
โผ
User๐ ๏ธ Technologies Used
Python
FastAPI
Uvicorn
Requests
RapidFuzz
yfinance
REST APIs
๐ Project Structure
MCP_Finance_Server/
โ
โโโ agent.py # Interactive agent and tool-selection logic
โโโ config.py # API configuration and request headers
โโโ main.py # FastAPI application and API endpoints
โโโ requirements.txt # Python dependencies
โ
โโโ tools/
โ โโโ basic_tools.py # Basic demonstration tools
โ โโโ finance_tools.py # Financial data and metric tools
โ
โโโ utils/
โโโ fetch_data.py # Yahoo Finance data retrieval
โโโ matcher.py # Company/ticker resolution using RapidFuzzโ๏ธ Installation
1. Clone the repository
git clone https://github.com/YOUR_USERNAME/MCP_Finance_Server.git
cd MCP_Finance_Server2. Create a virtual environment
python -m venv venv3. Activate the virtual environment
Windows:
venv\Scripts\activateLinux/macOS:
source venv/bin/activate4. Install dependencies
pip install -r requirements.txtโถ๏ธ Running the Server
Start the FastAPI server using Uvicorn:
uvicorn main:app --reloadThe server will be available at:
http://127.0.0.1:8000FastAPI's interactive API documentation is available at:
http://127.0.0.1:8000/docs๐ API Endpoints
Health Check
GET /Returns a message confirming that the server is running.
Greeting
GET /greet?name=JoAddition
GET /add?a=10&b=20Multiplication
GET /multiply?a=10&b=20Financial Data
GET /tool/FinancialDataFinder?symbol=AAPLExample response:
{
"Asset Name": "Apple Inc.",
"Symbol": "AAPL",
"Current Price": 000.00,
"Daily Change (%)": 0.00,
"Market State": "REGULAR",
"Market Summary": "Apple Inc. is currently trading at ...",
"Reference": "https://finance.yahoo.com/quote/AAPL"
}Specific Financial Metric
GET /tool/GetFinancialMetric?symbol=AAPL&metric=marketcapSupported metrics:
price
change
marketcap
volumeExample response:
{
"Symbol": "AAPL",
"Metric": "marketcap",
"Value": 0000000000000
}๐ค Using the Interactive Agent
Start the agent separately:
python agent.pyThe agent accepts natural-language-style queries and determines which financial tool should be used.
Example:
๐ฌ Ask something: price AAPLThe agent identifies the appropriate tool, extracts the symbol, calls the FastAPI server, and displays the resulting financial information.
It also supports explicit function-style requests:
FinancialDataFinder("TSLA")or:
GetFinancialMetric("AAPL","MarketCap")๐ Symbol Resolution
The project includes a fuzzy-matching layer using RapidFuzz.
For example, known company names can be resolved to their corresponding symbols:
Company / Asset | Symbol |
Apple | AAPL |
GOOG | |
Tesla | TSLA |
Infosys | INFY |
Microsoft | MSFT |
Bitcoin | BTC-USD |
Ethereum | ETH-USD |
This allows the financial tools to accept either recognized company names or ticker symbols.
๐ How It Works
The user enters a financial query.
The agent analyzes the query and determines the required tool.
The requested symbol/company is extracted.
The symbol resolver validates or maps the input to a known ticker.
The financial tool requests market information through
yfinance.Relevant financial metrics are extracted.
The server returns a structured JSON response.
The agent displays the result to the user.
๐ฏ Project Objective
The goal of this project is to demonstrate how financial capabilities can be organized into modular, callable tools and exposed through a lightweight API server. It provides a foundation for integrating financial data retrieval with agent-based applications and MCP-style tool architectures.
๐ฎ Future Enhancements
Expand support for additional stocks, ETFs, indices, and cryptocurrencies.
Replace rule-based tool selection with an LLM-based agent.
Implement the official MCP protocol for native MCP client compatibility.
Add authentication and API access control.
Add caching to reduce repeated financial-data requests.
Add historical price and charting capabilities.
Add Docker-based deployment.
Add automated testing and CI/CD.
Build a web interface for interacting with the financial tools.
๐ Disclaimer
Financial information retrieved by this project is intended for educational and software-development purposes only. It should not be considered financial advice. Market data may be delayed, incomplete, or unavailable depending on the external data provider.
๐ฉโ๐ป Author
Shanthini Joshitha
Built as a software engineering project exploring FastAPI, financial APIs, intelligent tool selection, and MCP-style architectures.
This server cannot be deployed
Maintenance
Related MCP Connectors
Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.
Live crypto + IDX stock market intelligence for AI agents โ 19 tools, no API key.
OpenFinance gives any AI agent easy trading across every major market through one hosted MCP server. Trade crypto spot and perpetuals on Hyperliquid with market, limit and TWAP orders, leverage and margin control. Trade stocks, indices, commodities, forex and pre-IPO names as Hyperliquid HIP-3 perps. Trade Polymarket prediction markets with odds, order books, positions, PnL and trader leaderboards. Swap and bridge across 40+ EVM chains and Solana with Relay and Jupiter, find memecoins across 200+ chains, launch tokens on Robinhood Chain and Solana, and buy crypto with card, bank or UPI. Write actions are designed to ask for your confirmation first. Connect with OAuth (sign in to OpenFinance and approve) or an API key. Works with Claude, ChatGPT, Cursor, VS Code, Codex and any MCP client. No install. Home: https://openfinance.tech/agents ยท Docs: https://docs.openfinance.tech ยท GitHub: https://github.com/openfinance-tech/mcp
SEC-filed company financials with filing citations, plus market data, for AI agents
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables LLMs to retrieve real-time stock and cryptocurrency prices and news using ticker symbols through the yfinance API.25-
- AlicenseAqualityCmaintenanceProvides AI agents with real-time financial market intelligence including stock quotes, crypto data, technical analysis, and portfolio insights. Enables natural language queries for current prices, technical indicators, asset comparisons, and portfolio analysis.179MIT
- AlicenseNot gradedqualityFmaintenanceEnables LLMs to access stock market and cryptocurrency data through the Financial Datasets API, including financial statements, prices, metrics, and press releases.17 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables searching and converting currencies, stocks, crypto, ETFs, and funds with current rates and source freshness for AI agents.3MIT