
Unofficial Questrade MCP server - access your trading accounts and market data in AI conversations.
概览
An Model Context Protocol (MCP) server for integrating with the Questrade API, providing access to trading accounts, market data, and portfolio information. : This is an unofficial, community-built integration and is not affiliated with, endorsed by, or supported by Questrade Inc. Use at your own risk. - 🔐 : OAuth 2.0 token management with automatic refresh - 📊 : Access accounts, positions, balances, and order history - 📈 : Real-time quotes, symbol search, and historical candles - 🛡️ : Comprehensive error handling and logging - 🔧 : Full TypeScript support with proper type definitions 1. Clone this repository 2. Install dependencies: 4. Configure your Questrade API credentials in .env: For detailed information about Questrade's API authorization, see the official API documentation. 1. Log in to your Questrade account or navigate directly to https://apphub.questrade.com/UI/UserApps.aspx 2. In the top right corner, select from the drop-down menu under your login name 3.
README
以下为原文 README 节选,完整内容请查看原文。
Questrade MCP Server
An unofficial Model Context Protocol (MCP) server for integrating with the Questrade API, providing access to trading accounts, market data, and portfolio information.
⚠️ Disclaimer: This is an unofficial, community-built integration and is not affiliated with, endorsed by, or supported by Questrade Inc. Use at your own risk.
Features
- 🔐 Authentication: OAuth 2.0 token management with automatic refresh
- 📊 Account Data: Access accounts, positions, balances, and order history
- 📈 Market Data: Real-time quotes, symbol search, and historical candles
- 🛡️ Error Handling: Comprehensive error handling and logging
- 🔧 TypeScript: Full TypeScript support with proper type definitions
Installation
Option 1: Install from npm (Recommended)
npm install -g questrade-mcp-server
Option 2: Clone and Build
-
Clone this repository
-
Install dependencies:
npm install -
Copy the environment template:
cp .env.example .env -
Configure your Questrade API credentials in
.env:QUESTRADE_API_URL=https://api01.iq.questrade.com QUESTRADE_REFRESH_TOKEN=your_refresh_token_here # QUESTRADE_TOKEN_DIR=/path/to/custom/directory
Getting Questrade API Credentials
For detailed information about Questrade’s API authorization, see the official API documentation.
Step 1: Generate API Token
-
Log in to your Questrade account or navigate directly to https://apphub.questrade.com/UI/UserApps.aspx
-
In the top right corner, select “API centre” from the drop-down menu under your login name
-
Click “Activate API” and agree to the API access agreement
-
Click “Generate new token” for manual authorization
-
Copy the refresh token provided
Step 2: Configure Environment
-
Copy your refresh token to
.env:QUESTRADE_REFRESH_TOKEN=your_refresh_token_here -
The MCP server will automatically:
- Use your refresh token to get an access token
- Discover the correct API server URL
- Handle token refresh when needed
- Persist new tokens to
~/.questrade-mcp/tokens.json(or system temp directory as fallback)
安装
npx questrade-mcp-server配置
{
"mcpServers": {
"questrade": {
"command": "npx",
"args": ["questrade-mcp-server"],
"env": {
"QUESTRADE_REFRESH_TOKEN": "your_refresh_token_here"
}
}
}
}