Kite MCP Trading Server

Kite MCP Trading Server

An MCP server for Zerodha Kite Connect that enables AI agents to execute trades, manage portfolios, fetch market data, and perform technical and fundamental analysis.

Category
Visit Server

README

Bun TypeScript Node.js MCP Zerodha Claude Open Source

Kite MCP Trading Server

<p align="center"> <img src="./banner.png" alt="Kite MCP Server Banner" width="100%"> </p> A powerful Model Context Protocol (MCP) Server built with Bun + TypeScript for Zerodha Kite Connect.

This server enables AI agents, automation workflows, and trading applications to interact with Zerodha accounts for:

  • Order Execution
  • Portfolio Management
  • Market Data Retrieval
  • Technical Analysis
  • Fundamental Analysis

Features

Trading Operations

  • Place Buy Orders
  • Place Sell Orders
  • Modify Existing Orders
  • Cancel Orders
  • View Order History
  • Fetch Active Orders

Portfolio Management

  • Get Holdings
  • Get Positions
  • Calculate Profit & Loss (PnL)

Market Data

  • Live Quotes
  • Last Traded Price (LTP)
  • Multiple Instrument Support

Technical Analysis

  • EMA 20
  • EMA 50
  • RSI 14
  • Trend Detection
  • Buy / Sell / Hold Signals

Fundamental Analysis

  • P/E Ratio Analysis
  • Price to Book Ratio
  • Return on Equity (ROE)
  • Debt to Equity
  • Profit Margins
  • Earnings Growth

Technologies Used

Runtime & Language

  • Bun
  • TypeScript

Trading APIs

  • Zerodha Kite Connect API
  • Yahoo Finance API

MCP

  • Model Context Protocol (MCP)
  • MCP SDK
  • MCP Server

Validation

  • Zod
  • JSON Schema

Architecture

Claude Desktop / Cursor / OpenAI
                │
                ▼
       Kite MCP Server
        (Bun + TypeScript)
                │
                ▼
      Zerodha Kite Connect
                │
                ▼
       Indian Stock Market

Installation

git clone https://github.com/BrextherFx/kite-mcp-server.git

cd kite-mcp-server

bun install

Environment Variables

Create a .env file:

KITE_API_KEY=
KITE_API_SECRET=
KITE_REQUEST_TOKEN=
KITE_ACCESS_TOKEN=

Running the Server

Development:

bun run dev

Generate Token:

bun run gen

Production:

bun run start

Zerodha Kite Developer Setup

Step 1: Create a Zerodha Trading Account

Open:

https://zerodha.com/open-account

Login:

https://kite.zerodha.com

Step 2: Create Kite Developer Account

https://developers.kite.trade/signup

Create your developer account.

Step 3: Create Application

Open:

https://developers.kite.trade

Create a new application.

Example:

App Name: Kite MCP Server
Redirect URL: http://localhost:3000/callback

Save and collect:

API Key
API Secret

Step 4: Configure IP Whitelist

Find your public IP:

https://ifconfig.me

Add the IP in:

Developer Console
└── Profile
    └── IP Whitelist

Step 5: Generate Request Token

bun run gen

Login using the generated URL.

Copy:

request_token=xxxxxxxx

Step 6: Generate Access Token

Store it inside .env:

KITE_ACCESS_TOKEN=xxxxxxxx

Claude Desktop Setup

Open:

%APPDATA%\Claude\claude_desktop_config.json

Add:

{
  "mcpServers": {
    "kite": {
      "command": "bun",
      "args": [
        "run",
        "C:/Projects/kite-mcp/index.ts"
      ]
    }
  }
}

Restart Claude Desktop.


MCP Tools

Tool Description
buy-stock Place buy order
sell-stock Place sell order
modify-order Modify order
cancel-order Cancel order
get-orders Get orders
get-holdings Get holdings
get-positions Get positions
get-quote Get live quote
get-ltp Get LTP
get-margins Get margins
get-pnl Calculate PnL
analyze-stock Technical + Fundamental Analysis

Roadmap

  • [ ] WebSocket Live Market Data
  • [ ] Option Chain Analysis
  • [ ] AI Trade Recommendations
  • [ ] Portfolio Risk Analysis
  • [ ] Historical Backtesting

Contributing

Contributions are welcome.

Feel free to open Issues or Pull Requests.


License

MIT License


Author

Momin Saad (BrextherFx)

Software Developer • AI Builder • Automation Enthusiast

🌐 Website: brextherfx.site

💻 GitHub: BrextherFx

Made with ❤️ by BrextherFx.


⭐ If you find this project useful, consider giving it a star.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured