Kite MCP 服务器 logo

Kite MCP 服务器

Organization
zerodha

Zerodha Kite MCP server

Publisherzerodha
Repositorykite-mcp-server
LanguageGo
Forks
110
Stars
260
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Kite MCP 服务器 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    260 stars and 110 forks from the linked repository.

Kite MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with secure access to the Kite Connect trading API. This server enables AI agents to retrieve market data, manage portfolios, and execute trades through a standardized interface.

TL;DR for Traders

Want to use AI with your Kite trading account? Just add https://mcp.kite.trade/mcp to your AI client configuration. No installation or API keys required - it's hosted and ready to use.

Features

  • Portfolio Management: View holdings, positions, margins, and mutual fund investments
  • Order Management: Place, modify, and cancel orders with full order history
  • GTT Orders: Good Till Triggered order management
  • Market Data Access: Real-time quotes, historical data, OHLC data
  • Pagination Support: Automatic pagination for large datasets (holdings, orders, trades)
  • Comprehensive Coverage: Implements most Kite Connect API endpoints
  • Multiple Deployment Modes: stdio, HTTP, SSE, and hybrid mode (production)
  • Built-in Documentation: Auto-served documentation at runtime

Quick Start

Hosted Version (Recommended)

The easiest way to get started is with our hosted version at mcp.kite.trade. Both /mcp and /sse endpoints are available - no installation or API keys required on your end.

Quick Setup: Add the following to your MCP configuration:

https://mcp.kite.trade/mcp

Recommended: Use the new HTTP mode (/mcp endpoint) for better performance and reliability. You can use mcp-remote to connect to the hosted server.

For self-hosting with your own API keys, follow the installation steps below.

Prerequisites

  • For hosted version (recommended): Nothing! Just use https://mcp.kite.trade/mcp
  • For self-hosting: Go 1.21 or later
  • For self-hosting: Valid Kite Connect API credentials

Getting started

bash
git clone https://github.com/zerodha/kite-mcp-server
cd kite-mcp-server

Configuration

Create a .env file with your Kite Connect credentials:

env
KITE_API_KEY=your_api_key
KITE_API_SECRET=your_api_secret
APP_MODE=http
APP_PORT=8080
APP_HOST=localhost

You can also use the provided justfile to initialize the config.

bash
just init-env

Running the Server

bash
# Build and run
go build -o kite-mcp-server
./kite-mcp-server

# Or run directly
go run main.go

The server will start and serve a status page at http://localhost:8080/

Client Integration

Setup Guide

Claude Desktop (Hosted Mode)

For the hosted version, add to your Claude Desktop configuration (~/.config/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "kite": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.kite.trade/mcp"]
    }
  }
}

Claude Desktop (HTTP Mode)

Add to your Claude Desktop configuration (~/.config/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "kite": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:8080/mcp", "--allow-http"],
      "env": {
        "APP_MODE": "http",
        "KITE_API_KEY": "your_api_key",
        "KITE_API_SECRET": "your_api_secret"
      }
    }
  }
}

Claude Desktop (SSE Mode)

Add to your Claude Desktop configuration (~/.config/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "kite": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:8080/sse", "--allow-http"],
      "env": {
        "APP_MODE": "sse",
        "KITE_API_KEY": "your_api_key",
        "KITE_API_SECRET": "your_api_secret"
      }
    }
  }
}

Claude Desktop (stdio Mode)

For self-hosted installations, you must first build the binary:

bash
go build -o kite-mcp-server

Then add to your Claude Desktop configuration (~/.config/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "kite": {
      "command": "/full/path/to/your/kite-mcp-server",
      "env": {
        "APP_MODE": "stdio",
        "KITE_API_KEY": "your_api_key",
        "KITE_API_SECRET": "your_api_secret"
      }
    }
  }
}

Important: Use the full absolute path to your built binary. For example:

  • /home/username/kite-mcp-server/kite-mcp-server (Linux)
  • /Users/username/kite-mcp-server/kite-mcp-server (macOS)
  • C:\Users\username\kite-mcp-server\kite-mcp-server.exe (Windows)

Other MCP Clients

For other MCP-compatible clients, use the hosted endpoint https://mcp.kite.trade/mcp with mcp-remote or configure your client to connect directly to the HTTP endpoint.

Available Tools

Setup & Authentication

  • login - Login to Kite API and generate authorization link

Market Data

  • get_quotes - Get real-time market quotes
  • get_ltp - Get last traded price
  • get_ohlc - Get OHLC data
  • get_historical_data - Historical price data
  • search_instruments - Search trading instruments

Portfolio & Account

  • get_profile - User profile information
  • get_margins - Account margins
  • get_holdings - Portfolio holdings
  • get_positions - Current positions
  • get_mf_holdings - Mutual fund holdings

Orders & Trading

  • place_order - Place new orders
  • modify_order - Modify existing orders
  • cancel_order - Cancel orders
  • get_orders - List all orders
  • get_trades - Trading history
  • get_order_history - Order execution history
  • get_order_trades - Get trades for a specific order

GTT Orders

  • get_gtts - List GTT orders
  • place_gtt_order - Create GTT orders
  • modify_gtt_order - Modify GTT orders
  • delete_gtt_order - Delete GTT orders

API Coverage

This server implements the majority of Kite Connect API endpoints and also provides additional tools.

Development

Development Environment

This project includes a Nix flake for consistent development environments:

bash
# Enter development shell
nix develop

# Or with direnv
direnv allow

Using Just Commands

Install Just for convenient development commands:

bash
just build      # Build the project
just run        # Run the server
just test       # Run tests
just lint       # Format and lint code
just coverage   # Generate coverage report

Running Tests

Requirements:

  • Go 1.23+ with GOEXPERIMENT=synctest (required for timing-dependent tests)
bash
# Run all tests
just test

# With coverage
just coverage

# With race detector
just test-race

# Direct go command (if you prefer)
CGO_ENABLED=0 GOEXPERIMENT=synctest go test -v ./...

Synctest Integration

This project requires Go's synctest package for time-dependent tests (session expiry, clock skew tolerance). All timing tests use synctest.Run() for:

  • Fast execution: Time-dependent tests complete in milliseconds instead of minutes
  • Deterministic timing: No flaky timing-based test failures
  • Controlled time: Tests can advance time without actual delays

The justfile automatically includes GOEXPERIMENT=synctest in all test commands.

Configuration Options

Environment VariableDefaultDescription
KITE_API_KEYRequiredYour Kite Connect API key
KITE_API_SECRETRequiredYour Kite Connect API secret
APP_MODEhttpServer mode: stdio, http, sse, or hybrid
APP_PORT8080Server port (HTTP/SSE/hybrid modes)
APP_HOSTlocalhostServer host (HTTP/SSE/hybrid modes)
EXCLUDED_TOOLS(empty)Comma-separated list of tools to exclude from registration

Note: In production, we use hybrid mode which supports both /sse and /mcp endpoints, making both HTTP and SSE protocols available for different client needs.

Tool Exclusion

You can exclude specific tools by setting the EXCLUDED_TOOLS environment variable with a comma-separated list of tool names. This is useful for creating read-only instances.

Example:

env
EXCLUDED_TOOLS=place_order,modify_order,cancel_order

The hosted version at mcp.kite.trade excludes potentially destructive trading operations for security. For accessing the other operations you can generate your own API keys and run the server locally.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run just lint and just test
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For bugs and general suggestions, please use GitHub Discussions.

For Kite Connect API documentation, visit: https://kite.trade/docs/connect/

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "zerodha-kite-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

Use Kite MCP 服务器 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Kite MCP 服务器 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Kite MCP 服务器 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Kite MCP 服务器 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "zerodha-kite-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "kite-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Kite MCP 服务器 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Kite MCP 服务器 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Kite MCP 服务器 to help me with this task?
Kite MCP 服务器
Sure. I read it.
Here is what I found using Kite MCP 服务器.

Option 2: Add an MCP server URL

Use this when Kite MCP 服务器 is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter your server URL in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste your server URL into the Server URL field.
  2. Enter a connection name for Kite MCP 服务器.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Kite MCP 服务器 connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Kite MCP 服务器 tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Kite MCP 服务器 tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Kite MCP 服务器 to help me with this task?
Kite MCP 服务器
Sure. I read it.
Here is what I found using Kite MCP 服务器.

Frequently asked questions

What is the Kite MCP 服务器 MCP server used for?

Kite MCP 服务器 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Kite MCP 服务器 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Kite MCP 服务器 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Kite MCP 服务器 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Kite MCP 服务器 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Kite MCP 服务器 MCP to TypingMind?

Kite MCP 服务器 can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Kite MCP 服务器 MCP provide in TypingMind?

Kite MCP 服务器 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Kite MCP 服务器 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Kite MCP 服务器 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇