oneqaz-trading-mcp
Provides AI agents with real-time financial market intelligence including regime detection, adaptive signals, macro context chains, and cross-market analysis for crypto, US, and Korean stocks.
README
oneqaz-trading-mcp
<!-- mcp-name: io.github.wnsod/oneqaz-trading-mcp -->
The context layer for financial AI.
Your AI agent shouldn't just see prices — it should understand what regime the market is in, which signals are actually working right now, and how macro flows down to individual assets.
OneQAZ provides this as a single MCP endpoint. Crypto, US stocks, Korean stocks. 1,100+ symbols. 24/7 live.
Keywords: MCP, trading, signals, market analysis, regime, portfolio, sentiment, technical analysis, crypto, stocks, Fear & Greed, cross-market, Claude, model context protocol
Why OneQAZ
Financial data APIs are everywhere. Market intelligence is not.
| Typical financial MCP | OneQAZ | |
|---|---|---|
| Price / OHLCV data | ✅ | ✅ |
| Technical indicators | ✅ | ✅ |
| Regime detection (trending / ranging / volatile) | ❌ | ✅ |
| Self-correcting signals (weighted by real outcomes) | ❌ | ✅ |
| Macro → ETF → Individual context chain | ❌ | ✅ |
| Live 24/7 cloud API | ❌ | ✅ |
Signal weights are adjusted continuously based on actual trade outcomes
per regime via Thompson Sampling — not static indicator thresholds.
Every response includes an _llm_summary field optimized for AI consumption.
What your AI gets
- Regime detection: Is the market trending, ranging, or volatile? Per-market and global
- Self-correcting signals: 1,100+ symbols scored by Thompson Sampling on actual trade outcomes
- Macro context chain: Global regime → bonds/forex/VIX/commodities → ETF/basket → individual symbol
- External context: News events, fundamentals, cross-market correlation — pre-processed for LLM consumption
- 19 Resources + 4 Tools: Stateless HTTP, compatible with any MCP client
_llm_summaryon every response: Human-readable text summary optimized for AI agent context windows
Market Coverage
| Market | Exchange | Universe | Symbols |
|---|---|---|---|
| Crypto | Bithumb | All listed pairs | ~440+ |
| Korean Stocks | KOSPI/KOSDAQ | KOSPI 200 | ~200 |
| US Stocks | NYSE/NASDAQ | S&P 500 | ~500 |
All symbols are monitored 24/7 with automated signal generation, regime detection, and virtual trading.
Quick Start
Option 1: Live API — no install needed
Real-time data, updated every minute.
{
"mcpServers": {
"oneqaz-trading": {
"url": "https://api.oneqaz.com/mcp"
}
}
}
Ask Claude: "What's the current market regime?"
Option 2: Local (demo data)
pip install oneqaz-trading-mcp
oneqaz-trading-mcp init # creates sample SQLite databases
oneqaz-trading-mcp serve # starts at http://localhost:8010
- Swagger UI:
http://localhost:8010/docs - MCP endpoint:
http://localhost:8010/mcp
Then connect from Claude:
{
"mcpServers": {
"oneqaz-trading": {
"url": "http://localhost:8010/mcp"
}
}
}
Use Cases
1. Give your AI agent market awareness
Connect OneQAZ and your agent understands market context without you building the pipeline:
# Your agent reads regime + signals + macro in one call
context = mcp.read("market://crypto/unified")
# Or go granular
regime = mcp.read("market://crypto/status") # what phase is the market in?
signals = mcp.call("get_signals", market_id="crypto", min_score=0.7) # what's working now?
macro = mcp.read("market://global/summary") # what's driving this from above?
# Feed to your agent's decision layer
prompt = f"""
Regime: {regime}
High-confidence signals: {signals}
Macro context: {macro}
Recommend portfolio action.
"""
2. Build a regime-aware trading system
Your AI reacts differently based on market state — no hardcoded rules:
regime = mcp.read("market://us_stock/status")
structure = mcp.read("market://us_stock/structure")
if regime["regime"]["stage"] == "volatile":
signals = mcp.call("get_signals", market_id="us_stock", action_filter="DEFENSIVE")
else:
signals = mcp.call("get_signals", market_id="us_stock", min_score=0.7)
3. Cross-market macro→micro analysis
Trace how macro shifts flow into individual assets:
# Macro layer
global_regime = mcp.read("market://global/summary")
bonds = mcp.read("market://global/category/bonds")
# Cross-market correlation
cross = mcp.read("market://unified/cross-market")
# Down to individual symbol with full context chain
symbol_ctx = mcp.read("market://us_stock/unified/symbol/NVDA")
4. Ask Claude directly
Already using Claude? Just connect and ask:
"What's the current market regime for crypto?"
"Show me the best performing positions in US stocks"
"Any macro risks I should know about?"
"Compare crypto vs US stock conditions"
Sample Response
Reading market://crypto/status returns:
{
"market_id": "crypto",
"regime": {
"stage": "sideways_bullish",
"score": 0.42,
"confidence": 0.78
},
"positions": {
"total": 5,
"long": 4,
"short": 1,
"avg_roi": 3.2
},
"signals_24h": {
"buy": 8,
"sell": 3,
"hold": 12,
"avg_score": 0.65
},
"_llm_summary": "Crypto market is sideways_bullish. 5 active positions (avg ROI +3.2%). 8 BUY signals in last 24h."
}
Configuration
All configuration is via environment variables:
| Variable | Default | Description |
|---|---|---|
MCP_SERVER_PORT |
8010 |
Server port |
MCP_SERVER_HOST |
0.0.0.0 |
Bind host |
MCP_LOG_LEVEL |
INFO |
Log level |
DATA_ROOT |
Auto-detect | Root directory for all data |
MCP_COIN_DATA_DIR |
{DATA_ROOT}/market/coin_market/data_storage |
Crypto data directory |
MCP_KR_DATA_DIR |
{DATA_ROOT}/market/kr_market/data_storage |
KR stock data directory |
MCP_US_DATA_DIR |
{DATA_ROOT}/market/us_market/data_storage |
US stock data directory |
MCP_EXTERNAL_CONTEXT_DATA_DIR |
{DATA_ROOT}/external_context/data_storage |
External context directory |
MCP_GLOBAL_REGIME_DATA_DIR |
{DATA_ROOT}/market/global_regime/data_storage |
Global regime directory |
Resources
| Resource URI | Description |
|---|---|
market://health |
Server health check |
market://global/summary |
Global macro regime summary |
market://global/category/{category} |
Per-category analysis (bonds, commodities, forex, vix, credit, liquidity, inflation) |
market://global/categories |
Available categories list |
market://structure/all |
All markets ETF/basket structure |
market://{market_id}/structure |
Per-market structure analysis |
market://{market_id}/status |
Market status (regime, positions, performance) |
market://{market_id}/positions/snapshot |
Current positions snapshot |
market://all/summary |
All markets combined summary |
market://indicators/fear-greed |
Fear & Greed Index |
market://indicators/context |
Combined market context |
market://{market_id}/signals/summary |
Signal summary (24h aggregation) |
market://{market_id}/signals/feedback |
Signal pattern feedback |
market://{market_id}/signals/roles |
Role-based signal summary |
market://{market_id}/external/summary |
External context (news, events, fundamentals) |
market://{market_id}/external/symbol/{symbol} |
Per-symbol external context |
market://{market_id}/unified/symbol/{symbol} |
Unified technical + external context |
market://{market_id}/unified |
Market-level unified context |
market://unified/cross-market |
Cross-market pattern analysis |
Market IDs: crypto, kr_stock, us_stock (aliases: coin, kr, us)
Tools
| Tool | Parameters | Description |
|---|---|---|
get_trade_history |
market_id, limit, action_filter, min_pnl, max_pnl, hours_back | Query trade history with filters |
get_positions |
market_id, min_roi, max_roi, strategy, sort_by, sort_order, limit | Query open positions |
get_signals |
market_id, symbol, min_score, max_score, action_filter, interval | Query trading signals |
get_latest_decisions |
market_id, limit, decision_filter, hours_back | Query recent trading decisions |
Docker
docker build -t oneqaz-trading-mcp .
docker run -p 8010:8010 oneqaz-trading-mcp
Data Directory Structure
{DATA_ROOT}/
├── market/
│ ├── global_regime/data_storage/
│ │ ├── global_regime_summary.json
│ │ └── {bonds,commodities,forex,vix,...}_analysis.db
│ ├── coin_market/data_storage/
│ │ ├── trading_system.db
│ │ ├── signals/{symbol}_signal.db
│ │ └── regime/market_structure_summary.json
│ ├── kr_market/data_storage/ (same structure)
│ └── us_market/data_storage/ (same structure)
└── external_context/data_storage/
├── coin_market/external_context.db
├── kr_market/external_context.db
└── us_market/external_context.db
Rate Limits
The live API (api.oneqaz.com/mcp) has rate limits to ensure fair usage:
| Limit | Value | Description |
|---|---|---|
| Daily quota | 1,500 requests/IP | Resets every 24 hours |
| Burst limit | 30 requests/min/IP | Prevents overloading |
What this means:
- Monitor 2-3 symbols all day: ~500-800 requests → no problem
- Scan entire market once: ~1,200-1,500 requests → fits in daily quota
- Exceeding limits returns HTTP 429 with
Retry-Afterheader
Response headers on every request:
X-RateLimit-Daily-Remaining: requests left todayX-RateLimit-Minute-Remaining: requests left this minute
Local self-hosted servers (localhost) have no rate limits.
Disclaimer
This software is provided for informational and educational purposes only. It is not financial advice.
- All signals, regime analysis, and market data are generated by automated systems and may contain errors.
- Past performance does not guarantee future results.
- You are solely responsible for your own investment decisions. The authors and contributors are not liable for any financial losses incurred from using this software.
- This is not a registered investment advisor, broker-dealer, or financial planner.
- Always do your own research (DYOR) before making any investment decisions.
By using this software, you acknowledge that you understand and accept these terms.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。