This service provides MCP and webhook APIs for Tradovate trading.
/mcp
- MCP protocol endpoint/webhook
- Webhook for trade actions/sse
- Server-Sent Events endpoint/message
- Message endpointget_available_accounts
- Get list of available trading accountsget_common_contracts
- Get list of commonly traded contractsget_contract_details
- Get details about a contractlist_positions
- List all positionsplace_order
- Place a new orderplace_bracket_order
- Place order with take profit and stop losscheck_pnl
- Check and close profitable positionscheck_oco
- Clean up orphaned ordersliquidate_position
- Close an existing positionliquidate_all_positions
- Close all positionscancel_all_orders
- Cancel all ordersget_account_summary
- Get account informationThe configuration file location depends on your operating system:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
Create or edit the config file and add your Tradovate MCP server:
{ "mcpServers": { "tradovate": { "command": "node", "args": ["/path/to/your/project/build/src/index.js"], "env": { "TRADOVATE_USERNAME": "your_username", "TRADOVATE_PASSWORD": "your_password", "TRADOVATE_API_ENVIRONMENT": "demo", "TRADOVATE_DEVICE_ID": "your_device_id", "TRADOVATE_CID": "your_cid", "TRADOVATE_API_SECRET": "your_api_secret", "TRADOVATE_DEMO_ACCOUNT_ID": "your_demo_account_id", "TRADOVATE_LIVE_ACCOUNT_ID": "your_live_account_id", "NODE_ENV": "production" } } } }
/path/to/your/project/build/src/index.js
with the actual path to your built server file, for example, C:/john/website/TradovateMCP/build/src/index.jsIf you prefer to run it through npm:
{ "mcpServers": { "tradovate": { "command": "npm", "args": ["run", "start"], "cwd": "/path/to/your/project", "env": { "TRADOVATE_USERNAME": "your_username", "TRADOVATE_PASSWORD": "your_password", "TRADOVATE_API_ENVIRONMENT": "demo", // ... other environment variables } } } }
After creating or modifying the configuration file, you must restart Claude Desktop for the changes to take effect.
Once Claude Desktop is restarted:
Once connected, you can use your tools like this:
Get my available trading accounts Place a bracket order for ESM5 Check PnL for my NQM5 position List my current positions Show me common contracts Close position for symbol GCM5
Claude will automatically use your MCP tools to execute these requests and provide the appropriate responses.
If you have issues:
npm run build
Make sure all these environment variables are set in your config:
{ "TRADOVATE_USERNAME": "your_username", "TRADOVATE_PASSWORD": "your_password", "TRADOVATE_API_ENVIRONMENT": "demo", "TRADOVATE_DEVICE_ID": "your_device_id", "TRADOVATE_CID": "your_cid", "TRADOVATE_API_SECRET": "your_api_secret", "TRADOVATE_DEMO_ACCOUNT_ID": "your_demo_account_id", "TRADOVATE_LIVE_ACCOUNT_ID": "your_live_account_id", "NODE_ENV": "production" }
Claude Desktop doesn't have built-in capabilities to connect to custom servers. Instead, you need to set up a client bridge that Claude Desktop can communicate with.
Set up a small service that can forward requests from Claude Desktop to your MCP server:
// tradovate-bridge.js const express = require('express'); const axios = require('axios'); const app = express(); const port = 3000; // Your MCP server webhook URL const MCP_WEBHOOK_URL = 'https://your-mcp-server.com/webhook'; app.use(express.json()); // Handle Claude Desktop requests app.post('/tradovate', async (req, res) => { try { // Forward the request to your MCP server const response = await axios.post(MCP_WEBHOOK_URL, req.body); // Return the response to Claude Desktop res.json(response.data); } catch (error) { console.error('Error forwarding request:', error); res.status(500).json({ status: 'error', message: error.message }); } }); app.listen(port, () => { console.log(`Tradovate bridge listening at http://localhost:${port}`); });
Run this bridge on your local machine using Node.js.
Since Claude Desktop can't directly connect to custom servers, you can:
Ask Claude to generate a Tradovate order request like this:
{ "action": "buy", "params": { "Ticker": "ESM5", "Quantity": 1, "LimitPrice": 5680, "TakeProfitPoints": 10, "StopLossPoints": 5, "OrderType": "Limit", "UseAutoTrail": true, "AutoTrailTrigger": 0.5 } }
For a more seamless experience, consider:
Replace your existing tools.ts
file with the enhanced version that includes all the new functionality.
Key changes include:
handlePlaceBracketOrder
and handlePlaceBracketOrderTool
handleCheckPnL
and handleCheckOCO
getAvailableAccounts
and getCommonContracts
Add the new tool definitions to your index.ts
file in the server capabilities section.
Update your CallToolRequestSchema
handler in index.ts
to include handlers for all the new tools.
Ensure your .env
file includes the following variables:
# Tradovate Credentials TRADOVATE_USERNAME=your_username TRADOVATE_PASSWORD=your_password TRADOVATE_APP_ID=your_app_id TRADOVATE_APP_VERSION=your_app_version TRADOVATE_DEVICE_ID=your_device_id TRADOVATE_CID=your_client_id TRADOVATE_SECRET=your_client_secret # Tradovate Environment TRADOVATE_API_ENVIRONMENT=demo # or 'live' # Account IDs TRADOVATE_LIVE_ACCOUNT_ID=12345678 TRADOVATE_DEMO_ACCOUNT_ID=23456789
{ "action": "get_available_accounts", "params": {} }
{ "action": "get_common_contracts", "params": {} }
{ "action": "place_bracket_order", "params": { "symbol": "ESM5", "action": "Buy", "orderType": "Limit", "quantity": 1, "price": 5680, "takeProfitPoints": 10, "stopLossPoints": 5, "useAutoTrail": true, "autoTrailTrigger": 0.5, "autoTrailStopLoss": 0.25, "autoTrailFreq": 0.25, "breakeven": 1.5, "isLive": false } }
{ "action": "check_pnl", "params": { "profitThreshold": 5, "isLive": false } }
{ "action": "check_oco", "params": { "forceCleanup": true, "isLive": false } }
get_available_accounts
get_common_contracts
get_contract_details
estimate_margin
place_bracket_order
list_positions
check_pnl
liquidate_position
get_available_accounts
get_account_summary
get_risk_parameters
check_oco
check_pnl
liquidate_all_positions
cancel_all_orders
If you encounter issues:
Excellgen Inc
15601 Crabbs Branch Way
Rockville, MD 20855
For technical support, feature requests, or general inquiries about the Tradovate MCP Server