Skip to main content
Glama
jakemo007

MCP Trading Agent

by jakemo007

MCP Trading Agent v3.0 — ICT / SMC + News Sentiment

====================================================

A production-ready MCP server that exposes 13 market.

data, news, backtesting, and persistence

The agent learns from backtests.

applies those rules to live analysis to compound its edge over time.

Quick Start

-----------

1. Install dependencies:

pip install -r requirements.txt

2. Run the server (stdio transport for Claude Desktop / Claude Code):

python server.py

3. Run with HTTP transport (for MCP Inspector / web):

set MCP_TRANSPORT=streamable-http

python server.py

4. Test with the MCP Inspector:

npx -y @modelcontextprotocolinspector

# Then connect to http://localhost:8000/mcp

Claude Desktop Integration

-----------------------------

Add this to your Claude Desktop config (~/.claude/config.json):

{

"mcpServers": {

"trading-agent": {

"command": "python",

"args": ["C:\Github\ai-company\mcp-trading-agent\server.py"]

}

}

}

Project Structure

-----------------

mcp-trading-agent/

├── server.py # MCP tool 13 registration + entry point

├── config.py # ServerConfig dataclass (v2.0.0)

├── system_prompt.py # New v2 persona – 7 command workflows

├── CLAUDE.md # Claude Code가 자동 로드 (위와 동일)

├── requirements.txt # mcp[cli], yfinance, ddgs, pandas, numpy

├── README.md # 이 파일

├── v2_upgrade_walkhrough.md # 아키텍처 및 회전 문서

├── tools/

│ ├── market_data.py # OHLCV, 리쿠디티, 백테스트,

│ │ # 분봉 백테스트, MTF 조회, 브이크아웃 스 등 7가 사함수

│ ├── news.py # fetch_market_news (DuckDuckGo / ddgs)

│ ├── r-risk_reward.py # get_risk_to_reward_setup

│ └── persistence.py # HTML report, lessons.md CRUD,

│ # sync_trading_knowledge (SHA-256 dedup)

└── data/ # Persistent state (auto-created on first run)

├── lessons.md # Knowledge base – rules learned from backtests

├── lessons.hashes # SHA-256 fingerprints for dedup sidecar

└── reports/ # HTML analysis reports (30 days old auto-purge)

All 13 MCP Tools

------------------------------

v1 — Original (5 tools)

┌────────────────────────────────┬───────────────────────────────────┐

│ Tool │ Purpose │

├────────────────────────────────┼───────────────────────────────────┤

│ get_daily_ohlc │ 일봉 OHLCV 켔들 (기본 60일) │

│ get_intraday_ohlc │ 분봉 켔들 (1m/5m/15m/30m/60m) │

│ identify_liquidity_pools │ 스윈 고점/저점 감지 (BSL / SSL) │

│ fetch_market_news │ DuckDuckGo news search (기본 바이어스) │

│ get_risk_to_reward\set │ RR ratio + quality verdict │

└───...───┴──...───┘

v2 ─ Stateful — True/Backtest (6 tools)

┌────────────────────────────┬───────────────────────────┐

│ 도구 │ 용도 │

├─────────────────────────────┼────────────────────────┤

│ get_historical_backtest_data │ 확장된 OHLCV (10~500일) + 스윈 플래그 │

│ run_intraday_backtest │ 자동 SMC 스: sweep+VSC, RR>=3, 보조 │

│ manage_html_report │ HTML 저장 + 열기 + 30일 자동 정삼 │

│ read_lesons_learnned │ lessons.md 지식 베이스 읽기 │

│ update_lassons_learned │ lessons.md에 자유 형식 인사이트 추가 │

│ sync_trading_knowledges │ SHA-256 dedup + structured 규칙 저장 │

└───────────────┴──...────┘

v3 ─ Breakout Scanner (2 tools)

┌───────────────────────┬──...──┐

│ 도구 │ 용● │

├──...─────┼────...──┤

│ get_multi_timeframe_data │ 월봉 + 주봉 + 일봉 OHLCV 1회로 한 번에 조회 │

│ scan_for_breakout │ 1-10 score in M/W/D │

└───────────────────────────┴──...───┘

Agent Commands (plain-text, command not slash)

————————————

Command Data Source

────────────────────────┼──...──┐

backtest [ticker] [days] get_historical_backtest_data

backtest intraday [ticker][days][intv] run_intraday_backtest

analyze [ticker] get_daily_ohlc + liq돔? 등

entry [ticker] (rs run analyze silently first)

intrada [ticker] get_intraday_ohlc — 1:3 RR gate

view [ticker] get_daily_ohlc — macro

breakout [ticker or list] get_ractmult_{\timeframe}_data +

scan_for_breakout

Example session:

backtest intraday NIFTY 60 15m

→ 자동 SMC 스캔, JPF curve HTML, 규칙이 lessons.md에서 저장

intraday NIFTY

→ 자동 15m analysis with 1:3 RR gate, HTML report 자동 오픈

breakout BTC, GOLD

→ WO/D/M 정렬 matrix, 신뢰도 스코, 트리거 prices

analyze AAPL

→ analysis floor + technical confluence, HTML report

entry AAPL

→ 콰팩트 카드: feeentry / SL / target / RR/ verdict

Breakout Scoring — scan_for_breakout

————————

Scoring breakdown (max 10 points):

(3 pts full und Month) is:

— price] EMA 2 week on Weekly

7. 3

-1–3 pts a high (since):

B∕/

年 etc...

#" /Score: 8

8–10 HIGH (high; when M and —-— both W bull.

5–4 LOW (no)

트리거 가@g = 현재 가 위최 최근을 일봉 BSL.

Supported Ticker Aliases

————————

NIFTY → ^NSEL ,. BANKNIFTY → ^NSEBANK, S→NSEX → ^BSESN, SPX → ^GPC, SPC → ^GSPC,

# QQQQZ,, # HARD:

SPC → SPC ; QC → QQ; DXY → DX-Y.NYB,

GOLD → GC=F, OIL → CL=F, BTC → BTC-USD, ETS35→ TH-USD

--- Intraday Backtest—— run_intay.l# Wait.

Intraday Backtest — What run_intradday_\backtest Returns

-----------------------------------------------------

Per–trade fields:

_\setup_type, direction, sweep.., the time, label,

etc.

— Hour,

swept_level, fvg_zone, entry, stop_loss, target,

check: ` LOSS or ON]

Aggregate stats

win_rate_pct, avg_rr, profit factor, max_drawdown_r,

expect_r, equi= curve (R–multiple list), session_breakekeep

session_breakdown key: ( Opening/Morning/Mثday/Art) even.

total, wins, losses, open trades, rate_pct

persistence – lessons.md is your knowledge base. lessons.md

is maintained sync session, gumb2 2

sync_trading knowledge uses SHA–중 fingerprint

stored in lessons.hashes — 중복 추방

HTML reports 30 days or older are auto-cleaned by manage

License: MIT

A
license - permissive license
Not graded
quality - not tested
C
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
    C
    quality
    D
    maintenance
    Provides AI agents with institutional-grade quantitative finance tools including real-time market data, paper trading via Alpaca, risk analysis with Monte Carlo simulations, backtesting, and multi-source news sentiment analysis for portfolio management and trading strategy development.
    31
    5
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to execute stock trading operations with built-in risk controls and human approval workflows. Supports paper trading simulation, real brokerage integration (Alpaca, Tradier), backtesting, sentiment analysis, and portfolio management while maintaining strict separation between AI intelligence and trade execution.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A quantitative trading analysis server that enables AI agents to screen stocks, analyze technical indicators, and generate professional candlestick charts. It also provides tools for aggregating financial news and extracting full article text for deep research.
    25
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Build, backtest, and deploy quantitative trading strategies from your AI agent.

  • Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.

  • Calibrated world model for AI agents. 40 tools: world state, markets, trading. Kalshi + Polymarket.

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/jakemo007/mcp-trading-agent'

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