Skip to main content

A uvx-runnable MCP server for Longbridge OpenAPI

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

longbridge_mcp-0.1.3.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

longbridge_mcp-0.1.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file longbridge_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: longbridge_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for longbridge_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ab7c9f0b14aa132aaef82c35cc7ad0210e2caa3274d8f5c0d0703f7fb4f28942
MD5 f1cb5d66845e6cebe182b9f3af998e76
BLAKE2b-256 1c75a733ff006c80ac249fbc63fbece00218931fb53dc9ec8db83210b0d5ffa7

See more details on using hashes here.

File details

Details for the file longbridge_mcp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: longbridge_mcp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for longbridge_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab8a4cb965e56e3b5eeb1f6b20739afabfeb49146d7553fec87745ad3b25f3f5
MD5 5b7f2129e0a58eeb4b30c5405ddb59c7
BLAKE2b-256 e37c38efe0dedd63482a876712e75fabcc37a639adf4baddf40418cc06971339

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page