Hi @Everyone,
What if you could hand an AI a simple idea, let it do the research, pick the stocks, and then place the trades in your own trading account, while you stay firmly in charge of every decision? That is exactly what becomes possible when Claude is connected to Dhan through the Model Context Protocol (MCP).
This guide walks you through the complete workflow, from adding the Dhan connector to Claude, logging in securely and reading your portfolio, to researching a market theme, building a five-stock basket, confirming the plan and verifying live orders on the Dhan platform. Every step explains what to do, why you are doing it, how it works and what you should see when it succeeds.
Why Generic AI Is Not Enough for Trading
A standard AI chat assistant answers from general information gathered from across the internet. It does not know your account, your balance, your holdings or your trading style. Ask it what your account balance is and it simply has no way to know, because that number is private, changes constantly and does not exist on the public web.
For complete research-to-execution automation, the AI needs a secure, controlled way to talk to your broker. That link is MCP.
What Is MCP (Model Context Protocol)?
MCP stands for Model Context Protocol. Think of it as a bridge, or an AI connector, between your AI assistant and an external service. The connector between Claude and Dhan is the Dhan MCP. Once the bridge is built, Claude is no longer limited to public information. It can work with your real account data through a defined set of tools.

Figure 1: How Claude reaches your Dhan account: you instruct Claude, Claude calls the Dhan MCP connector, and the connector talks to your Dhan account.
| Capability | What Claude can do once connected |
|---|---|
| Portfolio | Read your holdings and positions |
| Market data | Fetch live prices for stocks |
| Historical data | Retrieve past price data |
| Margin | Check available balance and utilised margin |
| Order book | Read pending and executed orders |
| Alerts | Work with price and market alerts |
| Orders | Place orders in your account when you instruct it |
MCP is not limited to brokers. Connectors exist for many services such as Gmail, Google Drive and Google Sheets. Once an MCP is connected, the AI can work with the real account behind it.
You Stay in Control
Because the connector reaches account level, it is designed around one rule: you are always the decision maker. Claude acts only on your instruction. It proposes a plan, shows you the quantities and values, and waits for your confirmation before any order is placed.

Figure 2: The confirmation loop: idea, research, plan, your review, your explicit confirmation, and only then order placement.
Handle account-level access carefully
The connector can see and act on your Dhan account. Only add connectors from developers you trust, and review the tool permissions carefully (Step 4).
Part 1: Connect Claude to Dhan
Step 1: Open the Connectors Settings
| Item | Detail |
|---|---|
| What to do | Open Claude, go to Settings, select Connectors, then follow the Customize link. |
| Why | Connectors are managed from the Customize area, so this is where the Dhan MCP will be added. |
| How it works | The Connectors page in Settings now simply points you to Customize, where you can browse, connect and manage connectors. |
| Expected result | The Customize screen opens with Skills and Connectors in the left menu. |

Figure 3: Settings > Connectors shows that connectors have moved to Customize. Click the Customize link.
Finding the Dhan MCP URL
Search for “Dhan MCP” on Google or in Dhan’s documentation. The instructions there give you the connector URL used in Step 3.
Step 2: Choose Add Custom Connector
| Item | Detail |
|---|---|
| What to do | In Customize > Connectors, click the plus (+) button and choose Add custom connector. |
| Why | Dhan is not in the pre-built list, so you register it manually as a custom connector. |
| How it works | The plus button offers two options: Browse connectors (pre-built ones) and Add custom connector (your own URL). |
| Expected result | The Add custom connector form appears. |

Figure 4: The plus (+) menu in Connectors offers Browse connectors and Add custom connector.
Step 3: Enter the Connector Name and URL
| Item | Detail |
|---|---|
| What to do | Type Dhan as the name, paste the Dhan MCP URL, and click Add. |
| Why | This tells Claude that Dhan is a broker and where to reach Dhan’s tools. |
| How it works | The URL points Claude to Dhan’s MCP server. The OAuth Client ID and Secret fields under Advanced settings are optional and can be left blank. |
| Expected result | Dhan appears in your connector list. |
Name : Dhan
URL : https://mcp.dhan.co/mcp

Figure 5: The Add custom connector form completed with the name Dhan and the Dhan MCP URL.
Trust check
The form itself warns: only use connectors from developers you trust. Anthropic does not control which tools developers make available and cannot verify that they will work as intended or that they will not change.
Step 4: Review the Tool Permissions
| Item | Detail |
|---|---|
| What to do | Open the Dhan connector and review the list of tools and their permissions. |
| Why | Each tool is a specific ability Claude can use. You decide when Claude may use it. |
| How it works | Dhan exposes 11 tools, including Alerts, Complete login, Historical data, Login, Margin, Market data, Orderbook, Portfolio and Search agent tools. Each tool can be set with the check (always allow), hand (ask first) or block icons, or all together through the group dropdown. |
| Expected result | Claude knows exactly which Dhan tools it may use. |

Figure 6: Dhan tool permissions. In this walkthrough all tools are set to Always allow.
Order confirmation still applies
Even with tools set to Always allow, the workflow in this guide keeps you in charge: Claude proposes the trades and waits for your explicit confirmation before placing orders.
Want extra safety?
Set tools that can act on your account to the ask-first option so that you approve each use.
Step 5: Check Whether You Are Connected
| Item | Detail |
|---|---|
| What to do | In a new chat, ask Claude whether it is connected with Dhan. |
| Why | Adding the connector only registers Dhan. You must still log in to your own Dhan account. |
| How it works | Claude calls the Portfolio tool. If your session is missing or expired, it returns a login link. |
| Expected result | Claude reports Not connected and shares a Dhan authentication link. |
Am I connected with Dhan?

Figure 7: Claude reports that the Dhan session has expired and provides a login link to authenticate.
Step 6: Open the Authentication Link
| Item | Detail |
|---|---|
| What to do | Click the link that Claude provides and choose Open link in the confirmation dialog. |
| Why | This starts Dhan’s secure browser consent, so you log in directly with Dhan and never share your credentials in the chat. |
| How it works | Claude warns you that you are leaving to visit an external link so you can confirm it is the Dhan address. |
| Expected result | The Dhan login page opens in your browser. |

Figure 8: Claude asks for confirmation before opening the external Dhan consent-login link.
Step 7: Complete the Login and Consent
| Item | Detail |
|---|---|
| What to do | Log in to Dhan and approve the consent. |
| Why | This grants the Dhan MCP a session on your account. |
| How it works | After approval, Dhan redirects to its MCP callback page. |
| Expected result | The page displays “Authentication completed. Return to your MCP client and continue.” |

Figure 9: Dhan confirms that authentication is complete. Return to Claude and continue.
Step 8: Confirm the Login and Check Your Balance
| Item | Detail |
|---|---|
| What to do | Return to Claude and ask whether you are logged in. |
| Why | This verifies that Claude can now read your live account. |
| How it works | Claude uses the Portfolio tool to read your funds directly from Dhan. |
| Expected result | Claude confirms the connection and shows your available balance, utilised margin and open positions. |
Am I logged in?

Figure 10: Claude confirms the connection: Available Balance ₹94,644.69, Utilised ₹0, no open positions.
Compare the figure with the balance shown in your Dhan terminal. It matches to the last decimal place. Claude cannot find this number anywhere on the internet. It is read from your account, live, through the MCP.
Step 9: Read Your Holdings
| Item | Detail |
|---|---|
| What to do | Ask Claude to check your holdings. |
| Why | This confirms that Claude can read portfolio-level data, not just the balance. |
| How it works | The Portfolio agent tool fetches your holdings, then Claude formats them into a table. |
| Expected result | A table of every holding with quantity, average cost and invested amount. |
Check my holdings

Figure 11: Claude lists seven holdings with quantity, average cost and invested value.
| Stock | Qty | Avg cost (₹) | Invested (₹) |
|---|---|---|---|
| VOLTAS | 12 | 1,309.80 | 15,717.60 |
| WIPRO | 4 | 200.14 | 800.55 |
| TATASTEEL | 2 | 197.37 | 394.74 |
| ONGC | 1 | 299.75 | 299.75 |
| PNB | 1 | 101.89 | 101.89 |
| YESBANK | 1 | 21.80 | 21.80 |
| TRIDENT | 1 | 24.16 | 24.16 |
| Total invested | 17,360.49 |
Session expiry
Login sessions can expire. If Claude reports that the Dhan session has expired, simply repeat Steps 5 to 8.
Part 2: From Market Idea to Live Positions
With the connection working, the real value begins. You can hand Claude a market thesis, ask it to research the stocks, and then have it build the position in your account, all in one conversation.

Figure 12: The workflow: idea, AI research, shortlist, plan, confirm and place orders, then monitor and rebalance.
Step 10: Share a Market Idea and Ask for Research
| Item | Detail |
|---|---|
| What to do | Describe your idea and ask Claude to research bullish and bearish stocks with a direct impact. |
| Why | AI research is only as useful as the thesis behind it. Your view on the market is what makes it your research. |
| How it works | Claude searches the web, gathers current information and organises it into sector-wise winners and losers. |
| Expected result | A structured thematic research report. |
In this example the thesis is a heat wave across India linked to El Nino. Reasoning: if crops suffer, FMCG companies are affected; cooling and power demand should rise; and water scarcity is already visible in cities like Mumbai.
I think there will be a heat wave across India and it will have a financial impact.
Research stocks, both bullish and bearish, that have a direct impact
on prices due to El Nino.

Figure 13: Claude searches the web and opens its El Nino / Heat Wave research. It cites flagged probabilities of a significant El Nino developing by mid-2026.
Claude’s research flagged an 80-90% probability of a significant El Nino developing by mid-2026 and lasting into early 2027, comparing the potential event to the major episodes of 1982-83, 1997-98 and 2015-16. From there it split the market into likely winners and likely losers.
| Sector | Expected impact | Reasoning | Example names |
|---|---|---|---|
| Cooling / air-conditioning | Bullish | Direct positive impact as heat drives demand for cooling | Voltas, Blue Star, Havells India |
| Power | Bullish | More electricity consumption in hot weather | NTPC, Tata Power |
| Water | Bullish | Demand rises with water scarcity | Water-related names |
| Auto | Slightly bearish | Seen as a bit bearish in the analysis | Auto companies |
| FMCG | Bearish | If crops fail, demand and costs are affected | FMCG companies |

Figure 14: Sector impact map for the heat-wave theme, based on the research described above.
This is an example thesis, not advice
The El Nino idea is used only to demonstrate the workflow. Form your own view and verify any AI research before acting on it.
Step 11: Ask Claude to Trade the Ideas
| Item | Detail |
|---|---|
| What to do | Ask Claude to trade the top five bullish stocks from its research. |
| Why | Research becomes action only when you decide it should. |
| How it works | Before touching your account, Claude asks clarifying questions about how you want to trade. |
| Expected result | Claude asks about product type, capital and order type, and reminds you of your available balance. |
Let us trade top 5 bullish stocks for it

Figure 15: Claude pauses to ask about product type, allocation and order type before placing anything.
| Question from Claude | Options |
|---|---|
| Product type | CNC (delivery / positional) or INTRADAY |
| How much to allocate | Total capital across all five, or per stock |
| Order type | MARKET order or LIMIT order (at a specific price) |
Step 12: Answer the Clarifying Questions
| Item | Detail |
|---|---|
| What to do | Reply with the product, the capital and how to split it. |
| Why | Your answers set the risk, the holding style and the size of the trade. |
| How it works | Claude uses your capital and splits it across the selected stocks using live prices. |
| Expected result | Claude prepares a plan and does not execute it yet. |
In this example the choices were the Intraday product and ₹50,000 for the El Nino portfolio, divided equally among the top five stocks (₹10,000 each).
Intraday order. I have ₹50,000 for this El Nino portfolio.
Divide it equally into the top five stocks and build this position.
Step 13: Review the Proposed Plan
| Item | Detail |
|---|---|
| What to do | Read the table Claude presents: stock, last traded price (LTP), quantity and value. |
| Why | This is your checkpoint. You verify every quantity and amount before any order exists. |
| How it works | Claude divides ₹10,000 per stock by the live price and rounds down to whole shares. |
| Expected result | A five-stock plan totalling ₹45,983. |

Figure 16: Claude’s proposed basket with live prices, quantities and values, plus a warning about the Amber allocation.
| Stock | LTP (₹) | Qty | Value (₹) |
|---|---|---|---|
| VOLTAS | 1,287.90 | 7 | 9,015 |
| BLUESTARCO | 1,634.40 | 6 | 9,806 |
| NTPC | 356.40 | 28 | 9,979 |
| TATAPOWER | 389.55 | 25 | 9,739 |
| AMBER | 7,443.50 | 1 | 7,444 |
| TOTAL | 45,983 |

Figure 17: Value allocated to each stock against the ₹10,000 target. Whole-share rounding leaves the total below ₹50,000.
Watch high-priced stocks
Amber costs about ₹7,443 per share, so only one share fits the ₹10,000 budget. Claude flags this and offers to swap Amber for a cheaper stock such as Havells or Coal India, or to proceed as is. Reviewing this kind of detail is exactly why the confirmation step exists.
Step 14: Confirm and Build the Position
| Item | Detail |
|---|---|
| What to do | Reply with a clear confirmation, or ask for changes first. |
| Why | Nothing is placed until you say so. This keeps you in control even though the connector can access your account. |
| How it works | On your confirmation, Claude calls the Dhan order tools and places one order per stock, then reports the order IDs. |
| Expected result | Orders are sent to Dhan and positions start to build. |
Let's build it now.
Order type
Claude’s summary described market buy orders, but in Dhan the orders appear as Limit orders priced close to the live price. Always check the order type in your Dhan orders page.
Step 15: Verify the Orders in Dhan
| Item | Detail |
|---|---|
| What to do | Open the Orders page on Dhan and compare it with Claude’s report. |
| Why | Independent verification confirms that the AI’s actions match what your broker recorded. |
| How it works | The page lists Pending Orders and Executed orders with time, product, quantity, order type, price, LTP and status. |
| Expected result | Executed and pending orders that match the plan. |

Figure 18: Dhan’s Orders page: Blue Star, Tata Power and NTPC are executed as Intraday limit orders, while Amber and Voltas are still pending.
| Stock | Product | Qty | Order type | Limit price (₹) | Status |
|---|---|---|---|---|---|
| Blue Star | Intraday | 6 / 6 | Limit | 1,636.10 | Success |
| Tata Power | Intraday | 25 / 25 | Limit | 390.05 | Success |
| NTPC | Intraday | 28 / 28 | Limit | 356.95 | Success |
| Voltas | Intraday | 0 / 7 | Limit | 1,286.00 | Pending |
| Amber Enterprises | Intraday | 1 | Limit | 7,442 | Pending |
The two Tata Steel delivery entries in the Executed list are earlier cancelled orders and are not part of this basket. Once price reaches the limit, the pending Voltas and Amber orders execute, completing all five positions.

Figure 19: Illustrative 5-minute candle chart: a limit buy stays pending until price trades down to the limit and then fills.
Why some orders stay pending
A limit order fills only at your price or better. If the market has not touched the limit, the order waits in the Pending list. That is why the Amber and Voltas orders were open while the others were already executed.
Step 16: Change the Product from Intraday to Delivery
| Item | Detail |
|---|---|
| What to do | Ask Claude to convert the positions to delivery. |
| Why | Intraday positions are meant to be closed within the day. Converting them lets you hold the theme for longer. |
| How it works | Claude uses Dhan’s tools to change the product type of your open positions. |
| Expected result | Positions move from Intraday to Delivery. |
Convert the positions to delivery
Putting the Trade in Context: Entry and Exit
A thematic idea gives you a reason to enter. It should also come with a plan for leaving. The illustrative daily chart below shows a typical thesis trade with an entry, a target, a stop-loss and two moving averages to judge trend. You can ask Claude to help you define such levels for the positions it builds.

Figure 20: Illustrative daily candle chart with EMA 20 and EMA 50, the entry point and example target and stop-loss levels.
Using the Same Workflow for Other Ideas
The heat-wave example is only one use. Any thesis can go through the same pipeline: research with Claude, plan, confirm and place.
- Defence budget: India’s defence budget may stay strong after a recent period of conflict.
- Data-centre boom: rising infrastructure demand linked to AI.
- IT sector: a view that IT companies could face pressure.
- Any personal idea: research it in Claude, then let the connector place the orders in your account after your confirmation.
Managing the Portfolio Actively
This is not passive investing. Once the positions are built you can return to the same conversation days or months later and ask how the portfolio is performing, compare it against your thesis, and ask Claude to rebalance it.
How is my El Nino portfolio performing now?
Compare it with the original plan and rebalance if needed.

Figure 21: Illustrative basket P&L curve with review points: positions built, a check after three days and a rebalance review after two months.
Best Practices and Troubleshooting
| Situation | What to do |
|---|---|
| Claude says you are not connected | Your session has expired. Run the login flow again (Steps 5 to 8). |
| Order stays in the Pending list | It is a limit order that has not reached its price. Wait, modify or cancel it in Dhan. |
| A stock gets only 1 share | Ask Claude to swap it for a lower-priced stock or accept the smaller allocation. |
| Total value is below your capital | Whole-share rounding. Adjust quantities or capital if needed. |
| Unsure what an order did | Always cross-check the Dhan Orders and Positions pages. |
- Give Claude a clear thesis and clear instructions: product, capital and order type.
- Read the plan carefully before you confirm.
- Verify every action in Dhan.
- Start with small amounts while you learn the workflow.
Summary
- MCP is the bridge that lets Claude read your Dhan account and act on it.
- Add the Dhan MCP as a custom connector, review its tool permissions and log in with Dhan’s secure consent flow.
- Once connected, Claude can read your balance, holdings, positions and orders in plain English.
- Give Claude a market thesis, get sector-wise research, then have it plan a basket with your chosen product, capital and order type.
- You stay in control: nothing is executed until you confirm.
- Afterward, review, compare and rebalance the portfolio by chatting with Claude.
Resources
YouTube video walkthrough: