Planned future enhancement for sending order confirmations and alerts related to Zerodha trading activities
Enables programmatic stock trading on Zerodha using the KiteConnect API, allowing buy/sell operations with specified symbols, exchanges, quantities, and prices
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., "@KiteMCPbuy 5 shares of TCS at current market price"
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.
๐ KiteMCP โ Zerodha Trading via MCP
KiteMCP is a command-based Zerodha trading system built using the KiteConnect API, Bun, and the Model Context Protocol (MCP). It allows real-time stock buy/sell operations through MCP command calls from a local server, currently integrated with Claude or any compatible tool interface.
๐ Features
๐ Buy and sell stocks programmatically via commands
๐ Modular MCP tool structure (
buy-stock,sell-stock)๐ Secure API key handling via
.envโ Schema validation using Zod
โ๏ธ Fast runtime with Bun and TypeScript
๐งช Local test environment with log outputs
Related MCP server: Zerodha Trading MCP
๐ง Setup Instructions
1. Clone the Repository
git clone https://github.com/your-username/zerodha-trade
cd zerodha-trade2. Install Dependencies (using Bun)
bun install3. Configure Environment Variables
Create a .env file in the root:
KITE_API_KEY=your_api_key
KITE_API_SECRET=your_api_secret
ACCESS_TOKEN=your_access_token4. Start the MCP Server
bun index.ts๐ธ Screenshots
Claude AI making transaction
Zerodha server
๐ฅ Example Command Usage
Send the following JSON to the server via terminal or Claude:
{
"id": "1",
"action": "call_tool",
"tool": "buy-stock",
"arguments": {
"symbol": "RELIANCE",
"exchange": "NSE",
"quantity": 10,
"price": 2800
}
}โ Input Validation
All tool inputs are validated using Zod for:
Required fields:
symbol,exchange,quantityType and range checks
Custom error messages on invalid input
๐งช Example Output
{
"status": "success",
"message": "Buy order placed for RELIANCE at โน2800"
}๐ก๏ธ Security Notes
Do not expose your
.envfile in productionAdd rate limiting and request authentication if going public
Store order logs securely
๐ Future Enhancements
๐ Deploy on cloud with webhook interface
๐ Add portfolio view and PnL tracking
๐ Telegram/email alerts for order confirmations
๐ง Auto-trading with strategy modules
๐จโ๐ป Author
Utkarsh Agarwal
GitHub โข LinkedIn
๐ License
MIT License ยฉ 2025 Utkarsh Agarwal
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.