Ahrefs

v1.0.0Marketing & SEOstable

A Model Context Protocol server that connects Claude desktop and other compatible AI assistants to Ahrefs, allowing them to access Ahrefs functionality.

ahrefs-mcp-servermcpai-integration
Share:
98
Stars
0
Downloads
0
Weekly
0/5

What is Ahrefs?

Ahrefs is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that connects claude desktop and other compatible ai assistants to ahrefs, allowing them to access ahrefs functionality.

A Model Context Protocol server that connects Claude desktop and other compatible AI assistants to Ahrefs, allowing them to access Ahrefs functionality.

This server falls under the Marketing & SEO category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol server that connects Claude desktop

Use Cases

Access Ahrefs SEO and competitive analysis tools through AI assistants. Query backlinks, keywords, and site authority data.
ahrefs

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ahrefs-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Ahrefs

The Ahrefs MCP server connects AI assistants like Claude directly to Ahrefs' powerful SEO data platform, enabling real-time access to backlink analysis, keyword research, domain ratings, competitive intelligence, and technical SEO insights without leaving your chat interface. It bridges the gap between conversational AI and enterprise-grade SEO tooling so marketers, content strategists, and SEO professionals can query Ahrefs data naturally. The official package is now the remote Ahrefs MCP server at @ahrefs/mcp, which requires no local server process and works directly with your Ahrefs API key.

Prerequisites

  • Node.js 18 or later installed on your system
  • An active Ahrefs account with API access (API v3 key from app.ahrefs.com/api)
  • Claude Desktop, Cursor, or another MCP-compatible AI client installed
  • npm available in your terminal
1

Obtain your Ahrefs API key

Log in to your Ahrefs account and navigate to the API section (app.ahrefs.com/api). Generate or copy your API v3 key. Note that MCP keys (used for the remote server) are different from standard API v3 keys — ensure you are using an API v3 key for this local server.

2

Install the Ahrefs MCP package globally

Install the @ahrefs/mcp package globally into a dedicated prefix directory to avoid permission issues. This places the binary where your MCP client can find it.

npm install --prefix=~/.global-node-modules @ahrefs/mcp -g
3

Add the server to your Claude Desktop configuration

Open your Claude Desktop config file at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add the Ahrefs server block with your API key.

{
  "mcpServers": {
    "ahrefs": {
      "command": "npx",
      "args": [
        "--prefix=~/.global-node-modules",
        "@ahrefs/mcp"
      ],
      "env": {
        "API_KEY": "your_ahrefs_api_v3_key_here"
      }
    }
  }
}
4

Restart Claude Desktop

Fully quit and reopen Claude Desktop so it picks up the updated configuration. You should see the Ahrefs tools available in the tool list within the chat interface.

5

Verify the connection with a test query

Send a message to Claude asking it to look up domain data for a site you own or are researching. A successful response with DR, traffic estimates, or backlink counts confirms the server is working.

Ahrefs Examples

Client configuration

Add this block to your claude_desktop_config.json to connect Claude Desktop to Ahrefs. Replace the API_KEY value with your actual Ahrefs API v3 key.

{
  "mcpServers": {
    "ahrefs": {
      "command": "npx",
      "args": [
        "--prefix=~/.global-node-modules",
        "@ahrefs/mcp"
      ],
      "env": {
        "API_KEY": "your_ahrefs_api_v3_key_here"
      }
    }
  }
}

Prompts to try

These prompts demonstrate the Ahrefs MCP server's capabilities for SEO research and competitive analysis.

- "What is the Domain Rating and estimated organic traffic for example.com?"
- "Find the top 10 keywords that example.com ranks for in the top 3 positions."
- "Show me the backlink profile for competitor.com — how many referring domains do they have?"
- "Identify broken backlinks pointing to mysite.com so I can reclaim link equity."
- "Which sites are the organic search competitors of example.com based on common keywords?"
- "What new keywords is competitor.com ranking for this month that I am not?"

Troubleshooting Ahrefs

Claude says 'No tools available' or the Ahrefs tools do not appear

Ensure Claude Desktop was fully restarted after editing the config file. Also check that the npm prefix path in the args array resolves correctly — on Windows, substitute the tilde with the full path like C:\Users\YourName\.global-node-modules\node_modules.

API authentication errors or 401 responses from Ahrefs

Confirm you are using an API v3 key, not an MCP key or legacy key. The API_KEY environment variable must be set exactly as shown — check for extra whitespace or quotes around the value in your JSON config.

Package installs but the npx command fails to start the server

Run 'npm install --prefix=~/.global-node-modules @ahrefs/mcp@latest -g' to upgrade to the latest version. If that fails, check Node.js version with 'node --version' — Node 18 or later is required.

Frequently Asked Questions about Ahrefs

What is Ahrefs?

Ahrefs is a Model Context Protocol (MCP) server that model context protocol server that connects claude desktop and other compatible ai assistants to ahrefs, allowing them to access ahrefs functionality. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Ahrefs?

Follow the installation instructions on the Ahrefs GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Ahrefs?

Ahrefs works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Ahrefs free to use?

Yes, Ahrefs is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Marketing & SEO MCP Servers

Explore all marketing & seo servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "ahrefs-mcp-server": { "command": "npx", "args": ["-y", "ahrefs-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Ahrefs?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides