zerodha-mcpserver
This is a Cloudflare Worker that serves as an MCP server for interacting with the Zerodha Kite Connect API, providing a comprehensive interface for trading and portfolio management.
The Zerodha Kite Connect MCP Server is designed to facilitate seamless interaction with the Zerodha Kite Connect API through a Cloudflare Worker. It offers a robust interface for managing trading activities and portfolios, including authentication, session management, and order handling. The server supports MCP-compatible responses, making it easy to integrate with MCP clients like Claude Desktop. Users can manage their holdings, positions, and GTT orders, as well as retrieve historical market data. The server ensures secure handling of API credentials and access tokens, leveraging Cloudflare's environment variables and KV namespace for storage. Deployment involves setting up a Cloudflare account, configuring API credentials, and deploying the worker using Wrangler.
Features
- Zerodha authentication and session management
- Portfolio management (holdings, positions)
- GTT (Good Till Triggered) orders
- Historical data retrieval
- MCP-compatible responses for seamless integration with Claude Desktop and other MCP clients
Usage with Different Platforms
Claude Desktop
Once deployed, you can add the worker as an MCP server in Claude Desktop:
1. Go to Settings > MCP Servers
2. Add a new server with your worker URL (e.g., `https://zerodha-mcp.your-subdomain.workers.dev`)
3. Claude will automatically discover the available methods
JavaScript
// Example of using the MCP worker in JavaScript
const loginUrl = await zerodhaWorker.getLoginUrl();
console.log('Please login at:', loginUrl);
// Authentication flow
window.location.href = loginUrl;
// After redirect back with request_token in URL...
const urlParams = new URLSearchParams(window.location.search);
const requestToken = urlParams.get('request_token');
// Get holdings after authentication
const holdingsResponse = await zerodhaWorker.getHoldings();
const holdings = JSON.parse(holdingsResponse.content[0].text);
console.log('Your holdings:', holdings);
// Get historical data
const historicalData = await zerodhaWorker.getHistoricalData(
'5633', // instrument_token (NSE:INFY)
'minute', // interval
'2023-01-01 09:15:00', // from
'2023-01-01 09:30:00', // to
false, // continuous
false // oi
);
console.log('Historical data:', JSON.parse(historicalData.content[0].text));
Related MCP Servers
View all finance servers →mcp-server
by financial-datasets
This is a Model Context Protocol (MCP) server that provides access to stock market data from Financial Datasets.
razorpay-mcp-server
by razorpay
The Razorpay MCP Server is a Model Context Protocol server that integrates with Razorpay APIs for advanced payment processing.
evm-mcp-server
by mcpdotdirect
A comprehensive Model Context Protocol (MCP) server that provides blockchain services across multiple EVM-compatible networks.
investor-agent
by ferdousbhai
The investor-agent is a Model Context Protocol server designed to provide comprehensive financial insights and analysis to Large Language Models.
mcp-cn-a-stock
by elsejj
This is an MCP (Model Content Protocol) service providing A-share data for large models.
mcp-trader
by wshobson
A Model Context Protocol (MCP) server designed for stock traders, offering a suite of tools for technical analysis and trading.
bsc-mcp
by TermiX-official
BNBChain MCP is a tool server designed for interacting with the Binance Smart Chain, enabling token transfers, smart contract interactions, and more, tailored for developers and AI agents.