diff --git a/docs/en/docs/cli.md b/docs/en/docs/cli.md index bf870656..8416a275 100644 --- a/docs/en/docs/cli.md +++ b/docs/en/docs/cli.md @@ -7,9 +7,9 @@ sidebar_icon: terminal id: cli --- -# Longbridge Terminal CLI +# Longbridge CLI -Longbridge Terminal is an AI-native CLI covering every Longbridge OpenAPI endpoint — real-time market data, account management, and trading. Designed for scripting, AI-agent tool-calling, and daily trading workflows from the terminal. +Longbridge CLI is an AI-native CLI tool covering every Longbridge OpenAPI endpoint — real-time market data, account management, and trading. Designed for scripting, AI-agent tool-calling, and daily trading workflows from the terminal. **GitHub:** [longbridge/longbridge-terminal](https://github.com/longbridge/longbridge-terminal) @@ -50,30 +50,37 @@ $ longbridge quote TSLA.US NVDA.US --format json ## Installation -**macOS** (requires [Homebrew](https://brew.sh)) + + ```bash brew install --cask longbridge/tap/longbridge-terminal ``` -**macOS / Linux** + + ```bash curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh ``` -**Windows** ([Scoop](https://scoop.sh)) + + ```powershell scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json ``` -**Windows** (PowerShell) + + ```powershell iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex ``` + + + Installs `longbridge` to `/usr/local/bin` (macOS/Linux) or `%LOCALAPPDATA%\Programs\longbridge` (Windows). On Windows the binary is `longbridge.exe`. After installation, authenticate and explore available commands: diff --git a/docs/en/docs/getting-started.md b/docs/en/docs/getting-started.md index 8492b505..3b5df6eb 100644 --- a/docs/en/docs/getting-started.md +++ b/docs/en/docs/getting-started.md @@ -34,29 +34,80 @@ All API response are used [Unix Timestamp](https://en.wikipedia.org/wiki/Unix_ti - + - + - + - + + + + +## CLI Quick Start + +If you don't need to write code, the [Longbridge CLI](/docs/cli) offers a lightweight alternative — install once, authorize via OAuth, no environment variables needed. + +### Installation + + + + +```bash +brew install --cask longbridge/tap/longbridge-terminal +``` + + + + +```bash +curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh +``` + + + + +```powershell +scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json +``` + + + + +```powershell +iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex +``` + +### Login + +```bash +longbridge login +``` + +The browser opens the authorization page automatically. The token is saved after approval — no need to repeat. + ## Install SDK :::warning Package Renamed diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md index bee2f6d6..737ab8b1 100644 --- a/docs/en/docs/index.md +++ b/docs/en/docs/index.md @@ -1,6 +1,6 @@ --- sidebar_position: -999 -title: Introduction +title: Platform Introduction id: getting_started_introduce sidebar_icon: book --- diff --git a/docs/en/docs/llm.md b/docs/en/docs/llm.md index 02612f44..5ae67d52 100644 --- a/docs/en/docs/llm.md +++ b/docs/en/docs/llm.md @@ -1,13 +1,13 @@ --- -sidebar_position: 2.2 +sidebar_position: 2.3 slug: /llm -sidebar_label: LLM +sidebar_label: LLMs sidebarCollapsed: true sidebar_icon: sparkles id: llm --- -# LLM Components +# LLMs Components We provide several components for LLMs (Large Language Models) that allow you to easily access and analyze financial data, real-time market data, and even enable AI to place orders. diff --git a/docs/en/docs/mcp.md b/docs/en/docs/mcp.md index 76ca88bc..08e5bdf8 100644 --- a/docs/en/docs/mcp.md +++ b/docs/en/docs/mcp.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 2.2 slug: /mcp sidebar_label: MCP sidebarCollapsed: true @@ -9,13 +9,16 @@ sidebar_icon: cpu # Longbridge MCP Service -Longbridge provides a hosted MCP (Model Context Protocol) service that lets you use Longbridge market data and account capabilities directly from AI coding assistants and chat tools — without managing API keys manually. +Longbridge provides a hosted HTTP MCP (Model Context Protocol) service that lets you use Longbridge market data and account capabilities directly from AI coding assistants and chat tools — without managing API keys manually. -**MCP endpoint:** `https://openapi.longbridge.com/mcp` +:::tip MCP endpoint +- Global: `https://openapi.longbridge.com/mcp` +- Mainland China: `https://openapi.longbridge.cn/mcp` (faster access) +::: ## Prerequisites -- An active Longbridge account with onboarding completed +- An active Longbridge account with onboarding completed, or a paper trading account - An AI client that supports MCP OAuth 2.1 (see compatibility note below) ## Available capabilities @@ -34,7 +37,34 @@ Actual tool availability varies by region, account level, and granted scopes. > Configuration format may vary across client versions. Treat your client's official MCP documentation as the source of truth. The core parameter you need is the server URL below. -In any MCP-capable client, add Longbridge as a remote MCP server: +### Claude Code + +Run the following command in your terminal: + +```bash +claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp +``` + +Then open the `claude` terminal interface, type `/mcp`, select `longbridge`, and choose **Authenticate** to complete the OAuth authorization flow. + +### Codex + +1. Click **Settings** (bottom right) → **MCP Servers** → **Add Server** +2. In the "Connect to a custom MCP" screen, fill in: + - Name: `longbridge` + - Type: **Streamable HTTP** + - URL: `https://openapi.longbridge.com/mcp` + - Leave all other fields empty +3. Click **Save** +4. Back in the MCP Servers list, click **Authenticate** on the `longbridge` entry to complete OAuth authorization + +### Cursor + +Settings → MCP Servers → Add Remote MCP Server, then enter the URL above. + +### Zed + +Add the following to your `settings.json` under the `context_servers` key (key name is customizable): ```json { @@ -46,15 +76,9 @@ In any MCP-capable client, add Longbridge as a remote MCP server: } ``` -Where to find the MCP configuration entry in each client: - -- **Cursor**: Settings → MCP Servers → Add Remote MCP Server -- **Claude Code**: MCP config file or the `claude mcp add` command -- **ChatGPT**: Settings → Connectors (or the workspace MCP configuration entry) -- **Zed**: `context_servers` key in `settings.json` (key name is customizable) -- **Cherry Studio**: Settings → MCP Servers → Add +### Cherry Studio -After saving the configuration, the client will guide you through the OAuth authorization flow automatically. +Settings → MCP Servers → Add, then enter the URL above. ## OAuth authorization flow diff --git a/docs/en/docs/qa/general.md b/docs/en/docs/qa/general.md index 5b4d4d8b..d75271f7 100644 --- a/docs/en/docs/qa/general.md +++ b/docs/en/docs/qa/general.md @@ -47,7 +47,7 @@ The platform offers two ways to access stock data without writing any code: **CLI (Command-line Tool)** -Install the [Longbridge Terminal CLI](/docs/cli) and query market data with simple commands — no programming required: +Install the [Longbridge CLI](/docs/cli) and query market data with simple commands — no programming required: ```bash longbridge quote AAPL.US TSLA.US diff --git a/docs/en/docs/qa/trade.md b/docs/en/docs/qa/trade.md index 576556fc..a5574347 100644 --- a/docs/en/docs/qa/trade.md +++ b/docs/en/docs/qa/trade.md @@ -31,7 +31,7 @@ After placing orders via the OpenAPI, you can view them through any of the follo - **Order inquiry API**: Call the API to query real-time order status - **WebSocket push**: Subscribe to trade push events to receive order updates in real time -- **CLI**: Use the [Longbridge Terminal CLI](/docs/cli) to query from the command line, e.g. `longbridge orders` +- **CLI**: Use the [Longbridge CLI](/docs/cli) to query from the command line, e.g. `longbridge orders` - **App / PC**: View orders and their statuses directly in the terminal products ## Q7: How can I know if my account has sufficient funds for trading? diff --git a/docs/zh-CN/docs/cli.md b/docs/zh-CN/docs/cli.md index ccd8147b..f811e17c 100644 --- a/docs/zh-CN/docs/cli.md +++ b/docs/zh-CN/docs/cli.md @@ -7,9 +7,9 @@ id: cli sidebar_icon: terminal --- -# Longbridge Terminal CLI +# Longbridge CLI -Longbridge Terminal 是一款 AI-native 命令行工具,覆盖全部 Longbridge Developers 端点,支持实时行情、账户管理与交易操作。专为脚本自动化、AI 代理工具调用及日常终端交易工作流设计。 +Longbridge CLI 是一款 AI-native 命令行工具,覆盖全部 Longbridge Developers 端点,支持实时行情、账户管理与交易操作。专为脚本自动化、AI 代理工具调用及日常终端交易工作流设计。 **GitHub:** [longbridge/longbridge-terminal](https://github.com/longbridge/longbridge-terminal) @@ -50,30 +50,37 @@ $ longbridge quote TSLA.US NVDA.US --format json ## 安装 -**macOS**(需要 [Homebrew](https://brew.sh)) + + ```bash brew install --cask longbridge/tap/longbridge-terminal ``` -**macOS / Linux** + + ```bash curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh ``` -**Windows**([Scoop](https://scoop.sh)) + + ```powershell scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json ``` -**Windows**(PowerShell) + + ```powershell iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex ``` + + + 安装完成后,`longbridge` 二进制文件位于 `/usr/local/bin`(macOS/Linux)或 `%LOCALAPPDATA%\Programs\longbridge`(Windows),Windows 下可执行文件名为 `longbridge.exe`。 安装完成后,完成登录并查看可用命令: diff --git a/docs/zh-CN/docs/getting-started.md b/docs/zh-CN/docs/getting-started.md index d61e035e..f3f30da7 100644 --- a/docs/zh-CN/docs/getting-started.md +++ b/docs/zh-CN/docs/getting-started.md @@ -34,29 +34,39 @@ SDK 会自动选择接入点;若判断不正确,可设置环境变量 `LONGB -
  • Python 3
  • -
  • Pip
  • +
    -
  • Node.js
  • -
  • Yarn
  • +
    -
  • Rust
  • +
    -
  • JDK
  • -
  • Maven
  • +
    -
  • Go
  • -
  • Go Docs
  • +
    ## CLI 快速入门 -如果你不需要写代码,[Longbridge Terminal CLI](/docs/cli) 提供更轻量的接入方式——安装即用,OAuth 一键授权,无需配置环境变量。 +如果你不需要写代码,[Longbridge CLI](/docs/cli) 提供更轻量的接入方式——安装即用,OAuth 一键授权,无需配置环境变量。 ### 安装 @@ -72,6 +82,20 @@ brew install --cask longbridge/tap/longbridge-terminal ```bash curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh +``` + + + + +```powershell +scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json +``` + + + + +```powershell +iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex ``` @@ -406,17 +430,17 @@ OAuth Token 应安全存储在应用程序中(如加密文件、安全密钥 **其他环境变量:** -| 名称 | 说明 | -| ---------------------------------- | --------------------------------------------------------------------- | -| `LONGBRIDGE_LANGUAGE` | 语言标识,`zh-CN`、`zh-HK` 或 `en`(默认:`en`) | -| `LONGBRIDGE_HTTP_URL` | HTTP 接口地址(默认:`https://openapi.longbridge.com`) | -| `LONGBRIDGE_QUOTE_WS_URL` | 行情 WebSocket 地址(默认:`wss://openapi-quote.longbridge.com/v2`) | -| `LONGBRIDGE_TRADE_WS_URL` | 交易 WebSocket 地址(默认:`wss://openapi-trade.longbridge.com/v2`) | -| `LONGBRIDGE_REGION` | 覆盖接入点;SDK 会按网络自动选择,若判断不正确可设置(如 `cn`、`hk`) | +| 名称 | 说明 | +| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `LONGBRIDGE_LANGUAGE` | 语言标识,`zh-CN`、`zh-HK` 或 `en`(默认:`en`) | +| `LONGBRIDGE_HTTP_URL` | HTTP 接口地址(默认:`https://openapi.longbridge.com`) | +| `LONGBRIDGE_QUOTE_WS_URL` | 行情 WebSocket 地址(默认:`wss://openapi-quote.longbridge.com/v2`) | +| `LONGBRIDGE_TRADE_WS_URL` | 交易 WebSocket 地址(默认:`wss://openapi-trade.longbridge.com/v2`) | +| `LONGBRIDGE_REGION` | 覆盖接入点;SDK 会按网络自动选择,若判断不正确可设置(如 `cn`、`hk`) | | `LONGBRIDGE_ENABLE_OVERNIGHT` | 是否开启夜盘行情,`true` 或 `false`(默认:`false`);需在 App 行情商店购买「LV1 实时行情 (OpenAPI)」行情卡,仅支持美股 | -| `LONGBRIDGE_PUSH_CANDLESTICK_MODE` | K 线推送模式,`realtime` 或 `confirmed`(默认:`realtime`) | -| `LONGBRIDGE_PRINT_QUOTE_PACKAGES` | 连接时是否打印行情包,`true` 或 `false`(默认:`true`) | -| `LONGBRIDGE_LOG_PATH` | 日志文件路径(默认:不写日志) | +| `LONGBRIDGE_PUSH_CANDLESTICK_MODE` | K 线推送模式,`realtime` 或 `confirmed`(默认:`realtime`) | +| `LONGBRIDGE_PRINT_QUOTE_PACKAGES` | 连接时是否打印行情包,`true` 或 `false`(默认:`true`) | +| `LONGBRIDGE_LOG_PATH` | 日志文件路径(默认:不写日志) | :::info SDK 同时支持旧版 `LONGPORT_*` 环境变量名以保持兼容。 diff --git a/docs/zh-CN/docs/index.md b/docs/zh-CN/docs/index.md index e10ce777..6ec03440 100644 --- a/docs/zh-CN/docs/index.md +++ b/docs/zh-CN/docs/index.md @@ -1,6 +1,6 @@ --- sidebar_position: -999 -title: OpenAPI 介绍 +title: 平台介绍 id: getting_started_introduce sidebar_icon: book --- diff --git a/docs/zh-CN/docs/llm.md b/docs/zh-CN/docs/llm.md index fbbba540..8e6704a9 100644 --- a/docs/zh-CN/docs/llm.md +++ b/docs/zh-CN/docs/llm.md @@ -1,13 +1,13 @@ --- -sidebar_position: 2.2 +sidebar_position: 2.3 slug: /llm -sidebar_label: LLM +sidebar_label: LLMs sidebarCollapsed: true id: llm sidebar_icon: sparkles --- -# LLM 组件 +# LLMs 组件 我们提供了一些用于 LLM(大型语言模型)的组件,您可以轻松访问和分析金融数据、实时市场数据,甚至可以让 AI 提交订单。 diff --git a/docs/zh-CN/docs/mcp.md b/docs/zh-CN/docs/mcp.md index bfcf2364..9435adad 100644 --- a/docs/zh-CN/docs/mcp.md +++ b/docs/zh-CN/docs/mcp.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 2.2 slug: /mcp sidebar_label: MCP sidebarCollapsed: true @@ -9,13 +9,16 @@ sidebar_icon: cpu # Longbridge MCP 服务 -Longbridge 提供托管的 MCP(Model Context Protocol)服务,让你在 AI 编程助手或对话工具中直接使用 Longbridge 的行情与账户能力,无需手动管理 API 密钥。 +Longbridge 提供托管的 HTTP MCP(Model Context Protocol)服务,让你在 AI 编程助手或对话工具中直接使用 Longbridge 的行情与账户能力,无需手动管理 API 密钥。 -**MCP 服务地址:** `https://openapi.longbridge.com/mcp` +:::tip MCP 服务地址 +- 全球:`https://openapi.longbridge.com/mcp` +- 中国大陆:`https://openapi.longbridge.cn/mcp`(访问更快) +::: ## 前置条件 -- 已拥有 Longbridge 账户并完成开户 +- 已拥有 Longbridge 账户并完成开户,或开通模拟账户 - 使用支持 MCP OAuth 2.1 的 AI 客户端(见下方兼容性说明) ## 可用能力 @@ -34,7 +37,34 @@ Longbridge 提供托管的 MCP(Model Context Protocol)服务,让你在 AI > 各客户端的 MCP 配置格式可能随版本变更,以客户端官方文档为准。以下提供核心配置参数。 -在支持 MCP 的客户端中,以 Remote MCP Server 方式添加如下配置: +### Claude Code + +在终端运行以下命令: + +```bash +claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp +``` + +然后进入 `claude` 终端界面,输入 `/mcp`,选择 `longbridge`,再选择 **Authenticate** 跟随流程完成 OAuth 授权。 + +### Codex + +1. 点击右下角 **Settings** → **MCP Servers** → **Add Server** +2. 在 "Connect to a custom MCP" 界面填写: + - Name:`longbridge` + - 类型:**Streamable HTTP** + - URL:`https://openapi.longbridge.com/mcp` + - 其他字段留空 +3. 点击 **Save** +4. 回到 MCP Servers 列表,点击 `longbridge` 条目上的 **Authenticate** 完成 OAuth 授权 + +### Cursor + +Settings → MCP Servers → 添加 Remote MCP Server,填入上方地址即可。 + +### Zed + +在 `settings.json` 的 `context_servers` 字段(key 名称可自定义)中添加: ```json { @@ -46,15 +76,9 @@ Longbridge 提供托管的 MCP(Model Context Protocol)服务,让你在 AI } ``` -各主流客户端的配置入口: - -- **Cursor**:Settings → MCP Servers → 添加 Remote MCP Server -- **Claude Code**:MCP 配置文件或 `claude mcp add` 命令 -- **ChatGPT**:Settings → Connectors(或工作区 MCP 配置入口) -- **Zed**:`settings.json` 中的 `context_servers` 字段(key 名称可自定义) -- **Cherry Studio**:设置 → MCP 服务器 → 添加 +### Cherry Studio -配置完成后,客户端会自动引导你完成 OAuth 授权流程。 +设置 → MCP 服务器 → 添加,填入上方地址即可。 ## OAuth 授权流程 diff --git a/docs/zh-CN/docs/qa/general.md b/docs/zh-CN/docs/qa/general.md index bafb374c..e2300ae3 100644 --- a/docs/zh-CN/docs/qa/general.md +++ b/docs/zh-CN/docs/qa/general.md @@ -47,7 +47,7 @@ sidebar_position: 0 **CLI(命令行工具)** -安装 [Longbridge Terminal CLI](/docs/cli),通过简单命令即可查询行情数据,无需编写任何代码: +安装 [Longbridge CLI](/docs/cli),通过简单命令即可查询行情数据,无需编写任何代码: ```bash longbridge quote AAPL.US TSLA.US diff --git a/docs/zh-CN/docs/qa/trade.md b/docs/zh-CN/docs/qa/trade.md index cb612d79..d095c39b 100644 --- a/docs/zh-CN/docs/qa/trade.md +++ b/docs/zh-CN/docs/qa/trade.md @@ -31,7 +31,7 @@ sidebar_position: 2 - **订单查询接口**:调用 API 查询订单实时状态 - **WebSocket 推送**:订阅交易推送,实时接收订单更新 -- **CLI**:通过 [Longbridge Terminal CLI](/docs/cli) 在命令行查询,例如 `longbridge orders` +- **CLI**:通过 [Longbridge CLI](/docs/cli) 在命令行查询,例如 `longbridge orders` - **App / PC**:直接在终端产品中查看对应账户下的订单及其状态 ## Q7: 如何知道账户资金是否足够交易? diff --git a/docs/zh-HK/docs/cli.md b/docs/zh-HK/docs/cli.md index 23d8571b..9c755c4e 100644 --- a/docs/zh-HK/docs/cli.md +++ b/docs/zh-HK/docs/cli.md @@ -7,9 +7,9 @@ id: cli sidebar_icon: terminal --- -# Longbridge Terminal CLI +# Longbridge CLI -Longbridge Terminal 是一款 AI-native 命令列工具,涵蓋全部 Longbridge Developers 端點,支援即時行情、帳戶管理與交易操作。專為腳本自動化、AI 代理工具調用及日常終端交易工作流程設計。 +Longbridge CLI 是一款 AI-native 命令列工具,涵蓋全部 Longbridge Developers 端點,支援即時行情、帳戶管理與交易操作。專為腳本自動化、AI 代理工具調用及日常終端交易工作流程設計。 **GitHub:** [longbridge/longbridge-terminal](https://github.com/longbridge/longbridge-terminal) @@ -50,30 +50,37 @@ $ longbridge quote TSLA.US NVDA.US --format json ## 安裝 -**macOS**(需要 [Homebrew](https://brew.sh)) + + ```bash brew install --cask longbridge/tap/longbridge-terminal ``` -**macOS / Linux** + + ```bash curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh ``` -**Windows**([Scoop](https://scoop.sh)) + + ```powershell scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json ``` -**Windows**(PowerShell) + + ```powershell iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex ``` + + + 安裝完成後,`longbridge` 二進位檔案位於 `/usr/local/bin`(macOS/Linux)或 `%LOCALAPPDATA%\Programs\longbridge`(Windows),Windows 下可執行檔名為 `longbridge.exe`。 安裝完成後,完成登入並查看可用指令: diff --git a/docs/zh-HK/docs/getting-started.md b/docs/zh-HK/docs/getting-started.md index 3b9426e7..594d64fa 100644 --- a/docs/zh-HK/docs/getting-started.md +++ b/docs/zh-HK/docs/getting-started.md @@ -34,26 +34,81 @@ SDK 會自動選擇接入點;若判斷不正確,可設定環境變數 `LONGB -
  • Python 3
  • -
  • Pip
  • +
    -
  • Node.js
  • -
  • Yarn
  • +
    -
  • Rust
  • +
    -
  • JDK
  • -
  • Maven
  • +
    -
  • Go
  • -
  • Go Docs
  • +
    +## CLI 快速入門 + +如果你不需要寫程式,[Longbridge CLI](/docs/cli) 提供更輕量的接入方式——安裝即用,OAuth 一鍵授權,無需配置環境變數。 + +### 安裝 + + + + +```bash +brew install --cask longbridge/tap/longbridge-terminal +``` + + + + +```bash +curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh +``` + + + + +```powershell +scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json +``` + + + + +```powershell +iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex +``` + + + + +### 登入 + +```bash +longbridge login +``` + +瀏覽器會自動開啟授權頁面,完成後 Token 自動儲存,後續無需重複操作。 + ## 安裝 SDK :::warning 包名變更 diff --git a/docs/zh-HK/docs/index.md b/docs/zh-HK/docs/index.md index 5efbf8c9..d2d207ec 100644 --- a/docs/zh-HK/docs/index.md +++ b/docs/zh-HK/docs/index.md @@ -1,6 +1,6 @@ --- sidebar_position: -999 -title: OpenAPI 介紹 +title: 平台介紹 id: getting_started_introduce sidebar_icon: book --- diff --git a/docs/zh-HK/docs/llm.md b/docs/zh-HK/docs/llm.md index aba148d8..6ad4978a 100644 --- a/docs/zh-HK/docs/llm.md +++ b/docs/zh-HK/docs/llm.md @@ -1,13 +1,13 @@ --- -sidebar_position: 2.2 +sidebar_position: 2.3 slug: /llm -sidebar_label: LLM +sidebar_label: LLMs sidebarCollapsed: true id: llm sidebar_icon: sparkles --- -# LLM 組件 +# LLMs 組件 我們提供了一些用於 LLM(大型語言模型)的組件,您可以輕鬆訪問和分析金融數據、實時市場數據,甚至可以讓 AI 提交訂單。 diff --git a/docs/zh-HK/docs/mcp.md b/docs/zh-HK/docs/mcp.md index f33c31e0..9c444b9c 100644 --- a/docs/zh-HK/docs/mcp.md +++ b/docs/zh-HK/docs/mcp.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 2.2 slug: /mcp sidebar_label: MCP sidebarCollapsed: true @@ -9,13 +9,16 @@ sidebar_icon: cpu # Longbridge MCP 服務 -Longbridge 提供托管的 MCP(Model Context Protocol)服務,讓你在 AI 編程助手或對話工具中直接使用 Longbridge 的行情與帳戶能力,無需手動管理 API 金鑰。 +Longbridge 提供托管的 HTTP MCP(Model Context Protocol)服務,讓你在 AI 編程助手或對話工具中直接使用 Longbridge 的行情與帳戶能力,無需手動管理 API 金鑰。 -**MCP 服務地址:** `https://openapi.longbridge.com/mcp` +:::tip MCP 服務地址 +- 全球:`https://openapi.longbridge.com/mcp` +- 中國大陸:`https://openapi.longbridge.cn/mcp`(訪問更快) +::: ## 前置條件 -- 已擁有 Longbridge 帳戶並完成開戶 +- 已擁有 Longbridge 帳戶並完成開戶,或開通模擬帳戶 - 使用支援 MCP OAuth 2.1 的 AI 客戶端(見下方相容性說明) ## 可用能力 @@ -34,7 +37,34 @@ Longbridge 提供托管的 MCP(Model Context Protocol)服務,讓你在 AI > 各客戶端的 MCP 配置格式可能隨版本變更,以客戶端官方文件為準。以下提供核心配置參數。 -在支援 MCP 的客戶端中,以 Remote MCP Server 方式加入如下配置: +### Claude Code + +在終端執行以下命令: + +```bash +claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp +``` + +然後進入 `claude` 終端介面,輸入 `/mcp`,選擇 `longbridge`,再選擇 **Authenticate** 跟隨流程完成 OAuth 授權。 + +### Codex + +1. 點擊右下角 **Settings** → **MCP Servers** → **Add Server** +2. 在 "Connect to a custom MCP" 介面填寫: + - Name:`longbridge` + - 類型:**Streamable HTTP** + - URL:`https://openapi.longbridge.com/mcp` + - 其他欄位留空 +3. 點擊 **Save** +4. 回到 MCP Servers 列表,點擊 `longbridge` 條目上的 **Authenticate** 完成 OAuth 授權 + +### Cursor + +Settings → MCP Servers → 添加 Remote MCP Server,填入上方地址即可。 + +### Zed + +在 `settings.json` 的 `context_servers` 欄位(key 名稱可自訂)中加入: ```json { @@ -46,15 +76,9 @@ Longbridge 提供托管的 MCP(Model Context Protocol)服務,讓你在 AI } ``` -各主流客戶端的配置入口: - -- **Cursor**:Settings → MCP Servers → 添加 Remote MCP Server -- **Claude Code**:MCP 配置文件或 `claude mcp add` 命令 -- **ChatGPT**:Settings → Connectors(或工作區 MCP 配置入口) -- **Zed**:`settings.json` 中的 `context_servers` 欄位(key 名稱可自訂) -- **Cherry Studio**:設定 → MCP 伺服器 → 添加 +### Cherry Studio -配置完成後,客戶端會自動引導你完成 OAuth 授權流程。 +設定 → MCP 伺服器 → 添加,填入上方地址即可。 ## OAuth 授權流程 diff --git a/docs/zh-HK/docs/qa/general.md b/docs/zh-HK/docs/qa/general.md index 7ffbc154..7fab426e 100644 --- a/docs/zh-HK/docs/qa/general.md +++ b/docs/zh-HK/docs/qa/general.md @@ -47,7 +47,7 @@ sidebar_position: 0 **CLI(命令列工具)** -安裝 [Longbridge Terminal CLI](/docs/cli),透過簡單指令即可查詢行情數據,無需撰寫任何程式碼: +安裝 [Longbridge CLI](/docs/cli),透過簡單指令即可查詢行情數據,無需撰寫任何程式碼: ```bash longbridge quote AAPL.US TSLA.US diff --git a/docs/zh-HK/docs/qa/trade.md b/docs/zh-HK/docs/qa/trade.md index f6dc9f4a..0bead5d0 100644 --- a/docs/zh-HK/docs/qa/trade.md +++ b/docs/zh-HK/docs/qa/trade.md @@ -31,7 +31,7 @@ sidebar_position: 2 - **訂單查詢接口**:調用 API 查詢訂單即時狀態 - **WebSocket 推送**:訂閱交易推送,即時接收訂單更新 -- **CLI**:透過 [Longbridge Terminal CLI](/docs/cli) 在命令列查詢,例如 `longbridge orders` +- **CLI**:透過 [Longbridge CLI](/docs/cli) 在命令列查詢,例如 `longbridge orders` - **App / PC**:直接在終端產品中查看對應帳戶下的訂單及其狀態 ## Q7: 如何確定帳戶資金是否足夠進行交易?