pocket-option-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
pocket-option-mcp
MCP (Model Context Protocol) server that connects Claude Code to a live Pocket Option trading bot. Read real-time market data, analyze strategy performance, and enqueue trades — all from a Claude conversation.
How It Works
The bot (pocket-option-bot.js) runs in the background, intercepts Pocket Option WebSocket data via Puppeteer/CDP, builds OHLC candles, calculates indicators, generates signals, and executes trades by clicking the DOM. It writes everything to a local SQLite database.
This MCP server is fully self-contained — it owns its own database (data/mcp.db) for any writes, and only reads from the bot's database. The bot's DB is never modified by this server.
Claude Code ←→ pocket-option-mcp (MCP stdio)
│
┌─────────┴────────────────┐
│ │
bot-db.js mcp-db.js
READONLY WRITABLE
(bot's trading_data.db) (data/mcp.db — owned by MCP)
│ │
└──────────┬───────────────┘
│
pocket-option-bot.js ←→ pocketoption.com
(Puppeteer + CDP)Trade execution flow:
po_trade → writes PENDING to mcp_orders in mcp.db → bot execution worker reads mcp_orders → clicks CALL/PUT on the Pocket Option page → updates status to EXECUTED → result sync writes WIN/LOSS back to mcp_orders
Related MCP server: tradingview-mcp
Prerequisites
Node.js 18+
pocket-option-bot.jsA valid Pocket Option account (the bot handles browser login)
Installation
git clone https://github.com/bambabaa/pocket-option-mcp
cd pocket-option-mcp
npm installBot DB path
Both databases live inside this repo under data/:
pocket-option-mcp/
└── data/
├── trading_data.db ← bot writes here, MCP reads here
└── mcp.db ← MCP writes here, bot reads hereConfigure pocket-option-bot.js to write to pocket-option-mcp/data/trading_data.db:
// In pocket-option-bot.js, update the database path:
const database = new TradingDatabase('/path/to/pocket-option-mcp/data/trading_data.db');Configuration
Add to ~/.claude/settings.json — no env vars needed:
{
"mcpServers": {
"pocket-option": {
"command": "node",
"args": ["/path/to/pocket-option-mcp/src/server.js"]
}
}
}Env var | Default | Description |
|
| Override bot DB path only if needed |
|
| Override MCP DB path only if needed |
Quick Start
Once Claude Code is restarted with the MCP server registered:
po_health # confirm both DBs accessible, check bot liveness
po_tracked_assets # see what assets are live
po_prices # latest price for all assets
po_signals # recent CALL/PUT signals from 8GSR strategy
po_rolling_summary days=0 # all-time P/L
po_trade asset=EURUSD_otc direction=PUT # enqueue a manual trade
po_mcp_orders # check your manual order statusTools (47)
Health & Market State
Tool | Description |
| Check both DBs (bot + MCP) and bot liveness. Call this first. |
| Active assets, signal rate, today P/L, top assets |
| List all assets the bot has candle data for |
| Latest price for one asset, or all assets if omitted |
Market Data (reads bot DB — readonly)
Tool | Description |
| OHLC bars. Use |
| Tick-level price history over a time window |
| Latest MA6/14, RSI-5, BB, Stochastic K/D v2, Keltner, Schaff values |
| CALL/PUT signals from the 8GSR pipeline (STC_CALL_8GSR / STC_PUT_8GSR) |
| Signals past expiry with no validation outcome yet |
Intelligence — Agentic One-Call Tools
Tool | Description |
| Score all assets by indicator alignment — price, signal, streak, WR, ranked |
| "What should I trade?" — ranked picks filtered by precision + WR + bias |
| Pre-trade audit → score 0-100 + GOOD/CAUTION/RISKY/AVOID |
| Per-asset CALL vs PUT WR history. Flags preferred direction and flat assets. |
| Rank assets by BB width bps — find flat/pegged assets to block |
Analysis & Backtesting
Tool | Description |
| Full candle replay — fires 8GSR gates bar-by-bar, validates at 60s AND 120s |
| Reconstruct all gate values for a specific historical signal |
| Win rate breakdown across 17 dimensions + z_score/p_value/wilson_95ci + cross-validation |
| A/B test: baseline vs modified thresholds side-by-side |
| Multivariate search: tests all parameter combinations, ranked by 120s WR |
| Rolling N-fold WR validation — STABLE/MODERATE/UNSTABLE verdict across time |
| Maps coincidence score (0-5) → actual WR → Kelly sizing multiplier |
| Per-gate margin analysis on losses — identifies the leaky gate |
| 2D WR heatmap for any two dimensions — finds winning combinations |
| Legacy single-parameter grid search |
| Binomial test + Wilson CI + Kelly fraction per slice |
Trade Execution
Tool | Description | DB |
| Enqueue a manual CALL or PUT. Bot picks it up on its next cycle. | writes MCP DB |
| Cancel a PENDING manual order before it executes | writes MCP DB |
| View manual orders placed via | reads MCP DB |
| View bot-generated execution queue | reads bot DB |
Results & Performance (reads bot DB — readonly)
Tool | Description |
| Executed live trades with WIN/LOSS results |
| P/L breakdown by asset |
| Win rate + P/L. |
| Daily performance table |
| Trade distribution and P/L by hour of day (descriptive — OTC has no sessions) |
Asset Analytics
Tool | Description |
| What drives wins/losses per asset: STC zone, RSI, direction, BB width breakdown |
| Current win/loss streak per asset |
| Rank assets by consecutive wins |
| Signal validation history — entry/exit price, WIN/LOSS |
| Trade outcomes per asset |
| Aggregate win rate from validation history |
Asset Controls
Tool | Description |
| Block an asset — bot skips all orders for it |
| Remove an active block |
| Block all assets with current BB < 5 bps at session start |
| Check one asset for auto-block conditions |
Multi-Agent Pipeline
Tool | Description |
| Full 4-bar indicator + candle + signal snapshot (for Analyst agent) |
| GO/PAUSE/STOP verdict: today P/L, consecutive losses, bot liveness |
| Write an agent decision to the audit trail |
| Read full agent decision history |
Architecture
src/
├── server.js MCP server entry point — 43 tools registered
├── connection.js Dual-DB: bot-db (READONLY) + mcp-db (writable)
├── core/
│ ├── health.js Check both DBs + bot liveness
│ ├── data.js Candles, prices, indicators, signals
│ ├── analysis.js Replay engine, find_edge, simulate, grid_search
│ ├── intelligence.js scan_all, recommend, risk_check, asset_bias
│ ├── agent-tools.js signal_context, drawdown_check, session_log, blocks
│ ├── orders.js Bot orders + MCP orders + P/L
│ ├── performance.js Daily records, rolling summary
│ ├── assets.js Asset analytics, streaks, outcomes
│ └── validation.js Pending signals, validation stats
└── tools/ One file per tool group
data/
├── trading_data.db Bot writes (READONLY to MCP)
└── mcp.db MCP writes — orders, blocks, agent logsDatabase Isolation
Table | Location | Who writes | Who reads |
| bot DB | bot |
|
| bot DB | bot |
|
| bot DB | bot |
|
| bot DB | bot |
|
| bot DB | bot |
|
| bot DB | bot |
|
| MCP DB | MCP server |
|
| MCP DB | MCP server | bot (checks before every order) |
| MCP DB | MCP server |
|
The MCP server has zero write access to the bot's database.
Documentation
Doc | Description |
Full CLI reference — every command, flag, and jq pattern | |
Exact JSON output shape for every tool and command |
Disclaimer
This tool is for personal use with your own Pocket Option account. It does not bypass any authentication, paywall, or security control. Ensure your usage complies with Pocket Option's Terms of Service. Binary options trading carries significant financial risk — use at your own discretion.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Trade Tradovate prop firm accounts from Claude or ChatGPT, every order checked against your rules.
Trade Robinhood through natural language in Claude Code.
Connects AI agents to cTrader account and market data with read-only access.
Connect Claude or Cursor to your LogToLast futures & forex trading journal and playbook rules.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude AI to perform forex trading operations and market data analysis through MetaTrader 5, including order placement, position management, and multi-timeframe candle data retrieval.16MIT
- FlicenseNot gradedqualityDmaintenanceConnects Claude Code to your local TradingView Desktop app via Chrome DevTools Protocol, enabling AI-assisted chart analysis, Pine Script development, and workflow automation.-
- FlicenseNot gradedqualityCmaintenanceConnects Claude Code to a locally running TradingView Desktop app via Chrome DevTools Protocol, enabling AI-assisted chart navigation, Pine Script development, drawing, alerts, replay, and screenshots through natural language.88 npm-
- AlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to connect to MetaTrader 5 for historical and live market data, account inspection, backtesting, and order management with token-based two-step confirmation and safety limits.MIT