基于Ahrefs数据的MCP(模型控制协议)SEO工具服务。包括反向链接分析、关键词研究、流量估算等功能。
此服务提供一个API来从Ahrefs获取SEO数据。它处理整个过程,包括解决验证码、认证和数据检索。结果会被缓存以提高性能并减少API成本。
此MCP服务仅供教育用途。请勿滥用。本项目灵感来源于
@哥飞社群。
🔍 反向链接分析
🎯 关键词研究
📊 流量分析
🚀 性能优化
pip install seo-mcp
或者使用uv:
uv pip install seo-mcp
克隆仓库:
git clone https://github.com/cnych/seo-mcp.git
cd seo-mcp
安装依赖:
pip install -e .
# 或者
uv pip install -e .
设置CapSolver API密钥:
export CAPSOLVER_API_KEY="your-capsolver-api-key"
你可以通过以下方式运行服务:
在Cursor设置中,切换到MCP标签页,点击+添加新的全局MCP服务器按钮,然后输入:
{
"mcpServers": {
"SEO MCP": {
"command": "uvx",
"args": ["--python", "3.10", "seo-mcp"],
"env": {
"CAPSOLVER_API_KEY": "CAP-xxxxxx"
}
}
}
}
你也可以在项目根目录创建一个.cursor/mcp.json文件,内容相同。
服务提供了以下MCP工具:
get_backlinks_list(domain: str)获取一个域名的反向链接。
参数:
domain (字符串):要分析的域名(例如:"example.com")返回值:
{
"overview": {
"domainRating": 76,
"backlinks": 1500,
"refDomains": 300
},
"backlinks": [
{
"anchor": "Example link",
"domainRating": 100,
"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")生成关键词建议。
参数:
keyword (字符串):种子关键词country (字符串):国家代码(默认:"us")search_engine (字符串):搜索引擎(默认:"Google")返回值:
[
{
"keyword": "Example keyword",
"volume": 1000,
"difficulty": 45,
"cpc": 2.5
}
]
get_traffic(domain_or_url: str, country: str = "None", mode: str = "subdomains")获取流量估算。
参数:
domain_or_url (字符串):要分析的域名或URLcountry (字符串):国家过滤器(默认:"None")mode (字符串):分析模式("subdomains" 或 "exact")返回值:
{
"traffic_history": [...],
"traffic": {
"trafficMonthlyAvg": 50000,
"costMontlyAvg": 25000
},
"top_pages": [...],
"top_countries": [...],
"top_keywords": [...]
}
keyword_difficulty(keyword: str, country: str = "us")获取关键词难度评分。
参数:
keyword (字符串):要分析的关键词country (字符串):国家代码(默认:"us")返回值:
{
"difficulty": 45,
"serp": [...],
"related": [...]
}
对于开发:
git clone https://github.com/cnych/seo-mcp.git
cd seo-mcp
uv sync
CAPSOLVER_API_KEY环境变量MIT许可证 - 详见LICENSE文件