This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Go (Golang) MCP (Model Context Protocol) server that integrates with LongBridge OpenAPI for Hong Kong/US stock trading.
hades/
├── cmd/server/main.go # Main entry point
├── internal/
│ ├── config/ # Configuration loading
│ ├── longbridge/ # LongBridge API client wrapper
│ ├── mcp/ # MCP HTTP server implementation
│ └── tools/ # MCP tools (quote, account, order, history)
├── config.yaml.example # Configuration example
└── bin/server # Compiled binary
- Build:
go build -o bin/server ./cmd/server - Run:
./bin/server -config config.yaml
The MCP server provides the following tools:
get_quote- Get real-time stock quotesget_quote_info- Get stock basic informationget_depth- Get order book (买卖盘)get_trades- Get real-time trades
get_candlesticks- Get K-line/candlestick data
get_account_info- Get account balance informationget_positions- Get current positions
submit_order- Submit a trade ordercancel_order- Cancel an orderget_orders- Get today's ordersget_order_detail- Get order detailsget_history_executions- Get historical executions
Create a config.yaml file:
app_key: "your_app_key"
app_secret: "your_app_secret"
access_token: "your_access_token"
server:
host: "0.0.0.0"
port: 8080Or use environment variables:
LONGPORT_APP_KEYLONGPORT_APP_SECRETLONGPORT_ACCESS_TOKEN
./bin/server -config config.yamlThe server will start on http://localhost:8080/mcp/
Mozilla Public License 2.0