Skip to main content
Glama
CMP-server Pocket Option 2026

CMP-server Pocket Option 2026

by Rufus011

Python MCP License Tests

CI Ruff Types: mypy Async

A modern, async, fully-typed bridge between AI assistants and the PocketOption trading platform. Plug it into Claude Code, Claude Desktop, Cursor — or drive it from GPT / Grok — solo or as a coordinated team of analysts and traders. Your model can read balances, pull candles, screen assets, and place trades through clean MCP tools.

📖 Full guide (English + Русский): GETTING_STARTED.md · ⚙️ SETUP.md · 🩺 TROUBLESHOOTING.md


IMPORTANT

This is a terminal / developer tool — not a click-and-run desktop app. There's nothing to double-click: no .exe, no installer, no window, no buttons. You set it up from a terminal / command line (pip install, then run a command) and connect it to an AI client (Claude Code, Claude Desktop, Cursor) by pasting a small block into that client's config file. It has no GUI of its own. If you've never used a command line, this isn't plug-and-play — start with GETTING_STARTED.md, which walks through every step.

WARNING

Trade responsibly. Binary options are negative-expectation by design, and OTC pairs use synthetic prices the broker controls — no bot changes that math. Real-money trading is off by default and only turns on when you explicitly set PO_ALLOW_REAL=1 / allow_real=True. Automated trading may also violate PocketOption's terms of service. Test on a demo account first; you use this at your own risk.

🎯 What it is — and what it isn't

  • It is clean, typed, tested infrastructure: a way to wire AI models into PocketOption over MCP, with real async plumbing, safety-first defaults, per-model memory, and multi-agent coordination. A solid base to build and learn on.

  • It isn't a profitable strategy or a "money-making bot." Binary options are negative-expectation, and this API is unofficial (reverse-engineered). The tooling makes agents disciplined and safe, not profitable — treat it as a framework and a learning / engineering showcase, and stay on demo.

Related MCP server: MetaTrader MCP Server

✨ Why this exists

Most PocketOption wrappers hand-roll the socket.io protocol, ship broken imports, disable TLS verification, and leak your session token into logs. This one doesn't.

  • 🧠 AI-native — exposes trading as first-class MCP tools, so any MCP host can use it with zero glue code.

  • ⚡ Truly async & event-driven — built on python-socketio; prices, fills and candles resolve on real events, no polling loops.

  • 🔒 Secure by default — TLS verification on, session tokens redacted from every log and protocol dump, real-money trading gated behind an explicit flag.

  • 🧩 Model-agnostic core — the trading logic lives once in client.py; Claude, GPT and Grok are thin facades over it.

  • 🧪 Actually tested — 72 offline tests (parsing, routing, safety guards, secret redaction) that need no network and no SSID.

  • 🐍 Typed & pinned — full type hints, py.typed, and a pinned Python version so tools never silently "modernize" your project.

🛠️ What your AI can do through it

Tool

What it does

💰 get_balance

current balance, demo/live

📋 list_assets

tradeable assets with payout % and allowed expirations

🔎 get_asset_info

one asset: payout, open/closed, expirations

🕯️ get_candles

OHLCV candles at any timeframe (60 / 300 / 900 / 3600 / 14400 s…)

💹 get_price

live price for an asset

🎯 place_trade

open a trade (call/put, any amount, expiration in seconds)

⏱️ check_result

wait for a trade to close → win/loss + profit

📂 open_positions

trades currently open

🧾 trade_history

recent closed trades

📊 performance

win rate and net P&L this session

The model computes its own indicators from get_candles — it never needs to read a chart image.

🤝 One model — or a whole trading desk

Connect a single model, or run several at the same time. Every model gets the exact same PocketOption toolset, and an optional shared opinion board lets them operate as a team — analysts posting reads, a trader acting on the consensus.

Connect…

How

Name on the board

Claude — Code / Desktop / Cursor

MCP config (claude_config_example.json)

claude

GPT — OpenAI

python run_gpt.py

gpt

Grok — xAI

python run_grok.py

grok

Any OpenAI-compatible — OpenRouter, Ollama, LM Studio, Mistral…

python run_any.py

model name

TradingView market data

add the tradingview MCP block — works with any of the above

—

Turn them into a desk. Run two or three models side by side and they coordinate through a shared, TTL-expiring opinion board (post_opinion / read_opinions): e.g. GPT and Grok each post an analyst read on EURUSD_otc, and Claude reads the board and only places the trade when they agree. They can also talk directly — send_message / read_messages, broadcast or addressed to one agent by name — to ask questions, agree a plan, or divide work. Each agent's role is just its name + instructions (drop a per-model manual in agent_manuals/) — so you decide who researches and who pulls the trigger.

%%{init: {'theme':'dark','themeVariables':{'primaryColor':'#0d1117','primaryTextColor':'#c9d1d9','primaryBorderColor':'#00ff88','lineColor':'#00ffcc','fontFamily':'monospace'}}}%%
flowchart TB
    TV["📈 TradingView (optional data)"]
    G["🤖 GPT — analyst"]
    K["🤖 Grok — analyst"]
    B["🗒️ opinions.json — shared board, TTL 15m"]
    C["🤖 Claude — trader"]
    PO["🟢 PocketOption"]

    TV -.-> G
    TV -.-> K
    G -->|post_opinion| B
    K -->|post_opinion| B
    B -->|read_opinions| C
    C -->|place_trade| PO

    style TV fill:#11161d,stroke:#48b0ff,color:#c9d1d9
    style G fill:#11161d,stroke:#00ff88,color:#c9d1d9
    style K fill:#11161d,stroke:#00ff88,color:#c9d1d9
    style B fill:#0d1117,stroke:#00ffcc,color:#00ffcc
    style C fill:#11161d,stroke:#00ff88,color:#c9d1d9
    style PO fill:#0d1117,stroke:#00ff88,color:#00ff88

Roles aren't hardcoded — the board just lets agents post and read each other's views. Whether a model acts as an analyst, a risk-checker, or the one that trades is defined by the prompt/instructions you give it and its AGENT_NAME.

🏗️ Architecture

%%{init: {'theme':'dark','themeVariables':{'primaryColor':'#0d1117','primaryTextColor':'#c9d1d9','primaryBorderColor':'#00ff88','lineColor':'#00ffcc','fontFamily':'monospace'}}}%%
flowchart LR
    AI["🤖 Claude / GPT / Grok"]
    S["mcp_server.py — MCP facade"]
    C["client.py — model-agnostic core"]
    PO["🟢 PocketOption"]
    M["models.py — typed parsing"]
    MEM["memory.py — strategies + opinions"]
    TV["📈 TradingView MCP (optional)"]

    AI -->|MCP tools| S
    S --> C
    C -->|socket.io / WSS| PO
    C --> M
    C --> MEM
    TV -.->|real-pair data| AI

    style AI fill:#11161d,stroke:#00ff88,color:#c9d1d9
    style S fill:#11161d,stroke:#00ffcc,color:#c9d1d9
    style C fill:#0d1117,stroke:#00ff88,color:#00ff88
    style PO fill:#0d1117,stroke:#00ff88,color:#00ff88
    style M fill:#11161d,stroke:#48b0ff,color:#c9d1d9
    style MEM fill:#11161d,stroke:#48b0ff,color:#c9d1d9
    style TV fill:#11161d,stroke:#48b0ff,color:#c9d1d9

The core knows nothing about any LLM. New models plug in as thin facades over the same client.py — the trading logic is written once.

sequenceDiagram
    participant AI as 🤖 AI model
    participant S as mcp_server.py
    participant C as client.py
    participant PO as PocketOption

    AI->>S: place_trade(EURUSD_otc, call, 60s)
    S->>C: validated request (pydantic)
    C->>PO: socket.io order
    PO-->>C: fill event
    C-->>S: trade opened
    S-->>AI: trade_id
    AI->>S: check_result(trade_id)
    PO-->>C: close event
    S-->>AI: win/loss + profit

Everything resolves on real socket events — no sleep-and-poll loops anywhere in the pipeline.

🚀 Quick start

# 1. install (registers the `pocketoption-mcp` command)
pip install .

# 2. grab your DEMO SSID from pocketoption.com
#    F12 → Network → websocket → the 42["auth",{...}] frame with "session"/"isDemo"

# 3. point Claude at it — merge the mcpServers block from
#    claude_config_example.json into your Claude / Cursor config, then restart.
TIP

Then just ask your assistant:"What PocketOption tools do you have?" → "Show my balance and the top 5 OTC pairs by payout."

# bash / zsh
export PO_SSID='42["auth",{...}]'
pocketoption-mcp        # or: python -m cmp_server_pocket_option_2026.mcp_server
# PowerShell
$env:PO_SSID='42["auth",{...}]'
pocketoption-mcp

It should print Connected to … (demo) and wait. Ctrl+C to stop.

Full step-by-step (installing Python, getting the SSID, config file locations) lives in GETTING_STARTED.md.

📈 Optional: TradingView for real (non-OTC) pairs

OTC pairs are synthetic, so outside data can't help there — the model reads them from candles alone. For real pairs you can run the third-party tradingview-mcp server alongside this one (needs uv, no TradingView account). The tradingview block in claude_config_example.json wires it up. Note: PocketOption's EURUSD maps to TradingView's FX:EURUSD — the two don't share a symbol namespace, so the model bridges them.

🧪 Development

pip install ".[dev]"
pytest                               # 72 offline tests — no network, no SSID
ruff check .                         # lint
mypy cmp_server_pocket_option_2026   # type-check

The suite is deliberately offline: it swaps the transport for a fake and feeds captured-shape events into the client, validating parsing, routing, safety guards and secret-redaction without ever touching PocketOption. CI runs all three on Python 3.10 / 3.11 / 3.12 / 3.13.

CAUTION

Runtime artifacts (sessions/, strategies/, opinions.json, dump.jsonl) are git-ignored. sessions/ holds your account token — never commit or share it.

🧰 Tech stack

⭐ Support the project

Stars Forks Issues Last commit

If this saved you time or you find it interesting, give it a ⭐ — it's the single biggest thing that helps the project reach other traders and developers. Fork it, build on it, share it (it's MIT).

Share on X Telegram

🐛 Found a bug? 💡 Have an idea?

Contributions of every size are welcome — the project is actively developed and open to collaborators.

  • 🐞 Bug → open an issue with the Bug report template. Redact your SSID before pasting logs.

  • 💡 Feature or improvement → open an issue with the Feature request template.

  • 💬 Questions / open discussion → the Discussions tab.

  • 🔧 Want to code? → PRs welcome — read CONTRIBUTING.md first (it's short). Good first areas: new indicators, more model adapters, better desk coordination.

💚 Support development

Building and maintaining this is unpaid open-source work. If it's useful to you, a donation keeps it moving — completely optional, and thank you 🙏

Donate on Bybit

Bybit UID: 497849886

How to send: in the Bybit app, use Send / transfer by UID (Bybit Pay), enter UID 497849886, then pick the coin and amount. Bybit-to-Bybit transfers are instant and fee-free. (The QR just encodes the UID for quick copying — it doesn't auto-open a payment.)

📜 License

MIT © 2026 Rufus011 — see LICENSE. Build on it freely, trade at your own risk.

Available Tools

24 tools
check_resultA

Wait for a placed trade to close, then return win/loss and profit.

Pass the request_id returned by place_trade. Blocks until the trade's expiration passes.

Inputs: request_id (required).

clear_opinionsA

Wipe the shared opinion board for a clean slate (e.g. starting a new session).

Inputs: no named parameters.

delete_skillB

Delete a saved skill/rule that's no longer useful.

Inputs: name (required).

delete_strategyB

Delete a saved strategy that has proven unreliable.

Inputs: name (required).

get_asset_infoA

Details for one asset: payout, whether it's open, and allowed expirations.

Inputs: symbol (required).

get_balanceB

Get the current account balance and whether it's a demo or live account.

Inputs: no named parameters.

get_candlesA

Fetch OHLCV candles for analysis.

timeframe is the candle size in seconds (60=M1, 300=M5, 900=M15, 3600=H1, 14400=H4). Returns candles oldest-first, each with time/open/high/low/close/volume. Call this for several timeframes to analyse multiple horizons at once.

Inputs: asset (required), count, timeframe.

get_operating_manualA

READ THIS FIRST. Explains the platform (PocketOption), how binary options work, every tool you have, your freedoms (any expiration in seconds, any/multiple timeframes, compute your own indicators), OTC vs real pairs, where to get extra data, and the most efficient workflow. Read it once before doing anything else.

Inputs: no named parameters. Returns: result

get_priceB

Get the current live price for an asset (subscribes and waits for a tick).

Inputs: asset (required).

get_skillB

Get one saved skill/rule by its name.

Inputs: name (required).

get_strategyA

Get one saved strategy by its name.

Inputs: name (required).

list_assetsA

List tradeable assets with payout %% and available expirations (in seconds).

Filters: active_only (open for trading now), otc_only (synthetic OTC pairs), asset_type ('currency'/'stock'/'crypto'/'commodity'/'index'), search (substring of symbol or name). Sorted by payout, capped at limit.

Inputs: limit, search, otc_only, asset_type, +1 more.

list_skillsA

List the rules / skills YOU wrote down before (your own private file only).

Read this at the START of every session together with list_strategies, so you remember the rules you set for yourself and don't repeat past mistakes. You never see another model's skills here.

Inputs: no named parameters.

list_strategiesA

List the trading strategies YOU saved in previous sessions (your own file only).

This notebook is private to you (keyed by AGENT_NAME); you never see other models' strategies here. Call this at the START of a session to build on past experience instead of starting blank. Each entry has your entry logic, the asset/timeframe it suited, and its recorded results.

Inputs: no named parameters.

open_positionsA

List trades currently open on the account.

Inputs: no named parameters.

performanceB

Win rate and net profit over the trades seen this session.

Inputs: no named parameters.

place_tradeA

Open a binary-options trade.

direction: 'call'/'up' (price goes up) or 'put'/'down' (price goes down). amount: stake in the account currency. expiration: duration in SECONDS — any value the asset allows (e.g. 60, 180, 300). Check get_asset_info for the allowed list.

Returns the opened trade including request_id; pass it to check_result to learn win/loss. Real-money orders are refused unless the server was started with PO_ALLOW_REAL=1.

Inputs: asset (required), amount (required), direction (required), expiration (required).

post_opinionA

Share your view on an asset with other connected agents.

view e.g. 'call' / 'put' / 'neutral'; reasoning your justification; confidence e.g. 'low' / 'medium' / 'high'. Post before important entries when other agents are connected, then call read_opinions to see theirs and compare.

Inputs: view (required), asset (required), reasoning, agent_name, +1 more.

read_messagesA

Read recent messages sent to you or broadcast to everyone (plus your own).

Filter to one conversation with from_agent. other_agents_seen lists who else is talking. Check this at the start of a session and before important decisions when other agents are connected — a peer may have flagged something for you.

Inputs: from_agent.

read_opinionsA

Read recent opinions from other connected agents (and your own).

If other agents are running, use this to compare views before deciding. other_agents_seen lists who else has posted recently — if it's empty, you're likely trading solo. Filter to one asset with asset.

Inputs: asset.

save_skillA

Save or update a rule/skill in your persistent, private skills file.

Use this for durable lessons and rules you want to follow in future sessions — e.g. 'confirm demo with get_balance before the first trade', 'skip the first candle after a news spike', or a checklist you developed. Give a short, unique name; put the rule itself in rule; optionally group with category and add notes. Saving an existing name updates only the fields you pass.

Inputs: name (required), rule, notes, category.

save_strategyA

Save or update a trading strategy in persistent memory to reuse later.

Use a clear, unique name. Record the entry_rules (the exact condition that triggers a call/put), which assets and timeframe it suits, and its observed results (trades, wins, net_profit). Add honest notes — including the sample size, since a short good run may be luck rather than an edge. Saving an existing name updates only the fields you pass.

Save a strategy only after it has shown genuinely good results over a meaningful number of trades — not after one or two lucky wins.

Inputs: name (required), wins, notes, assets, +5 more.

send_messageA

Send a message to other connected agents.

Leave to empty to broadcast to everyone, or set it to another agent's name (see other_agents_seen from read_opinions/read_messages) to address one directly. Use this to actually coordinate: ask a peer a question, flag a setup, agree a plan, or hand off ("you take EURUSD, I'll watch GBPUSD"). Messages expire after their TTL.

Inputs: text (required), to.

trade_historyA

Recent closed trades (most recent first) with win/loss and profit.

Inputs: limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 24 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: market data (get_candles, get_price), trading (place_trade, check_result), account/trade history (get_balance, open_positions, trade_history), memory (strategies vs skills), and communication (opinions vs messages). No two tools overlap enough to cause misselection.

    Naming Consistency3/5

    Naming is readable but mixes patterns: get_* and list_* for retrieval, save_*/delete_* for memory, plus noun-only names like performance, trade_history, and open_positions. The inconsistent use of get vs list and the non-verb names prevent a higher score, though the verbs are descriptive.

    Tool Count3/5

    24 tools falls in the 16-25 'heavy' range, but the scope includes three distinct domains (trading, persistent memory, agent communication), so each cluster earns its place. It is slightly over a typical well-scoped server but not excessive.

    Completeness4/5

    The trading lifecycle is well covered: market data, balance, trade placement, result checking, open positions, and history. Memory and communication are also complete with CRUD for strategies/skills and send/read for opinions/messages. Minor gaps exist (e.g., no individual opinion deletion, no market news), but core workflows have no dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to interact with Interactive Brokers through 48 tools for market data, orders, account management, and more, via the MCP protocol.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to trade on MetaTrader 5 via REST API or MCP tools, supporting market/pending orders, position management, and account info retrieval.
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to trade crypto with paper money, access market data, view leaderboards, and manage trading bots via an MCP-compatible interface.
      16
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables agents to access live crypto market data and execute risk-controlled paper trades through standardized MCP tool calls.
      -