Skip to main content
Glama
NagrajADesai

mcp-indian-stocks

by NagrajADesai
README.md
# Indian Stock Market MCP Server

An MCP (Model Context Protocol) server built in Python that provides real-time and historical data from the Indian Stock Market (BSE and NSE). 

## 🚀 Quick Start Guide

### 1. Get Your API Key
1. Go to [IndianAPI.in - Indian Stock Market API](https://indianapi.in/indian-stock-market).
2. Sign up and copy your API key.

### 2. Set Up the `.env` File
1. Clone this repository to your computer.
2. In the root of the project folder, create a new file named exactly `.env`.
3. Open the `.env` file and paste your API key like this:

```env
INDIAN_STOCK_API_KEY=your_api_key_here
```

### 3. Connect to Claude Desktop
To use this with Claude Desktop, update your configuration file.

*(On Windows, this is usually at `%APPDATA%\Claude\claude_desktop_config.json`)*

Add this to the `mcpServers` section:

```json
{
  "mcpServers": {
    "IndiaStockExchange": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp",
        "fastmcp",
        "run",
        "<file-path>\\main.py"
      ],
      "env": {}
    }
  }
}
```

> **Important:** Replace `<file-path>` with the actual path where you saved this repository (e.g., `C:\\Users\\yourname\\mcp-indian-stocks`).

---

## 🛠️ Available Tools

- **`get-market-news`** - Get the latest general market news.
- **`get-news`** - Get specific Indian Stock Exchange news.
- **`get-stock-details`** - Get comprehensive details for a specific stock.
- **`get-stock-history`** - Get historical pricing data for a stock.
- **`get-stock-price`** - Get the real-time stock price.
- **`get-stock-recommendations`** - Get stock recommendations based on market trends.
- **`get-top-gainers`** - Get a list of the top gaining stocks.
- **`get-top-losers`** - Get a list of the top losing stocks.

TDQS

A3.5/5.0

Scored across 11 tools

Disambiguation4/5

Each tool targets a distinct data category (mutual funds, IPOs, news, forecasts, corporate actions, commodities, etc.), so purposes are largely separable. Minor risk: get_price_shockers vs get_trending_stocks both surface 'notable stocks,' and get_stock_details vs get_historical_data both touch price data, but descriptions differentiate them adequately.

Naming Consistency4/5

Strong get_* verb_noun pattern (get_ipo_data, get_news, get_stock_details, etc.) across most tools. Two tools deviate with search_* (search_mutual_fund, search_industry), which is a reasonable distinction for search semantics but breaks pure consistency.

Tool Count5/5

11 tools is well within the ideal 3-15 range for a market-data server, with each tool covering a meaningful distinct data source. No redundant or filler tools are apparent.

Completeness4/5

Broad coverage spanning news, IPOs, forecasts, corporate actions, commodities, trending stocks, industry search, and historical data. A direct real-time stock quote or watchlist/portfolio operation is a minor gap, but agents can work around it via get_stock_details.