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_ENABLE_WRITE_TOOLS=false by default

Usage

Run locally from this repo:

uvx --from . longbridge-mcp

For an MCP client configuration:

{
  "mcpServers": {
    "longbridge": {
      "command": "uvx",
      "args": ["--from", "/absolute/path/to/longbridge-mcp", "longbridge-mcp"],
      "env": {
        "LONGBRIDGE_APP_KEY": "your-app-key",
        "LONGBRIDGE_APP_SECRET": "your-app-secret",
        "LONGBRIDGE_ACCESS_TOKEN": "your-access-token",
        "LONGBRIDGE_MCP_ENABLE_WRITE_TOOLS": "false"
      }
    }
  }
}

Tool Surface

Read tools include the legacy quote/account endpoints plus additional Longbridge Python SDK read capabilities:

  • 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-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 implemented but only registered when LONGBRIDGE_MCP_ENABLE_WRITE_TOOLS=true:

  • 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.0.tar.gz (45.4 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.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: longbridge_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 45.4 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.0.tar.gz
Algorithm Hash digest
SHA256 af036578e26df92b01f6faf6061bf6014fd12574f2e8534ff069a19983e884e0
MD5 43665dcf608fb75b0d0b95eea7b30418
BLAKE2b-256 90e0f6a0078821f994cc35ecc1021833cf1014f5d9b13df63cc2aca89ec8d773

See more details on using hashes here.

File details

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

File metadata

  • Download URL: longbridge_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80c8246e20275d154b33642be73a2f875c0ba37dab121db27eebc8e1e435bebf
MD5 b31cddbf68edf4447aab256480ede333
BLAKE2b-256 ee6fb2e605929ebf7c5645195b63387f07699841f8b3a9722abbf757a4673a5c

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