SEO MCP
Integrates with Cloudflare's Turnstile CAPTCHA service to automatically solve CAPTCHA challenges when accessing Ahrefs SEO data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SEO MCP get backlinks for example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: seo-mcp
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-mcpOr use uv:
uv pip install seo-mcpManual Installation
Clone the repository:
git clone https://github.com/cnych/seo-mcp.git cd seo-mcpInstall dependencies:
pip install -e . # Or uv pip install -e .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 keywordcountry(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 analyzecountry(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 analyzecountry(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 syncHow it works
The user sends a request through MCP
The service uses CapSolver to solve the Cloudflare Turnstile CAPTCHA
The service gets the authentication token from Ahrefs
The service retrieves the requested SEO data
The service processes and returns the formatted results
Troubleshooting
CapSolver API key error:Check the
CAPSOLVER_API_KEYenvironment variableRate 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 toolsget_backlinks_listA
Get backlinks list for the specified domain
Args:
domain (str): The domain to query
Returns:
List of backlinks for the domain, containing title, URL, domain rating, etc.
Inputs: domain (required).
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
Inputs: domain_or_url (required), country, mode.
keyword_difficultyC
Get keyword difficulty for the specified keyword
Inputs: keyword (required), country.
keyword_generatorC
Get keyword ideas for the specified keyword
Inputs: keyword (required), country, search_engine.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool addresses a distinct SEO function: backlinks, traffic, keyword difficulty, and keyword generation. There is no overlap in purpose.
Two tools use the 'get_' prefix (get_backlinks_list, get_traffic) while two do not (keyword_difficulty, keyword_generator). This inconsistency in naming pattern could confuse an agent.
With 4 tools, the set is appropriately scoped for basic SEO tasks. It is not too small or too large for the domain.
Core SEO operations are covered (backlinks, traffic, keywords), but lacks features like rank tracking, site audit, or competitive analysis, leaving notable gaps.
Maintenance
Related MCP Connectors
SEO MCP server — backlinks, domain authority, tech stack, and 18+ tools via Common Crawl.
Official Ahrefs MCP server. Access SEO data, including backlinks, keywords, and competitor research.
SEO MCP server for keyword research, live SERPs, backlinks, site audits and AI visibility.
SEO MCP server for keyword research, SERP analysis, audits, and Search Console workflows.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server providing tools to access Semrush API data for domain analytics, keyword research, backlink analysis, and traffic analytics.1971 npmMIT
- AlicenseAqualityBmaintenanceAn SEO MCP server providing free SEO tools including on-page audits, broken link checks, sitemap analysis, and keyword ideas via Google Suggest, all without requiring an API key.1031 npm6MIT
- FlicenseAqualityCmaintenanceAn MCP server providing 20 SEO tools including coverage reports, supporting both stdio and HTTP modes for data-driven SEO analysis.20-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides SEO analysis tools including backlink analysis, keyword research, and traffic estimation using Ahrefs data, with CAPTCHA solving and caching.MIT