Dhan MCP Server
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Dhan MCP Servershow my holdings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Dhan MCP Server
An MCP (Model Context Protocol) server that exposes Dhan trading APIs as tools, enabling AI assistants to manage orders, view portfolios, fetch market data, and more.
Prerequisites
Node.js 18+
A Dhan account with API access
Access token from Dhan's developer portal
Related MCP server: DhanHQ MCP Server
Setup
1. Get your Dhan API credentials
Log in to Dhan Web
Go to Profile → DhanHQ Trading APIs
Generate an Access Token and note your Client ID
2. Install and build
npm install
npm run build3. Configure environment
Copy .env.example to .env and fill in your credentials:
cp .env.example .envDHAN_ACCESS_TOKEN=your_jwt_access_token_here
DHAN_CLIENT_ID=your_dhan_client_id_hereUsage
Run directly
DHAN_ACCESS_TOKEN=<token> DHAN_CLIENT_ID=<clientId> node dist/index.jsConfigure with Claude Desktop
Add to your Claude Desktop config.json:
{
"mcpServers": {
"dhan": {
"command": "node",
"args": ["/path/to/dhan-mcp-server/dist/index.js"],
"env": {
"DHAN_ACCESS_TOKEN": "your_access_token",
"DHAN_CLIENT_ID": "your_client_id"
}
}
}
}Available Tools
Orders
Tool | Description |
| Place a new order (equity, F&O, currency, commodity) |
| Place a large order split into smaller chunks automatically |
| Get all orders for today |
| Get a specific order by ID |
| Get order by client correlation ID |
| Modify a pending order |
| Cancel a pending order |
Trades
Tool | Description |
| Get all executed trades for today |
| Get trades for a specific order |
Portfolio
Tool | Description |
| View equity holdings from previous sessions |
| View open positions for today |
| Convert position between product types (e.g. INTRADAY → CNC) |
Funds & Margin
Tool | Description |
| View available margin, used margin, collateral |
| Calculate margin required for a potential order |
Market Data
Tool | Description |
| Real-time LTP for given securities |
| OHLC data for given securities |
| Full market depth (bid/ask, volume, OI) |
| Complete option chain for an underlying |
| Available expiry dates for an underlying |
| Historical daily OHLCV candles |
| Intraday OHLCV candles (1/5/15/25/60 min) |
Statements
Tool | Description |
| Account ledger for a date range |
| Historical trade records |
Profile & Auth
Tool | Description |
| User profile information |
| Renew the access token |
EDIS
Tool | Description |
| Generate EDIS slip for selling holdings |
| Check EDIS status for an ISIN |
Exchange Segments
Segment | Description |
| NSE Equity |
| NSE Futures & Options |
| NSE Currency Derivatives |
| BSE Equity |
| BSE Futures & Options |
| BSE Currency Derivatives |
| MCX Commodity |
Product Types
Type | Description |
| Cash and Carry (delivery) |
| Intraday MIS |
| Margin |
| Margin Trading Facility |
| Cover Order |
| Bracket Order |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vibeoski/dhan-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server