Skip to content
Back to search

seo-mcp

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/cnych--seo-mcp/badge.svg)](/listings/cnych--seo-mcp)

HTML

<a href="/listings/cnych--seo-mcp"><img src="/api/listings/cnych--seo-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prerequisites

- Python 3.10 or higher - CapSolver account and API key ([register here](https://dashboard.capsolver.com/passport/register?inviteCode=1dTH7WQSfHD0))

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"

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 236 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # SEO MCP
  2. A MCP (Model Control Protocol) SEO tool service based on Ahrefs data. Includes features such as backlink analysis, keyword research, traffic estimation, and more.
  3. [中文](./README_CN.md)
  4. ## Overview
  5. 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.
  6. > This MCP service is for educational purposes only. Please do not misuse it. This project is inspired by `@哥飞社群`.
  7. ## Features
  8. - 🔍 Backlink Analysis
  9. - Get detailed backlink data for any domain
  10. - View domain rating, anchor text, and link attributes
  11. - Filter educational and government domains
  12. - 🎯 Keyword Research
  13. - Generate keyword ideas from a seed keyword
  14. - Get keyword difficulty score
  15. - View search volume and trends
  16. - 📊 Traffic Analysis
  17. - Estimate website traffic
  18. - View traffic history and trends
  19. - Analyze popular pages and country distribution
  20. - Track keyword rankings
  21. - 🚀 Performance Optimization
  22. - Use CapSolver to automatically solve CAPTCHA
  23. - Response caching
  24. ## Installation
  25. ### Prerequisites
  26. - Python 3.10 or higher
  27. - CapSolver account and API key ([register here](https://dashboard.capsolver.com/passport/register?inviteCode=1dTH7WQSfHD0))
  28. ### Install from PyPI
  29. ```bash
  30. pip install seo-mcp
  31. ```
  32. Or use `uv`:
  33. ```bash
  34. uv pip install seo-mcp
  35. ```
  36. ### Manual Installation
  37. 1. Clone the repository:
  38. ```bash
  39. git clone https://github.com/cnych/seo-mcp.git
  40. cd seo-mcp
  41. ```
  42. 2. Install dependencies:
  43. ```bash
  44. pip install -e .
  45. # Or
  46. uv pip install -e .
  47. ```
  48. 3. Set the CapSolver API key:
  49. ```bash
  50. export CAPSOLVER_API_KEY="your-capsolver-api-key"
  51. ```
  52. ## Usage
  53. ### Run the service
  54. You can run the service in the following ways:
  55. #### Use in Cursor IDE
  56. In the Cursor settings, switch to the MCP tab, click the `+Add new global MCP server` button, and then input:
  57. ```json
  58. {
  59. "mcpServers": {
  60. "SEO MCP": {
  61. "command": "uvx",
  62. "args": ["--python", "3.10", "seo-mcp"],
  63. "env": {
  64. "CAPSOLVER_API_KEY": "CAP-xxxxxx"
  65. }
  66. }
  67. }
  68. }
  69. ```
  70. You can also create a `.cursor/mcp.json` file in the project root directory, with the same content.
  71. ### API Reference
  72. The service provides the following MCP tools:
  73. #### `get_backlinks_list(domain: str)`
  74. Get the backlinks of a domain.
  75. **Parameters:**
  76. - `domain` (string): The domain to analyze (e.g. "example.com")
  77. **Returns:**
  78. ```json
  79. {
  80. "overview": {
  81. "domainRating": 76,
  82. "backlinks": 1500,
  83. "refDomains": 300
  84. },
  85. "backlinks": [
  86. {
  87. "anchor": "Example link",
  88. "domainRating": 76,
  89. "title": "Page title",
  90. "urlFrom": "https://referringsite.com/page",
  91. "urlTo": "https://example.com/page",
  92. "edu": false,
  93. "gov": false
  94. }
  95. ]
  96. }
  97. ```
  98. #### `keyword_generator(keyword: str, country: str = "us", search_engine: str = "Google")`
  99. Generate keyword ideas.
  100. **Parameters:**
  101. - `keyword` (string): The seed keyword
  102. - `country` (string): Country code (default: "us")
  103. - `search_engine` (string): Search engine (default: "Google")
  104. **Returns:**
  105. ```json
  106. [
  107. {
  108. "keyword": "Example keyword",
  109. "volume": 1000,
  110. "difficulty": 45,
  111. "cpc": 2.5
  112. }
  113. ]
  114. ```
  115. #### `get_traffic(domain_or_url: str, country: str = "None", mode: str = "subdomains")`
  116. Get the traffic estimation.
  117. **Parameters:**
  118. - `domain_or_url` (string): The domain or URL to analyze
  119. - `country` (string): Country filter (default: "None")
  120. - `mode` (string): Analysis mode ("subdomains" or "exact")
  121. **Returns:**
  122. ```json
  123. {
  124. "traffic_history": [...],
  125. "traffic": {
  126. "trafficMonthlyAvg": 50000,
  127. "costMontlyAvg": 25000
  128. },
  129. "top_pages": [...],
  130. "top_countries": [...],
  131. "top_keywords": [...]
  132. }
  133. ```
  134. #### `keyword_difficulty(keyword: str, country: str = "us")`
  135. Get the keyword difficulty score.
  136. **Parameters:**
  137. - `keyword` (string): The keyword to analyze
  138. - `country` (string): Country code (default: "us")
  139. **Returns:**
  140. ```json
  141. {
  142. "difficulty": 45,
  143. "serp": [...],
  144. "related": [...]
  145. }
  146. ```
  147. ## Development
  148. For development:
  149. ```bash
  150. git clone https://github.com/cnych/seo-mcp.git
  151. cd seo-mcp
  152. uv sync
  153. ```
  154. ## How it works
  155. 1. The user sends a request through MCP
  156. 2. The service uses CapSolver to solve the Cloudflare Turnstile CAPTCHA
  157. 3. The service gets the authentication token from Ahrefs
  158. 4. The service retrieves the requested SEO data
  159. 5. The service processes and returns the formatted results
  160. ## Troubleshooting
  161. - **CapSolver API key error**:Check the `CAPSOLVER_API_KEY` environment variable
  162. - **Rate limiting**:Reduce request frequency
  163. - **No results**:The domain may not be indexed by Ahrefs
  164. - **Other issues**:See [GitHub repository](https://github.com/cnych/seo-mcp)
  165. ## License
  166. MIT License - See LICENSE file

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.