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 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_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.1.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.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: longbridge_mcp-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2761d75996e0e5d51152ad5fe8eb18e80d32a19228ccb6c431d4eefcc7861046
MD5 0fe528c107a57ddef4183542204bc5de
BLAKE2b-256 abcfd1c8dca946f432f83c32376189f40ae3471ea1b2aa263e0b4e32fb369b4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: longbridge_mcp-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 408f3148941e060f266c9f92179a775f13cc2dade7362ebf4b1753cab37cd3f2
MD5 284971d8c1efa5bf85e69e21123d1e60
BLAKE2b-256 b7b0f20c85c263c900232971a3157aad411dd9aeeb15310d06a6e2532a4f38d6

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