longbridge-mcp

作者 longbridge已验证

AI skill: longbridge-mcp

7
Stars
1
Forks
Rust
语言
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/longbridge/longbridge-mcp

快速入门

使用 longbridge-mcp 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Longbridge

Longbridge MCP Server

ChatGPT App Claude Connector Official MCP Registry Smithery LobeHub longbridge-mcp MCP server License Longbridge

Official MCP server for the Longbridge brokerage. 163 tools across real-time quotes, options, order routing, fundamentals, analyst ratings, calendars, IPO, price alerts, DCA plans, grid trading, portfolio analytics and community sharelists — covering US and HK markets. Built with Rust using rmcp and axum.


Now live in ChatGPT and Claude

Longbridge is officially listed in the ChatGPT Apps directory and the Claude Connectors directory.
Talk to the markets in plain language — quotes, options, fundamentals, and your own portfolio —
with no config files to edit and no tokens to paste.

Add it in one placeThen just ask
ChatGPTSettings → Apps & Connectors → add Longbridge"How's NVDA trading today?" · "Show my HK positions"
ClaudeSettings → Connectors → add Longbridge (web · desktop · mobile)"Compare AAPL and MSFT valuations" · "Any IPOs this week?"

Sign in once with your Longbridge account. Every request runs over the same hosted, OAuth 2.1–secured endpoint documented below — read-only market data plus full account, portfolio, and trading tools, all gated by your own credentials.


Highlights

  • 163 tools, one endpoint — quotes, options, order routing, fundamentals, analyst research, screeners, IPO, alerts, DCA, grid trading and portfolio analytics across US and HK markets.
  • Stateless by design — every request forwards its Bearer token straight to the Longbridge SDK. No sessions, no database, nothing stored server-side.
  • OAuth 2.1, auto-discovered — RFC 9728 protected-resource and RFC 8414 authorization-server metadata; clients complete the flow with no token to paste.
  • Clean, typed responses — snake_case fields, RFC 3339 timestamps, human-readable symbols, and typed outputSchema descriptors for compatible clients.

Built in Rust with rmcp and axum.

Connect your own client

Longbridge runs a hosted endpoint at https://mcp.longbridge.com — point any MCP client at it and complete OAuth when prompted. Authorization is auto-discovered via RFC 9728; there is no token to paste.

Claude Code

claude mcp add --transport http longbridge https://mcp.longbridge.com

Claude Desktop — add to claude_desktop_config.json, then restart:

{ "mcpServers": { "longbridge": { "url": "https://mcp.longbridge.com" } } }

Cursor · Cline · Windsurf · Zed · other clients — point them at https://mcp.longbridge.com with transport streamable-http.

More Claude Code commands
# Local self-hosted instance (see Self-hosting below)
claude mcp add --transport http longbridge-local http://localhost:8000/mcp

claude mcp list                  # registered servers
claude mcp get longbridge        # config + auth status
claude mcp remove longbridge     # unregister
claude mcp logout longbridge     # re-trigger OAuth after revocation

On first use, the client reads the WWW-Authenticate challenge, fetches /.well-known/oauth-protected-resource (RFC 9728), and opens your browser for the Longbridge OAuth flow. Tokens are cached per session and refreshed automatically.

The 163 tools

Twenty categories spanning market data, trading, research and account management.

CategoryCountCoverage
Quote32Real-time and historical quotes, candlesticks, depth, brokers, options, warrants, watchlists, capital flow, market temperature, short positions, option volume
Fundamental33Financial statements/reports, business segments, institutional views, industry peers/valuation, dividends, EPS forecasts, valuations & valuation comparison, company info/executives, shareholders, corporate actions, operating metrics
Trade14Order submission/cancellation/replacement, positions, balance, executions, cash flow, margin
Market15Market status, industry/top-mover rank, broker holdings, A/H premium, trade statistics, anomalies, short trades/margin, index constituents
DCA9Dollar-cost averaging plan create/update/pause/resume/stop, execution history, statistics, support check
Grid11Grid trading order submit/replace/cancel/suspend/restart, list/detail/trigger-history reads, per-symbol setup info, one-time strategy consent
Sharelist8Community sharelist CRUD, member add/remove/sort, popular lists
IPO7IPO subscriptions, calendar, listed stocks, order detail, profit/loss analysis
Content7News list/detail, discussion topic CRUD and replies
Alert5Price alert CRUD (add, delete, enable, disable, list)
Screener5Stock screener search, indicators, strategy recommendation/management
Portfolio4Exchange rates, profit/loss analysis (summary, detail, realized)
ATM3Bank cards, withdrawal records, deposit records
Macrodata2Macroeconomic indicator list and detail
Search2News search, community topic search
Statement2Account statement listing and export
Calendar1Finance calendar (earnings, dividends, IPOs, macro data, closures)
Quant1Run a quant indicator script against historical K-line data
Authenticate1OAuth code exchange for clients that can't complete a browser redirect
Utility1Current UTC time

Self-hosting

Prefer your own instance? Run the published image:

docker run -p 8443:8443 \
  -v /path/to/certs:/certs:ro \
  ghcr.io/longbridge/longbridge-mcp \
  --bind 0.0.0.0:8443 \
  --base-url https://mcp.example.com \
  --tls-cert /certs/cert.pem \
  --tls-key /certs/key.pem

Set --base-url to your externally reachable URL on any public deployment — it is published in the OAuth metadata clients use to discover the authorization server. It defaults to http://localhost:{port}, which remote clients cannot use.

Or build from source: cargo build --release && ./target/release/longbridge-mcp.

Configuration & environment variables

Config lives at ~/.longbridge/mcp/config.json (override the directory with LONGBRIDGE_MCP_CONFIG_DIR). CLI flags take precedence. When tls_cert and tls_key are both set the server runs HTTPS, otherwise HTTP; base_url defaults to https://localhost:{port} with TLS or http://localhost:{port} without.

OptionConfig KeyCLI FlagDefaultDescription
Bind addressbind--bind127.0.0.1:8000HTTP server listen address
Base URLbase_url--base-urlautoPublic base URL for resource metadata
Log directorylog_dir--log-dir(stderr)Directory for rolling log files
TLS certificatetls_cert--tls-cert(none)PEM certificate file for HTTPS
TLS private keytls_key--tls-key(none)PEM private key file for HTTPS

Advanced environment variables — most deployments never touch these; they exist for non-production Longbridge environments and SDK debugging.

VariableDefaultDescription
LONGBRIDGE_MCP_CONFIG_DIR~/.longbridge/mcpConfig file directory
LONGBRIDGE_HTTP_URLhttps://openapi.longbridge.comLongbridge API base URL (also used for OAuth metadata)
LONGBRIDGE_PUBLIC_HOSTS(none)Comma-separated hostnames accepted from the edge-injected X-Host header; matching requests echo that host in the 401 challenge / RFC 9728 metadata. Unset = X-Host ignored
LONGBRIDGE_GLOBAL_OAUTH_URL(none)Authorization-server URL advertised to requests arriving via an allowlisted X-Host (global single-domain entry). Unset = fall back to LONGBRIDGE_HTTP_URL
LONGBRIDGE_QUOTE_WS_URLwss://openapi-quote.longbridge.com/v2Quote WebSocket endpoint
LONGBRIDGE_TRADE_WS_URLwss://openapi-trade.longbridge.com/v2Trade WebSocket endpoint
LONGBRIDGE_MCP_QUOTE_WS_IDLE_TTL_SECS600Idle seconds before a cached quote WebSocket context is evicted
LONGBRIDGE_MCP_QUOTE_WS_MAX_CONTEXTS1024Maximum cached quote WebSocket contexts per server process
LONGBRIDGE_MCP_LOG_PAYLOADS(unset)1 lifts the payload log caps (see below). Never set this in production
LONGBRIDGE_LOG_PATH(none)SDK internal log path. Leave unset in production — the SDK writes unfiltered request/response bodies there
Logging & customer data

MCP requests and responses carry customer data — cash balances, positions, order history — and upstream SDK frames carry access tokens. None of it belongs in a log file, so the server caps the log targets that would print it, independent of RUST_LOG:

TargetCapWhat it would otherwise print
longbridge_httpcliwarnOpenAPI request and full response bodies (INFO)
longbridge_wscliwarnEvery WebSocket frame, auth token included (INFO)
longbridge::tradewarnOrder push events (INFO)
rmcpinfoDecoded MCP requests and full tool results (DEBUG), raw JSON-RPC frames (TRACE)

So raising verbosity is safe: RUST_LOG=debug (or trace) gives you the server's own logs without leaking customer data. Two switches defeat this, both off by default — LONGBRIDGE_MCP_LOG_PAYLOADS=1 (removes the caps; use only against a test account locally) and LONGBRIDGE_LOG_PATH (makes the SDK write unfiltered bodies to that directory; the server warns at startup when set).

HTTP endpoints, authentication & metrics

The server expects a Longbridge OAuth access token in Authorization: Bearer <token>. On missing or invalid auth it returns 401 with a WWW-Authenticate header pointing to the protected-resource metadata, which directs clients to the Longbridge OAuth authorization server.

MethodPathDescription
GET/.well-known/oauth-protected-resourceProtected Resource Metadata (RFC 9728)
GET/.well-known/oauth-authorization-serverAuthorization Server Metadata (RFC 8414); advertises direct Longbridge authorize/register and proxied token/revoke endpoints
POST/oauth2/tokenOAuth token proxy; derives x-dc-region from the code/refresh token, defaulting to AP
POST/oauth2/revokeOAuth revocation proxy; derives x-dc-region from the token, defaulting to AP
GET/metricsPrometheus metrics
POST/GET/DELETE/mcpMCP Streamable HTTP endpoint (requires Bearer token)

Prometheus metrics: mcp_tool_calls_total (counter), mcp_tool_call_duration_seconds (histogram), and mcp_tool_call_errors_total (counter) — each labelled by tool_name.

Development

cargo +nightly fmt      # format
cargo clippy            # lint
cargo test              # test

License

Released under the MIT License.

常见问题

What is longbridge-mcp?

longbridge-mcp is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by longbridge. It has 7 GitHub stars.

Is longbridge-mcp safe to use?

Yes. longbridge-mcp passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install longbridge-mcp?

Clone the repository with "git clone https://github.com/longbridge/longbridge-mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is longbridge-mcp written in?

longbridge-mcp is primarily written in Rust. It is open-source under longbridge on GitHub, so you can review or fork the full source.

Are there alternatives to longbridge-mcp?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh longbridge-mcp against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情