Sponsored by Deepsite.site

Backlinks Mcp

Created By
cnych8 months ago
Content

Backlinks MCP

A MCP (Model Control Protocol) service for retrieving backlink information for any domain using Ahrefs' data.

Overview

This service provides an API to retrieve backlink data for websites. It handles the entire process including captcha solving, authentication, and data retrieval from Ahrefs. The results are cached to improve performance and reduce API costs.

This MCP server is only for learning purposes, please do not abuse it, otherwise the consequences will be self-responsible. This project is inspired by @哥飞社群.

About this MCP Server, please refer to the introduction of Claude MCP Backlinks MCP.

Features

  • 🔍 Retrieve backlink data for any domain
  • 🔒 Automatic captcha solving with CapSolver
  • 💾 Signature caching to reduce API calls
  • 🚀 Fast and efficient data retrieval
  • 🧹 Simplified output with the most relevant backlink information

Installation

Prerequisites

  • Python 3.8 or higher
  • A CapSolver account and API key (register here)
  • uv installed (on macOS, you might need to install with brew install uv)

Manual Setup

  1. Clone the repository:

    git clone https://github.com/cnych/backlinks-mcp.git
    cd backlinks-mcp
    
  2. Install FastMCP with uv:

    uv pip install fastmcp
    
  3. Set up your CapSolver API key:

    export CAPSOLVER_API_KEY="your-capsolver-api-key"
    

Usage

Running the Service

You can use FastMCP to run the service in several ways:

Install in Claude Desktop

To install this server in Claude Desktop and interact with it right away:

fastmcp install src/backlinks_mcp/server.py

Test with the MCP Inspector

For development and testing:

fastmcp dev src/backlinks_mcp/server.py

Install in Cursor IDE

On Cursor Settings, switch to MCP tab, click the +Add new global MCP server button, then input the following content:

{
  "mcpServers": {
    "Backlink MCP": {
      "command": "uvx",
      "args": ["backlinks-mcp"],
      "env": {
        "CAPSOLVER_API_KEY": "CAP-xxxxxx"
      }
    }
  }
}

Also, you can create a .cursor/mcp.json file in the project root directory and input the above content, so it's a project-specific MCP server.

CAPSOLVER_API_KEY env can get from here.

Next, we can use this MCP in Cursor:

Use Backlinks MCP on Cursor

API Reference

The service exposes the following MCP tool:

Retrieves a list of backlinks for the specified domain.

Parameters:

  • domain (string): The domain to query (e.g., "example.com")

Returns: A list of backlink objects, each containing:

  • anchor: The anchor text of the backlink
  • domainRating: The domain rating score (0-100)
  • title: The title of the linking page
  • urlFrom: The URL of the page containing the backlink
  • urlTo: The URL being linked to
  • edu: Boolean indicating if it's from an educational site
  • gov: Boolean indicating if it's from a government site

Example Response:

[
  {
    "anchor": "example link",
    "domainRating": 76,
    "title": "Useful Resources",
    "urlFrom": "https://referringsite.com/resources",
    "urlTo": "https://example.com/page",
    "edu": false,
    "gov": false
  },
  ...
]

Development

For development purposes, you can clone the repository and install development dependencies:

git clone https://github.com/cnych/backlinks-mcp.git
cd backlinks-mcp
uv sync

How It Works

  1. The service first attempts to retrieve a cached signature for the domain
  2. If no valid cache exists, it:
    • Solves the Cloudflare Turnstile captcha using CapSolver
    • Obtains a signature and validity period from Ahrefs
    • Caches this information for future use
  3. Uses the signature to retrieve the backlinks data
  4. Processes and returns the simplified backlink information

Troubleshooting

  • CapSolver API Key Error: Ensure your CAPSOLVER_API_KEY environment variable is set correctly
  • Rate Limiting: If you encounter rate limits, try using the service less frequently
  • No Results: Some domains may have no backlinks or may not be indexed by Ahrefs
  • Issues: If you encounter issues with Backlinks MCP, check the Backlinks MCP GitHub repository for troubleshooting guidance

License

This project is licensed under the MIT License - see the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code