turtlestack-lite
OfficialAllows deployment of the MCP server on Cloudflare Workers for global edge computing, enabling low-latency trading operations.
Provides trading integration with Kite (Zerodha) including order placement, portfolio management, technical analysis with 40+ indicators, and real-time market data.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@turtlestack-liteshow my portfolio across all brokers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ TurtleStack Lite - Multi-Broker Trading MCP Server
๐ 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.
โจ Features
๐ฏ 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
๐ Quick Start
git clone https://github.com/turtlehq-tech/turtlestack-lite.git
cd turtlestack-lite
npm install
npm startClaude AI Configuration
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.
๐ง Configuration Setup
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.
๐ Required Replacements
The following files contain placeholder values that need to be replaced with your actual credentials:
1. Test Files (for development/testing):
tests/debugAuthentication.js:16,17- ReplaceYOUR_CLIENT_ID_HEREandYOUR_PROGRESS_TOKEN_HEREtests/testClaudeConnection.js:21,22- ReplaceYOUR_CLAUDE_SESSION_TOKEN_HEREandYOUR_CLAUDE_CLIENT_ID_HEREtests/testGrowwOrderFix.js:13- ReplaceYOUR_GROWW_API_KEY_HEREtests/testGrowwOrderReference.js:11- ReplaceYOUR_GROWW_API_KEY_HEREtests/debugAuthentication.js:44- ReplaceYOUR_GROWW_JWT_TOKEN_HEREtests/testClaudeConnection.js:40,52- ReplaceYOUR_GROWW_JWT_TOKEN_HERE
2. Cloudflare Configuration (for Cloudflare Workers deployment):
bridge.js:4- ReplaceYOUR_WORKER_SUBDOMAIN.YOUR_USERNAME.workers.devcloudflare/wrangler.toml:17- ReplaceYOUR_KV_NAMESPACE_ID_HEREcloudflare/mcp-config-for-claude.json:5- Replace worker URL in the embedded command
๐ How to Get Your Credentials
For Kite (Zerodha):
Create an app to get
api_keyandapi_secretGenerate access token using the authentication flow
For Groww:
Use browser developer tools to inspect network requests on Groww web app
Extract JWT token from Authorization header
Token format:
eyJraWQiOiJ...(long JWT string)
For Dhan:
Go to Dhan API Portal
Get your
access_tokenandclient_id
For Cloudflare Workers:
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
โ ๏ธ Security Best Practices
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
๐งช Quick Setup for Testing
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.tomlInstallation
npm installTesting
# 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.jsProject Structure
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 demoUsage
Start Unified Trading Server
npm start
# or for development
npm run devFeatures
Multi-Broker Support
โ Kite (Zerodha) - Fully implemented with advanced features
โ Groww - Fully implemented with advanced features
โ Dhan - Fully implemented with advanced features
Architecture Benefits
๐๏ธ 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
Key Commands
Broker Management
# List all available brokers
List brokers
# Set active broker
Set active broker to kiteAuthentication (Secure - No Stored Credentials)
# 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_idTrading Operations
# 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 marginsAdvanced Features
# 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 growwAdvanced Broker Features
๐ Kite (Zerodha) Advanced Features:
โ 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
๐ Groww Advanced Features:
โ 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
โก Dhan Advanced Features:
โ 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
Technical Indicator Support
๐ Unified Technical Analysis Commands:
Individual Indicators:
# 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 RELIANCECross-Broker Comparison:
# 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 brokersAdvanced Parameters:
# 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โ All Brokers Support:
๐ Trend Indicators:
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
๐ Momentum Indicators:
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
๐ Volatility Indicators:
Bollinger Bands: 20-period with 2 standard deviations default
ATR (Average True Range): Volatility measurement
๐ฐ Volume Indicators:
OBV (On-Balance Volume): Volume flow indicator
MFI (Money Flow Index): Price and volume momentum
๐ฏ Support & Resistance:
Fibonacci Retracement: Key retracement levels (23.6%, 38.2%, 50%, 61.8%)
Support/Resistance Levels: Automated level detection
๐ง Implementation Details:
Groww: Native API support for technical indicators via
/technical/{indicator}endpointsKite & 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
๐ Available Technical Analysis Tools:
MCP Commands:
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
Unified Command Examples:
# 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 brokersSecurity Features
โ 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
Adding New Brokers
To add a new broker (e.g., Upstox):
Create broker file:
src/brokers/UpstoxBroker.jsExtend BaseBroker: Implement all required methods
Add to index: Export in
src/brokers/index.jsUpdate server: Add to broker registry in
UnifiedTradingServer.jsTest: Authenticate and test all operations
The modular architecture makes adding new brokers straightforward and maintainable.
๐ Cloudflare Workers Deployment
For deploying to Cloudflare Workers, see the complete setup guide in /cloudflare/README.md.
๐ License
Apache 2.0 License - see LICENSE file for details.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/turtlehq-tech/turtlestack-lite'
If you have feedback or need assistance with the MCP directory API, please join our Discord server