MCP Connector

Analyze SEO Data with Ahrefs

SEO MCP is an Ahrefs-backed MCP tool for backlink analysis, keyword research, keyword difficulty, and traffic estimation.

Works with ahrefs

91
Spark score
out of 100
Updated Apr 2025
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Leverage comprehensive SEO data analysis powered by Ahrefs to gain insights into backlinks, keyword research, traffic estimation, and keyword difficulty.

Outcomes

What it gets done

01

Retrieve detailed backlink data for any domain.

02

Generate keyword ideas with difficulty scores and search volumes.

03

Estimate website traffic, analyze trends, and identify popular pages.

04

Calculate keyword difficulty with SERP analysis.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-seo-mcp | bash

Capabilities

Tools your agent gets

get_backlinks_list

Retrieve detailed backlink data for any domain, including domain rating, anchor text, and link attributes

keyword_generator

Generate keyword ideas from a base keyword with difficulty scores and search volumes

get_traffic

Get traffic estimates, history, trends, popular pages, and country distribution analysis

keyword_difficulty

Get keyword difficulty scores with SERP analysis and related keywords

Overview

SEO MCP Server

SEO MCP surfaces Ahrefs-backed backlink analysis, keyword research, keyword difficulty scoring, and traffic estimation as MCP tools, handling CAPTCHA and authentication via CapSolver. Use it for SEO or content research that needs real backlink, keyword difficulty, or traffic data from Ahrefs surfaced directly in an AI assistant conversation.

What it does

SEO MCP is a Model Control Protocol SEO tool service built on Ahrefs data. It provides backlink analysis (detailed backlink data for a domain including domain rating, anchor text, and link attributes, with filtering for educational and government domains), keyword research (keyword ideas generated from a seed term, with difficulty scores, search volume, and trends), and traffic analysis (estimated website traffic, traffic history, popular pages, country distribution, and keyword rankings). It handles the full process of pulling this data from Ahrefs, including solving the CAPTCHA and authentication involved, and caches responses to improve performance and reduce API costs. The project states it is for educational purposes only.

When to use - and when NOT to

Use this when an SEO or content workflow needs real backlink, keyword, or traffic data pulled directly from Ahrefs - competitive backlink research, keyword difficulty checks before targeting a term, or estimating a domain's traffic and top pages - without leaving an AI assistant conversation. It depends on a CapSolver account and API key to solve the CAPTCHA/Cloudflare Turnstile challenge that gates access to Ahrefs data, so it is not usable without that dependency configured, and its own documentation frames it as educational rather than a guaranteed production data source.

Inputs and outputs

Four tools are exposed: get_backlinks_list(domain) returning an overview (domain rating, backlink count, referring domains) plus a list of individual backlinks with anchor text, domain rating, title, and source/target URLs; keyword_generator(keyword, country, search_engine) returning keyword ideas with volume, difficulty, and CPC; get_traffic(domain_or_url, country, mode) returning traffic history, monthly average traffic and cost estimates, top pages, top countries, and top keywords; and keyword_difficulty(keyword, country) returning a difficulty score along with SERP and related-keyword data.

Integrations

Requires Python 3.10+ and a CapSolver account and API key. Installable via pip install seo-mcp or uv pip install seo-mcp, or from source by cloning the repository and running pip install -e ., with the CapSolver key set via CAPSOLVER_API_KEY. Configured in Cursor's MCP settings (or a project .cursor/mcp.json) with uvx --python 3.10 seo-mcp as the command. Internally, requests flow through CapSolver to clear the Cloudflare Turnstile challenge, then authenticate against Ahrefs before retrieving and formatting the requested data. The project is released under the MIT License.

Who it's for

SEO practitioners and content teams who want backlink, keyword, and traffic data from Ahrefs surfaced directly inside an AI assistant workflow, for research or competitive analysis.

pip install seo-mcp
Source README

SEO MCP

A MCP (Model Control Protocol) SEO tool service based on Ahrefs data. Includes features such as backlink analysis, keyword research, traffic estimation, and more.

中文

Overview

This service provides an API to retrieve SEO data from Ahrefs. It handles the entire process, including solving the CAPTCHA, authentication, and data retrieval. The results are cached to improve performance and reduce API costs.

This MCP service is for educational purposes only. Please do not misuse it. This project is inspired by @哥飞社群.

Features

  • 🔍 Backlink Analysis

    • Get detailed backlink data for any domain
    • View domain rating, anchor text, and link attributes
    • Filter educational and government domains
  • 🎯 Keyword Research

    • Generate keyword ideas from a seed keyword
    • Get keyword difficulty score
    • View search volume and trends
  • 📊 Traffic Analysis

    • Estimate website traffic
    • View traffic history and trends
    • Analyze popular pages and country distribution
    • Track keyword rankings
  • 🚀 Performance Optimization

    • Use CapSolver to automatically solve CAPTCHA
    • Response caching

Installation

Prerequisites

  • Python 3.10 or higher
  • CapSolver account and API key (register here)

Install from PyPI

pip install seo-mcp

Or use 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"
    

Usage

Run the service

You can run the service in the following ways:

Use in Cursor IDE

In the Cursor settings, switch to the MCP tab, click the +Add new global MCP server button, and then input:

{
  "mcpServers": {
    "SEO MCP": {
      "command": "uvx",
      "args": ["--python", "3.10", "seo-mcp"],
      "env": {
        "CAPSOLVER_API_KEY": "CAP-xxxxxx"
      }
    }
  }
}

You can also create a .cursor/mcp.json file in the project root directory, with the same content.

API Reference

The service provides the following MCP tools:

get_backlinks_list(domain: str)

Get the backlinks of a domain.

Parameters:

  • domain (string): The domain to analyze (e.g. "example.com")

Returns:

{
  "overview": {
    "domainRating": 76,
    "backlinks": 1500,
    "refDomains": 300
  },
  "backlinks": [
    {
      "anchor": "Example link",
      "domainRating": 76,
      "title": "Page title",
      "urlFrom": "https://referringsite.com/page",
      "urlTo": "https://example.com/page",
      "edu": false,
      "gov": false
    }
  ]
}
keyword_generator(keyword: str, country: str = "us", search_engine: str = "Google")

Generate keyword ideas.

Parameters:

  • keyword (string): The seed keyword
  • country (string): Country code (default: "us")
  • search_engine (string): Search engine (default: "Google")

Returns:

[
  {
    "keyword": "Example keyword",
    "volume": 1000,
    "difficulty": 45,
    "cpc": 2.5
  }
]
get_traffic(domain_or_url: str, country: str = "None", mode: str = "subdomains")

Get the traffic estimation.

Parameters:

  • domain_or_url (string): The domain or URL to analyze
  • country (string): Country filter (default: "None")
  • mode (string): Analysis mode ("subdomains" or "exact")

Returns:

{
  "traffic_history": [...],
  "traffic": {
    "trafficMonthlyAvg": 50000,
    "costMontlyAvg": 25000
  },
  "top_pages": [...],
  "top_countries": [...],
  "top_keywords": [...]
}
keyword_difficulty(keyword: str, country: str = "us")

Get the keyword difficulty score.

Parameters:

  • keyword (string): The keyword to analyze
  • country (string): Country code (default: "us")

Returns:

{
  "difficulty": 45,
  "serp": [...],
  "related": [...]
}

Development

For development:

git clone https://github.com/cnych/seo-mcp.git
cd seo-mcp
uv sync

How it works

  1. The user sends a request through MCP
  2. The service uses CapSolver to solve the Cloudflare Turnstile CAPTCHA
  3. The service gets the authentication token from Ahrefs
  4. The service retrieves the requested SEO data
  5. The service processes and returns the formatted results

Troubleshooting

  • CapSolver API key error:Check the CAPSOLVER_API_KEY environment variable
  • Rate limiting:Reduce request frequency
  • No results:The domain may not be indexed by Ahrefs
  • Other issues:See GitHub repository

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.