SEO MCP: Your Free Ahrefs Data API for Developers and SEO Pros

SEO MCP

Project Description

SEO MCP (Model Control Protocol) is a free SEO tool service leveraging Ahrefs data. It provides an API to retrieve SEO data from Ahrefs, handling CAPTCHA solving, authentication, and data retrieval. The results are cached for performance and to reduce API costs.

This service is intended for educational purposes.

Usage Instructions

Prerequisites

  • Python 3.10 or higher
  • CapSolver account and API key

Installation

Install from PyPI

pip install seo-mcp
# Or using uv
uv pip install seo-mcp

Manual Installation

  1. Clone the repository:
    git clone https://github.com/cnych/seo-mcp.git
    cd seo-mcp
    
  2. Install dependencies:
    pip install -e .
    # Or
    uv pip install -e .
    
  3. Set the CapSolver API key:
    export CAPSOLVER_API_KEY="your-capsolver-api-key"
    

Run the Service

Use in Cursor IDE

In Cursor settings, navigate to the MCP tab, click "+Add new global MCP server", and input:

{
  "mcpServers": {
    "SEO MCP": {
      "command": "uvx",
      "args": ["--python", "3.10", "seo-mcp"],
      "env": {
        "CAPSOLVER_API_KEY": "CAP-xxxxxx"
      }
    }
  }
}
Alternatively, create a .cursor/mcp.json file in the project root with the same content.

API Reference

  • get_backlinks_list(domain: str): Get backlinks for a domain.
    • Parameters: domain (string, e.g., "example.com")
  • keyword_generator(keyword: str, country: str = "us", search_engine: str = "Google"): Generate keyword ideas.
    • Parameters: keyword (string), country (string, default: "us"), search_engine (string, default: "Google")
  • get_traffic(domain_or_url: str, country: str = "None", mode: str = "subdomains"): Get traffic estimation.
    • Parameters: domain_or_url (string), country (string, default: "None"), mode (string, "subdomains" or "exact")
  • keyword_difficulty(keyword: str, country: str = "us"): Get keyword difficulty score.
    • Parameters: keyword (string), country (string, default: "us")

Key Features

  • Backlink Analysis: Get detailed backlink data (domain rating, anchor text, link attributes), filter educational and government domains.
  • Keyword Research: Generate keyword ideas, view difficulty, search volume, and trends.
  • Traffic Analysis: Estimate website traffic, view history, popular pages, country distribution, and track keyword rankings.
  • Performance Optimization: Uses CapSolver for automatic CAPTCHA solving, includes response caching.
  • Ahrefs Data Integration: Retrieves SEO data directly from Ahrefs.

Target Users

This tool is for developers, SEO professionals, and researchers who need programmatic access to Ahrefs data for analysis, automation, or educational purposes.

Application Scenarios

  • Automated SEO data collection from Ahrefs.
  • Building custom SEO dashboards or tools.
  • Researching backlink profiles for competitive analysis.
  • Generating keyword ideas for content creation.
  • Monitoring website traffic and keyword rankings programmatically.

Share this article