MCP Order Flow Server

MCP Order Flow Server

mcp-order-flow-server•byfintools-ai

A Model Context Protocol server that delivers real-time order flow analysis, connecting to market data brokers via gRPC to provide institutional-grade market microstructure insights.

License: Not specified•Runtime: Awaiting documentation review•Category: finance crypto

WHAT IT DOES

  • •Exposes an MCP tool, analyze_order_flow_tool, that accepts a ticker, an analysis history window, and an option to include pattern detection.
  • •Retrieves live market data through gRPC, with a Redis fallback data source option.
  • •Detects institutional order flow patterns such as absorption, stacking, and sweeps and derives support/resistance levels.
  • •Computes market momentum metrics including bid/ask dynamics and size acceleration.

BEST FOR

  • •Algorithmic trading applications needing real-time order flow analysis delivered to AI agents through MCP.
  • •Analyzing order flow patterns and significant price levels for specific tickers over configurable time windows.
  • •Production deployments where low-latency market data retrieval is required.

ABOUT MCP-ORDER-FLOW-SERVER

MCP Order Flow Server is cataloged as an MCP server attributed to fintools-ai. A Model Context Protocol server that delivers real-time order flow analysis, connecting to market data brokers via gRPC to provide institutional-grade market microstructure insights. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Order Flow Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which tickers and time windows can be analyzed?

The tool takes a required ticker symbol such as SPY or QQQ and an optional history window defaulting to 5mins, with examples including 30s, 10mins, and 1h.

Can pattern detection be turned off?

Yes; include_patterns defaults to true but can be disabled so pattern detection is excluded from the response.

Which data sources does the server support?

The server supports gRPC for production and Redis as a development or fallback data source, selected through the DATA_SOURCE environment variable.

Upstream README

View this exact version on GitHub

README.md · 19e5e2454940 · Fetched 2026-11-13 12:37:41 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

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:

    git clone <repository-url>
    cd mcp-order-flow-server
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Generate protobuf files (if using gRPC data source):

    ./generate_proto.sh
    
  4. Configure environment (optional):

    export DATA_BROKER_GRPC_URL=localhost:9090
    export LOG_LEVEL=INFO
    
  5. Start the server:

    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

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

Example Response

<order_flow_data ticker="SPY" timestamp="2024-01-15T10:30:00" current_price="485.24">
    <data_summary>
        <quote_count>1847</quote_count>
        <history_window>300s</history_window>
        <pattern_count>3</pattern_count>
    </data_summary>
    
    <current_quote>
        <bid_price>485.230</bid_price>
        <ask_price>485.250</ask_price>
        <bid_size>1800</bid_size>
        <ask_size>1200</ask_size>
        <spread>0.020</spread>
    </current_quote>
    
    <metrics window="10s">
        <momentum>
            <bid_movement>0.050</bid_movement>
            <ask_movement>0.045</ask_movement>
            <bid_lifts>3</bid_lifts>
            <ask_lifts>2</ask_lifts>
        </momentum>
        <size_dynamics>
            <avg_bid_size>1650</avg_bid_size>
            <avg_ask_size>1250</avg_ask_size>
            <large_bids>1</large_bids>
            <large_asks>0</large_asks>
        </size_dynamics>
        <behaviors>
            <bid_stacking>YES</bid_stacking>
            <momentum_building>YES</momentum_building>
        </behaviors>
    </metrics>
    
    <significant_levels>
        <bid_levels>
            <level price="485.20" appearances="15" total_size="45000" />
            <level price="485.15" appearances="12" total_size="38000" />
        </bid_levels>
        <ask_levels>
            <level price="485.30" appearances="12" total_size="38000" />
            <level price="485.35" appearances="9" total_size="28000" />
        </ask_levels>
    </significant_levels>
    
    <detected_patterns>
        <pattern type="absorption">
            <subtype>bullish</subtype>
            <strength>strong</strength>
            <description>Strong bid absorption at 485.20</description>
        </pattern>
    </detected_patterns>
</order_flow_data>

Configuration

Environment Variables

# 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

┌─────────────────┐    ┌──────────────────┐    ┌───────────────────┐
│   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

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

# 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:

./generate_proto.sh

Performance

Benchmarks

  • Analysis Latency: < 1ms per request (gRPC mode)
  • Concurrent Requests: 2000+ simultaneous analyses
  • Memory Usage: ~50MB base + 1KB per active ticker
  • CPU Usage: < 5% on modern hardware

Optimization Tips

  1. Use gRPC mode for production deployments
  2. Reduce history window for faster responses
  3. Disable patterns if not needed (include_patterns=false)
  4. Batch requests when analyzing multiple tickers

Error Handling

The server provides detailed error responses for common issues:

<order_flow_data ticker="INVALID" error="true">
    <error_message>No data available for ticker</error_message>
    <possible_causes>
        <cause>Invalid ticker symbol</cause>
        <cause>Market data broker not running</cause>
        <cause>Network connectivity issues</cause>
    </possible_causes>
    <suggestions>
        <suggestion>Verify ticker symbol is correct</suggestion>
        <suggestion>Check market data broker status</suggestion>
        <suggestion>Ensure network connectivity</suggestion>
    </suggestions>
</order_flow_data>

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Order Flow Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-order-flow-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related finance crypto MCP Servers

Alternative and complementary servers in the same category

View all in finance crypto →
USA Spending MCP Server
usaspending-mcp-server•thsmale

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

Repository stats unavailable
Finance & Analytics
Fortnox MCP server — More AI
more-ai-chatgpt-claude-mcp-fortnox•amor3

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

0
Finance & Analytics

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.

Repository stats unavailable
Finance & Analytics