semrush-mcp

semrush-mcp

10

Semrush MCP Server is a Model Context Protocol server designed to interface with Semrush API data, offering tools for domain and keyword analytics as well as backlink and traffic data analysis. It requires a Semrush API key for operation and is configured to prevent unauthorized access to your API units.

Semrush MCP Server

A Model Context Protocol (MCP) server implementation that provides tools for accessing Semrush API data.

Features

The Semrush MCP server provides tools for:

  • Domain Analytics

    • Domain overview information
    • Organic and paid keywords analysis
    • Competitor analysis
  • Keyword Analytics

    • Keyword overview data
    • Related keyword discovery
  • Backlink Analysis

    • Backlink data
    • Referring domains analysis
  • Traffic Analytics

    • Traffic summary for domains
    • Traffic sources analysis
    • (Note: Requires .Trends API subscription)

Setup

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Create a .env file with your Semrush API key:
    SEMRUSH_API_KEY=your_api_key_here
    
  4. Build the project:
    npm run build
    
  5. Start the server:
    npm run start
    

Environment Variables

VariableDescriptionDefault
SEMRUSH_API_KEYYour Semrush API key(Required)
API_CACHE_TTL_SECONDSTime to cache API responses300
API_RATE_LIMIT_PER_SECONDMaximum API requests per second10
NODE_ENVEnvironment (development/production)development
PORTServer port3000
LOG_LEVELLogging levelinfo

Available Tools

Tool NameDescriptionRequired Parameters
semrush_domain_overviewGet domain overview datadomain, [database]
semrush_domain_organic_keywordsGet organic keywords for domaindomain, [database], [limit]
semrush_domain_paid_keywordsGet paid keywords for domaindomain, [database], [limit]
semrush_competitorsGet organic search competitorsdomain, [database], [limit]
semrush_backlinksGet backlinks for a domain/URLtarget, [limit]
semrush_backlinks_domainsGet referring domainstarget, [limit]
semrush_keyword_overviewGet keyword overview datakeyword, [database]
semrush_related_keywordsFind related keywordskeyword, [database], [limit]
semrush_keyword_overview_single_dbGet detailed keyword data for specific databasekeyword, database
semrush_batch_keyword_overviewAnalyze up to 100 keywords at oncekeywords, database
semrush_keyword_organic_resultsGet domains ranking in organic resultskeyword, database, [limit]
semrush_keyword_paid_resultsGet domains in paid search resultskeyword, database, [limit]
semrush_keyword_ads_historyGet 12-month history of domains bidding on keywordkeyword, database, [limit]
semrush_broad_match_keywordsGet broad matches and alternate search querieskeyword, database, [limit]
semrush_phrase_questionsGet question-based keywordskeyword, database, [limit]
semrush_keyword_difficultyGet difficulty index for ranking in top 10keywords, database
semrush_traffic_summaryGet traffic summary data for domainsdomains, [country]
semrush_traffic_sourcesGet traffic sources datadomain, [country]
semrush_api_units_balanceCheck API units balancecheck: true

Parameters in [brackets] are optional.

API Units Consumption

API requests to Semrush consume API units from your account. Different types of requests have different costs. You can check your API units balance using the semrush_api_units_balance tool.

Keyword Reports API Units Consumption

ToolAPI Units per Line
semrush_keyword_overview10
semrush_keyword_overview_single_db10
semrush_batch_keyword_overview10
semrush_keyword_organic_results10
semrush_keyword_paid_results20
semrush_related_keywords40
semrush_keyword_ads_history100
semrush_broad_match_keywords20
semrush_phrase_questions40
semrush_keyword_difficulty50

Adding to Cursor or Claude

To add this MCP server to Cursor or Claude:

Cursor

  1. In Cursor, go to Settings > MCP Servers
  2. Click "Add Server"
  3. Configure the server with the following settings:
    • Name: Semrush MCP (or any name you prefer)
    • Type: command
    • Command: node
    • Arguments: /path/to/semrush-mcp/dist/index.js (replace with your actual path)
    • Environment Variables:
      • SEMRUSH_API_KEY: Your Semrush API key
      • Other optional variables as needed
  4. Click "Save"

Usage Using NPX

Using Environment Variables in Cursor/Claude/Windsurf Configuration

Configure your MCP servers JSON file for your designated consuming environment by adding this MCP using the following format:

{
  "mcpServers": {
    "semrush-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "github:mrkooblu/semrush-mcp"
      ],
      "env": {
        "SEMRUSH_API_KEY": "your-api-key",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Running it from your terminal:

SEMRUSH_API_KEY=your-api-key npx -y github:mrkooblu/semrush-mcp

Development

To run the server in development mode:

npm run dev

Security Notes

  • Never share your Semrush API key publicly
  • API key provides access to your API units balance
  • Exposing credentials can lead to unauthorized API usage and unexpected charges

License