Tiger MCP

Tiger MCP

Enables trading and market analysis through Tiger Brokers API integration. Provides real-time market data, portfolio management, order execution, and technical analysis tools with a comprehensive web dashboard for monitoring.

Category
访问服务器

README

🐅 Tiger MCP System

Python Version License MCP Compatible Docker Support UV Workspace Code Quality

Build Status Test Coverage Dependencies Security Scan

GitHub stars GitHub issues Contributions welcome

Professional-grade Model Context Protocol (MCP) server for Tiger Brokers API integration with Claude AI

A comprehensive MCP server system that enables seamless integration between Claude AI and Tiger Brokers trading platform, featuring real-time market data, algorithmic trading capabilities, and intelligent portfolio management.


✨ Key Features

🤖 AI-Native Trading

  • Claude AI Integration: Direct MCP protocol support for conversational trading
  • Natural Language Processing: Execute trades using natural language commands
  • Intelligent Analysis: AI-powered market analysis and portfolio optimization
  • Risk Management: Automated risk assessment and position sizing

📊 Real-Time Market Data

  • Live Market Feeds: Real-time quotes, order books, and market depth
  • Historical Analysis: Comprehensive historical data with technical indicators
  • Market Scanning: Advanced screening and filtering capabilities
  • Global Markets: Support for US, HK, SG markets and more

High-Performance Trading

  • Sub-second Execution: Optimized order routing and execution
  • Portfolio Management: Real-time position tracking and P&L monitoring
  • Risk Controls: Built-in risk management and compliance checks
  • Scalable Architecture: UV workspace with modern async/await patterns

🛡️ Enterprise Security

  • Encrypted Communication: TLS/SSL encryption for all data transmission
  • Secure Authentication: Tiger Brokers OAuth2 with refresh token management
  • Audit Logging: Comprehensive logging for compliance and debugging
  • Production Ready: Docker containerization with health checks

🚀 Quick Start

Prerequisites

  • Python 3.11+ with UV package manager
  • Docker & Docker Compose for containerized deployment
  • Tiger Brokers Account with API access (Apply here)
  • Claude Desktop or Claude API access

⚡ 30-Second Setup

# 1. Clone and setup
git clone <your-repository-url>
cd tiger-mcp
cp .env.template .env  # Configure your Tiger API credentials

# 2. Install dependencies
curl -LsSf https://astral.sh/uv/install.sh | sh  # Install UV
uv sync  # Install all workspace dependencies

# 3. Start with Docker
docker-compose up -d

# 4. Verify installation
curl http://localhost:8000/health

🔧 Configuration

Edit .env with your Tiger Brokers credentials:

# Tiger API Configuration
TIGER_CLIENT_ID=your_client_id_here
TIGER_PRIVATE_KEY=your_private_key_here
TIGER_ACCOUNT=your_account_id_here
TIGER_SANDBOX=true  # Set to false for live trading

# Database (using Docker defaults)
DATABASE_URL=postgresql://tiger:tiger@localhost:5432/tiger_mcp

⚠️ Security Note: Never commit real credentials to version control. Use .env file for local development and secure environment variables for production.

🤖 Claude AI Integration

Tiger MCP supports both Claude Desktop and Claude Code with comprehensive trading capabilities.

Claude Desktop Configuration

Add Tiger MCP to your Claude Desktop configuration (~/.config/claude/config.json):

{
  "mcpServers": {
    "tiger-mcp": {
      "command": "uv",
      "args": ["run", "--package", "mcp-server", "python", "-m", "mcp_server.main"],
      "cwd": "/path/to/tiger-mcp",
      "env": {
        "TIGER_CLIENT_ID": "your_client_id",
        "TIGER_PRIVATE_KEY": "your_private_key", 
        "TIGER_ACCOUNT": "your_account_id"
      }
    }
  }
}

Claude Code Integration

For Claude Code users, Tiger MCP provides enhanced development and trading workflows:

# Configure Claude Code MCP server
cp config/claude_mcp.json ~/.config/claude-code/mcp-servers/

# Start the MCP server for Claude Code
uv run --package mcp-server python -m mcp_server --claude-code-mode

# Use with Claude Code commands
claude code analyze-portfolio --account=all
claude code backtest-strategy --symbol=AAPL --days=30
claude code risk-assessment --portfolio

Claude Code Features:

  • Code-Driven Trading: Generate and execute trading algorithms
  • Portfolio Analysis: Automated portfolio analysis and reporting
  • Strategy Development: Backtest and optimize trading strategies
  • Risk Management: Code-based risk analysis and position sizing
  • Multi-Account Operations: Manage multiple Tiger accounts programmatically

🎯 Example Conversations

General Trading (Claude Desktop & Claude Code):

💬 "Show me my portfolio performance this week"
💬 "What are the top gainers in tech stocks today?"
💬 "Buy 100 shares of AAPL when it drops below $180"
💬 "Analyze the risk of my current positions"

Multi-Account Trading:

💬 "Show portfolio for account account2_id"
💬 "Compare performance across all my accounts"
💬 "Switch to trading account account3_id and buy 100 TSLA"
💬 "What's the total portfolio value across all accounts?"

Claude Code Advanced Usage:

💬 "Generate a momentum trading strategy for NASDAQ stocks"
💬 "Backtest a mean reversion strategy on my current holdings"
💬 "Create a risk report for all accounts in PDF format"
💬 "Implement dollar-cost averaging for my portfolio"

🛠️ Available Tools & Capabilities

Tool Description Use Case
get_account_info Account details and balances Portfolio overview
get_portfolio Holdings and P&L analysis Performance tracking
get_market_data Real-time quotes and data Market analysis
place_order Execute trading orders Order management
scan_market Market screening tools Stock discovery
get_historical_data Historical price data Backtesting
calculate_indicators Technical analysis Chart analysis

📖 Documentation

🚀 Getting Started

🔧 Development

🚀 Deployment


🎯 Use Cases

💼 Portfolio Management

  • Real-time portfolio tracking and performance analysis
  • Automated rebalancing and risk management
  • Multi-account portfolio consolidation
  • Tax-loss harvesting optimization

📈 Algorithmic Trading

  • Strategy backtesting with historical data
  • Automated order execution based on technical indicators
  • Custom alert systems for market opportunities
  • High-frequency trading with sub-second latency

🔍 Market Research

  • Advanced market scanning and stock screening
  • Fundamental and technical analysis automation
  • Sector rotation and correlation analysis
  • Options strategy analysis and optimization

🤖 AI-Powered Insights

  • Natural language queries for market data
  • Automated report generation and analysis
  • Risk assessment and scenario modeling
  • Intelligent trade recommendations

🏗️ Architecture

Tiger MCP is built using a modern, scalable architecture:

graph TB
    Claude[Claude AI] --> MCP[MCP Server]
    MCP --> Tiger[Tiger Brokers API]
    MCP --> DB[(PostgreSQL)]
    MCP --> Cache[(Redis)]
    
    Dashboard[Web Dashboard] --> API[FastAPI Backend]
    API --> DB
    API --> Tiger
    
    Docker[Docker Compose] --> MCP
    Docker --> API
    Docker --> DB
    Docker --> Cache
  • MCP Server: FastMCP-based server with async/await patterns
  • Database: PostgreSQL with async SQLAlchemy for data persistence
  • Caching: Redis for high-performance data caching
  • Security: JWT authentication with encrypted credentials storage
  • Monitoring: Comprehensive logging and health check endpoints

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Python: Black formatting, type hints, docstrings
  • Testing: Minimum 80% test coverage required
  • Documentation: Update docs for any new features
  • Security: Follow security best practices

📜 License

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


⚠️ Disclaimer

Important: This software is for educational and research purposes. Trading financial instruments involves substantial risk and may not be suitable for all investors. Past performance does not guarantee future results. Always consult with financial professionals before making investment decisions.


🆘 Support & Community


🙏 Acknowledgments

  • Tiger Brokers for providing robust API services
  • Anthropic for Claude AI and MCP protocol
  • FastMCP for the excellent MCP framework
  • UV for modern Python package management

<div align="center">

⭐ Star this repository if you find it useful!

Built with ❤️ for the trading and AI community

</div>

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选