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.2.tar.gz (45.3 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.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: longbridge_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 45.3 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.2.tar.gz
Algorithm Hash digest
SHA256 a72d3b1945220cb7214374884a47af2ba33e7f066767d19919ab4f155cdc72a1
MD5 6c03653d0e70140bc5c06a49113b1ace
BLAKE2b-256 05a155333c9f7ef954e7c3324df316472190ade6d173db66466b3ef9e22c47cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: longbridge_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b510ff5280cb2b9df8ceadc0818cafd57c0ae2eb07a6645b9190c38ec2350ebb
MD5 4e3eb87c2ec3499d7451bd77cf67e3b5
BLAKE2b-256 63c7e3a551e9774f953784bbcf30cd1496d1019f82398308b706f48044002d2f

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