Skip to main content
Glama

Trading Analysis MCP Server

by zkyko

Trading Analysis UI & MCP Project

Overview āœ… instead of ##Overview

This project is a part of the MCP (Model Context Protocol) ecosystem, providing a modern web-based UI and API for uploading, processing, and analyzing trading screenshots. It leverages FastAPI for backend services and React (served via CDN) for the frontend, enabling smart file handling, trade extraction, and analytics.

  • MCP (Model Context Protocol): A flexible protocol and toolkit for building AI-powered, context-aware applications. This project demonstrates MCP's capabilities in the domain of trading analysis.

  • Trading Analysis UI: A user-friendly web interface for uploading trade screenshots, extracting trade data, and managing trade logs.


Features āœ… instead of ##Features

  • 🌐 Web UI: Drag & drop upload, image paste, and file management

  • 🧠 Automatic Trade Extraction: Extracts trade data from images using OCR and custom logic

  • šŸ·ļø Smart File Naming: Organizes files by trade metadata and date

  • šŸ“ File Management: List, search, and serve uploaded/processed images

  • šŸ“Š Trade Analytics: Search logs and view trading statistics

  • šŸ”’ CORS Enabled: For easy integration with other tools

  • šŸ“š API Documentation: Available at /docs when the server is running


Directory Structure

MCP/ ā”œā”€ā”€ analyze_trade.py ā”œā”€ā”€ DeepSeek.py ā”œā”€ā”€ mcp_server.py ā”œā”€ā”€ mcp_trading_server.py ā”œā”€ā”€ mcp.json ā”œā”€ā”€ Ocr.py ā”œā”€ā”€ requirements.txt ā”œā”€ā”€ run_extract.py ā”œā”€ā”€ simple_mcp_server.py ā”œā”€ā”€ test_system.py ā”œā”€ā”€ trade_test.png ā”œā”€ā”€ ui_server.py # Main FastAPI server (UI & API) ā”œā”€ā”€ web_api_server.py ā”œā”€ā”€ logs/ │ └── trade_log.jsonl ā”œā”€ā”€ tools/ │ ā”œā”€ā”€ __init__.py │ ā”œā”€ā”€ extract_trade.py # Trade extraction logic │ └── trade.py # Trade log search & stats ā”œā”€ā”€ uploads/ # Uploaded images ā”œā”€ā”€ processed/ # Processed images (by month) ā”œā”€ā”€ static/ # Static files (UI assets) └── trade_logs/

Setup & Installation

  1. Clone the repository

git clone <your-repo-url> cd MCP
  1. Install Python dependencies

pip install -r requirements.txt
  1. (Optional) Configure environment variables

If you use a .env file, place it in the project root.

  1. Run the UI server

python ui_server.py

The server will start at http://localhost:8003


Usage

Web UI

  • Open http://localhost:8003 in your browser

  • Drag & drop or paste trading screenshots to upload and analyze

  • View processed images and trade logs

API Endpoints

  • POST /extract-trade-upload — Upload and process an image

  • POST /extract-trade — Extract trade data from an existing image path

  • POST /search-trades — Search trade logs

  • GET /trading-stats — Get trading statistics

  • GET /list-images — List all available images

  • GET /trade-log — Get raw trade log content

  • GET /file-structure — Get organized file structure

  • GET /uploads/{filename} — Serve uploaded files

  • GET /processed/{date_folder}/{filename} — Serve processed files

API documentation is available at http://localhost:8003/docs


Example: Upload and Extract Trade Data

curl -F "file=@trade_test.png" http://localhost:8003/extract-trade-upload

Extending & Customizing

  • Trade Extraction Logic: Edit tools/extract_trade.py to improve OCR or parsing.

  • Trade Analytics: Edit tools/trade.py for custom search/statistics.

  • UI Customization: The UI is served as a React app via CDN; you can replace the HTML template in ui_server.py for a custom frontend.



Credits

Nischal Bhandari

MCP

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

A FastAPI-based server that provides a web UI for uploading, processing, and analyzing trading screenshots with automatic trade data extraction and analytics.

  1. Overview āœ… instead of ##Overview
    1. Features āœ… instead of ##Features
      1. Directory Structure
        1. Setup & Installation
          1. Usage
            1. Web UI
            2. API Endpoints
          2. Example: Upload and Extract Trade Data
            1. Extending & Customizing
              1. Credits
                1. MCP

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/zkyko/MCP'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server