dse-stock-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dse-stock-mcpWhich DSE shares gained the most today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dse-stock-mcp
Ask your AI assistant about the Dhaka Stock Exchange and get live numbers back — every listed share, today's gainers and losers, market breadth, turnover.
An MCP server built with FastMCP.
⚠️ Not investment advice. This tool reports publicly published prices. It does not analyse, recommend, or predict. Figures are last-traded values and may lag the live market. Verify anything you intend to act on against dsebd.org directly.
Unofficial. Not affiliated with or endorsed by the Dhaka Stock Exchange.
Tools
Tool | What it does |
| How many shares rose, fell, held flat or never traded, plus total turnover. |
| Biggest movers — |
| Prices for specific trading codes, e.g. |
| Find trading codes by substring, e.g. |
Covers all ~395 listed instruments. One request to the exchange serves each call.
Related MCP server: CSE Market MCP Server
Install
Requires uv and Python 3.12+.
git clone https://github.com/Claudefarid/dse-stock-mcp.git
cd dse-stock-mcp
uv sync
uv run fastmcp install claude-code server.py:mcpRestart your client, then ask "Which DSE shares gained the most today?" No API key, no login, no paid data feed.
Verify with uv run python test_server.py.
Two things that will bite you if you build this yourself
Both are handled here, and both produce wrong answers rather than errors if you miss them.
1. Untraded shares look like a -100% crash.
A share that did not trade is listed with LTP = 0 and TRADE = 0 — the exchange prints --
for its change. Compute percent change naively and you get −100%, so your "biggest losers" list
fills up with shares that simply never traded. On the day this was written, 11 of 395 shares were
untraded, and they crowded out every genuine decline. This server marks them traded: false,
excludes them from movers, and counts them separately in market_summary.
2. dsebd.org serves an incomplete TLS certificate chain.
The leaf certificate is signed by a Sectigo intermediate that the server never sends. Browsers
and curl recover by fetching it via AIA; Python's certifi bundle cannot, so httpx fails with
CERTIFICATE_VERIFY_FAILED.
The fix is not verify=False. That disables verification entirely — a bad trade anywhere,
and a worse one for financial data. This server verifies against the operating system's trust
store via truststore, which resolves the missing
intermediate and keeps verification fully intact.
import ssl, truststore
ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
httpx.AsyncClient(verify=ctx)Please be considerate
Prices are published by the Dhaka Stock Exchange. Requests identify themselves by User-Agent. Each call is a single page fetch — don't poll it in a tight loop.
License
MIT — see LICENSE. Covers this code only, not the exchange's data.
Available Tools
4 toolsget_stockGet StockA
Look up current prices for specific DSE trading codes.
Codes are the exchange's short symbols, e.g. ['GP', 'BEXIMCO', 'SQURPHARMA']. Case-insensitive. Use search_stock if you only know part of a name.
Inputs: codes (required). Returns: object
market_summaryMarket SummaryA
Overall market breadth — how many shares rose, fell, or held flat today.
Inputs: no named parameters. Returns: object
search_stockSearch StockA
Find DSE trading codes containing a substring, e.g. 'PHARMA' or 'BANK'.
Inputs: query (required). Returns: object
top_moversTop MoversA
Biggest percentage movers of the session.
direction is 'gainers', 'losers', 'volume' (most shares traded) or
'value' (most taka traded). Ranking uses percent change, not absolute taka,
so cheap and expensive shares compare fairly.
Inputs: limit, direction. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: exact price lookup, ranked movers, market breadth, and code search. Even get_stock and search_stock are disambiguated by the explicit guidance to use search_stock for partial names.
Names are all lowercase snake_case and readable, but the pattern is mixed: get_stock and search_stock follow verb_noun, while top_movers and market_summary are noun phrases. This is not a consistent convention.
Four tools is well-scoped for a focused stock market data server. Each tool provides a distinct, valuable capability without redundancy or bloat.
The toolset covers the core read-only workflows: looking up prices, finding movers, understanding market breadth, and discovering trading codes. Historical data or detailed company information would be nice but are not essential to the apparent purpose.
Maintenance
Related MCP Connectors
A Model Context Protocol server exposing real-time and historical Colombo Stock Exchange (CSE) data to AI agents and LLM applications. Provides quotes and OHLCV price history, full financial statements (income, balance sheet, cash flow), pre-computed technicals (moving averages, RS ratings, volume signals), macroeconomic indicators, corporate actions, and rule-based screening across CSE stocks and sector indices, everything needed to build CSE-aware trading assistants, research tools, and market-analysis agents. This is the official MCP server of www.ceyloncharts.com
NSE/BSE stock data via Tickertape as JSON: index lists, screener, 10-year fundamentals.
Live crypto + IDX stock market intelligence for AI agents — 19 tools, no API key.
Market data, filings, fundamentals, macro, news and research runs for AI assistants.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides real-time stock market data and company search functionality for the Colombo Stock Exchange (CSE). It enables AI assistants to retrieve current prices, change percentages, and ticker information for Sri Lankan listed companies.74 npm13ISC
- FlicenseNot gradedqualityDmaintenanceEnables querying real-time and historical Colombo Stock Exchange data, including prices, sectors, top movers, and technical indicators like RSI and MACD, for AI-assisted market analysis.1-
- FlicenseNot gradedqualityDmaintenanceEnables querying Pakistan Stock Exchange data including market summaries, stock quotes, history, and sector breakdowns using natural language.-
- FlicenseCqualityDmaintenanceEnables AI assistants to access National Stock Exchange of India (NSE) data, including live quotes, market status, indices, option chains, corporate actions, and historical data, through natural language.241-