NN

ngm9/nsei_mcp_server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

2 stars 6 forks 质量 52 趋势 8MIT

National Stock Exchange India (NSEI) MCP Server

概览

A Model Context Protocol (MCP) server that provides access to NSEI trade data through a standardized interface. This server allows AI assistants like Claude to access financial data programmatically. - : Access the top movers — gainers and losers for any given time period (presently limiting upto any 3 months interval) - : Retrieve latest trades for further analysis of the day's movements - Python 3.8 or higher - UV package manager (recommended) or pip - Financial Modeling Prep API key 2. Install dependencies using UV (recommended): UV provides faster dependency resolution and installation. To run the server with UV: The server will start and listen for connections on the default MCP port. Claude Desktop can connect to MCP servers to access financial data. Here's how to set it up: 1. Download Claude Desktop 2. If you're running the server from previous steps, you may shut it down since Claude Desktop will spawn a local server by itself. 2. Edit claude_desktop_config.json:

README

National Stock Exchange of India (NSEI) MCP Server

A Model Context Protocol (MCP) server that provides access to NSEI trade data through a standardized interface. This server allows AI assistants like Claude to access financial data programmatically.

Features

  • Get top Movers: Access the top movers — gainers and losers for any given time period (presently limiting upto any 3 months interval)
  • Get latest trades: Retrieve latest trades for further analysis of the day’s movements

Installation

Prerequisites

  • Python 3.8 or higher
  • UV package manager (recommended) or pip
  • Financial Modeling Prep API key

Setup

  1. Clone this repository

  2. Install dependencies using UV (recommended):

    uv venv
    uv pip install -r requirements.txt
    

    Or using pip:

    pip install -r requirements.txt
    

Running the Server

UV provides faster dependency resolution and installation. To run the server with UV:

# Activate the virtual environment
uv venv activate

# Run the server
python nsei_mcp_server.py

The server will start and listen for connections on the default MCP port.

Using pip

# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Run the server
python fmp_mcp_server.py

Connecting with Claude Desktop

Claude Desktop can connect to MCP servers to access financial data. Here’s how to set it up:

  1. Download Claude Desktop
  2. If you’re running the server from previous steps, you may shut it down since Claude Desktop will spawn a local server by itself.
  3. Edit claude_desktop_config.json:
    	"fmp_mcp_server": {
            "command": "uv",
            "args": [
                "--directory",
                "REPLACE ME WITH ABSOLUTE DIRECTORY TO REPO",
                "run",
                "fmp_mcp_server.py"]
             }

Now Claude can use the FMP data through the MCP interface. You can ask Claude to:

  • Get top movers for the day from NSE
  • Retrieve trades for a particular stock — “how did RIL perform today?”
  • And more!

Example Queries for Claude

Once connected, you can ask Claude questions like:

  • “How did SBI’s stock perform today?”
  • “Was RIL among the top movers today?”
  • “Find me the biggest losers by percentage points in today’s equity market trading”

Caching

Will be implemented in future versions

Logging

Logs are written to the logs directory with rotation enabled:

  • Maximum log file size: 10MB
  • Number of backup files: 5

License

MIT License

Acknowledgements

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →