- NanoBits
- Posts
- Zerodha MCP calculated my portfolio risk in 17 seconds, I'm speechless 🤯
Zerodha MCP calculated my portfolio risk in 17 seconds, I'm speechless 🤯
Claude App & Kite MCP server to create an AI assistant for investment analysis

EDITOR’S NOTE
Dear Future-Proof Humans,
What if your AI assistant could look at your stock portfolio and tell you exactly which sectors are overweight, calculate your portfolio's risk profile, and suggest specific stocks to buy based on your current holdings?
What if it could scan earnings calendars for all your investments, analyze historical price patterns around those announcements, and recommend whether you should hold through earnings or take profits?
What if it could do all this while you're having a natural conversation, no spreadsheets or manual calculations required?
We've been exploring MCP connections for weeks now. After showing you how Claude works with WhatsApp, Gmail, Brave Search, and Reddit, I wanted to tackle something that hits closer to home for many of us: our investment portfolios.
đź’ˇ Quick reminder:
MCP (Model Context Protocol) lets Claude connect directly to external tools and services. No programming needed—your AI assistant can now interact with apps and data sources using simple commands.
This week, we're connecting Claude to Zerodha's Kite platform. This isn't just about checking stock prices. We're talking about real portfolio analysis, risk assessment, and investment strategy discussions with your AI assistant.
In this edition of Nanobits, we will:
⚡️ Walk through setting up the Kite MCP server connection
đź”— Show you the actual portfolio analysis prompts we tested
📊 Explore how Claude can help with sector allocation and stock selection decisions
Let's turn your investment analysis into a conversation. Let's begin!
ARE YOU NEW TO MODEL CONTEXT PROTOCOL?
Think of MCP as a universal translator—it lets AI like Claude and Cursor actually interact with your apps and data (no more copy-paste purgatory).
Catch up fast: Here’s an MCP explainer breaking down how it works, why it matters, and where it’s headed.
These are the past experiments we have conducted with various MCP servers:
You can reach out to us if you get stuck.
MCP IN ACTION: WHAT CAN YOU DO WITH YOUR KITE BY ZERODHA APP?
As before, we will work with Claude Desktop as our MCP host for this newsletter.
What You Need First
Make sure you have these ready:
Claude Desktop App (download from Anthropic's website)
Node.js installed on your computer
Access to your Zerodha Kite account
Step 1: Install Node.js
Download and install Node.js from nodejs.org.
Once installed, open your Command Prompt or Terminal and type node --version
to verify it's working.
Step 2: Configure Claude Desktop
Open your Claude Desktop application. Look for the settings option and click it. In the left sidebar, you'll see "Developer." Click on that, then click "Edit Config."

This opens your configuration file, claude_desktop_config.json
. Add this exact code:
{
"mcpServers": {
"kite": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.kite.trade/sse"]
}
}
}
Copy and paste this exactly as shown. The formatting matters.
Step 3: Save and Restart
Save the configuration file and completely close Claude Desktop. Reopen it fresh.
Step 4: Verify the Connection
In Claude Desktop, look for the tools/hammer icon in the chat interface. Click it to verify that Kite MCP tools are available. Follow the authorization prompts to connect to your Zerodha account.
Step 5: Test It Out
Start a new conversation and try: "What's my current portfolio value?" or "Show me my top holdings." If Claude responds with your actual portfolio data, you're connected.
If these things feel alien to you, you can refresh your memory with our previous newsletter or reply to this email to learn more. We are also available on LinkedIn.
TASKS WITH KITE BY ZERODHA MCP SERVER
Now you're ready to start using Claude with your Kite account!
Connecting Claude to your Zerodha account opens up possibilities that go far beyond checking stock prices. We tested four specific investment analysis tasks that would normally require spreadsheets, multiple websites, and hours of manual work.
Task 1: Calculate Your Portfolio Beta
One of the most fundamental risk metrics for any portfolio is beta, which measures how much your investments move relative to the market. Getting this number usually means downloading data, looking up individual stock betas, and doing weighted calculations.
How It Works
Claude can access your actual holdings and calculate your portfolio's weighted beta in real time:
Claude logs into your Kite account (with your permission)
Retrieves your current holdings and position sizes
Looks up individual stock betas for each holding
Calculates the weighted average based on your actual allocations
Example Prompt
What is the beta for my Kite portfolio?
What Claude Returns

If you want a more detailed result, you can watch this video on Beta calculation.
As shown in the screenshot, Claude created a complete portfolio beta calculator that shows:
Total portfolio value: ₹2,57,059
Portfolio Beta: 0.106 (much lower than market volatility). It provides the option to enter beta values for respective stocks, allowing it to calculate an overall weighted value.
Beta completion: 3% (meaning some holdings lack beta data)
Risk Level: Low Risk (Less volatile than the market)
Claude created a visual interface that allowed you to input beta values manually.
Task 2: Portfolio Diversification Analysis
Getting beyond basic metrics, we wanted to see if Claude could analyze correlation patterns across the holdings and suggest specific improvements. This type of analysis typically requires advanced portfolio management software.
How It Works
Claude can examine your holdings for correlation clusters and suggest specific stocks to improve diversification:
Analyzes correlation patterns between your current holdings
Identifies sectors or stocks that move together
Suggests specific replacement stocks from uncorrelated sectors
Provides allocation percentages and expected impact
Example Prompt
Analyze the correlation between my top holdings and suggest 3 stocks from different sectors that would reduce my overall portfolio correlation and improve diversification.
What Claude Returns

If you want a more detailed result, you can watch this video on correlation and diversification analysis.
The analysis revealed some interesting insights about my portfolio structure:
Claude provided three specific stock recommendations (Nestle, Asian Paint, Bajaj Auto) with detailed correlation analysis for each, identified key concentration risks in my portfolio, and quantified the expected impact using precise metrics, such as reducing portfolio correlation from -0.70 to -0.50 and achieving a 15-25% reduction in volatility.
The depth of this analysis surprised me. Claude didn't just suggest random stocks; it identified specific correlation clusters in my holdings and recommended stocks that would genuinely improve risk-adjusted returns.
Task 3: Earnings Season Strategy
Earnings announcements can create significant volatility in individual stocks. I wanted to see if Claude could scan my holdings for upcoming earnings and provide historical context to inform my decision-making.
How It Works
Claude combines your portfolio data with earnings calendars and historical price analysis:
Identifies which of your holdings have earnings in the next 2-4 weeks
Analyzes historical price movements around those earnings dates
Categorizes stocks by volatility patterns
Provides specific recommendations for each holding
Example Prompt
Identify which of my holdings have earnings announcements in the next 2-4 weeks. Analyze their historical price movements around earnings and suggest whether to hold, hedge, or take profits.
What Claude Returns

If you want a more detailed result, you can watch this video on earnings analysis.
The earnings analysis provided immediate actionable insights:
Claude identified specific earnings dates for my holdings over the next 2-4 weeks, provided immediate action items with color-coded urgency (take profits on COCHINSHIP, hedge HDFCBANK), and categorized all my stocks by historical earnings volatility patterns with specific percentage moves and strategic recommendations for each.
This level of analysis would have taken me hours to compile manually, requiring me to check earnings calendars, look up historical price data, and cross-reference with my actual position sizes.
Task 4: Sector Rotation Strategy
For my final test, I wanted to see if Claude could analyze current market momentum and suggest a complete reallocation strategy based on my existing holdings.
How It Works
Claude can evaluate sector performance trends and suggest specific reallocation strategies:
Analyzes your current sector allocation
Reviews recent sector momentum and performance
Identifies overweight and underweight positions
Suggests specific stocks for long-term positioning
Example Prompt
Should I rotate some of my allocation to other sectors? Analyze the current sector's momentum and suggest where to reallocate funds. Suggest the top 3 stocks that have long-term gains.
What Claude Returns

If you want a more detailed result, you can watch this video on reallocation analysis.
The sector rotation analysis provided a comprehensive rebalancing strategy:
Claude recommended three specific long-term stocks (TCS, ICICI Bank, Bajaj Finance) with detailed rationales and growth catalysts for each, plus provided a complete reallocation strategy with exact percentage adjustments across sectors, including what to reduce, increase, and maintain in my portfolio.
The strategy aims to reduce concentration risk while positioning for sectors with strong long-term growth potential.
Each of these tasks demonstrates how Claude can transform portfolio management from a manual, time-intensive process into conversational analysis that provides institutional-quality insights.
End Note
That’s all from us for this week.
From WhatsApp to Reddit to Google Tasks, we've explored ways to make Claude work for you. Now we're adding your investment portfolio to your AI toolkit, turning complex portfolio analysis into simple conversations.
Having Claude analyze your actual holdings, calculate risk metrics, and suggest specific stocks based on your current positions is like having a personal investment analyst available 24/7. The level of detail in the correlation analysis, earnings calendars, and sector rotation strategies was surprising to us.
Next week, we'll explore even more practical MCP connections you can build in minutes. Until then, try connecting Claude to your Zerodha account and see what happens when your AI can read your portfolio and provide institutional-quality analysis.
Three Kite App + Claude experiments to try this weekend:
Ask Claude, "Break down my portfolio's exposure to different factors (growth vs value, small vs large cap, domestic vs export-oriented). My current allocation shows 34.16% small-cap - is this optimal given current market conditions?" Watch it analyze your style tilts and factor concentrations.
Challenge Claude to run a stress test on my portfolio: How would a 20% market correction affect my holdings? Which positions would be most vulnerable? Create a visualization that shows potential losses by sector and suggest corresponding hedging strategies.
Have Claude analyze your sector allocation and create a rebalancing plan with specific stock recommendations, target percentages, and the expected impact on your portfolio's risk profile
Start small by checking your portfolio beta. If you get stuck, reply to this email and we'll walk you through the setup.
Which other daily task would you automate first? Let us know what you'd like Claude to handle for you next.
Share the love ❤️ Tell your friends!
If you liked our newsletter, share this link with your friends and request them to subscribe too.
Check out our website to get the latest updates on AI.
Reply