Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Mcp Order Flow Server

    This is the mcp to fetch and get order flow information

    0 stars
    Python
    Updated Jun 17, 2025

    Table of Contents

    • Features
    • Quick Start
    • Prerequisites
    • Installation
    • Usage
    • MCP Tool: analyze_order_flow_tool
    • Parameters
    • Example Request
    • Example Response
    • Configuration
    • Environment Variables
    • Data Sources
    • Architecture
    • Key Components
    • Development
    • Project Structure
    • Testing
    • Regenerating Protobuf Files
    • Performance
    • Benchmarks
    • Optimization Tips
    • Error Handling

    Table of Contents

    • Features
    • Quick Start
    • Prerequisites
    • Installation
    • Usage
    • MCP Tool: analyze_order_flow_tool
    • Parameters
    • Example Request
    • Example Response
    • Configuration
    • Environment Variables
    • Data Sources
    • Architecture
    • Key Components
    • Development
    • Project Structure
    • Testing
    • Regenerating Protobuf Files
    • Performance
    • Benchmarks
    • Optimization Tips
    • Error Handling

    Documentation

    MCP Order Flow Server

    A high-performance Model Context Protocol (MCP) server that provides real-time order flow analysis for algorithmic trading applications. This server connects to market data brokers via gRPC to deliver institutional-grade market microstructure insights.

    Python 3.10+

    gRPC

    MCP

    Features

    • Real-time Order Flow Analysis: Live market microstructure data processing
    • High-Performance gRPC Integration: Sub-millisecond latency data retrieval
    • Institutional Pattern Detection: Absorption, stacking, and sweep patterns
    • Support/Resistance Levels: Algorithmically derived key price levels
    • Market Momentum Metrics: Bid/ask dynamics and size acceleration
    • MCP Protocol Compliance: Seamless integration with AI agents and LLMs

    Quick Start

    Prerequisites

    • Python 3.10 or higher
    • A compatible market data broker (gRPC endpoint)
    • Basic understanding of market microstructure concepts

    Installation

    1. Clone the repository:

    bash
    git clone 
       cd mcp-order-flow-server

    2. Install dependencies:

    bash
    pip install -r requirements.txt

    3. Generate protobuf files (if using gRPC data source):

    bash
    ./generate_proto.sh

    4. Configure environment (optional):

    bash
    export DATA_BROKER_GRPC_URL=localhost:9090
       export LOG_LEVEL=INFO

    5. Start the server:

    bash
    python src/mcp_server.py

    Usage

    MCP Tool: analyze_order_flow_tool

    The server exposes a single MCP tool for order flow analysis:

    Parameters

    ParameterTypeDefaultDescription
    tickerstringrequiredStock/ETF ticker symbol (e.g., "SPY", "QQQ")
    historystring"5mins"Analysis time window (e.g., "30s", "10mins", "1h")
    include_patternsbooleantrueInclude pattern detection in response

    Example Request

    json
    {
      "method": "tools/call",
      "params": {
        "name": "analyze_order_flow_tool",
        "arguments": {
          "ticker": "SPY",
          "history": "5mins",
          "include_patterns": true
        }
      }
    }

    Example Response

    xml
    1847
            300s
            3
        
        
        
            485.230
            485.250
            1800
            1200
            0.020
        
        
        
            
                0.050
                0.045
                3
                2
            
            
                1650
                1250
                1
                0
            
            
                YES
                YES
            
        
        
        
            
                
                
            
            
                
                
            
        
        
        
            
                bullish
                strong
                Strong bid absorption at 485.20

    Configuration

    Environment Variables

    bash
    # Data source configuration
    DATA_SOURCE=grpc                    # Use 'grpc' (recommended) or 'redis'
    DATA_BROKER_GRPC_URL=localhost:9090 # gRPC endpoint for market data
    
    # Redis fallback (if DATA_SOURCE=redis)
    REDIS_HOST=localhost
    REDIS_PORT=6379
    REDIS_DB=0
    
    # Logging
    LOG_LEVEL=INFO                      # DEBUG, INFO, WARNING, ERROR

    Data Sources

    SourceLatencyThroughputUse Case
    gRPC0.1-0.5ms2000+ req/sProduction (Recommended)
    Redis0.5-2ms500+ req/sDevelopment/Fallback

    Architecture

    code
    ┌─────────────────┐    ┌──────────────────┐    ┌───────────────────┐
    │   MCP Client    │───▶│  MCP Server      │───▶│  Market Data      │
    │  (AI Agent)     │    │  (This Repo)     │    │  Broker (gRPC)    │
    └─────────────────┘    └──────────────────┘    └───────────────────┘
                                  │
                                  ▼
                           ┌──────────────────┐
                           │  Order Flow      │
                           │  Analysis Engine │
                           └──────────────────┘

    Key Components

    • MCP Server: FastMCP-based server handling tool requests
    • gRPC Client: High-performance data retrieval from market broker
    • State Manager: XML response formatting and data aggregation
    • Pattern Detector: Real-time institutional pattern recognition

    Development

    Project Structure

    code
    mcp-order-flow-server/
    ├── src/
    │   ├── mcp_server.py           # Main MCP server entry point
    │   ├── config.py               # Configuration management
    │   ├── proto/                  # Generated protobuf files
    │   ├── storage/
    │   │   ├── grpc_client.py     # gRPC data client
    │   │   └── redis_client.py    # Redis fallback client
    │   ├── formatters/
    │   │   └── state_manager.py   # XML response formatting
    │   └── tools/
    │       └── order_flow_tool.py # MCP tool implementation
    ├── generate_proto.sh           # Protobuf generation script
    ├── test_tool.py               # Development testing
    └── requirements.txt           # Python dependencies

    Testing

    bash
    # Run development tests
    python test_tool.py
    
    # Test specific ticker
    python -c "
    import asyncio
    from src.tools.order_flow_tool import analyze_order_flow
    result = asyncio.run(analyze_order_flow('SPY', '1min', True))
    print(result)
    "

    Regenerating Protobuf Files

    If the market data broker's protobuf definitions change:

    bash
    ./generate_proto.sh

    Performance

    Benchmarks

    • Analysis Latency:

    No data available for ticker

    Invalid ticker symbol

    Market data broker not running

    Network connectivity issues

    Verify ticker symbol is correct

    Check market data broker status

    Ensure network connectivity

    code
    // Code block

    Similar MCP

    Based on tags & features

    • CH

      Chuk Mcp Linkedin

      Python00
    • PU

      Pursuit Mcp

      Python00
    • HE

      Hello Mcp

      Python00
    • GR

      Gradle Mcp

      Python00

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • CH

      Chuk Mcp Linkedin

      Python00
    • PU

      Pursuit Mcp

      Python00
    • HE

      Hello Mcp

      Python00
    • GR

      Gradle Mcp

      Python00

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k