Loading repository data…
Loading repository data…
arindhimar / repository
ContextCraft is an intelligent stock trading assistant powered by Claude and Zerodha KiteConnect, integrated with powerful tools for automated trading, portfolio risk analysis, and in-depth stock analysis. With seamless integration of MCP (Model Context Protocol), it enables natural language interaction for live trading, portfolio management.
Built by Arin Dhimar ✨
Claude-integrated 🧐 • Zerodha-powered 📈 • Python 3.10+ ✨
ContextCraft is an intelligent, Claude-compatible MCP (Model Context Protocol) server that lets Claude (or any MCP agent) perform live stock trading through Zerodha KiteConnect.
Speak naturally. Claude understands:
“Buy 10 shares of INFY at market price.”
“Sell 5 SBIN when it hits 780.”
kiteconnect| File | Purpose |
|---|---|
server.py | MCP server with trading tools |
main.py | Minimal script entrypoint |
.env | API key + token (Git ignored) |
pyproject.toml | Project + dependency declarations |
git clone https://github.com/arindhimar/contextcraft.git
cd contextcraft
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
.envAPI_KEY=your_kiteconnect_key
ACCESS_TOKEN=your_valid_access_token
RAPIDAPI_KEY =your_valid_rapidapi_key
RAPIDAPI_HOST = "indian-stock-exchange-api2.p.rapidapi.com"
mcp dev server.py
uv run python server.py
trade(symbol, side, quantity, price?)Place a buy/sell order for a stock.
| Param | Type | Description |
|---|---|---|
| symbol | str | Substring or full tradingsymbol |
| side | str | "buy" or "sell" |
| quantity | int | Number of shares |
| price | float? | Leave blank or say "market" for LTP |
portfolio_risk_analyzer()Analyzes your portfolio’s risk by evaluating the stocks you hold, their current prices, and their market volatility.
explain_stock(symbol)Returns a simplified, AI-generated explanation of a stock, including its market trends, news, and predictions.
| Param | Type | Description |
|---|---|---|
| symbol | str | Substring or full tradingsymbol |
earnings_calendar()Fetches the earnings calendar for the current or upcoming quarter, providing predictions on stock movements based on earnings announcements.
"mcpServers": {
"ContextCraft": {
"command": "uv",
"args": [
"--directory", "C:\\Users\\Arin Dhimar\\Documents\\ContextCraft\\mcp-server-contextcraft",
"run", "python", "server.py"
]
}
}
Reload config in Claude Desktop. You're live!
MIT License © Arin Dhimar
Made with coffee, code & context ☕️