MCP Trading for Vietnam Securities Market
This server acts as a local trading bridge for DNSE, SSI, and TCBS, allowing you to execute stock market operations securely from an AI client.
Manage accounts and sessions: Connect to brokers, request, and submit One-Time Passwords (OTP) to open trading sessions.
Monitor market status: Check bridge connection status, view accounts, current balances, held positions, and open order books.
Execute trades: Place (Buy/Sell) and cancel stock orders.
Security: All sensitive API keys and signatures are handled locally on your machine.
mcp-trading
English: Local MCP server (stdio) for trading Vietnamese stocks on DNSE, SSI and TCBS from Claude or any MCP client. Broker API keys stay on your machine (
~/.algolab, chmod 600) and requests are signed locally from your own IP. 9 tools:bridge_status,get_broker_accounts,get_broker_balance,get_broker_positions,get_broker_orders,request_broker_otp,submit_broker_otp,place_broker_order,cancel_broker_order. Orders are always two-step (preview → explicit confirm). Link a broker withnpx -y mcp-trading link, then addnpx -y -p mcp-trading mcp-trading-serverto your MCP client. For Vietnamese market data (prices, financials, broker research, macro) use the hosted Algolab MCP. License: MIT.
MCP server chạy trên máy bạn để giao dịch chứng khoán Việt Nam (DNSE · SSI · TCBS) ngay trong Claude Code / Claude Desktop — khoá API nằm nguyên trên máy bạn:
Khoá lưu tại
~/.algolab/mcp-broker.json(chmod 600) — không đi qua chat AI, không qua server bên thứ ba.Ký/gọi request local từ chính IP của bạn — không cần relay/VPN (DNSE HMAC V2, TCBS JWT, SSI V3 OAuth).
Phạm vi: DNSE · SSI · TCBS đều đầy đủ (đọc + đặt/huỷ lệnh, ký/gửi local). SSI ký lệnh bằng keypair sinh trên máy bạn — dán public key vào iBoard một lần.
Lệnh tiền luôn 2 bước: AI chỉ nhận bản xem trước, bạn xác nhận rõ ràng thì lệnh mới được gửi.
Không cần tài khoản npm hay GitHub để dùng — chỉ cần Node.js ≥ 18, chạy bằng npx (gói mcp-trading trên npm).
Cách 1 — cài nhanh bằng npx (khuyên dùng)
Liên kết CTCK (chạy trong terminal của bạn — KHÔNG dán khoá vào chat AI):
npx -y mcp-trading link # hỏi chọn DNSE / SSI / TCBS rồi nhập khoá
npx -y mcp-trading link dnse # API Key + Secret (webtrading DNSE → LightSpeed API) + email OTP
npx -y mcp-trading link ssi # ConsumerID + Secret + tiểu khoản; sinh keypair → dán public key iBoard
npx -y mcp-trading link tcbs # API Key iFlash (app TCInvest) — tiểu khoản tự phát hiện sau iOTP
npx -y mcp-trading status # xem trạng thái (không bao giờ in khoá)Khai báo với Claude Code — thêm vào ~/.claude.json:
{
"mcpServers": {
"mcp-trading": {
"command": "npx",
"args": ["-y", "-p", "mcp-trading", "mcp-trading-server"]
}
}
}Restart Claude — nhóm tool bridge_status, get_broker_*, place_broker_order… xuất hiện.
Related MCP server: CzechMedMCP
Cách 2 — cài thẳng từ GitHub
Thay mcp-trading bằng github:algolabx/mcp-trading trong mọi lệnh trên (VD npx -y github:algolabx/mcp-trading link).
Cách 3 — clone repo
git clone https://github.com/algolabx/mcp-trading.git && cd mcp-trading && npm install
node src/cli.js link dnse~/.claude.json: { "command": "node", "args": ["<đường-dẫn>/mcp-trading/src/index.js"] }.
Tool
Tool | Việc | Cần OTP? |
| Trạng thái liên kết cả 3 CTCK (không bao giờ in khoá) | — |
| Đọc tài khoản (tham số | DNSE: không · SSI: OTP 1 lần rồi tự refresh · TCBS: iOTP/8h |
| Mở phiên theo từng CTCK | — |
| Lệnh thật DNSE/TCBS, 2 bước xem trước → | Có |
An toàn
Không có tool nào nhận hay trả khoá — kênh duy nhất đưa khoá vào là CLI trên terminal của bạn.
Request đi thẳng máy bạn → CTCK qua HTTPS; bridge không gọi về bất kỳ máy chủ nào của Algolab.
Thu hồi bất kỳ lúc nào:
unlink dnse(xoá khỏi máy) và/hoặc thu hồi key tại CTCK (chết toàn cục).Test:
npm test(chữ ký HMAC, quyền file 600, chuẩn hoá chiều lệnh).
Nguồn
Bridge này là Tầng C của thiết kế bảo mật "Két Ba Tầng" của Algolab — xem tài liệu tại mcp.algolab.vn/trading. MIT License.
Available Tools
9 toolsbridge_statusARead-onlyIdempotent
Trạng thái bridge local: CTCK nào đã liên kết trên máy này, phiên nào còn hạn. Khoá KHÔNG bao giờ hiển thị; liên kết/thu hồi chỉ qua CLI mcp-trading trong terminal.
Inputs: no named parameters.
cancel_broker_orderADestructive
Huỷ một lệnh theo order_id (DNSE, SSI, TCBS). Cũng 2 bước: không confirm → preview; confirm=true mới gửi.
Inputs: order_id (required), broker, market, account, +1 more.
get_broker_accountsBRead-onlyIdempotent
Danh sách tiểu khoản tại một CTCK (gọi thẳng từ máy user).
Inputs: broker.
get_broker_balanceBRead-onlyIdempotent
Tiền mặt / sức mua của một tiểu khoản.
Inputs: broker, account.
get_broker_ordersCRead-onlyIdempotent
Sổ lệnh trong ngày của một tiểu khoản.
Inputs: broker, market, account.
get_broker_positionsCRead-onlyIdempotent
Danh mục đang nắm giữ của một tiểu khoản.
Inputs: broker, market, account.
place_broker_orderADestructive
Đặt lệnh THẬT (DNSE, SSI, TCBS — tất cả ký/gửi local). Nghi thức 2 bước bắt buộc: gọi lần đầu KHÔNG kèm confirm → trả preview, chưa gửi gì; đọc lại cho người dùng, CHỜ họ xác nhận rõ ràng rồi mới gọi lại với confirm=true. Không tự ý xác nhận thay.
Inputs: side (required), symbol (required), quantity (required), price, +5 more.
request_broker_otpA
Nhờ CTCK gửi OTP mở phiên. DNSE: OTP email (chỉ cần cho đặt/huỷ lệnh; có Smart OTP thì bỏ qua). SSI: gửi theo 2FA đã đăng ký — cần một lần cho cả đọc, sau đó refresh tự gia hạn. TCBS: không gửi gì — iOTP sinh trong app TCInvest, nộp thẳng submit_broker_otp.
Inputs: email, broker.
submit_broker_otpADestructive
Nộp OTP mở phiên. DNSE: trading token 8h (smart_otp=true nếu mã từ app). SSI: mở access+refresh token (đọc dùng được ngay, tự gia hạn). TCBS: JWT 8h + bridge tự phát hiện tiểu khoản.
Inputs: otp, broker, smart_otp, transaction_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct operation: placing/canceling orders, retrieving accounts/balance/positions/orders, OTP request/submit, and bridge status. No overlapping purposes; descriptions are clear and mutually exclusive.
Most tools follow a consistent verb_noun pattern (get_broker_*, place_broker_order, cancel_broker_order, request_broker_otp, submit_broker_otp). The exception is 'bridge_status', which uses noun_verb but still communicates its purpose clearly; overall naming is predictable.
9 tools is well-scoped for a trading server covering order lifecycle, account queries, and authentication. Each tool earns its place without redundancy or unnecessary sprawl.
The set covers core trading workflows: placing, canceling, listing orders, viewing positions/balance/accounts, and OTP-based session management. Minor gaps exist (e.g., no modify order, no market data) but the essential operations for executing and monitoring trades are present.
Maintenance
Related MCP Connectors
Validated molecular biology tools: cloning, primers, CRISPR, Sanger, alignment, qPCR, phylogenetics
European Nucleotide Archive (ENA) — EMBL-EBI's public record of raw sequencing runs, assemblies…
Hosted DNA/RNA/protein tools: primers, oligos, PCR, cloning, CRISPR, alignment, batch & pipelines.
HLA nomenclature and match checks against a pinned IPD-IMGT/HLA release. No patient identifiers.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for searching research grants across NSF (US), ERC (EU), and KRF/NRF (Korea) via a unified interface. NIH excluded—covered by existing connectors.310 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server with 60 tools connecting AI assistants to Czech healthcare databases (SUKL, MKN-10, NRPZS) and global biomedical sources (PubMed, ClinicalTrials.gov, OpenFDA).2MIT
- FlicenseNot gradedqualityBmaintenanceBridges Codex with MiMoCode as a coding agent for planning, implementation, and review via MCP tools.-
- AlicenseNot gradedqualityDmaintenanceMCP server for foldkit, exposing 7-prime spine, 7 κ-bands, and 6 fold operations as tools and resources for fold-based state analysis and transformation.MIT