Skip to Content

Longbridge Skill Installation Guide

Once installed, you can say things like this to your AI assistant and get real answers:

  • "Screen US and HK stocks: market cap above $50B, P/E below 25, recent MACD golden cross — ranked by market cap"
  • "NVDA just reported — compare actuals vs analyst estimates, break down revenue by segment, and check if valuation is reasonable"
  • "Set a trailing stop on TSLA: trigger a sell if it drops more than 8%, show me the order details before executing"
  • "Review my portfolio this month: P&L trend, biggest winner, worst drag, US vs HK allocation"
  • "Based on my 5-year long-term DCA plan, I'm due to buy this month's QQQ and SPY within the next two days. Can you check the recent market conditions and let me know if the timing looks reasonable?"

How it works

Longbridge Skill gives your AI assistant knowledge of what the longbridge CLI can do. To actually fetch live data or execute trades, the AI needs one of two capabilities:

  • Shell execution — the AI runs longbridge commands directly in a terminal
  • MCP integration — the AI connects to the Longbridge MCP server over the network

Method 1 — Install the CLI

For AI tools that can execute shell commands (Claude Code, Codex, Gemini CLI, Warp, etc.).

Install the CLI:

bash
# macOS (requires Homebrew — install at https://brew.sh if not already installed)
brew install --cask longbridge/tap/longbridge-terminal

# macOS / Linux
curl -sSL https://github.com/longbridge/longbridge-terminal/raw/main/install | sh

Windows (Scoop):

powershell
scoop install https://github.com/longbridge/longbridge-terminal/raw/refs/heads/main/.scoop/longbridge.json

Windows (PowerShell):

powershell
iwr https://github.com/longbridge/longbridge-terminal/raw/main/install.ps1 | iex

Connect your Longbridge account:

bash
longbridge login

That's it. The AI can now call longbridge commands on your behalf.

See the CLI reference for the full command list and installation details.

OpenClaw handles installation differently — send this message in chat and it takes care of everything:

Install the Longbridge Developers Skill from this zip file: https://open.longbridge.com/skill/longbridge.zip

Method 2 — Connect the MCP server

For AI tools that support MCP (Claude Desktop, Cursor, Zed, Gemini CLI, Warp, etc.).

Add the following as a remote MCP server in your AI tool:

https://openapi.longbridge.com/mcp

Where to find the MCP configuration in each client:

ClientWhere to configure
Claude DesktopEdit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
CursorSettings → MCP Servers → Add Remote MCP Server
Zedcontext_servers key in ~/.config/zed/settings.json
Gemini CLImcpServers key in ~/.gemini/settings.json
WarpSettings → AI → MCP Servers → Add

The first time you ask a Longbridge question, your client will open a browser tab for OAuth authorization — no API key required.


Why Claude.ai and ChatGPT.com don't work

Claude.ai (web) and ChatGPT.com (web) are browser-based interfaces with no access to your local system. They cannot run shell commands or connect to external MCP servers, so the Skill has no way to fetch live market data or execute trades.

If you use Claude, install Claude Desktop and use the MCP method above.


Verify installation

After installing, ask your AI assistant:

Use Longbridge to get the current quote for AAPL

If it returns live data, you're all set.

Tip: If the Skill isn't triggered automatically, prefix your request with /longbridge to force it — for example: /longbridge get the current quote for AAPL.


Troubleshooting

AI says it can't find the Longbridge tool

Some clients require a restart or a new conversation to load the Skill. Confirm the installation is complete, then try again in a new session.

Prompted for authorization when querying data

Run longbridge login in your terminal and complete the OAuth flow — no API Key required.

Trading operations not working

Confirm your account has OpenAPI trading permissions enabled and is eligible to trade in the target market (HK / US).

Revoking Authorization

To revoke access, go to your Longbridge account → Security Settings → manage authorized apps.