A MCP server implementation for LongPort OpenAPI, provides real-time stock market data, provides AI access analysis and trading capabilities through MCP. - LongPort OpenAPI: https://open.longportapp.com/en/ - SDK docs: https://longportapp.github.io/openapi - Trading - Create, amend, cancel orders, query today’s/past orders and transaction details, etc. - Quotes - Real-time quotes, acquisition of h
Add this skill
npx mdskills install longportapp/openapiWell-documented MCP server for stock market data and trading with clear setup instructions
A MCP server implementation for LongPort OpenAPI, provides real-time stock market data, provides AI access analysis and trading capabilities through MCP.
Run script to install:
curl -sSL https://raw.githubusercontent.com/longportapp/openapi/refs/heads/main/mcp/install | bash
Download the latest binary from the Releases page.
Once you done server setup, and connected, you can talk with AI:
To configure LongPort MCP in Cursor:
+ Add New MCP Serverlongport-mcp (or your preferred name)commandenv LONGPORT_APP_KEY=your-app-key LONGPORT_APP_SECRET=your-app-secret LONGPORT_ACCESS_TOKEN=your-access-token longport-mcpIf you are using Windows, replace command with cmd /c "set LONGPORT_APP_KEY=your-app-key && set LONGPORT_APP_SECRET=your-app-secret && set LONGPORT_ACCESS_TOKEN=your-access-token && longport-mcp"
Or use this config:
{
"mcpServers": {
"longport-mcp": {
"command": "/usr/local/bin/longport-mcp",
"env": {
"LONGPORT_APP_KEY": "your-app-key",
"LONGPORT_APP_SECRET": "your-app-secret",
"LONGPORT_ACCESS_TOKEN": "your-access-token"
}
}
}
}
To configure LongPort MCP in Cherry Studio:
+ Add Serverlongport-mcp (or your preferred name)STDIOenv LONGPORT_APP_KEY=your-app-key LONGPORT_APP_SECRET=your-app-secret LONGPORT_ACCESS_TOKEN=your-access-token longport-mcpIf you are using Windows, replace command with cmd /c "set LONGPORT_APP_KEY=your-app-key && set LONGPORT_APP_SECRET=your-app-secret && set LONGPORT_ACCESS_TOKEN=your-access-token && longport-mcp"
env LONGPORT_APP_KEY=your-app-key LONGPORT_APP_SECRET=your-app-secret LONGPORT_ACCESS_TOKEN=your-access-token longport-mcp --sse
Default bind address is 127.0.0.1:8000, you can change it by using the --bind flag:
longport-mcp --sse --bind 127.0.0.1:3000
To run the server in read-only mode, set the flag --readonly:
longport-mcp --readonly
This will prevent the server from submitting orders to the exchange.
To enable logging, set the flag --log-dir to the directory where you want to store the logs:
longport-mcp --log-dir /path/to/log/dir
Install via CLI
npx mdskills install longportapp/openapiLongPort MCP is a free, open-source AI agent skill. A MCP server implementation for LongPort OpenAPI, provides real-time stock market data, provides AI access analysis and trading capabilities through MCP. - LongPort OpenAPI: https://open.longportapp.com/en/ - SDK docs: https://longportapp.github.io/openapi - Trading - Create, amend, cancel orders, query today’s/past orders and transaction details, etc. - Quotes - Real-time quotes, acquisition of h
Install LongPort MCP with a single command:
npx mdskills install longportapp/openapiThis downloads the skill files into your project and your AI agent picks them up automatically.
LongPort MCP works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.