home / mcp / zerodha kite mcp server

Zerodha Kite MCP Server

Provides an MCP server to interact with Zerodha Kite API for trading actions and holdings retrieval.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "121yaseen-zerodha-mcp": {
      "command": "node",
      "args": [
        "/path/to/your/Zerodha-MCP/dist/trader.js"
      ]
    }
  }
}

This MCP server lets you control the Zerodha Kite trading API through a Model Context Protocol client. You can place buy and sell orders and retrieve your holdings and positions, all through simple MCP tool calls. This makes it easy to automate trading actions from your preferred MCP client.

How to use

Connect your MCP client to the server and call the available tools to perform trading actions or fetch your portfolio data. You will interact with a local stdio MCP server that runs the trader logic and communicates via standard input/output with your client.

How to install

Prerequisites you need to set up before running the server.

  • Node.js (runtime)
  • npm or yarn (package manager)

Steps to install and prepare the MCP server.

  • Create a working directory for Zerodha-MCP

Install dependencies for the project.

npm install
# or
yarn install

Build the project to produce the executable MCP server entry, typically a dist/trader.js file.

npm run build
# or, if no build script exists, use esbuild directly
esbuild trader.ts --bundle --outfile=dist/trader.js --platform=node --format=esm

Configuring the MCP server for your MCP client

The MCP client connects to a local stdio server that you run with Node. Use the following configuration to point your MCP client to the server executable.

{
  "mcpServers": {
    "trader": {
      "command": "node",
      "args": ["/path/to/your/Zerodha-MCP/dist/trader.js"]
    }
  }
}

Available tools

trader.add

Adds two numbers and returns the sum.

trader.sellStock

Places a market sell order for a given stock using NSE, product CNC; returns confirmation or an error.

trader.buyStock

Places a market buy order for a given stock using NSE, product CNC; returns confirmation or an error.

trader.getPositions

Fetches your current open positions and returns them as JSON.

trader.getHoldings

Fetches your current holdings from your demat account and returns them as JSON.