NEPSE API

v1.0.0Finance & Fintechstable

Unlock Nepal Stock Exchange (NEPSE) data with this powerful unofficial API. Features REST, WebSocket, and a first-of-its-kind Model Context Protocol (MCP) server, enabling AI models like Claude to perform live market analysis with over 20 specialized

financial-marketsmcpmcp-serversnepalnepal-stock-exchange
Share:
44
Stars
0
Downloads
0
Weekly
0/5

What is NEPSE API?

NEPSE API is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to unlock nepal stock exchange (nepse) data with this powerful unofficial api. features rest, websocket, and a first-of-its-kind model context protocol (mcp) server, enabling ai models like claude to per...

Unlock Nepal Stock Exchange (NEPSE) data with this powerful unofficial API. Features REST, WebSocket, and a first-of-its-kind Model Context Protocol (MCP) server, enabling AI models like Claude to perform live market analysis with over 20 specialized

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Unlock Nepal Stock Exchange (NEPSE) data with this powerful

Use Cases

Perform live market analysis on Nepal Stock Exchange data.
Access REST and WebSocket APIs for stock market data.
Use 20+ specialized tools for financial analysis.
surajrimal07

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx nepseapi-unofficial

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use NEPSE API

The NEPSE API Unofficial MCP server brings live Nepal Stock Exchange market data to AI assistants through more than 20 specialized tools, covering market summaries, top gainers and losers, sector data, company details, and index tracking. It requires no API keys because it sources data from unofficial public endpoints, and it ships with REST and WebSocket transports alongside the MCP interface, making it a comprehensive toolkit for investors and analysts who want AI-assisted NEPSE market analysis.

Prerequisites

  • Python 3.10 or higher and pip installed
  • Git to clone the repository
  • FastMCP and required Python dependencies (installed via pip)
  • An MCP-compatible client such as Claude Desktop
  • Optional: Docker and Docker Compose for containerized deployment
1

Clone the repository

Download the full project source, which includes the MCP server, REST API, and WebSocket server as separate services managed by start_servers.py.

git clone https://github.com/surajrimal07/NepseAPI-Unofficial.git
cd NepseAPI-Unofficial
2

Create and activate a virtual environment

Isolate the Python dependencies from your system Python to avoid conflicts with other projects.

python -m venv venv
source venv/bin/activate  # Linux/macOS
# venv\Scripts\activate    # Windows
3

Install Python dependencies

Install all required packages including FastMCP, requests, and pydantic as listed in requirements.txt.

pip install -r requirements.txt
4

Start all services

Launch the REST API, WebSocket server, and MCP server together using the provided start script.

python start_servers.py
5

Add the MCP server to your client configuration

Register the MCP server in claude_desktop_config.json. The server runs using uv with FastMCP transport; adjust the path to mcp_server.py to match your clone location.

{
  "mcpServers": {
    "nepseapi-mcp-server": {
      "command": "uv",
      "args": [
        "run",
        "--with", "fastmcp",
        "--with", "requests",
        "--with", "pydantic",
        "python",
        "/absolute/path/to/NepseAPI-Unofficial/mcp_server.py"
      ]
    }
  }
}

NEPSE API Examples

Client configuration

claude_desktop_config.json entry for the NEPSE MCP server running via uv with FastMCP. No API keys are required.

{
  "mcpServers": {
    "nepseapi-mcp-server": {
      "command": "uv",
      "args": [
        "run",
        "--with", "fastmcp",
        "--with", "requests",
        "--with", "pydantic",
        "python",
        "/absolute/path/to/NepseAPI-Unofficial/mcp_server.py"
      ]
    }
  }
}

Prompts to try

Example prompts that exercise the 20+ NEPSE market analysis tools available through the MCP server.

- "Give me today's NEPSE market summary including total turnover and market cap"
- "Which stocks are the top gainers and losers today on NEPSE?"
- "Show me all details for company symbol NABIL including sector and price history"
- "What is the current NEPSE index value and sub-index breakdown?"
- "Is NICA a valid NEPSE stock symbol? Also suggest similar symbols."

Troubleshooting NEPSE API

mcp_server.py fails to start with import errors

Ensure you activated the virtual environment before running the server. Run `pip install -r requirements.txt` again inside the venv and verify fastmcp and pydantic are listed in the installed packages.

Market data tools return stale or empty results

The server caches responses for 10 minutes and is subject to a 6 requests-per-minute rate limit per client. Wait for the cache window to expire or restart the server. Note that NEPSE market data is only live during trading hours (Nepal time).

Docker Compose startup fails

Ensure Docker Desktop is running and ports 8000, 8001, and 8002 are not occupied by other services. Run `docker-compose logs` to inspect which container is failing and check for missing Python package errors.

Frequently Asked Questions about NEPSE API

What is NEPSE API?

NEPSE API is a Model Context Protocol (MCP) server that unlock nepal stock exchange (nepse) data with this powerful unofficial api. features rest, websocket, and a first-of-its-kind model context protocol (mcp) server, enabling ai models like claude to perform live market analysis with over 20 specialized It connects AI assistants to external tools and data sources through a standardized interface.

How do I install NEPSE API?

Follow the installation instructions on the NEPSE API GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with NEPSE API?

NEPSE API works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is NEPSE API free to use?

Yes, NEPSE API is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "nepseapi-unofficial": { "command": "npx", "args": ["-y", "nepseapi-unofficial"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use NEPSE API?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides