A Node.js library for Longport Open API
Longport MCP server exists for a simple reason — assistants are far more useful when they can act on Longport directly instead of describing what you should do. A Node.js library for Longport Open API.
Longport OpenAPI provides programmatic quote trading interfaces for investors with research and development capabilities and assists them to build trading or quote strategy analysis tools based on their own investment strategies. The functions fall into the following categories:
Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.
Once Longport is connected, these are the calls the assistant has available:
Trading — Create, amend, cancel orders, query today’s/past orders and transaction details, etcQuotes — Real-time quotes, acquisition of historical quotes, etcPortfolio — Real-time query of the account assets, positions, fundsReal — time subscription - Provides real-time quotes and push notifications for order status changesYou will need 7 environment variables: LONGPORT_APP_KEY, LONGPORT_APP_SECRET, LONGPORT_ACCESS_TOKEN, LONGPORT_HTTP_URL, LONGPORT_QUOTE_WS_URL, LONGPORT_TRADE_WS_URL, LONGPORT_LOG_PATH. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
Among the payments and commerce options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Longport's toolset — Trading, Quotes, Portfolio and 1 more — is a fair guide to whether it matches your workflow. It is maintained by sunli829; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| Trading | Create, amend, cancel orders, query today’s/past orders and transaction details, etc. |
| Quotes | Real-time quotes, acquisition of historical quotes, etc. |
| Portfolio | Real-time query of the account assets, positions, funds |
| Real | time subscription - Provides real-time quotes and push notifications for order status changes |
| Variable | Description | Required |
|---|---|---|
| LONGPORT_APP_KEY | Credential the server authenticates with. | Yes |
| LONGPORT_APP_SECRET | Credential the server authenticates with. | Yes |
| LONGPORT_ACCESS_TOKEN | Credential the server authenticates with. | Yes |
| LONGPORT_HTTP_URL | Endpoint or connection string the server talks to. | Yes |
| LONGPORT_QUOTE_WS_URL | Endpoint or connection string the server talks to. | Yes |
| LONGPORT_TRADE_WS_URL | Endpoint or connection string the server talks to. | Yes |
| LONGPORT_LOG_PATH | Filesystem location the server is allowed to use. | Optional |
Payments infrastructure meets AI — customers, invoices, subscriptions and current API docs from Stripe's server.
Build for Shopify with current APIs — the official Dev MCP server for schema-accurate storefront and admin code.
Give your AI assistant a supervised window into your Interactive Brokers account — balances, positions, live quotes and orders.
Invoices, payments and disputes through PayPal's official server — commerce operations by conversation.
Enables querying and listing Azure resources and costs directly from an MCP client.
Empowers LLMs with Bitcoin Lightning Network payment capabilities via the ZBD API.