psx-mcp-server
Click on "Install 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., "@psx-mcp-serverget the current quote for HBL"
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.
psx-mcp-server
A Model Context Protocol server that gives Claude and other MCP agents live Pakistan Stock Exchange data — quotes, intraday and end-of-day history, indices (KSE-100 and 17 others), company fundamentals, dividends, and announcements — sourced from the public PSX Data Portal. No API key required.
Quick start
The server runs via uv — uvx fetches and runs it in one step,
so there is nothing to install manually.
Claude Code:
claude mcp add psx -- uvx psx-mcp-serverClaude Desktop — add to claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"psx": {
"command": "uvx",
"args": ["psx-mcp-server"]
}
}
}Any MCP client: run uvx psx-mcp-server (stdio transport). Requires uv
(install guide).
Related MCP server: Alpha Vantage MCP Server
Example
You: Which PSX stocks gained the most today, and what's HBL trading at?
The agent calls get_market_snapshot and get_quote, and answers:
TOP 5 GAINERS:
TCORPR2 +22.62% Rs.5.42
PINL +10.52% Rs.10.51
HICL +10.05% Rs.11.50
TSPL +10.02% Rs.18.12
CLVL +10.02% Rs.22.41
breadth: 296 advancers / 180 decliners
HBL: Habib Bank Limited | current Rs.318.15 | P/E 7.43
KSE100: 187,454.69 (+1.12%)Tools
Tool | Parameters | Returns |
|
| Matching tickers (exact matches first). Use first if unsure of a ticker. |
|
| Current price, LDCP, OHL, change %, volume, bid/ask, 52-week range, P/E (PKR). |
|
| Intraday OHLCV bars (or |
|
| Daily open/close/volume (~5 yrs). Works for indices. No high/low. |
|
| Full daily OHLCV for one month — the only free source of daily high/low. |
|
| Top movers ( |
| — | All ~18 PSX indices with change %. |
|
| Business description, sector, market cap, shares, free float, P/E. |
|
| Payout history (cash/bonus/rights) with book-closure dates. |
|
| Recent corporate announcements with document (PDF) links. |
Resources: psx://symbols (full ticker directory), psx://sectors (sector names),
psx://indices (current index values).
Prompts: analyze_stock(symbol) (single-stock research brief),
market_overview() (today's market wrap).
Notes
Prices are in PKR; timestamps are Pakistan Standard Time (UTC+5, no DST).
PSX trades Monday–Friday, ~09:30–15:30 PKT. Outside those hours, quotes reflect the last session and intraday data may be empty.
Responses are cached briefly (30 s intraday … 24 h for the symbol directory) to be polite to the portal. Override the request identity with the
PSX_MCP_USER_AGENTenvironment variable.
Development
git clone https://github.com/ahmedraza-96/psx-mcp-server
cd psx-mcp-server
uv sync
uv run pytest # unit tests (mocked, offline)
uv run ruff check . && uv run ruff format --check .
# Live tests hit the real portal — run during PKT market hours:
uv run pytest -m live --override-ini "addopts="
# Re-record test fixtures if PSX changes its markup:
uv run python scripts/record_fixtures.pyArchitecture: parsers/ are pure functions (raw response in, dataclasses out) tested against
committed fixtures in tests/fixtures/; client.py owns all HTTP I/O (caching, retries, error
mapping); tools.py composes the two into MCP tools. See
CHANGELOG.md for release history.
Disclaimer
This is an unofficial project and is not affiliated with or endorsed by the Pakistan Stock
Exchange. Data comes from the public PSX Data Portal (dps.psx.com.pk) and may be delayed or
inaccurate. For licensed or commercial market data, contact marketdatarequest@psx.com.pk.
Nothing here is investment advice.
License
MIT © Ahmed Raza
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/ahmedraza-96/psx-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server