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?"
The quickest way to get started is with a terminal-based AI tool — Claude Code, Codex, opencode, or OpenClaw. Install the CLI, authenticate once, and the AI runs longbridge commands on your behalf.
If you'd rather not install local software, connect via MCP instead — just add a URL to your AI tool's config.
Either way, also install the Skill: a set of instruction files that tells your AI what Longbridge can do and how to use it.
Step 1 — Connect to the Longbridge platform
CLI and MCP are both ways to access the Longbridge Developers platform. Pick one:
- CLI — best experience; the AI runs
longbridgecommands directly in your terminal; requires installing software on your system - MCP — easier to connect; just add a URL to your AI tool's config; no local install needed
Method A — CLI (recommended)
Works with Claude Code, Codex (Work locally), opencode, OpenClaw, Gemini CLI, Warp, and any tool that can run shell commands.
Install the CLI:
# macOS (requires Homebrew — install at https://brew.sh if not already installed)
brew install --cask longbridge/tap/longbridge-terminal
# macOS / Linux
curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | shWindows (Scoop):
scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.jsonWindows (PowerShell):
iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iexAuthenticate:
longbridge auth loginThat's it. The AI can now call longbridge commands on your behalf.
See the CLI reference for the full command list and installation details.
Method B — MCP
Works with Claude Desktop, Cursor, Zed, Gemini CLI, Warp, and any tool that supports MCP.
Add the following as a remote MCP server in your AI tool:
https://openapi.longbridge.com/mcpUsers in mainland China can use the accelerated endpoint:
https://openapi.longbridge.cn/mcp
Where to find the MCP configuration in each client:
| Client | Where to configure |
|---|---|
| Claude Desktop | Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) |
| Cursor | Settings → MCP Servers → Add Remote MCP Server |
| Zed | context_servers key in ~/.config/zed/settings.json |
| Gemini CLI | mcpServers key in ~/.gemini/settings.json |
| Warp | Settings → 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.
Step 2 — Install the Skill
The Skill is a set of instruction files that tell your AI assistant what Longbridge can do.
Via Claude Code plugin (recommended for Claude Code users):
In Claude Code, run these two commands:
/plugin marketplace add longbridge/skills
/plugin install longbridge@longbridge-skillsThis installs all Longbridge skills through the Claude Code plugin system and keeps them up to date automatically.
Via npx / bunx (global install):
# Node.js
npx skills add longbridge/skills -g
# Bun
bunx skills add longbridge/skills -gOr download the ZIP and install manually:
Download longbridge-all.zip and unzip it, then place the files in your AI tool's Skill directory (Claude Code: .claude/skills/, Cursor: paste into the Rules editor, other tools: see the README).
OpenClaw — send this message in chat and it handles everything automatically:
Install the Longbridge Developers Skill from this zip file:
https://open.longbridge.com/skill/longbridge-all.zipKnown restrictions by tool
Some environments have network whitelists or sandboxing that block CLI installation and MCP server connections. If things aren't working, check here first.
Claude Desktop — use the Code tab
Chat and Cowork modes in Claude Desktop have network restrictions that prevent CLI installation and MCP server connections. Do not try to install from either of these modes — it will not work no matter how many times you retry.
Switch to the Code tab in Claude Desktop (this is Claude Code embedded in the app). From the Code tab, you have full terminal access — you can install the CLI, connect MCP, and install the Skill all in one session.

Codex — select "Work locally"
Codex in Cloud mode has the same network whitelist restrictions. When starting a new session, select Work locally instead of Cloud. This gives the agent full access to your shell and network.

Claude.ai and ChatGPT.com (web)
Browser-based interfaces have no access to your local system. They cannot run shell commands or connect to external MCP servers.
For Claude, use Claude Desktop and switch to the Code tab.
Verify installation
After installing, ask your AI assistant:
Use Longbridge to get the current quote for AAPLIf it returns live data, you're all set.
Tip: If the Skill isn't triggered automatically, prefix your request with
/longbridgeto 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 auth login in your terminal and complete the OAuth flow.
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.