π Most Advanced Multi-Broker Trading MCP Server for Claude AI - Unified API for Kite (Zerodha), Groww, and Dhan with 40+ Technical Indicators, Real-time Trading, Portfolio Management, and Cloudflare Workers Support.
π― Multi-Broker Support: Seamlessly trade across Kite (Zerodha), Groww, and Dhan
π Advanced Technical Analysis: 40+ indicators including RSI, MACD, Bollinger Bands, VWAP, ATR
π Real-time Trading: Live order placement, modification, and cancellation
πΌ Portfolio Management: Unified portfolio tracking across all brokers
βοΈ Cloudflare Workers: Deploy globally with edge computing
π€ Claude AI Integration: Natural language trading commands
π Enterprise Security: No stored credentials, session-based authentication
β‘ High Performance: Optimized for speed and reliability
ποΈ Modular Architecture: Easy to extend and customize
git clone https://github.com/turtlehq-tech/turtlestack-lite.git
cd turtlestack-lite
npm install
npm start
Add this configuration to your Claude Desktop settings (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"turtlestack-lite": {
"command": "node",
"args": ["/path/to/turtlestack-lite/src/index.js"]
}
}
}
Replace /path/to/turtlestack-lite/
with your actual installation path:
# Example paths:
# macOS: "/Users/yourusername/Projects/turtlestack-lite/src/index.js"
# Linux: "/home/yourusername/turtlestack-lite/src/index.js"
# Windows: "C:\\Users\\yourusername\\turtlestack-lite\\src\\index.js"
π Security Note: No API keys or secrets are stored in the configuration. All credentials must be provided through Claude commands for maximum security.
Important: This repository contains dummy placeholder values for all sensitive IDs and tokens. Before using the project, you must replace these placeholders with your actual credentials.
The following files contain placeholder values that need to be replaced with your actual credentials:
tests/debugAuthentication.js:16,17
- ReplaceYOUR_CLIENT_ID_HERE
andYOUR_PROGRESS_TOKEN_HERE
tests/testClaudeConnection.js:21,22
- ReplaceYOUR_CLAUDE_SESSION_TOKEN_HERE
andYOUR_CLAUDE_CLIENT_ID_HERE
tests/testGrowwOrderFix.js:13
- ReplaceYOUR_GROWW_API_KEY_HERE
tests/testGrowwOrderReference.js:11
- ReplaceYOUR_GROWW_API_KEY_HERE
tests/debugAuthentication.js:44
- ReplaceYOUR_GROWW_JWT_TOKEN_HERE
tests/testClaudeConnection.js:40,52
- ReplaceYOUR_GROWW_JWT_TOKEN_HERE
bridge.js:4
- ReplaceYOUR_WORKER_SUBDOMAIN.YOUR_USERNAME.workers.dev
cloudflare/wrangler.toml:17
- ReplaceYOUR_KV_NAMESPACE_ID_HERE
cloudflare/mcp-config-for-claude.json:5
- Replace worker URL in the embedded command
- Go to Kite Connect Developer Console
- Create an app to get
api_key
andapi_secret
- Generate access token using the authentication flow
- Use browser developer tools to inspect network requests on Groww web app
- Extract JWT token from Authorization header
- Token format:
eyJraWQiOiJ...
(long JWT string)
- Go to Dhan API Portal
- Get your
access_token
andclient_id
- Create KV namespace:
wrangler kv:namespace create "SESSIONS_KV"
- Note the namespace ID from the output
- Update your worker subdomain based on your Cloudflare account
- Never commit real credentials to version control
- Use environment variables for production deployments
- Rotate tokens regularly for security
- Test with dummy data first before using real credentials
Replace these specific placeholders to get started quickly:
# 1. Update test files with your tokens
sed -i 's/YOUR_GROWW_JWT_TOKEN_HERE/your_actual_groww_token/g' tests/testClaudeConnection.js
sed -i 's/YOUR_GROWW_API_KEY_HERE/your_actual_api_key/g' tests/testGroww*.js
# 2. Update Cloudflare config (if using workers)
sed -i 's/YOUR_WORKER_SUBDOMAIN.YOUR_USERNAME.workers.dev/your-worker.your-account.workers.dev/g' bridge.js
sed -i 's/YOUR_KV_NAMESPACE_ID_HERE/your_actual_kv_id/g' cloudflare/wrangler.toml
npm install
# Run all tests
npm test
# Run unit tests only
npm run test:unit
# Run integration tests only
npm run test:integration
# Run tests with watch mode
npm run test:watch
# Demo technical indicators
node tests/demo.js
src/
βββ brokers/
β βββ BaseBroker.js # Base interface for all brokers
β βββ KiteBroker.js # Kite (Zerodha) implementation
β βββ GrowwBroker.js # Groww implementation
β βββ DhanBroker.js # Dhan implementation
β βββ index.js # Broker exports and factory
βββ server/
β βββ UnifiedTradingServer.js # Main MCP server (v2.0.0)
βββ utils/
β βββ logger.js # Logging utility
β βββ formatters.js # Data formatting utilities
β βββ technicalIndicators.js # Backward compatibility wrapper
β βββ technicalIndicators/ # Modular technical analysis
β βββ index.js # Main aggregation file
β βββ trendIndicators.js # SMA, EMA, VWAP, ADX, Parabolic SAR
β βββ momentumIndicators.js # RSI, MACD, Stochastic, Williams %R, CCI, MFI
β βββ volatilityIndicators.js # Bollinger Bands, ATR
β βββ volumeIndicators.js # OBV
β βββ supportResistanceIndicators.js # Fibonacci, Support/Resistance
βββ index.js # Entry point
tests/
βββ unit/
β βββ technicalIndicators.test.js # Technical indicators unit tests
βββ integration/
β βββ brokers.test.js # Broker integration tests
β βββ unifiedTradingServer.test.js # Server integration tests
βββ fixtures/
β βββ mockData.js # Test data fixtures
βββ demo.js # Technical indicators demo
npm start
# or for development
npm run dev
- β Kite (Zerodha) - Fully implemented with advanced features
- β Groww - Fully implemented with advanced features
- β Dhan - Fully implemented with advanced features
- ποΈ Modular Design: Each broker in separate file
- π Pluggable: Easy to add new brokers
- π§ͺ Testable: Individual components can be tested
- π Maintainable: Clean separation of concerns
- π Scalable: Supports unlimited brokers
# List all available brokers
List brokers
# Set active broker
Set active broker to kite
# Authenticate Kite with access token
Authenticate kite with api_key: your_api_key and access_token: your_access_token
# Authenticate Kite with request token
Authenticate kite with api_key: your_api_key, api_secret: your_api_secret, and request_token: your_request_token
# Authenticate Groww
Authenticate groww with access_token: your_groww_access_token
# Authenticate Dhan
Authenticate dhan with access_token: your_dhan_access_token and client_id: your_dhan_client_id
# Get portfolio from active broker
Show my portfolio
# Get portfolio from specific broker
Show my groww portfolio
# Compare portfolios across brokers
Compare my portfolios across all brokers
# Place order using active broker
Create buy order for RELIANCE 10 shares at market price
# Get margins
Show my account margins
# Get consolidated portfolio across all brokers
Show me my consolidated portfolio across all brokers
# Kite Advanced Features
Get my Kite mutual fund holdings
Place GTT order for RELIANCE
Get historical data for INFY
# Groww Advanced Features
Get technical indicators RSI for RELIANCE
Search for instruments containing "TATA"
Get historical candle data for HDFC
# Dhan Advanced Features
Get option chain for NIFTY
Place bracket order with stop loss and target
Get live market feed for instruments
# Logout from specific broker
Logout from kite
# Logout from all brokers
Logout from all brokers
# Technical Analysis Operations
Get RSI for RELIANCE
Get MACD for INFY
Get Bollinger Bands for HDFC
Get VWAP for TATA STEEL
Get ATR for NIFTY
# Cross-broker technical comparison
Compare RSI for RELIANCE across all brokers
Compare MACD for INFY across kite and groww
- β Technical Analysis: RSI, MACD, Bollinger Bands, SMA, EMA, Stochastic
- Mutual Funds: Holdings, orders, SIP management
- GTT (Good Till Triggered): Advanced conditional orders
- Historical Data: OHLC data with custom intervals
- Instruments: Complete instrument master data
- Order Management: Modify, cancel, bracket orders
- Profile & Margins: Account details and fund limits
- β Technical Analysis: RSI, MACD, Bollinger Bands (Native API support)
- Historical Data: Candlestick data for any time period
- Advanced Search: Complex instrument filtering
- Order Management: Create, modify, cancel orders
- Market Data: Real-time quotes and live feeds
- Instrument Details: Complete security information
- β Technical Analysis: RSI, MACD, Bollinger Bands, SMA, EMA, Stochastic
- Option Chain: Complete options data with Greeks
- Bracket/Cover Orders: Advanced order types with SL/Target
- Kill Switch: Emergency stop for all trading activities
- Live Market Feed: Real-time price updates
- Security Info: Detailed instrument information
- Order Book/Trade Book: Complete trading history
- Exchange Status: Real-time market status updates
# Get specific technical indicators
Get RSI for RELIANCE with period 14
Get MACD for INFY from kite broker
Get Bollinger Bands for HDFC with period 20
Get VWAP for TATA STEEL from groww
Get ATR for NIFTY with period 14
Get ADX for RELIANCE with period 14
# Multiple indicators at once
Get technical indicators RSI,MACD,BOLLINGER for RELIANCE
# Compare same indicator across brokers
Compare RSI for RELIANCE across all brokers
Compare MACD for INFY across kite,groww,dhan
Compare Bollinger Bands for HDFC across authenticated brokers
# With custom periods and timeframes
Get RSI for RELIANCE with period 21 and interval 1h
Get MACD for INFY with fast_period 10, slow_period 20, signal_period 7
Get Bollinger Bands for HDFC with period 20 and standard_deviations 2.5
- SMA (Simple Moving Average): Any period
- EMA (Exponential Moving Average): Any period
- VWAP (Volume Weighted Average Price): Intraday trading benchmark
- Parabolic SAR: Stop and Reverse trend following system
- ADX (Average Directional Index): Trend strength indicator
- RSI (Relative Strength Index): 14-period default, overbought/oversold
- MACD (Moving Average Convergence Divergence): 12,26,9 default parameters
- Stochastic Oscillator: %K and %D lines
- Williams %R: Momentum oscillator
- CCI (Commodity Channel Index): Price deviation indicator
- MFI (Money Flow Index): Volume-weighted RSI
- Bollinger Bands: 20-period with 2 standard deviations default
- ATR (Average True Range): Volatility measurement
- OBV (On-Balance Volume): Volume flow indicator
- MFI (Money Flow Index): Price and volume momentum
- Fibonacci Retracement: Key retracement levels (23.6%, 38.2%, 50%, 61.8%)
- Support/Resistance Levels: Automated level detection
- Groww: Native API support for technical indicators via
/technical/{indicator}
endpoints - Kite & Dhan: Historical data + local calculation using comprehensive TechnicalIndicators utility class
- Consistent API: Unified command interface across all brokers regardless of implementation
- Cross-Broker Comparison: Compare same indicator across multiple brokers simultaneously
- Real-time Calculation: Indicators calculated from live historical data with customizable parameters
- Intelligent Routing: UnifiedTradingServer automatically routes requests to appropriate broker methods
get_technical_indicators
- Multiple indicators at onceget_rsi
- Relative Strength Indexget_macd
- Moving Average Convergence Divergenceget_bollinger_bands
- Bollinger Bandsget_vwap
- Volume Weighted Average Priceget_atr
- Average True Rangeget_adx
- Average Directional Indexcompare_technical_indicators
- Cross-broker comparison
# Individual technical indicators
Get RSI for RELIANCE with period 14
Get MACD for INFY from kite
Get Bollinger Bands for HDFC with period 20 and standard_deviations 2
Get VWAP for TATASTEEL from groww
Get ATR for NIFTY with period 14 from dhan
Get ADX for RELIANCE with period 14
# Multiple indicators
Get technical indicators RSI,MACD,BOLLINGER,VWAP for RELIANCE
# Cross-broker comparison
Compare RSI for RELIANCE across all brokers
Compare MACD for INFY across kite,groww
Compare VWAP for HDFC across authenticated brokers
- β No stored credentials: All API keys/tokens provided via commands
- β Session-based: Credentials cleared when server restarts
- β Broker isolation: Each broker maintains separate credentials
- β Runtime authentication: Authenticate only when needed
- β Modular security: Each broker handles its own authentication
To add a new broker (e.g., Upstox):
- Create broker file:
src/brokers/UpstoxBroker.js
- Extend BaseBroker: Implement all required methods
- Add to index: Export in
src/brokers/index.js
- Update server: Add to broker registry in
UnifiedTradingServer.js
- Test: Authenticate and test all operations
The modular architecture makes adding new brokers straightforward and maintainable.
For deploying to Cloudflare Workers, see the complete setup guide in /cloudflare/README.md
.
Apache 2.0 License - see LICENSE file for details.