MCPAIPythonBeginner5 min read

Connect AI Agents to Tadawul with SAHMK MCP

Give AI assistants like Claude and Cursor direct access to real-time Saudi stock market data. Ask questions in plain language and get live prices, company profiles, and historical data — no application code required.

PyPI version

1. What is MCP?

MCP (Model Context Protocol) is an open standard that lets AI assistants call external tools. The SAHMK MCP server gives your assistant five tools for Tadawul data:

ToolWhat it does
get_quoteReal-time price, change, volume, and liquidity for one stock
get_quotesCompare prices for multiple stocks at once
get_market_summaryTASI index, advancing/declining counts, market mood
get_companyCompany profile, fundamentals, valuation, and analyst data
get_historicalHistorical daily/weekly/monthly OHLCV price data

2. Get your API key

You need a SAHMK API key. Get your free key by signing up here.

Your key starts with shmk_live_ or shmk_test_.

3. Installation

Install the MCP server from PyPI:

bash
pip install sahmk-mcp

Verify it's installed:

bash
sahmk-mcp --help

4. Connect to Claude Desktop

Add the following to your Claude Desktop config file.

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%\Claude\claude_desktop_config.json

claude_desktop_config.json
{
  "mcpServers": {
    "sahmk": {
      "command": "sahmk-mcp",
      "env": {
        "SAHMK_API_KEY": "your_api_key_here"
      }
    }
  }
}

Restart Claude Desktop. You should see the SAHMK tools available in the tools menu.

5. Connect to Cursor

Add the following to your project's .cursor/mcp.json:

.cursor/mcp.json
{
  "mcpServers": {
    "sahmk": {
      "command": "sahmk-mcp",
      "env": {
        "SAHMK_API_KEY": "your_api_key_here"
      }
    }
  }
}

Restart Cursor. The SAHMK tools will be available to the AI assistant in your editor.

6. Try it out

Once connected, ask your AI assistant questions in plain language.

Get a stock price

Prompt

prompt
What's the current price of Aramco?

The AI calls get_quote with symbol 2222 and responds with something like:

Example response
Aramco (2222) is currently trading at 27.60 SAR, up 0.04 (0.15%) today.
Volume: 15.3M shares traded.

Compare multiple stocks

Prompt

prompt
Compare Aramco and Al Rajhi Bank

The AI calls get_quotes with symbols ["2222", "1120"].

Check the market

Prompt

prompt
How is the Saudi market doing today?

The AI calls get_market_summary and responds with the TASI index level, change, and market mood.

Company research

Prompt

prompt
Tell me about STC

The AI calls get_company with symbol 7010.

Historical prices

Prompt

prompt
Show me Aramco's price history for the last 3 months

The AI calls get_historical with the appropriate date range and returns daily OHLCV data.

7. Available plans

PlanPriceRequests/day
Free0 SAR100
Starter149 SAR/mo5,000
Pro499 SAR/mo50,000
EnterpriseContact usUnlimited

The free plan gives you 100 requests per day — enough to get started and test the integration.

8. Next steps

Give your AI assistant access to Tadawul

Install the SAHMK MCP server and start asking questions about the Saudi stock market in plain language. 100 free requests per day, no credit card required.

Resources