Developers API

Connect AI Agents to Tadawul with SAHMK MCP

Give AI assistants like Claude and Cursor direct access to Saudi market data through SAHMK MCP. Ask questions in plain language for quotes, market summaries, movers, sectors, company data, financials, dividends, and historical prices.

MCPAIPythonBeginner5 min read
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 these tools for Tadawul data:

ToolWhat it does
get_quoteGet live quote details for one stock
get_quotesCompare live quotes for multiple stocks
get_market_summarySee how an index is performing today
get_market_moversGet top gainers, losers, or active stocks with stable type, index, count, and items
get_sectorsView sector performance with stable index, count, and items
get_companyGet company profile and key fundamentals
get_historicalFetch historical OHLCV price data
get_financialsReview company financial statements and metrics
get_dividendsSee dividend history and payout details

Note: get_financials and get_dividends may require an eligible plan (Starter+ or above).

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.

Prompt

prompt
How is the Saudi market doing today?

Calls get_market_summary.

Prompt

prompt
Show the top gainers in TASI

Calls get_market_movers.

Prompt

prompt
Show sector performance in TASI

Calls get_sectors.

Prompt

prompt
Get financials for Aramco

Calls get_financials.

Prompt

prompt
Show dividends for Aramco

Calls get_dividends.

Prompt

prompt
Compare Aramco and Al Rajhi Bank

Calls get_quotes.

Prompt

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

Calls get_historical.

Financials and dividends may require an eligible plan (Starter+ or above).

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