thai-chart-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@thai-chart-mcpdraw a weekly chart for TOP with stop loss levels at 70 and 66"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
thai-chart-mcp
MCP server เล็ก ๆ ที่ วาดกราฟรายสัปดาห์ของหุ้นไทยแล้วส่งเป็นภาพให้ Claude ดู — เพื่อให้ Claude ทำ technical analysis ได้โดยไม่ต้องให้คุณแคปหน้าจอเองทุกครั้ง
ทำไมไม่ใช่ TradingView MCP
สั้น ๆ คือ ใช้ TradingView ไม่ได้ และไม่จำเป็นต้องใช้
TradingView ไม่มี public API สำหรับดึงภาพกราฟ — ที่มีคือ widget embed ซึ่งไว้ฝังในเว็บ ไม่ใช่ไว้ให้โปรแกรมดึงภาพ
การ scrape หน้าเว็บเขาผิด ToS — เซิร์ฟเวอร์ที่สร้างบนฐานนั้นจะพังเมื่อไรก็ได้ และไม่ควรสร้างตั้งแต่แรก
สิ่งที่ต้องการจริง ๆ ไม่ใช่ "ภาพจาก TradingView" แต่คือ "กราฟรายสัปดาห์ที่ถูกต้อง" — ซึ่งสร้างเองได้จากข้อมูลราคา
ตัวนี้เลยดึง ข้อมูลราคา OHLCV จากแหล่งที่เปิดให้ใช้ แล้ว วาดกราฟเอง ด้วย mplfinance
ข้อดีที่ได้มาฟรี ๆ จากการวาดเอง:
คุมได้เองว่าจะใส่ MA เส้นไหน (ตั้งไว้ที่ 20 / 50 / 200 สัปดาห์ ตามที่ technical analysis ต้องการ)
ขีดเส้น stop loss ลงบนกราฟได้ — ส่ง
levels=[70, 66]แล้วเห็นเลยว่าราคาอยู่ตรงไหนเทียบจุดตัดขาดทุนได้ ตัวเลขจริง กลับมาพร้อมภาพ (ราคาอยู่เหนือ/ใต้ MA กี่ %, ช่วง 52 สัปดาห์, วอลุ่มเทียบค่าเฉลี่ย) → Claude ไม่ต้องเดาค่าจากการมองภาพ ซึ่งเป็นจุดที่ AI อ่านกราฟผิดบ่อยที่สุด
Related MCP server: Yahoo Finance MCP Server
ติดตั้ง — คำสั่งเดียว
ต้องมี Python 3.10 ขึ้นไป
cd /path/to/thai-chart-mcp
python3 install.pyสคริปต์จะทำให้ครบทั้ง 4 ขั้น: สร้าง .venv → ติดตั้ง library → ทดสอบว่าวาดกราฟได้จริง →
เพิ่ม thai-chart เข้า config ของ Claude Desktop
ปลอดภัยกับ config เดิม: สำรองไฟล์เก่าไว้ก่อนเสมอ (claude_desktop_config.backup-<วันเวลา>.json)
แก้เฉพาะคีย์ thai-chart MCP server ตัวอื่นที่มีอยู่แล้วไม่ถูกแตะ และรันซ้ำได้ไม่พัง
ตัวเลือก:
python3 install.py --no-config # ติดตั้งอย่างเดียว ไม่แตะ config
python3 install.py --print-config # แสดง config ที่ต้องใส่ แล้วจบ (ใส่เองด้วยมือ)เสร็จแล้ว ปิด Claude Desktop ให้สนิทแล้วเปิดใหม่ (ปิดแค่หน้าต่างไม่พอ — ต้อง Quit จริง ๆ)
ติดตั้งเองทีละขั้น (ถ้าไม่อยากใช้สคริปต์)
cd thai-chart-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python3 test_render.py # ได้ไฟล์ test_output.pngทดสอบว่าดึงข้อมูลจริงได้:
python3 -c "from server import _fetch_daily, to_weekly; print(to_weekly(_fetch_daily('TOP', 5)).tail())"ต่อกับ Claude
วิธีที่ 1 — รันบนเครื่องตัวเอง (แนะนำ)
เซิร์ฟเวอร์รันบนเครื่องคุณ ใช้เน็ตของคุณ และ Claude เรียกผ่าน Claude Desktop
แก้ไฟล์ config ของ Claude Desktop:
macOS —
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows —
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"thai-chart": {
"command": "/absolute/path/to/thai-chart-mcp/.venv/bin/python",
"args": ["/absolute/path/to/thai-chart-mcp/server.py"]
}
}
}⚠️ ต้องใส่ path เต็ม ทั้งสองช่อง และต้องเป็น python ใน
.venvไม่ใช่python3เฉย ๆ ไม่งั้นมันจะหา library ไม่เจอ — เป็นสาเหตุอันดับหนึ่งที่ MCP server ไม่ขึ้น
ปิดแล้วเปิด Claude Desktop ใหม่ → ควรเห็น thai-chart ในรายการเครื่องมือ
วิธีที่ 2 — self-host เป็น remote MCP
python3 server.py --http --host 0.0.0.0 --port 8000แล้วเพิ่มเป็น custom connector ที่ https://<โดเมนของคุณ>/mcp
⚠️ ถ้าเปิดออกอินเทอร์เน็ต ต้องมี reverse proxy + TLS + auth อย่างน้อยที่สุด อย่าเปิด port ตรง ๆ และจำไว้ว่าบางเครือข่ายบล็อกโดเมนที่ไม่อยู่ใน allowlist (ซึ่งเป็นสาเหตุที่ TradingView กับ settrade ต่อไม่ได้ตั้งแต่แรก)
เครื่องมือที่มี
weekly_chart(symbol, years=5, weeks_shown=160, levels=None)
วาดกราฟแท่งเทียนรายสัปดาห์ + MA 20/50/200 สัปดาห์ + วอลุ่ม คืน ภาพ PNG พร้อมสรุปตัวเลข
weekly_chart("TOP", levels=[70, 66])
weekly_chart("KKP", weeks_shown=100, levels=[105])weekly_table(symbol, weeks=30)
ตาราง OHLCV + MA รายสัปดาห์เป็นข้อความ — ใช้เมื่อต้องการตัวเลขแม่น ๆ แทนการอ่านจากภาพ
compare_closes(symbols, weeks=12)
เทียบราคาปิดรายสัปดาห์หลายตัวในตารางเดียว
compare_closes(["TOP", "OR", "KKP"], weeks=16)เรื่องชื่อย่อหุ้น
ประเภท | ใส่แบบนี้ | ระบบแปลงเป็น |
หุ้นไทย |
|
|
ดัชนี/ETF ต่างประเทศ |
| ใช้ตรง ๆ |
ข้อจำกัดที่ต้องรู้: DR อย่าง SP50001 ไม่มีบน Yahoo Finance — ถ้าอยากดูกราฟของสิ่งที่ DR ตัวนั้นอ้างอิง ให้ใช้ ^GSPC หรือ SPY แทน แล้วจำไว้ว่าราคา DR จริงจะต่างออกไปตามค่าเงินบาท
ข้อมูลจาก Yahoo Finance เป็นข้อมูลฟรี อาจมีคลาดเคลื่อนหรือล่าช้า — ก่อนส่งคำสั่งซื้อขายจริงให้ยึดราคาในแอปโบรกเกอร์เสมอ
ถ้าไม่ขึ้นใน Claude
อาการ | สาเหตุที่พบบ่อย |
ไม่เห็น server เลย | path ใน config ไม่ใช่ path เต็ม หรือชี้ไปที่ python นอก |
server ขึ้นแต่เรียกแล้ว error | ยังไม่ได้ |
| ชื่อย่อผิด หรือหลักทรัพย์นั้นไม่มีบน Yahoo (เช่น DR) |
| MCP SDK เวอร์ชัน 2 — โค้ดรองรับแล้วทั้งสองรุ่น ถ้ายังเจอให้ |
กราฟออกมาแต่เส้น MA200 หาย | ข้อมูลไม่ถึง 200 สัปดาห์ → เพิ่ม |
เครื่องมือนี้แสดงข้อมูลราคาในอดีตเพื่อประกอบการวิเคราะห์เท่านั้น ไม่ใช่คำแนะนำการลงทุน
บันทึกการแก้ไข
v1.1
แก้บั๊ก
weekly_chartใช้งานไม่ได้บน MCP SDK 2.x — SDK รุ่นใหม่ serialize ออบเจกต์Imageที่อยู่ใน list ไม่ได้ (PydanticSerializationError) ทำให้เครื่องมือนี้ error ทุกครั้งขณะที่weekly_tableทำงานปกติ → แปลงเป็นImageContentก่อนส่ง (ยัง fallback ให้ SDK 1.x)เตือนเมื่อแท่งสุดท้ายยังไม่ปิดสัปดาห์ — เช่น ดูวันอังคาร แท่ง "สัปดาห์นี้" มีแค่ 2 วันทำการ ถ้าเอาไปใช้เป็น "ราคาปิดรายสัปดาห์" ตัดสินใจเรื่อง stop จะผิด ตอนนี้สรุปตัวเลขจะขึ้น ⚠️ บอกให้เอง
This server cannot be deployed
Maintenance
Related MCP Connectors
Your investing research inside Claude: watchlists, financial ratios, reverse-DCF valuations, investment theses, notes, portfolio, earnings calendar and news for the companies you follow. 70 read and write tools; ask what's on your morning desk, rank a watchlist by ROE, log a trade or save a thesis. OAuth sign-in. Free to start.
Claude, ChatGPT, Grok or Perplexity: draw on live charts, backtest and trade on your own broker
The full TraderMatrix market-data connector for Claude, Cursor and any MCP client. 51 tools: scored and tiered unusual options activity, dealer gamma (GEX), Apex levels and gamma pockets, IV rank, sector flow, dark-pool net-notional rollups, market health and macro regime, gap-continuation and breakout signals, wheel and CSP screeners, a one-call ticker snapshot, and your own watchlists. Needs a TraderMatrix API key (OAuth sign-in works for Claude web and mobile). A free, no-key connector with the gapper scanner and Market Health tools is listed separately as TraderMatrix Free.
> TradingMCP puts a market analyst inside your AI assistant. Paste one URL into Claude, ChatGPT, Cursor, VS Code or any MCP client and ask in plain language: screen for breakouts, run a multi-timeframe analysis, backtest a strategy with walk-forward validation, scan for smart-money and volume signals, or get a one-prompt morning market brief. In clients that support MCP Apps, price charts and the Markets panel are drawn right in the chat. > 40+ tools covering crypto (real-time), stocks, ETFs, FX, futures and commodities across major global exchanges. > Hosted, nothing to install: Pro $9/month (2,500 tool calls) or Pro+ $29/month (10,000). Paid upfront with a 14-day money-back guarantee; your API key arrives right after checkout. > Built on the open-source tradingview-mcp core (MIT, ~5k GitHub stars): self-host it free, or use the hosted version with zero ops. > For research and education, not financial advice. Not affiliated with TradingView
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides technical analysis for Korean and US stocks through natural language queries. Enables users to analyze stock charts, search for tickers, and access technical indicators like RSI and MACD within Claude Desktop and other MCP clients.8-
- AlicenseAqualityDmaintenanceProvides real-time stock quotes, market indices, historical data, and financial visualizations from Yahoo Finance without API keys, enabling users to analyze and visualize market data through Claude.39 npm1MIT
- FlicenseNot gradedqualityDmaintenanceProvides Indonesian stock (IDX) analysis tools for Claude Code, enabling real-time stock data, technical and fundamental analysis, and buy/sell recommendations.4-
- FlicenseNot gradedqualityCmaintenanceProvides Claude with free stock-market data including quotes, fundamentals, history, news, index top-10 rankings, market movers, and penny-stock screens using public sources like Yahoo Finance and Wikipedia. No API keys or subscriptions required.-