Zerodha Kite MCP Server

MCP金融服务

提供方 121yaseen

金融服务 未标注 API Key 社区 / 第三方 Cursor

一个与Zerodha Kite API交互的MCP服务器,支持股票买卖、持仓查询等功能,适用于自动化交易场景。

一句话选型结论

按资料字段整理

Zerodha Kite MCP Server 属于金融服务类 MCP 服务器,传输方式未标注,API Key,可直接接入 Cursor,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类金融服务 传输方式未标注 鉴权API Key 部署方式支持远程部署
GitHub 星标 1 仓库热度,无公开仓库时显示未标注
工具数 5 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

金融服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量5暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

股票交易TypeScript本地部署自动化交易金融APIMCP协议Zerodha集成

安装与配置

未标注 API Key
上游未给出传输方式
  1. 1
    准备运行环境

    确认你的客户端支持远程端点,并拿到服务地址。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 5 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
行情与财务数据

查行情、财报、汇率等金融数据。

支付与账务查询

查订单、账单与交易流水。

风控与核验

做身份、信用与风险信息核验。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 5 个工具,职责相对集中,接入后不容易误操作。
  • 已适配 Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • 远程端点依赖网络与服务方可用性,注意密钥与调用额度。
  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好API Key对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在金融服务场景里让模型直接调用外部能力的人。
  • 已经在用 Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Zerodha Kite MCP Server当前 5 未标注 支持远程部署 无 2026-05-17
Alpaca MCP 62 stdio · 本地进程 支持远程部署 有 2026-05-18
OpenNews MCP 11 stdio · 本地进程 支持远程部署 有 2026-05-17
MCP Server 273df76d 未标注 stdio · 本地进程 本地部署 有 2026-05-17
tradingview-mcp 未标注 stdio · 本地进程 本地部署 有 2026-04-19
goat (Goat SDK) 未标注 未标注 未标注 无 2026-05-17

服务器档案

金融服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方121yaseen上游标注的维护方 121yaseen
分类金融服务本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式API Key远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型支持远程部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

8.5 KB
来自项目仓库与上游目录的原文,未做删改

Zerodha Kite MCP Server

This project implements an MCP (Model Context Protocol) server that interacts with the Zerodha Kite API, allowing you to perform trading actions like buying and selling stocks, and fetching your holdings and positions.

Prerequisites

  1. Node.js and npm/yarn: Ensure you have Node.js installed. This project uses typescript and esbuild for building.
  2. Zerodha Kite Developer Account: You need an account with Zerodha and access to their developer API.

Setup Instructions

1. Create a Kite App

  • Go to https://developers.kite.trade/create and create a new app.
  • During app creation, you can use any redirection URL (e.g., https://localhost:3000/api/callback/userauth). This URL is primarily used for the initial authentication flow.
  • Note down the API key and API secret provided after app creation.

2. Configure API Keys in the Project

  • Open the index.ts file.
  • Replace "your_api_key" with your actual Kite App API key.typescript const apiKey = "YOUR_ACTUAL_API_KEY"; // Replace with your API key
  • Important: The apiSecret is needed for the initial access token generation. It's commented out in the index.ts file by default. You will need to uncomment it and add your API secret when generating the access token for the first time.typescript // const apiSecret = "YOUR_ACTUAL_API_SECRET"; // Uncomment and replace for first-time token generation

3. Obtain an Access Token

The access token is required for the server to make authenticated calls to the Kite API. It needs to be generated once and can then be reused.

  • Step 3a: Get the Login URL
    • In index.ts, temporarily uncomment the getLoginUrl function:typescript // async function getLoginUrl() { // return kc.getLoginURL(); // }
    • You'll also need to call this function. You can add a line like console.log(await getLoginUrl()); at the end of the file or run it in a separate script.
    • Run the modified index.ts (e.g., using ts-node index.ts or by building and running the JS output). This will print a login URL to your console.
  • Step 3b: Authorize and Get Request Token
    • Open the printed login URL in your browser.
    • Log in with your Zerodha credentials and authorize the app.
    • After successful authorization, you will be redirected to your specified redirect_url. The URL will contain a request_token parameter (e.g., https://localhost:3000/api/callback/userauth?request_token=YOUR_REQUEST_TOKEN).
    • Copy this request_token.
  • Step 3c: Generate Access Token
    • In index.ts, uncomment the getAccessToken function and ensure your apiSecret is correctly set:typescript // async function getAccessToken(requestToken: string) { // const response = await kc.generateSession(requestToken, apiSecret); // console.log(response.access_token); // }
    • Call this function with the request_token you obtained. For example, add await getAccessToken("YOUR_REQUEST_TOKEN"); to the script or run it interactively.
    • Run the script. This will print your access_token to the console.
  • Step 3d: Set the Access Token in index.ts
    • Copy the generated access_token.
    • Paste it into the access_token variable in index.ts:typescript const access_token = "YOUR_GENERATED_ACCESS_TOKEN"; // Replace with your access token
    • Security Note: After generating the access token, you can (and should) comment out or remove the getLoginUrl and getAccessToken functions, and especially the apiSecret from index.ts to avoid accidental exposure. The access_token is long-lived.

4. Install Dependencies

Navigate to the project root directory in your terminal and run:```bash
npm install

or

yarn install

This will install `kiteconnect`, `@modelcontextprotocol/sdk`, `zod`, and other necessary dependencies.

### 5. Build the Project

The project uses TypeScript. You need to compile it to JavaScript. A common way is to use `esbuild` as suggested by the MCP server setup. If you have a `build` script in your `package.json` (e.g., `esbuild trader.ts --bundle --outfile=dist/trader.js --platform=node --format=esm`), run:```bash
npm run build
# or
yarn build

This will typically create a dist directory with the compiled trader.js file. Make sure the output path matches the one you will use in the MCP server configuration (see below).

Running the MCP Server

Once the setup is complete and the project is built, the MCP server can be started. The trader.ts (compiled to dist/trader.js) is the entry point for the MCP server.

The server listens for commands via standard input/output (stdio) when configured with an MCP client like Cursor.

Configuring with Cursor

To use this trader bot as an MCP server in Cursor:

  1. Go to Cursor settings (Cmd/Ctrl + ,).
  2. Navigate to Extensions -> MCP.
  3. Click on Edit in settings.json for Model Context Protocol: Servers.
  4. Add the following configuration:json { "mcpServers": { "trader": { "command": "node", "args": ["/path/to/your/Zerodha-MCP/dist/trader.js"] // Ensure this path is correct } } }
    Important: Replace /path/to/your/Zerodha-MCP/dist/trader.js with the absolute path to the compiled trader.js file on your system. For example, if your username is user and the project is in Development/Zerodha-MCP, the path would be /Users/user/Development/Zerodha-MCP/dist/trader.js.

Available MCP Tools

The server exposes the following tools that can be called by an MCP client:

  • trader.add

    • Description: A simple tool to add two numbers.
    • Parameters:
      • a (number): The first number.
      • b (number): The second number.
    • Returns: The sum of a and b.
  • trader.sellStock

    • Description: Places a market sell order for a given stock.
    • Parameters:
      • tradingsymbol (string): The trading symbol of the stock (e.g., "INFY", "RELIANCE").
      • quantity (number): The number of shares to sell.
    • Returns: A confirmation message "Stock sold successfully" or an error if the transaction fails.
    • Note: This uses PRODUCT_CNC (Cash and Carry, for delivery-based trades) and EXCHANGE_NSE. The order tag is automatically generated and incremented.
  • trader.buyStock

    • Description: Places a market buy order for a given stock.
    • Parameters:
      • tradingsymbol (string): The trading symbol of the stock.
      • quantity (number): The number of shares to buy.
    • Returns: A confirmation message "Stock bought successfully" or an error if the transaction fails.
    • Note: This uses PRODUCT_CNC and EXCHANGE_NSE. The order tag is automatically generated and incremented.
  • trader.getPositions

    • Description: Fetches your current open positions.
    • Parameters: None.
    • Returns: A JSON string representing your current positions.
  • trader.getHoldings

    • Description: Fetches your current holdings (stocks in your demat account).
    • Parameters: None.
    • Returns: A JSON string representing your holdings.

Project Structure Highlights

  • index.ts: Contains the core Kite Connect API interaction logic, including setting API keys, access tokens, and functions for buying/selling stocks, and fetching profile, holdings, and positions. It also handles persisting an orderTagCounter in counter.json to ensure unique order tags.
  • trader.ts: Sets up the MCP server using @modelcontextprotocol/sdk. It defines the tools exposed by the server and maps them to the functions in index.ts.
  • counter.json: Automatically created in the same directory as index.js (or its compiled output) to store and persist the last used order tag number. This ensures that order tags are unique across server restarts.

Development Notes

  • Order Tagging: The system uses an incremental counter (orderTagCounter in index.ts, persisted in counter.json) to tag orders. This helps in identifying orders.
  • Error Handling: Basic error handling is implemented (logging to console). You might want to expand this for more robust error reporting through the MCP.
  • Initial Setup: The init() function in index.ts is called automatically when index.ts is imported. It loads the orderTagCounter and sets the Kite Connect access token.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Zerodha Kite MCP Server 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Zerodha Kite MCP Server 怎么在 Cursor 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Zerodha Kite MCP Server 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Zerodha Kite MCP Server 需要 API Key 吗?

资料标注需要API Key认证,使用前准备好对应凭据,并按最小权限配置。

Zerodha Kite MCP Server 支持哪些客户端?

资料标注支持 Cursor;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Zerodha Kite MCP Server 能提供哪些能力?

资料显示约 5 个工具;能力标签包括 TypeScript、Cursor、金融数据。具体工具清单以官方文档为准。

Zerodha Kite MCP Server 需要什么运行环境?

属于远程端点,不需要在本地装运行时。

Zerodha Kite MCP Server 是本地还是远程?

它是远程端点,连服务地址即可。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。