Finance MCP Server

Finance MCP Server

Provides comprehensive stock market data and technical analysis tools via the MCP protocol, enabling real-time quotes, historical data, and professional indicators like RSI and MACD for Claude Desktop and other clients.

Category
访问服务器

README

📈 Finance MCP Server

PyPI version Python Support License: MIT

A powerful Model Context Protocol (MCP) server that brings comprehensive stock market data and technical analysis capabilities to Claude Desktop and other MCP-compatible clients.

🚀 Features

  • 📊 Stock Information: Complete company profiles, market metrics, and key statistics
  • 📈 Historical Data: Customizable historical price data with multiple timeframes
  • ⚡ Real-time Quotes: Live stock prices with change calculations
  • 🔧 Technical Indicators: 10+ professional-grade technical analysis tools
  • 🚀 High Performance: Intelligent caching system for optimal speed
  • 🛡️ Robust: Comprehensive error handling and validation
  • 🔌 Easy Integration: One-command installation for Claude Desktop

📦 Quick Installation

For Claude Desktop Users

pip install finance-mcp-server

Then add to your Claude Desktop configuration:

{
  "mcpServers": {
    "finance": {
      "command": "finance-mcp-server"
    }
  }
}

Restart Claude Desktop and start asking about stocks! 🎉

Manual Installation

# Clone the repository
git clone https://github.com/akshatbindal/finance-mcp-server.git
cd finance-mcp-server

# Install in development mode
pip install -e .

# Or install from PyPI
pip install finance-mcp-server

🎯 Usage Examples

Once installed, you can ask Claude Desktop natural language questions like:

  • "What's Apple's current stock price and market cap?"
  • "Show me Tesla's performance over the last 6 months"
  • "Calculate RSI and MACD for Microsoft stock"
  • "Compare the 50-day moving average of Google vs Amazon"
  • "What are the Bollinger Bands for Netflix right now?"

🛠️ Available Tools

The Finance MCP Server exposes the following tools via the MCP protocol:

  • get_comprehensive_stock_info: Get detailed company, market, financial, and analyst data for any stock symbol.
  • get_historical_data: Retrieve historical price data with customizable period and interval, including splits/dividends.
  • get_options_data: Fetch options chain data for a stock, including calls and puts for multiple expiration dates.
  • get_institutional_holders: View institutional and major holders for a stock.
  • get_earnings_calendar: Access earnings calendar, history, and analyst price targets.
  • get_analyst_recommendations: Analyst recommendations, upgrades, and downgrades.
  • get_financial_statements: Download full income statement, balance sheet, and cash flow (annual/quarterly).
  • get_news: Latest news headlines and metadata for a stock.
  • get_technical_analysis: Professional indicators (SMA, EMA, RSI, MACD, Bollinger Bands, volume, support/resistance, etc).
  • get_sector_performance: Compare performance, volatility, and metrics for multiple stocks.
  • get_dividend_history: Dividend payment history, summary, and stats.

Example Tool Call (MCP JSON)

{
  "tool": "get_comprehensive_stock_info",
  "arguments": {"symbol": "AAPL"}
}

Caching & Performance

  • Company info, news, options, holders, calendar, recommendations: 5–60 min cache
  • Real-time data: 1 min cache
  • Fundamentals: 10 min cache
  • Optimized yfinance usage: Multi-threading enabled, batch requests, and error isolation

Error Handling

  • All endpoints return clear error messages on failure
  • Graceful fallback for missing or partial data
  • Logging for all exceptions and warnings

Technical Analysis

  • Moving averages (SMA 20/50/200, EMA 12/26)
  • RSI, MACD, Bollinger Bands, volume trends
  • Support/resistance, volatility, and more

Expanded Data

  • Options chain (calls/puts, OI, IV, last trade)
  • Institutional/major holders
  • Earnings calendar/history, analyst targets
  • Full financial statements (annual/quarterly)
  • News headlines, publisher, related tickers
  • Dividend history and summary

🛠️ Configuration

Basic Configuration

{
  "mcpServers": {
    "finance": {
      "command": "finance-mcp-server"
    }
  }
}

Advanced Configuration

{
  "mcpServers": {
    "finance": {
      "command": "finance-mcp-server",
      "env": {
        "LOG_LEVEL": "INFO",
        "CACHE_DURATION": "300"
      }
    }
  }
}

🔧 Development

Setting Up Development Environment

# Clone the repository
git clone https://github.com/akshatbindal/finance-mcp-server.git
cd finance-mcp-server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e .

# Install development dependencies
pip install pytest black flake8 mypy

# Run tests
pytest

# Format code
black finance_mcp/

# Type checking
mypy finance_mcp/

Running the Server

# Run directly
python -m finance_mcp.server

# Or use the console script
finance-mcp-server

# With debug logging
LOG_LEVEL=DEBUG finance-mcp-server

📊 Performance Features

Intelligent Caching

  • Stock Info & Technical Indicators: 5-minute cache
  • Real-time Data: 1-minute cache
  • Historical Data: Session-based caching
  • Automatic cache invalidation

Error Handling

  • Graceful handling of invalid stock symbols
  • Network timeout protection
  • Comprehensive error messages
  • Fallback mechanisms for data retrieval

🔒 Privacy & Security

  • No Data Storage: All data is retrieved in real-time from Yahoo Finance
  • No User Tracking: No personal information is collected or stored
  • Rate Limiting: Built-in protection against API abuse
  • Error Isolation: Errors don't crash the entire server

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Run the test suite: pytest
  5. Format your code: black finance_mcp/
  6. Submit a pull request

Areas for Contribution

  • Additional technical indicators
  • Cryptocurrency support
  • Options and futures data
  • News sentiment integration
  • Performance optimizations
  • Documentation improvements

📋 Requirements

  • Python: 3.8 or higher
  • Dependencies:
    • mcp >= 1.0.0 - Model Context Protocol framework
    • yfinance >= 0.2.18 - Yahoo Finance API wrapper
    • pandas >= 2.0.0 - Data manipulation and analysis
    • ta >= 0.10.2 - Technical analysis library

🐛 Troubleshooting

Common Issues

Server not starting?

# Check if all dependencies are installed
pip install -r requirements.txt

# Test the server manually
finance-mcp-server

No data for a symbol?

  • Verify the stock symbol is correct (e.g., "AAPL" not "Apple")
  • Check if the market is open (affects real-time data)
  • Some symbols may not be available on Yahoo Finance

Claude Desktop not connecting?

  • Ensure the configuration JSON is valid
  • Check that the command path is correct
  • Restart Claude Desktop completely
  • Check Claude Desktop's logs for error messages

Getting Help

📄 License

This project is licensed under the Apache License - see the LICENSE file for details.

🙏 Acknowledgments

  • Yahoo Finance for providing free financial data
  • MCP Team for the Model Context Protocol framework
  • Technical Analysis Library contributors
  • Open Source Community for inspiration and support

🔮 Roadmap

Version 1.1.0 (Coming Soon)

  • [ ] Cryptocurrency support (Bitcoin, Ethereum, etc.)
  • [ ] Options chain data
  • [ ] Earnings calendar integration
  • [ ] News sentiment analysis

Version 1.2.0 (Future)

  • [ ] Portfolio tracking capabilities
  • [ ] Custom indicator builder
  • [ ] Multi-timeframe analysis
  • [ ] Advanced charting data

Version 2.0.0 (Vision)

  • [ ] Machine learning predictions
  • [ ] Risk analysis tools
  • [ ] Backtesting framework
  • [ ] Professional trader features

⭐ Star History

Star History Chart


Made with ❤️ for the MCP and trading communities

Bringing professional-grade financial analysis to conversational AI

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选