SEO research has a dashboard problem: the data you need is spread across Keyword Explorer, Site Explorer, and Site Audit, each requiring its own navigation flow. The Ahrefs MCP server collapses all of that into a single conversation with Claude — ask for keyword difficulty, get a SERP overview, check a competitor's domain rating, and pull top pages from your site, all without leaving the chat window.

What is Ahrefs?

Ahrefs is a professional SEO toolset trusted by marketers, agencies, and content teams worldwide. Its core strengths are its backlink index (one of the largest on the web), its keyword database with accurate search volume and difficulty scores, and its Site Explorer tool for competitive analysis. Ahrefs also provides Site Audit for technical SEO checks, Rank Tracker for position monitoring, and Content Explorer for finding high-performing content in any niche. API access (available on Lite plans and above) lets developers and power users pull Ahrefs data programmatically — and now, via MCP, directly into Claude.

What the Ahrefs MCP Server Does

Once connected, Claude can use the following Ahrefs tools during your conversation:

  • Get keyword difficulty and volume — check how hard it is to rank for a keyword and how many people search for it monthly
  • Check domain rating — get the DR score for any domain, including competitors
  • Get backlink count for a URL — see how many referring domains link to a specific page
  • List top pages by organic traffic — find which pages on any domain drive the most search traffic
  • Keyword ideas — generate a list of related keywords with metrics from a seed term
  • SERP overview for a keyword — see which pages currently rank and their key metrics
  • Site audit summary — get a high-level overview of technical SEO issues on your site

Prerequisites

Before setting up the Ahrefs MCP server, confirm you have:

  • Ahrefs paid subscription — Lite plan or above. The free Ahrefs Webmaster Tools account does not include API access. Check your plan at ahrefs.com.
  • Ahrefs API token — in Ahrefs, go to Account Settings → API. Generate a token if one doesn't exist yet.
  • Node.js 18+ — verify with node --version.
  • Claude Desktop — installed and signed in.

How to Install the Ahrefs MCP Server

  1. Get your Ahrefs API token. Log into Ahrefs, go to Account Settings (top right avatar) → API. Copy the token displayed. If no token exists, click Generate.
  2. Open your Claude Desktop config file. macOS: ~/Library/Application Support/Claude/claude_desktop_config.json. Windows: %APPDATA%\Claude\claude_desktop_config.json.
  3. Add the Ahrefs MCP server entry inside the mcpServers object. Use the config JSON below.
  4. Replace the placeholder with your actual API token.
  5. Save the file and fully quit Claude Desktop.
  6. Relaunch Claude Desktop. Look for the hammer icon in the chat input to confirm MCP tools are active.
  7. Run a test query: "What is the keyword difficulty for 'best mcp servers'?" Claude should return a difficulty score and search volume from Ahrefs.

Configuration JSON

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "ahrefs": {
      "command": "npx",
      "args": ["-y", "@ahrefs/mcp-server"],
      "env": {
        "AHREFS_API_TOKEN": "your_api_token_here"
      }
    }
  }
}
Replace your_api_token_here with the API token from your Ahrefs account settings.

Real Use Cases

Here are five SEO workflows the Ahrefs MCP server handles directly in Claude:

  1. "What's the keyword difficulty for 'mcp server tutorial' and how much monthly search volume does it get?" — Claude checks both metrics in one query and returns them in a readable format. Faster than opening Keyword Explorer for a single lookup.
  2. "Give me 20 keyword ideas around 'AI productivity tools' with low difficulty" — Claude pulls a keyword ideas list from Ahrefs filtered by low difficulty. Great as a starting point for content planning without running a full Keyword Explorer session.
  3. "What's the Domain Rating of competitor.com?" — Claude retrieves the DR score for any domain you specify. Useful for quick competitive benchmarking without opening Site Explorer.
  4. "How many backlinks does our homepage have?" — Claude queries the backlink count for your specified URL. Use this before and after a link-building campaign to track progress.
  5. "What are the top 10 pages on our site by organic traffic?" — Claude returns the pages driving the most search traffic. Identify your best-performing content quickly and decide where to double down.

Pros

  • SEO research in natural language instead of clicking through dashboards. Keyword checks, competitor DR lookups, and backlink counts that used to require multiple page loads now take one sentence.
  • Great for quick competitive checks. Checking a competitor's domain authority or top pages before a meeting or pitch is instant with the MCP server active.
  • Keyword clustering and analysis feels much faster via Claude. Ask Claude to group a list of keywords by topic or intent and Claude combines the Ahrefs data with its own analysis capabilities — something no dashboard does natively.
  • Reduces context switching during content creation. Stay in Claude while writing content and run SEO checks inline without breaking your writing flow.

Cons and Limitations

  • Requires a paid Ahrefs subscription with API access. This is not a free tool — Lite plans start at a significant monthly cost, and API access is not available on the free Webmaster Tools account.
  • API unit consumption. Each query consumes Ahrefs API units, which are limited by your plan. Complex queries — like pulling keyword ideas or site audit data — use more units. Monitor your usage in Account Settings, especially during setup and testing.
  • Real-time data may lag the Ahrefs web app. API data can be several hours behind the live Ahrefs dashboard. For time-sensitive ranking changes or fresh backlink data, check the Ahrefs interface directly.

Frequently Asked Questions

Yes. Ahrefs API access requires a Lite plan or above. The free Ahrefs account (Ahrefs Webmaster Tools) does not include API access. You will need an active paid subscription and an API token from Account Settings → API to use the MCP server.

API unit consumption varies by query type. Simple metrics like Domain Rating or a single keyword's difficulty use relatively few units, while bulk keyword research or site audit queries consume significantly more. Monitor your API unit usage in the Ahrefs Account Settings dashboard, especially during initial testing when you may be running exploratory queries frequently.

Yes. You can ask Claude to check the Domain Rating of any domain, retrieve backlink counts for competitor URLs, and find their top organic pages. This makes the MCP server genuinely useful for quick competitive intelligence checks without navigating through the Ahrefs dashboard manually.

There is no free MCP server that matches Ahrefs data quality, but you can use the Google Search Console MCP server if you have GSC access — it provides organic traffic data for your own site at no extra cost. For competitor data, a Semrush MCP server is an alternative if you already have a Semrush subscription.