Skip to main content
Glama
cnych

Backlinks MCP

by cnych

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 @哥飞社群.

Related MCP server: Sitemap MCP Server

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 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

License

MIT License - See LICENSE file

Available Tools

4 tools
get_trafficC
Check the estimated search traffic for any website. 

Args:
    domain_or_url (str): The domain or URL to query
    country (str): The country to query, default is "None"
    mode (["subdomains", "exact"]): The mode to use for the query
Returns:
    Traffic data for the specified domain or URL
ParametersJSON Schema
NameRequiredDescriptionDefault
domain_or_urlYes
countryNoNone
modeNosubdomains

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool checks 'estimated search traffic,' implying a read-only operation, but fails to detail critical aspects like rate limits, authentication needs, data sources, accuracy, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first. The structured 'Args' and 'Returns' sections enhance clarity without unnecessary verbosity. However, minor improvements could make it more efficient, such as integrating parameter details more seamlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is partially complete. It covers the basic purpose and parameters but lacks details on behavioral traits, usage context, and output specifics. Without annotations or output schema, more comprehensive guidance would improve completeness for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description includes an 'Args' section that lists parameters (domain_or_url, country, mode) and a 'Returns' note, adding meaning beyond the input schema, which has 0% description coverage. However, it doesn't fully compensate for the schema gap—e.g., it doesn't explain what 'subdomains' vs. 'exact' mode entails or provide examples for the country parameter. The baseline is 3 due to some added value but incomplete coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Check the estimated search traffic for any website.' It specifies the verb ('Check') and resource ('search traffic for any website'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like get_backlinks_list or keyword_difficulty, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It lacks context about scenarios where this tool is appropriate, prerequisites, or comparisons with sibling tools like get_backlinks_list or keyword_generator. This omission leaves the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

keyword_difficultyC

Get keyword difficulty for the specified keyword

ParametersJSON Schema
NameRequiredDescriptionDefault
keywordYes
countryNous

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' data, implying a read-only operation, but doesn't clarify aspects like whether it requires authentication, has rate limits, returns a numerical score or textual assessment, or involves external API calls. The description is minimal and misses key behavioral traits needed for safe and effective use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it appropriately concise. However, it's front-loaded with the core action but lacks structure for additional details like parameters or usage, which could enhance clarity without sacrificing brevity. It earns a high score for conciseness but not the top due to minimal content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (2 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'keyword difficulty' entails, how results are returned, or the role of parameters like 'country'. For a tool that likely provides SEO metrics, more context is needed to guide the agent effectively, making this inadequate for the task.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 2 parameters with 0% description coverage, so the description must compensate. It mentions 'keyword' but doesn't explain its format (e.g., single word, phrase) or constraints. It omits the 'country' parameter entirely, leaving its purpose (e.g., regional SEO data) and default value ('us') undocumented. This fails to add meaningful semantics beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get keyword difficulty for the specified keyword' clearly states the verb ('Get') and resource ('keyword difficulty'), making the purpose understandable. However, it lacks specificity about what 'keyword difficulty' represents (e.g., SEO competition score, ranking challenge) and doesn't distinguish this tool from its siblings like 'keyword_generator', which might also involve keyword analysis. This vagueness prevents a higher score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'keyword_generator' for generating keywords or 'get_traffic' for traffic data, nor does it specify contexts where keyword difficulty is relevant (e.g., SEO planning, content strategy). Without any usage context or exclusions, the agent must infer when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

keyword_generatorC

Get keyword ideas for the specified keyword

ParametersJSON Schema
NameRequiredDescriptionDefault
keywordYes
countryNous
search_engineNoGoogle

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get keyword ideas' but doesn't explain how it works (e.g., API calls, data sources), potential limitations (e.g., rate limits, freshness of data), or output format. This leaves significant gaps in understanding the tool's behavior beyond a basic read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, straightforward sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (3 parameters, no annotations, no output schema), the description is incomplete. It doesn't address how results are returned, error handling, or the tool's scope compared to siblings. For a tool that likely involves external data queries, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'specified keyword' but doesn't explain the 'keyword' parameter's semantics (e.g., seed term, phrase) or the purpose of 'country' and 'search_engine' parameters (e.g., localization, platform-specific results). The description adds minimal value beyond what the schema's property titles imply.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get keyword ideas for the specified keyword' clearly states the verb ('Get') and resource ('keyword ideas'), but it's vague about what 'keyword ideas' entails (e.g., related keywords, search volume suggestions). It doesn't differentiate from sibling tools like 'keyword_difficulty', which might also involve keywords but for a different purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'keyword_difficulty' or other siblings. It lacks context such as use cases (e.g., SEO research, content planning) or prerequisites, leaving the agent to infer usage based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updates
    • First observedget_backlinks_list
    • First observedget_traffic
    • First observedkeyword_difficulty
    • First observedkeyword_generator

TDQS

B3.1/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap. get_backlinks_list retrieves backlink data for domains, get_traffic provides traffic estimates, keyword_difficulty assesses keyword competitiveness, and keyword_generator suggests related keywords. The four tools cover separate aspects of SEO analysis without ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case formatting. Each name clearly indicates its function: get_backlinks_list, get_traffic, keyword_difficulty, and keyword_generator maintain perfect naming consistency throughout the set.

Tool Count4/5

Four tools is reasonable for an SEO/backlink analysis server, though slightly minimal. The tools cover core SEO functions (backlinks, traffic, keyword difficulty, keyword generation), but additional tools like domain authority checking or competitor analysis could enhance completeness. The count is appropriate but leaves room for expansion.

Completeness3/5

The tool set covers key SEO analysis areas but has notable gaps. While it provides backlink data, traffic estimates, and keyword tools, it lacks domain authority metrics, competitor backlink analysis, and link-building tools. Agents can perform basic SEO analysis but may encounter dead ends for more advanced workflows requiring these missing operations.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cnych/seo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server