Metadata-Version: 2.5
Name: globaldatafeeds-mcp
Version: 0.2.0
Summary: MCP server exposing GlobalDataFeeds (GFDL) Indian market data (NSE/BSE/MCX/NFO) to AI assistants.
Author: Suren
License-Expression: MIT
Keywords: bse,gfdl,globaldatafeeds,india,market-data,mcp,mcx,nse
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: mcp[cli]>=2.0
Requires-Dist: truststore>=0.10.5
Description-Content-Type: text/markdown

# globaldatafeeds-mcp

An [MCP](https://modelcontextprotocol.io) server that exposes **GlobalDataFeeds (GFDL)**
Indian market data — NSE, BSE, MCX, NFO, currency and indices — to any AI assistant
(Claude, Cursor, VS Code Copilot, etc.).

> **You bring your own key.** This server ships with **no** API key. Each user supplies
> their own GlobalDataFeeds access key through their client's config. Get a key from
> <https://globaldatafeeds.in>.

## Tools

Quotes: `get_last_quote`, `get_last_quote_short`, `get_last_quote_array`, `get_snapshot` ·
History: `get_history`, `get_history_after_market`, `get_exchange_snapshot` ·
Discovery: `get_exchanges`, `search_instruments`, `get_instruments`, `get_instrument_types`,
`get_products`, `get_expiry_dates`, `get_option_types`, `get_strike_prices` ·
Derivatives: `get_option_chain`, `get_option_greeks` ·
Analytics: `get_top_gainers_losers`, `get_volume_shockers` ·
Account: `get_server_info`, `get_limitation`, `get_market_messages`, `get_exchange_messages`,
`get_holidays`.

## Configuration

The server reads these environment variables:

| Variable | Required | Description |
|----------|----------|-------------|
| `GDF_API_KEY`  | **yes** | Your personal GFDL access key. |
| `GDF_BASE_URL` | no | Your GFDL endpoint. Defaults to the shared test server. |
| `GDF_LOG`      | no | Set to `0` to disable request logging. |

## Connect it to your AI client

Each client passes **your own key** via an `env` block — the key never lives in the package.

### Claude Desktop
`Settings → Developer → Edit Config`:

```json
{
  "mcpServers": {
    "globaldatafeeds": {
      "command": "uvx",
      "args": ["globaldatafeeds-mcp"],
      "env": {
        "GDF_API_KEY": "YOUR_OWN_KEY",
        "GDF_BASE_URL": "https://your-gfdl-endpoint:port"
      }
    }
  }
}
```

### Cursor
`~/.cursor/mcp.json` — same shape as above (`"mcpServers"` with the `env` block).

### VS Code (Copilot)
`.vscode/mcp.json` — prompts for the key so it's never written to the file:

```json
{
  "inputs": [
    { "type": "promptString", "id": "gdf-key", "description": "GFDL API Key", "password": true }
  ],
  "servers": {
    "globaldatafeeds": {
      "type": "stdio",
      "command": "uvx",
      "args": ["globaldatafeeds-mcp"],
      "env": { "GDF_API_KEY": "${input:gdf-key}" }
    }
  }
}
```

Restart the client after editing its config.

## Local development

```bash
uv sync
cp .env.example .env          # put your key in .env
uv run mcp dev server.py      # opens the MCP Inspector
```

## License

MIT
