longportapp
MCP Serverlongportapppublic

openapi

LongPort OpenAPI SDK Base.

Repository Info

274
Stars
38
Forks
274
Watchers
68
Issues
Rust
Language
Apache License 2.0
License

About This Server

LongPort OpenAPI SDK Base.

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

LongPort OpenAPI SDK

Go project version PyPI version npm version Maven Central

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:

  • 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

This repo contains the following main components:

NameDocumentDescription
RustDocLongPort OpenAPI for Rust (>= 1.56.1)
PythonDocLongPort OpenAPI for Python 3 (>= 3.7)
Node.jsDocLongPort OpenAPI for Node.js (>= 10)
JavaDocLongPort OpenAPI for Java (>= 1.8)
CDocLongPort OpenAPI for C (>= C99)
C++DocLongPort OpenAPI for C++(>= C++17)
Gohttps://github.com/longportapp/openapi-go
MCPAn MCP server implementation for LongPort OpenAPI

Environment Variables

NameDescription
LONGPORT_LANGUAGELanguage identifier, zh-CN, zh-HK or en (Default: en)
LONGPORT_APP_KEYApp key
LONGPORT_APP_SECRETApp secret
LONGPORT_ACCESS_TOKENAccess token
LONGPORT_HTTP_URLHTTP endpoint url (Default: https://openapi.longportapp.com)
LONGPORT_QUOTE_WS_URLQuote websocket endpoint url (Default: wss://openapi-quote.longportapp.com/v2)
LONGPORT_TRADE_WS_URLTrade websocket endpoint url (Default: wss://openapi-trade.longportapp.com/v2)
LONGPORT_ENABLE_OVERNIGHTEnable overnight quote, true or false (Default: false)
LONGPORT_PUSH_CANDLESTICK_MODErealtime or confirmed (Default: realtime)
LONGPORT_PRINT_QUOTE_PACKAGESPrint quote packages when connected, true or false (Default: true)
LONGPORT_LOG_PATHSet the path of the log files (Default: no logs)

SDK Documenation

https://longportapp.github.io/openapi

Resources

  • LongPort OpenAPI
  • LongPort OpenAPI Docs

License

Licensed under either of

  • Apache License, Version 2.0,(LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.

Quick Start

1

Clone the repository

git clone https://github.com/longportapp/openapi
2

Install dependencies

cd openapi
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerlongportapp
Repoopenapi
LanguageRust
LicenseApache License 2.0
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation