DEV Community

dineshrajdhanapathyDD
dineshrajdhanapathyDD

Posted on • Originally published at Medium on

Build a Smart Trading Assistant with Kite MCP Server and Claude Sonnet 4

1
Ai generated image — Charts terminal

AI assist in determining the current performance of your stocks by analysing your portfolio. That future has arrived with Zerodha’s most recent Kite MCP (Model Context Protocol) version. Through the MCP, you can ask Claude to work with your Zerodha account. Through this connection, investors may ask sophisticated market questions in plain English and communicate with their portfolio. This integration will fundamentally alter your investment process, regardless of your level of experience. We will go into great detail in this guide on how to integrate the Zerodha Kite MCP server with Claude and use it to revolutionise our investment workflow.

What is Kite MCP?

Kite MCP Server is a Zerodha-developed backend server program that integrates smoothly with the Kite Connect API. It enables you to programmatically manage your trading account, automate activities, and retrieve market data using a local or hosted server setup. It acts as an intermediary between your application and Zerodha’s trading infrastructure. Kite MCP stands for Model Context Protocol  — a new way to bridge your LLM (like Claude Sonnet 4) with Zerodha’s trading tools , such as holdings, orders, P&L, and market data.

2
Kite MCP Ecosystem

Why It Matters

Traditionally, you’d use the Kite Connect API to:

  • Write manual code
  • Query stock data
  • Analyze it yourself

But with Kite MCP , you can just ask:

“Check the NIFTY 50 index performance for the last 10 trading days?”

“Check my portfolio which stocks perform well?”

And Claude AI responds with insights, using live, contextual data.

How It Works

  • Acts as a connector : MCP links your LLM to Zerodha’s APIs.
  • 🧠 Provides context : Supplies Claude with current portfolio data, past trades, etc.
  • 🔄 Enables dynamic actions : Claude can not only “see” your data but also suggest or trigger actions like rebalancing or placing orders (if permitted).

Kite MCP turns your AI into a smart stock assistant that understands and acts on your portfolio data — in real time.

Prerequisites:

Prior to starting, make sure you have:

  • You have Node.js (version 14 or above) installed on your computer.
  • Your preferred desktop AI helper app is Claude Desktop.
  • A Zerodha trading account with free access to the Kite Connect API.

Check out the Kite MCP Server on GitHub:

Kite MCP Server MCP Server

GitHub — zerodha/kite-mcp-server: Zerodha Kite MCP server github.com

Setup Instructions:

1. Installing Node.js

First, download Node from the official website https://nodejs.org/en/download, depending on your operating system.

Once downloaded, use the following command to validate its installation:

npm -v
Enter fullscreen mode Exit fullscreen mode

3
check node.js version

Installing Claude Desktop

You can download Claude directly from the official site, or clone the app repository to install it on your local machine for more control and customization.

Building & Installation (Debian/Ubuntu based)

For Debian-based distributions (Debian, Ubuntu, Linux Mint, MX Linux, etc.), you can build Claude Desktop using the provided build script. Use command-line flags to specify the desired output format (.deb).

# Clone this repository
git clone https://github.com/aaddrick/claude-desktop-debian.git
cd claude-desktop-debian
Enter fullscreen mode Exit fullscreen mode

4
clone claude-desktop-debian

Build the package (Defaults to .deb)

./build.sh
Enter fullscreen mode Exit fullscreen mode

5
packages install

Updating the Build Script

When a new version of Claude Desktop is released, the script attempts to automatically detect the correct download URL based on your system architecture (amd64 or arm64). If the download URLs change significantly in the future, you may need to update the CLAUDE_DOWNLOAD_URL variables near the top of build.sh. The script should handle the rest of the build process automatically.

The script will automatically:

  • Check for and install required dependencies.

6
complete claude desktop apps

Claude apps installed successfully on your desktop! You can now integrate them with the Kite MCP Server to start using AI-powered portfolio insights in real time.

Uninstallation

Debian Package (.deb)

If you installed the .debpackage, you can uninstall it usingdpkg:sudo dpkg -r claude-desktop

If you also want to remove configuration files (including MCP settings), usepurge: sudo dpkg -P claude-desktop

7
claude signin page

You can sign in to Claude using your email and password by choosing the “Continue with Google” option on the Claude login page

8
AI assistant

  • Clearly mention the AI assistant functionality.
  • Click ‘I understand’ to continue the process.

9
pricing model of claude

  • various plan prices in Claude, but we are using free only.

10
default page claude desktop

  • Finally set up my desktop application.

Configuring Claude Desktop for MCP

we are using Claude’s desktop Application, we will need to change the settings file.

To do this:

  • Go to Claude Settings.
  • Then go to the Developer Section.
  • Click on “Edit Config”.

11
Developer settings

  • Look for “claude_desktop_config.json”. If the file isn’t already there, please create it with the same name.

12
config.json file

  • Insert the following code into it and save the file. This code contains a link to the Kite MCP, which Claude will use to access the remote tools.
{
   "mcpServers": {
       "kite": {
           "command": "npx",
           "args": ["mcp-remote", "https://mcp.kite.trade/sse"]
       }
   }
}
Enter fullscreen mode Exit fullscreen mode

13
vs code config.json file

  • To apply the modifications, save the file and restart Claude Desktop.

Troubleshooting Tips

No “kite” option in Tools menu?

• Ensure you’ve saved the config properly and restarted the app.

OAuth errors or “access denied”?

• Double-check your Zerodha API key permissions under the Kite developer dashboard.

Delayed updates in portfolio metrics?

• MCP streams over SSE; verify your network allows long-lived HTTP connections to mcp.kite.trade.

You should now see Kite MCP now showing up inside the setting menu in the prompt window

14
kite integration claude

You can now check the account from Kite (for example, ask about stock performance), and you should be prompted to visit a link.

15
login kite link

Navigate to that link, login into Kite, and then you will be required to authorise the Kite MCP app.

16
Authorize Kite MCP

You should obtain the login successful screen and may navigate back to the Claude desktop app and prompt with Done/Continue to alert it that the login is done so that it can proceed with fetching the desired data.

17
Kite Login Successful

Testing the Integration

Now that we have successfully added the Zerodha Kite MCP server to Claude, it’s time to test it out.

18
AI Investment Analysis

Claude Prompt:

“Check the NIFTY 50 index performance for the last 10 trading days?”

This prompt will instruct Claude to:

  • Connect to the Kite MCP Server
  • Fetch the historical market data for the NIFTY index
  • Summarise it in a user-friendly format — such as daily % change, trends, and overall movement.

When we enter the query, Claude correctly finds the Kite MCP AI tools and begins to enumerate the tools it will employ. It then prompts us to log in to Kite using the URL. When we click on the link and enter our account information, we will be logged in.

output:

19
Nifty Index Performance

Claude AI Response: The Nifty has trended upward over the past 10 days, gaining about 1.52%. It broke above 25,000 on June 6 and has since been consolidating around that level.

Next Claude Prompt:

“Check my portfolio which stocks perform well”

output:

20
My portfolio performance

Claude AI Response: Your portfolio is well-diversified, and several high-potential stocks are already delivering impressive returns.

Kite MCP’s Data Security Highlights

User-Authorized Access Only

  • Claude can access only the data explicitly authorised by the user  — no blanket access is granted.

No Credential Storage in Claude

  • Your Zerodha login credentials are never stored in Claude. All authentication is securely handled by Zerodha’s systems.

Read-Only by Design

  • Current operations are strictly read-only , meaning no trades or changes can happen without the user’s direct action or intent.

Privacy-Centric Architecture

  • Zerodha designed Kite MCP with privacy and safety as top priorities , ensuring control always stays with the user.

Conclusion

The launch of Kite MCP marks a major leap forward in AI-assisted trading. By integrating with Claude and other MCP-compatible clients, it transforms how traders interact with their portfolios, making insights, analytics, and decision-making as easy as asking a question.

With the Kite MCP server running on Debian using Node.js and connected seamlessly to your Kite apps , you now have a personalised, secure, and intelligent stock assistant right at your fingertips. This setup allows you to analyse your holdings, track performance, and make data-driven decisions  — all through natural language.

As AI in finance continues to evolve, this fusion of Zerodha’s secure infrastructure and Claude’s contextual intelligence is not just a tool; it’s a glimpse into the future of smart investing. Stay tuned, explore its full capabilities, and take control of your trading journey like never before.

Thank you for taking the time to read my article! If you found it helpful, feel free to like, share, and drop your thoughts in the comments — I’d love to hear from you.

Top comments (0)