dse-stock-mcp
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.
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Claudefarid/dse-stock-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server