This document provides a detailed guide on how to use the NEPSE API MCP (Model-driven Communication Protocol) Server. The server exposes a set of tools that can be used to access real-time and historical data from the Nepal Stock Exchange (NEPSE).
The MCP server provides a structured way to interact with the NEPSE API. It uses a tool-based architecture, where each tool corresponds to a specific API endpoint or a set of related endpoints. The server uses Pydantic models to validate data and provide clear, consistent data structures in the output.
Here is a list of all the tools available on the MCP server:
pingget_market_statusget_market_summaryget_nepse_subindexget_nepse_indexget_daily_nepse_index_graphget_daily_sensitive_index_graphget_daily_float_index_graphget_daily_sensitive_float_index_graphget_daily_bank_subindex_graphget_daily_development_bank_subindex_graphget_daily_finance_subindex_graphget_daily_hotel_tourism_subindex_graphget_daily_hydropower_subindex_graphget_daily_investment_subindex_graphget_daily_life_insurance_subindex_graphget_daily_manufacturing_processing_subindex_graphget_daily_microfinance_subindex_graphget_daily_mutual_fund_subindex_graphget_daily_non_life_insurance_subindex_graphget_daily_others_subindex_graphget_daily_trading_subindex_graphget_live_marketget_price_volumeget_top_gainersget_top_losersget_top_ten_traded_by_sharesget_top_ten_traded_by_turnoverget_top_ten_traded_by_transactionsget_supply_and_demandget_company_infoget_floorsheetget_historical_dataget_market_depthget_security_overviewvalidate_stock_symbolfind_symbol_by_company_namefind_company_name_by_symbol
The MCP server also provides a set of pre-defined prompts to facilitate common user queries. These prompts are designed to be used by AI models to generate user-facing responses.
- Description: Get a quick summary of a stock's current price, volume, and latest trades.
- Parameters:
symbol(str): The stock symbol.
- Description: Get a snapshot of today's top gainers, losers, and overall market mood.
- Parameters: None
- Description: Analyze the performance of a specific sector today.
- Parameters:
sector(str): The name of the sector.
- Description: Get a detailed report on a company: profile, price history, and recent trades.
- Parameters:
symbol(str): The stock symbol.
- Description: Monitor live prices and volumes for a custom list of stocks.
- Parameters:
symbols(str): A comma-separated list of stock symbols.
- Description: Analyze the current bid/ask depth for a stock (only when the market is open).
- Parameters:
symbol(str): The stock symbol.
- Description: Explore all trades for a stock after the market has closed (floorsheet).
- Parameters:
symbol(str): The stock symbol.
- Description: Check if a stock symbol is valid and get suggestions if not.
- Parameters:
symbol(str): The stock symbol to validate.
- Description: Check if the NEPSE market is currently open or closed.
- Parameters: None
- Description: Set up a price or volume alert for a stock.
- Parameters:
symbol(str): The stock symbol.type(str): The type of alert (e.g., "price", "volume").threshold(str): The threshold value for the alert.
- Description: A simple tool to check if the server is running.
- Parameters: None
- Output:
{"pong": true}
- Description: Get the current status of the NEPSE market.
- Parameters: None
- Output: A
MarketStatusobject.
- Description: Get the latest live NEPSE market summary.
- Parameters: None
- Output: A
Summaryobject.
- Description: Get real-time live market data for all securities.
- Parameters:
limit(optional, int): Number of results per page.page(optional, int): Page number for pagination.
- Output: A paginated list of
LiveMarketItemobjects.
- Description: Get price and volume data for all stocks, or filter by company.
- Parameters:
company(optional, str): Company name or symbol to filter by.limit(optional, int): Number of results per page.page(optional, int): Page number for pagination.
- Output: A paginated list of
PriceVolumeItemobjects.
- Description: Get the top 10 gainers of the day.
- Parameters: None
- Output: A list of
TopGainerLoserobjects.
- Description: Get the top 10 losers of the day.
- Parameters: None
- Output: A list of
TopGainerLoserobjects.
- Description: Get the top 10 most traded scrips by shares.
- Parameters: None
- Output: A list of
TopTradeScripobjects.
- Description: Get the top 10 most traded scrips by turnover.
- Parameters: None
- Output: A list of
TopTurnoverobjects.
- Description: Get the top 10 most traded scrips by transactions.
- Parameters: None
- Output: A list of
TopTradersobjects.
- Description: Get supply and demand data.
- Parameters: None
- Output: A
SupplyDemandDataobject.
- Description: Get the floorsheet (all trades) for a specific stock.
- Parameters:
symbol(str): The stock symbol.limit(optional, int): Number of results per page.page(optional, int): Page number for pagination.
- Output: A paginated list of
TradeContractobjects.
- Description: Get the market depth (buy/sell orders) for a stock.
- Parameters:
symbol(str): The stock symbol.
- Output: A
MarketDepthResponseobject.
- Description: Get the NEPSE index and related indices.
- Parameters: None
- Output: A dictionary of
IndexDataobjects, keyed by index name.
- Description: Get all NEPSE sub-indices (sector indices).
- Parameters: None
- Output: A dictionary of
SubIndexobjects, keyed by sub-index name.
These tools return time-series data for various indices.
-
Parameters:
limit(optional, int): Number of results per page.page(optional, int): Page number for pagination.
-
Output: A paginated list of
TimeValueobjects. -
get_daily_nepse_index_graph -
get_daily_sensitive_index_graph -
get_daily_float_index_graph -
get_daily_sensitive_float_index_graph -
get_daily_bank_subindex_graph -
get_daily_development_bank_subindex_graph -
get_daily_finance_subindex_graph -
get_daily_hotel_tourism_subindex_graph -
get_daily_hydropower_subindex_graph -
get_daily_investment_subindex_graph -
get_daily_life_insurance_subindex_graph -
get_daily_manufacturing_processing_subindex_graph -
get_daily_microfinance_subindex_graph -
get_daily_mutual_fund_subindex_graph -
get_daily_non_life_insurance_subindex_graph -
get_daily_others_subindex_graph -
get_daily_trading_subindex_graph
- Description: Get detailed information about a company.
- Parameters:
symbol(str): The stock symbol.
- Output: A
CompanyInfoobject.
- Description: Get historical trade data for a stock.
- Parameters:
symbol(str): The stock symbol.start_date(str): The start date (YYYY-MM-DD).end_date(str): The end date (YYYY-MM-DD).
- Output: A list of
HistoricalTradeEntryobjects.
- Description: Get a comprehensive overview of a security.
- Parameters:
symbol(str): The stock symbol.
- Output: A
SecurityOverviewobject.
- Description: Validate a stock symbol.
- Parameters:
symbol(str): The stock symbol to validate.
- Output: A dictionary with validation results.
- Description: Find a stock symbol by company name.
- Parameters:
company_name(str): The name of the company.
- Output: A dictionary with the symbol and other info.
- Description: Find a company name by stock symbol.
- Parameters:
symbol(str): The stock symbol.
- Output: A dictionary with the company name and other info.
The MCP server uses the following Pydantic models to structure the data returned by the tools.
SummaryPriceVolumeItemSupplyDemandSupplyDemandDataTopGainerLoserTopTradeScripTopTurnoverTopTradersMarketStatusCompanyInfoLiveMarketItemMarketIndexSubIndexTradeContractHistoricalTradeEntryMarketDepthItemMarketDepthDataMarketDepthResponseSecurityDailyTradeDtoInstrumentTypeShareGroupSectorMasterCompanyIdSecuritySecurityOverviewTurnoverIndexScripDetailSectorDetailMarketSummaryIndexDataTimeValueTimeSeriesData