Skip to main content

longbridge-mcp

Python MCP server for Longbridge OpenAPI, designed to run with uvx.

Requirements

  • uv
  • Longbridge OpenAPI credentials using only the LONGBRIDGE_* prefix

Environment

Required:

  • LONGBRIDGE_APP_KEY
  • LONGBRIDGE_APP_SECRET
  • LONGBRIDGE_ACCESS_TOKEN

Optional Longbridge SDK passthrough:

  • LONGBRIDGE_LANGUAGE
  • LONGBRIDGE_HTTP_URL
  • LONGBRIDGE_QUOTE_WS_URL
  • LONGBRIDGE_TRADE_WS_URL
  • LONGBRIDGE_ENABLE_OVERNIGHT
  • LONGBRIDGE_PUSH_CANDLESTICK_MODE
  • LONGBRIDGE_PRINT_QUOTE_PACKAGES
  • LONGBRIDGE_LOG_PATH

Server safety switch:

  • LONGBRIDGE_MCP_READ_ONLY=true by default

Usage

Run from PyPI:

uvx longbridge-mcp

Run locally from this repo during development:

uvx --from . longbridge-mcp

For an MCP client configuration:

{
  "mcpServers": {
    "longbridge": {
      "command": "uvx",
      "args": ["longbridge-mcp"],
      "env": {
        "LONGBRIDGE_APP_KEY": "your-app-key",
        "LONGBRIDGE_APP_SECRET": "your-app-secret",
        "LONGBRIDGE_ACCESS_TOKEN": "your-access-token",
        "LONGBRIDGE_MCP_READ_ONLY": "true"
      }
    }
  }
}

Tool Surface

Quote tools always available:

  • quote-static-info
  • quote-realtime-info
  • quote-depth
  • quote-trades
  • quote-intraday
  • quote-history-candlesticks
  • quote-capital-flow
  • quote-capital-distribution
  • quote-calc-index
  • quote-watch-list
  • quote-security-list
  • quote-market-temperature
  • quote-history-market-temperature
  • quote-trading-days
  • quote-option-chain-expiry-dates
  • quote-option-chain-info
  • quote-option-quote
  • quote-warrant-quote
  • quote-warrant-list
  • quote-brokers
  • quote-participants
  • quote-level
  • quote-package-details

Trade read tools are also available by default:

  • trade-history-executions
  • trade-today-executions
  • trade-account-balance
  • trade-stock-positions
  • trade-cash-flow
  • trade-fund-positions
  • trade-history-orders
  • trade-today-orders
  • trade-order-detail
  • trade-margin-ratio

Write tools are only registered when LONGBRIDGE_MCP_READ_ONLY=false:

  • trade-submit-order
  • trade-cancel-order
  • trade-replace-order
  • quote-watch-list-create-group
  • quote-watch-list-update-group
  • quote-watch-list-delete-group

Notes

  • Transport is stdio only.
  • Output is structured JSON-like tool data, not text-wrapped JSON blobs.
  • OAuth and push streaming are intentionally out of scope for this version.

Metadata

Release files for longbridge-mcp 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for longbridge-mcp 0.1.3
File Size Uploaded Provenance Actions
longbridge_mcp-0.1.3.tar.gz 45.6 kB Without provenance Details for longbridge_mcp-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for longbridge-mcp 0.1.3
File Interpreter ABI Platform Actions
longbridge_mcp-0.1.3-py3-none-any.whl Python 3 none any Details for longbridge_mcp-0.1.3-py3-none-any.whl

Total release size: 56.3 kB

Release files / longbridge_mcp-0.1.3.tar.gz

Download URL longbridge_mcp-0.1.3.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ab7c9f0b14aa132aaef82c35cc7ad0210e2caa3274d8f5c0d0703f7fb4f28942
BLAKE2b-256 checksum
How to use checksums
1c75a733ff006c80ac249fbc63fbece00218931fb53dc9ec8db83210b0d5ffa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / longbridge_mcp-0.1.3-py3-none-any.whl

Download URL longbridge_mcp-0.1.3-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab8a4cb965e56e3b5eeb1f6b20739afabfeb49146d7553fec87745ad3b25f3f5
BLAKE2b-256 checksum
How to use checksums
e37c38efe0dedd63482a876712e75fabcc37a639adf4baddf40418cc06971339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for longbridge-mcp 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page