Skip to main content
Glama
Ahsansabir143

trading-platform-mcp-server

Trading Platform v2 — Binance Intelligence & Execution

Binance-only trading intelligence and execution platform with Claude connected through MCP. Production-grade Python monorepo.

Architecture

Claude (reasoning layer)
    │  MCP bounded tool interface
    ▼
mcp-server ─────────────────────────────────────────────────
                                                            │
gateway-api (REST + WebSocket, web/mobile clients)          │
    │                                                       │
    ▼                                                       ▼
strategy-service ──► execution (paper / live orders)
    │                      │
    │               private user stream
    ▼                      │
analytics ◄────────────────┘
    │
    ▼
normalizer
    │
    ▼
binance-ingest (WebSocket streams + REST polling)
    │
    ▼
Redis Streams + Redis hot state
    │
    ▼
Postgres (persistent history + all business records)

Related MCP server: Trading MCP Server

Services

Service

Port

Purpose

gateway-api

8000

REST + WebSocket API

binance-ingest

8001

Raw stream ingest

normalizer

8002

Payload normalization + hot state

analytics

8003

Derived metrics + decision snapshots

strategy-service

8004

Strategy CRUD, eval, intents

execution

8005

Risk validation + order routing

mcp-server

8006

Claude MCP tool interface

Phase Status

Phase

Description

Status

1

Shared foundation (schemas, Redis, DB, utils, infra)

✅ Complete

2

Binance ingest (all stream types + private user stream)

🔲 Next

3

Normalizer (all event types + hot state)

🔲

4

Analytics (10 engines + decision snapshot builder)

🔲

5

Strategy service (CRUD, versioning, eval, simulation)

🔲

6

Execution — paper mode (validation + risk engine)

🔲

7

Execution — live (Binance orders + fill reconciliation)

🔲

8

MCP server (25 bounded tools + OAuth + audit)

🔲

9

Gateway API (all REST + WebSocket routes)

🔲

10

Hardening (tests, observability, incident workflows)

🔲

Quick Start (local dev)

Prerequisites

  • Python 3.12

  • Docker + Docker Compose

1. Install shared package

cd C:\Users\ahsan\trading-platform-v2
pip install -e .

2. Copy and configure env

Copy-Item .env.example .env
# Edit .env with your Binance keys and secrets

3. Start infrastructure

docker compose -f infra/docker-compose.yml up postgres redis -d

4. Run migrations

$env:PYTHONPATH = "C:\Users\ahsan\trading-platform-v2"
alembic -c migrations/alembic.ini upgrade head

5. Start a service (example: gateway-api)

$env:PYTHONPATH = "C:\Users\ahsan\trading-platform-v2"
python -m uvicorn services.gateway_api.main:app --host 0.0.0.0 --port 8000 --reload

6. Run tests

$env:PYTHONPATH = "C:\Users\ahsan\trading-platform-v2"
python -m pytest tests/unit/ -v

Key Design Principles

  1. Claude is the controller — never the direct execution layer

  2. Strategy ≠ Execution — TradeIntent objects cross the boundary, never raw orders

  3. Execution is the only Binance caller — no other service may place orders

  4. Private user streams are truth — fills, balances, positions come from there

  5. Raw ≠ Derived — never mixed in the same API field

  6. MCP is bounded — approval levels and symbol policies enforced on every tool call

  7. Paper = Live pipeline — same validation, different execution path

  8. Everything is auditable — audit_log, mcp_tool_calls, execution_events for every action

  9. Idempotent jobs — job_id + deterministic client_order_id prevent duplicate execution

Redis Key Domains

All keys are built via shared.redis.keys.RedisKeys — never inline strings.

  • market:{type}:{symbol}:* — hot market state

  • analytics:{type}:{symbol}:* — derived analytics

  • account:{user_id}:* — account state

  • risk:{user_id}:* — risk state and limits

  • strategy:{id}:* — active strategy state

  • approval:{user_id}:level — current approval level

  • kill_switch:{account_id} — global kill switch flag

  • pause:user:{account_id} — per-user trading pause

  • pause:symbol:{account_id}:{symbol} — per-symbol pause

  • cooldown:{account_id}:{symbol} — post-loss cooldown

  • job:lock:{job_id} — execution job idempotency lock

Redis Streams

  • stream:binance:raw — raw Binance payloads

  • stream:binance:normalized — canonical NormalizedEvent records

  • stream:analytics:derived — analytics engine outputs

  • stream:strategy:intents — TradeIntent objects

  • stream:execution:events — execution lifecycle events

  • stream:mcp:audit — MCP tool call audit trail

Database

28 tables across 5 domains:

  • Market: symbols, candles, trade_history, funding_history, oi_history, liquidation_events, wall_events, market_snapshots

  • Account: users, exchange_accounts, api_credentials_ref, balances, positions, orders, fills

  • Execution: execution_jobs, execution_events, risk_policies, approval_levels

  • Strategy: strategies, strategy_versions, strategy_runs, strategy_evaluations, strategy_actions, strategy_rollbacks

  • Audit: mcp_sessions, mcp_tool_calls, audit_log, incident_log, account_update_reasons

Approval Levels

Level

Value

Can Do

L0

l0_readonly

Read data only

L1

l1_simulation

Run simulations

L2

l2_paper

Paper trading

L3

l3_assisted_live

Live with confirmation

L4

l4_bounded_auto

Bounded auto-execution

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    A Model Context Protocol server that provides Claude Code with seamless access to Binance exchange API functionality for market data retrieval, account management, and trading operations.
    Last updated
    10
    109
    33
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Provides a comprehensive suite of 20 tools for cryptocurrency trading and technical analysis across 100+ exchanges like Binance and MEXC via CCXT. It enables users to execute orders, track positions, and scan for market opportunities through Claude Desktop using natural language.
    Last updated
    28
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Provides over 156 tools to interact with the Binance.com global exchange API for spot trading, wallet management, and staking operations. It enables users to execute orders, retrieve market data, and manage crypto assets through natural language interfaces like Claude and ChatGPT.
    Last updated
    63
    33
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Provides comprehensive Binance trading capabilities through Claude Desktop, including account management, spot and futures trading, market data, and advanced analysis tools.
    Last updated
    109
    9
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

  • Crypto transaction firewall and risk tools for MCP agents.

  • Crypto MCP with 21 tools for market data, DeFi, analytics, and sentiment. Post-paid USDC billing.

View all MCP Connectors

Latest Blog Posts

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/Ahsansabir143/mcp-web-app'

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