شعار TradingView MCP Server

TradingView MCP Server

المجتمع
jaipreet15

tradingview mcp that exposes tradingview market data, multi-exchange scanners and ai backtesting engine to AI assistants and tradingview mcp automation tools

الناشرjaipreet15
المستودعtradingview-mcp
اللغةTypeScript
التفريعات
206
النجوم
150
الأدوات المتاحة
0
نوع نقل البياناتstdio
الفئات
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح TradingView MCP Server إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 150، والنسخ المتفرعة: 206 في المستودع المرتبط.

TradingView MCP Server

A production-oriented Model Context Protocol server that exposes TradingView market data, multi-exchange screeners, technical analysis, sentiment, news, and a built-in backtesting engine to AI assistants and automation tools.

Disclaimer: Independent open-source project — not affiliated with TradingView Inc. Outputs are for research and education only, not financial advice.


Table of Contents


Feature Highlights

CapabilityDetails
Multi-exchange screenersCrypto, US equities, EGX, BIST, HKEX, SSE, TWSE, and more via static symbol lists + TradingView scanner API
Technical analysisBollinger ratings, RSI, multi-timeframe alignment, volume breakouts, candle patterns
Backtesting9 strategies with Sharpe, Calmar, walk-forward overfitting detection
Market intelligenceReddit sentiment, RSS financial news, Yahoo Finance quotes
ResilienceRetry/backoff, in-memory + optional distributed cache, structured error envelopes
MCP-native36 tools, stdio transport, works with Claude Desktop, Cursor, Copilot, and other MCP clients

Architecture

Layer responsibilities

  1. MCP router (src/server.ts) — validates inputs, delegates to services, returns JSON payloads.
  2. Services — domain logic with no MCP dependencies; independently testable.
  3. Screener provider — HTTP client with retry, jitter, throttling, and cache integration.
  4. Persistence — optional Redis-backed cache with graceful fallback to in-memory storage.

Workflows

Screener request flow

Combined analysis flow


Project Structure

tradingview-mcp/
├── src/
│   ├── index.ts              # CLI entry point
│   ├── server.ts             # MCP tool registration
│   ├── config/               # Environment validation (Zod)
│   ├── core/                 # Errors, shared types
│   ├── indicators/           # Pure indicator math + metrics
│   ├── persistence/          # Redis connection + cache store
│   ├── services/             # Domain services
│   │   ├── screener/         # TradingView scanner integration
│   │   ├── scanner/          # Volume breakout scanners
│   │   ├── backtest.ts       # Strategy backtesting
│   │   ├── yahoo-finance.ts  # Price quotes + OHLCV
│   │   ├── sentiment.ts      # Reddit analysis
│   │   ├── news.ts           # RSS aggregation
│   │   ├── egx.ts            # Egyptian Exchange tools
│   │   └── futures.ts        # Futures overview tools
│   ├── utils/                # Validators, HTTP, logging
│   └── data/coinlist/        # Per-exchange symbol lists
├── tests/unit/               # Vitest unit tests
├── docs/AUDIT.md             # Pre-migration audit notes
├── .env.example              # Configuration reference
├── package.json
├── tsconfig.json
└── tsup.config.ts

Design decisions:

  • Strict TypeScript — strict, noUnusedLocals, noUncheckedIndexedAccess enabled.
  • Service isolation — MCP layer contains zero business logic.
  • Cache abstraction — Redis is optional; server runs without it.
  • Structured errors — stable ErrorCode strings for programmatic handling.

Installation

Requirements

  • Node.js 18+
  • npm 9+
  • (Optional) Redis 6+ for distributed caching

Setup

bash
git clone https://github.com/your-org/tradingview-mcp.git
cd tradingview-mcp
npm install
npm run build

Claude Desktop

json
{
  "mcpServers": {
    "tradingview": {
      "command": "node",
      "args": ["D:/path/to/tradingview-mcp/dist/index.js"]
    }
  }
}

Cursor / VS Code MCP

Point your MCP configuration at the built dist/index.js binary. Restart the host after changes.

Docker (with Redis)

bash
docker compose up -d

Configuration

Copy .env.example to .env:

VariableDefaultDescription
LOG_LEVELinfoLogging verbosity
REDIS_ENABLEDfalseEnable distributed cache
REDIS_URL—Full Redis connection URL
REDIS_HOST127.0.0.1Redis host when URL not set
REDIS_PORT6379Redis port
REDIS_KEY_PREFIXtradingview-mcp:Key namespace prefix
TRADINGVIEW_MCP_CACHE_TTL60Fresh cache TTL (seconds)
TRADINGVIEW_MCP_STALE_TTL21600Stale fallback TTL (seconds)
TRADINGVIEW_MCP_RETRY_DELAYS1.0,4.0Retry backoff schedule
TRADINGVIEW_MCP_MAX_INFLIGHT2Concurrent TA request cap
PROXY_ENABLEDfalseEnable rotating HTTP proxy

See .env.example for the complete list.


Development

bash
# Watch mode
npm run dev

# Type check
npm run typecheck

# Lint
npm run lint

# Full validation pipeline
npm run validate

Adding a new MCP tool

  1. Implement logic in src/services/.
  2. Register the tool in src/server.ts with Zod parameter schema.
  3. Add unit tests under tests/unit/.
  4. Run npm run validate.

Testing

bash
npm test              # run once
npm run test:watch    # watch mode

Current coverage focuses on:

  • Structured error envelopes
  • Timeframe/exchange validators
  • Cache store behavior

Integration tests against live TradingView/Yahoo APIs are intentionally excluded to keep CI deterministic.


Troubleshooting

Empty screener results vs errors

SymptomMeaningAction
[] empty arrayNo symbols matched filters todayNormal — adjust filters
{"error":{"code":"ALL_BATCHES_FAILED"}}Upstream failureWait and retry; check network
Timeout messagesScanner slow or rate-limitedReduce batch size; enable cache

Redis connection failures

The server degrades gracefully — if Redis is unreachable at startup, in-memory caching is used automatically. Check REDIS_URL, firewall rules, and that Redis accepts connections.

Windows MCP timeout on first launch

Pre-build the project (npm run build) before configuring your MCP host so the server starts instantly:

bash
npm install && npm run build

Node version errors

Requires Node 18+. Verify with node --version.


Contributing

  1. Fork the repository and create a feature branch.
  2. Follow existing TypeScript conventions and strict compiler settings.
  3. Keep MCP handlers thin — put logic in services.
  4. Add tests for non-trivial changes.
  5. Run npm run validate before opening a PR.
  6. Write clear commit messages describing why, not just what.

FAQ

Does this require a TradingView account?
No. The server uses public scanner and chart endpoints. No login or API key is needed.

Can I run without Redis?
Yes. Set REDIS_ENABLED=false (default). Caching uses in-memory storage only.

Which exchanges are supported?
Any exchange with a symbol list in src/data/coinlist/ and a TradingView scanner market mapping in src/utils/validators.ts.

Are backtest results guaranteed?
No. Backtests use historical Yahoo Finance data with simulated costs. Past performance does not predict future results.

How do I handle rate limits?
Tune TRADINGVIEW_MCP_MAX_INFLIGHT, TRADINGVIEW_MCP_MIN_INTERVAL_S, and enable Redis caching to reduce duplicate upstream calls.

Is this financial advice?
No. This software is an informational tool. Consult a licensed professional before making financial decisions.


License

MIT — see LICENSE.

التثبيت

TypingMind
{
  "mcpServers": {
    "tradingview-mcp": {
      "command": "docker",
      "args": [
        "compose",
        "up",
        "-d"
      ]
    }
  }
}

استخدم MCP الخاص بـ TradingView MCP Server مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل TradingView MCP Server، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف TradingView MCP Server كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ TradingView MCP Server.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "tradingview-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "tradingview-mcp-server"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ TradingView MCP Server، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ TradingView MCP Server.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام TradingView MCP Server لمساعدتي في هذه المهمة؟
TradingView MCP Server
بالتأكيد. قرأته.
إليك ما وجدته باستخدام TradingView MCP Server.

الأسئلة الشائعة

ما استخدامات خادم MCP TradingView MCP Server؟

TradingView MCP Server هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP TradingView MCP Server مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام TradingView MCP Server مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP TradingView MCP Server مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل TradingView MCP Server، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP TradingView MCP Server بـ TypingMind؟

يعمل TradingView MCP Server عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP TradingView MCP Server في TypingMind؟

يتيح TradingView MCP Server إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP TradingView MCP Server؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان TradingView MCP Server يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇