Skip to main content
Glama
egebese

SEO Research MCP

by egebese

DataSEO MCP

DataSEO MCP 是一个模型上下文协议 (MCP) 服务器,用于 AI 助手中的实用 SEO 研究。它结合了 Ahrefs 免费 SEO 数据、CAPTCHA 提供商回退机制以及可选的基于 OpenRouter 的查询规划,并提供了一套精简的 MCP 工具。

[!CAUTION] 本项目仅用于教育和研究目的。它会与包括 Ahrefs、CapSolver、Anti-Captcha 和 OpenRouter 在内的第三方服务进行交互。用户有责任遵守所有适用的服务条款。

功能

工具

用途

示例提示词

get_backlinks_list

反向链接概览和顶级反向链接行

"显示 suparank.io 的反向链接"

keyword_generator

关键词和问题建议

"查找用于入职培训的 SaaS SEO 关键词"

get_traffic

自然流量估算

"估算 ege.md 的流量"

keyword_difficulty

KD 和 SERP 快照

"检查 AI SEO 工具的难度"

ai_search_queries

按搜索意图生成的 AI 查询建议

"为 SaaS SEO 生成 AI 搜索查询"

domain_overview

单域名反向链接 + 流量摘要

"总结 suparank.io"

compare_domains

比较 2-5 个域名

"比较 suparank.io 和 ahrefs.com"

backlink_opportunities

竞争对手反向链接来源差距

"查找我域名的反向链接差距"

seo_content_brief

SERP + AI 辅助内容摘要

"为 AI SEO 审计创建内容摘要"

DataSEO MCP 由 Ege Bese 维护。有关 AI SEO 和排名跟踪工作流,请参阅 Suparank。

Related MCP server: SEO Insights MCP Server

安装

uvx --python 3.10 dataseo-mcp

对于本地开发:

git clone https://github.com/egebese/dataseo-mcp.git
cd dataseo-mcp
uv sync
uv run dataseo-mcp

旧版 seo-mcp 命令仍作为兼容性别名保留。

配置

Ahrefs 支持的工具至少需要一个 CAPTCHA 提供商:

export CAPSOLVER_API_KEY="your-capsolver-key"
# or
export ANTICAPTCHA_API_KEY="your-anticaptcha-key"

如果两者都已配置,则优先尝试 CapSolver,并使用 Anti-Captcha 作为回退。AI 工具是可选的:

export OPENROUTER_API_KEY="your-openrouter-key"
export OPENROUTER_MODEL="openai/gpt-4o-mini"  # optional

有用的运行时覆盖:

变量

默认值

用途

DATASEO_CACHE_DIR

~/.cache/dataseo-mcp

签名缓存位置

DATASEO_REQUEST_TIMEOUT

30

HTTP 超时时间(秒)

DATASEO_MAX_POLLING_ATTEMPTS

120

CAPTCHA 轮询上限

OPENROUTER_BASE_URL

https://openrouter.ai/api/v1

兼容 OpenAI 的 AI 端点

MCP 设置

Claude Desktop / Cursor 风格配置:

{
  "mcpServers": {
    "dataseo": {
      "command": "uvx",
      "args": ["--python", "3.10", "dataseo-mcp"],
      "env": {
        "CAPSOLVER_API_KEY": "YOUR_CAPSOLVER_KEY",
        "ANTICAPTCHA_API_KEY": "YOUR_ANTICAPTCHA_KEY",
        "OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY"
      }
    }
  }
}

Claude Code:

claude mcp add dataseo --scope user -- uvx --python 3.10 dataseo-mcp

VS Code MCP 配置:

{
  "servers": {
    "dataseo": {
      "command": "uvx",
      "args": ["--python", "3.10", "dataseo-mcp"],
      "env": {
        "CAPSOLVER_API_KEY": "YOUR_CAPSOLVER_KEY"
      }
    }
  }
}

仅需一个 CAPTCHA 提供商密钥。仅在需要 AI 辅助查询生成或内容摘要时添加 OPENROUTER_API_KEY。

API 参考

返回:

{
  "overview": {
    "domainRating": 76,
    "backlinks": 1500,
    "refDomains": 300
  },
  "backlinks": [
    {
      "anchor": "DataSEO MCP",
      "domainRating": 76,
      "title": "Example page",
      "urlFrom": "https://source.example/page",
      "urlTo": "https://example.com/page",
      "edu": false,
      "gov": false
    }
  ]
}

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

返回现有 label / value 形状的关键词和问题建议。

get_traffic(domain_or_url, country="None", mode="subdomains")

返回流量历史、流量摘要、热门页面、国家/地区和关键词。保留了旧版 costMontlyAvg 字段,并包含 costMonthlyAvg。

keyword_difficulty(keyword, country="us")

返回关键词难度分数和带有可用指标的自然 SERP 行。

ai_search_queries(keyword, count=10, model="openai/gpt-4o-mini", language="en")

返回去重后的 AI 生成查询:

{
  "keyword": "ai seo audit",
  "queries": [
    {"query": "what is an AI SEO audit", "intent": "informational"},
    {"query": "best AI SEO audit tools", "intent": "commercial"}
  ],
  "model_used": "openai/gpt-4o-mini",
  "total_queries": 2
}

count 在 1 到 50 之间验证。有效的意图包括 informational(信息型)、commercial(商业型)、transactional(交易型)和 navigational(导航型)。

附加工具

  • domain_overview(domain, country="None"):单个域名的反向链接概览加流量摘要。

  • compare_domains(domains, country="None"):比较 2-5 个唯一域名。

  • backlink_opportunities(domain, competitors):列出目标样本中不存在的竞争对手反向链接来源。

  • seo_content_brief(keyword, country="us", count=12, model, language):结合关键词难度、SERP 行、AI 搜索查询和推荐的内容角度。

架构

server.py 被刻意保持精简。实现分为:

  • services.py:MCP 工具编排和公共返回形状。

  • schemas.py:Pydantic 验证和规范化。

  • captcha.py:带有边界轮询的 CapSolver / Anti-Captcha 回退。

  • backlinks.py, keywords.py, traffic.py:Ahrefs 端点适配器。

  • ai.py:兼容 OpenRouter/OpenAI 的查询生成。

  • cache.py:默认位于 ~/.cache/dataseo-mcp 下的 JSON 签名缓存。

所有外部 HTTP 边界都在测试中进行了模拟。

开发

uv sync
uv run pytest -q
uv run ruff check .
uv run python -m compileall -q src
uv run python -c "from seo_mcp.server import main"

故障排除

问题

修复

未配置 CAPTCHA 提供商

设置 CAPSOLVER_API_KEY 或 ANTICAPTCHA_API_KEY

CAPTCHA 解决失败

检查提供商余额、密钥有效性和速率限制

AI 工具返回缺少密钥错误

设置 OPENROUTER_API_KEY

SEO 响应为空

域名或关键词可能未被上游源索引

旧命令不再记录

使用 dataseo-mcp;seo-mcp 仍可作为别名使用

许可证

MIT 许可证,附带教育用途声明。原始分支归属保留在 LICENSE 中。

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?

No annotations are present, so the description carries the full burden. It does not disclose whether the tool is read-only, destructive, requires authentication, or has rate limits. For a data query tool, this is a significant gap.

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 concise at two sentences plus an Args/Returns list. It is front-loaded with the purpose and structured for easy scanning. No wasted words.

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 no output schema, the description only vaguely states 'Traffic data' without specifying structure. Combined with missing behavioral context, the description is incomplete for a 3-parameter tool.

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 and their types, adding some meaning beyond the schema (e.g., domain_or_url is 'The domain or URL to query'). However, it does not explain the difference between 'subdomains' and 'exact' modes, nor the effect of the country parameter, beyond default values.

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 states 'Check the estimated search traffic for any website', which clearly identifies the verb and resource. It distinguishes from sibling tools like get_backlinks_list and keyword_difficulty by focusing on traffic estimation, but does not explicitly differentiate.

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, nor does it specify prerequisites or exclusions. It simply states the tool's function without context for decision-making.

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.6/5.0
Behavior2/5

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

No annotations provided, so description must carry full burden. It does not disclose how difficulty is calculated, what unit/scale is used, or any side effects. Bare minimum.

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

Conciseness3/5

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

Single sentence of 8 words is concise but lacks substance. Appropriate length for the content, but more detail would improve informativeness.

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 no annotations, no output schema, and 2 params requiring explanation, the description is inadequate. Leaves agent guessing about return values, scope, and usage nuances.

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 has 0% description coverage. Description only mentions 'specified keyword' without explaining its meaning or format. Country parameter and default are not explained. Adds minimal value to schema.

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 'Get keyword difficulty for the specified keyword' clearly states the action and resource. It is distinct from sibling tools like get_backlinks_list and get_traffic, though sibling differentiation is implicit rather than explicit.

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?

No guidance on when to use this tool compared to alternatives. Lacks context about prerequisites or typical use cases.

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.4/5.0
Behavior2/5

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

No annotations provided. Description only says 'get ideas' with no disclosure of behavior (e.g., return format, rate limits, data source).

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

Conciseness3/5

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

Extremely short, no fluff, but lacks essential details. Conciseness is achieved at the expense of completeness.

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

Completeness1/5

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

With 3 parameters, no output schema, and no annotations, the description is severely incomplete. No information on return values or side effects.

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

Parameters1/5

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

Schema coverage is 0% and description only mentions the keyword parameter, ignoring country and search_engine. Fails to compensate for missing parameter descriptions.

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 it returns keyword ideas for a given keyword. It distinguishes from sibling tools (backlinks, traffic, difficulty) but lacks specificity about the output format or scope.

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?

No guidance on when to use this tool vs. alternatives, no prerequisites, no context about typical use cases.

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.

  1. 4 tool updatesv1.0.0
    • First observedget_backlinks_list
    • First observedget_traffic
    • First observedkeyword_difficulty
    • First observedkeyword_generator

TDQS

B3.1/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: get_backlinks_list retrieves backlink data, get_traffic provides traffic estimates, keyword_difficulty assesses keyword competitiveness, and keyword_generator suggests related keywords. There is no overlap in functionality, making tool selection unambiguous.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with snake_case: get_backlinks_list, get_traffic, keyword_difficulty, keyword_generator. The naming is predictable and readable, with no deviations in style or convention.

Tool Count4/5

With 4 tools, the count is reasonable for an SEO research server, covering key areas like backlinks, traffic, and keywords. It is slightly lean but not insufficient, as these tools address core SEO analysis needs without being overwhelming.

Completeness3/5

The toolset covers essential SEO research functions but has notable gaps. For example, there are no tools for competitor analysis, content suggestions, or SERP features, which are common in SEO workflows. Agents can perform basic research but may lack comprehensive coverage for advanced tasks.

Maintenance

ActivityInactive
ResponsivenessSlow

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI-powered IDEs to perform SEO research including backlink analysis, keyword generation, traffic estimation, and keyword difficulty using Ahrefs data and CapSolver for CAPTCHA solving.
    4
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Connects AI assistants to SEO APIs for backlinks analysis, keyword research, and traffic analysis.
    9 npm
    28
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides AI agents with professional-grade SEO capabilities including on-page analysis, technical audits, PageSpeed insights, and Ahrefs data integration.
    13
    11 npm
    5
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables SEO data retrieval including backlinks, keyword research, keyword difficulty, and traffic estimation using Ahrefs free tools.
    4 npm
    MIT