Skip to main content

SEO MCP

A free SEO tool MCP (Model Control Protocol) service based on Ahrefs data. Includes features such as backlinks, keyword ideas, and more.

中文版

Overview

This service provides APIs to retrieve SEO data for websites. It handles the entire process, including captcha solving, authentication, and fetching data from Ahrefs.

This MCP service is for learning purposes only. Please do not abuse it, or you will bear the consequences. This project was inspired by the @GoFei Community.

For more information about this MCP service, please refer to Claude MCP SEO MCP Introduction.

Features

  • 🔍 Retrieve backlink data for any domain
  • 🔎 Get keyword ideas and SEO suggestions
  • 🔒 Automatically solve captchas using CapSolver
  • 💾 Signature caching to reduce API calls
  • 🚀 Fast and efficient data retrieval
  • 🧹 Simplified output providing the most relevant SEO information

Installation

Prerequisites

  • Python 3.10 or higher
  • CapSolver account and API key (register here)
  • pip or uv installed (on macOS, you may need to install with brew install uv)

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 using pip or uv:

    pip install -e .
    # or
    uv pip install -e .
    
  3. Set the CapSolver API key:

    export CAPSOLVER_API_KEY="your-capsolver-api-key"
    

Usage

Running the service

You can run the service in several ways:

Install in Claude Desktop

To install this service and interact with it immediately in Claude Desktop:

fastmcp install src/seo_mcp/server.py

Use MCP Inspector for testing

For development and testing:

fastmcp dev src/seo_mcp/server.py

Install in Cursor IDE

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

{
  "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 and input the above content, so it becomes a specific project's MCP service.

The CAPSOLVER_API_KEY environment variable can be obtained from here.

Next, we can use this MCP in Cursor:

Use SEO MCP Backlinks Tool on Cursor

Use SEO MCP Keyword Tool on Cursor

API Reference

The service exposes the following MCP tools:

get_backlinks_list(domain: str)

Retrieve the backlink list for a specified domain.

Parameters:

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

Returns:

A list of backlink objects, each containing:

  • anchor:The anchor text of the backlink
  • domainRating:The domain rating (0-100)
  • title:The title of the linked page
  • urlFrom:The URL of the page containing the backlink
  • urlTo:The URL of the page being linked to
  • edu:A boolean value indicating whether the backlink is from an educational website
  • gov:A boolean value indicating whether the backlink is from a government website

Example Response:

[
  {
    "anchor": "Example link",
    "domainRating": 76,
    "title": "Useful resource",
    "urlFrom": "https://referringsite.com/resources",
    "urlTo": "https://example.com/page",
    "edu": false,
    "gov": false
  },
  ...
]

keyword_generator(keyword: str, country: str = "us", search_engine: str = "Google")

Get creative and SEO suggestions for a specified keyword.

Parameters:

  • keyword (string): The keyword to query
  • country (string): The country code (e.g. "us")
  • search_engine (string): The search engine (e.g. "Google")

Returns:

  • A list of keyword ideas, containing two types:

    • keyword ideas:Regular keyword suggestions, containing keyword, country, difficulty, volume, and update time
    • question ideas:Question-based keyword suggestions, with the same format

    Each keyword object contains:

    • keyword:The keyword text
    • country:The country code
    • difficulty:The difficulty rating (Easy, Medium, Hard, or Unknown)
    • volume:The search volume level (e.g. MoreThanOneHundred, MoreThanOneThousand)
    • updatedAt:The data update time

Development

For development purposes, you can clone the repository and install the development dependencies:

git clone https://github.com/cnych/seo-mcp.git
cd seo-mcp
uv sync  # or use pip install -e .

How it works

  1. The service first attempts to retrieve the cached signature of the domain
  2. If no valid cache exists, it will:
    • Use CapSolver to solve the Cloudflare Turnstile captcha
    • Retrieve the signature and expiration date from Ahrefs
    • Cache this information for future use
  3. Use the signature to retrieve SEO data
  4. Process and return simplified SEO information

Troubleshooting

  • CapSolver API key error:Ensure the CAPSOLVER_API_KEY environment variable is correctly set
  • Rate limiting:If you encounter rate limiting, try reducing the frequency of using the service
  • No results:Some domains may have no backlinks or not indexed by Ahrefs
  • Issues:If you encounter issues with SEO MCP, please refer to the SEO MCP GitHub repository for troubleshooting guides

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for seo-mcp 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seo-mcp 0.2.4
File Size Uploaded Provenance
seo_mcp-0.2.4.tar.gz 12.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for seo-mcp 0.2.4
File Interpreter ABI Platform
seo_mcp-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / seo_mcp-0.2.4.tar.gz

Download URL seo_mcp-0.2.4.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
08278e3a94880970f98ee62a64ea9070edc6081162233989c3321984c2254e4a
BLAKE2b-256 checksum
How to use checksums
b044ff516b2b9ced1e59d4813650f408e67a30cc4bc44d034ffd8828d4c743d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / seo_mcp-0.2.4-py3-none-any.whl

Download URL seo_mcp-0.2.4-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b28f2a9e5f9c3e561afedc2e88a7d16753dd3d2a5e549b185c2b7aae3ce129f6
BLAKE2b-256 checksum
How to use checksums
3ae709a3ad6b26ba86f2ddbaa863b453a53a1ce1b1d447def61b5348e46ee74e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Security for seo-mcp 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page