Ahrefs MCP: connect Claude to Ahrefs for keyword research, and what it costs in API units

Ahrefs runs an official MCP server over its API v3. How to add it to Claude Code, Claude Desktop and Cursor, what tools it exposes (Keywords Explorer, Site Explorer, SERP overview, Rank Tracker, Brand Radar), a research workflow that works, and how API units are consumed.

Walma Engineering·Updated 12 September 2026·7 min read

We planned this entire guide section with the Ahrefs MCP server: the keyword clusters, the difficulty filters, the traffic-potential rankings. It is the fastest way we know to go from "what should we write" to a prioritised list, and it works from inside Claude Code so the research lands next to the content. This guide covers setup, the tools, a workflow that works, and the part nobody tells you about: API units.

Setup

The server is remote and official. In Claude Code:

claude mcp add ahrefs https://api.ahrefs.com/mcp/mcp -t http

Start a session, run /mcp, choose Ahrefs and complete the login in the browser. In Claude Desktop, add it as a custom connector with the same URL. In Cursor, add it to mcp.json with the url field. General instructions are in Claude Code, Cursor and Claude Desktop.

You need an Ahrefs plan that includes API access. The server tells you if you do not.

What it exposes

The server mirrors Ahrefs API v3, which is large. The tools that matter for content and SEO work:

  • Keywords Explorer: matching terms, related terms, search suggestions, overview, volume by country and history.
  • Site Explorer: organic keywords, top pages, referring domains, backlinks, domain rating, competitors, and history for all of them.
  • SERP overview: who ranks for a keyword, with domain rating, traffic and page type.
  • Rank Tracker: your tracked keywords and competitors.
  • Site Audit: crawl issues and page data.
  • Brand Radar: mentions, citations and share of voice in AI answers, which is the closest thing to a metric for SEO for AI search.

Every tool has a doc companion that returns its schema, and the server asks you to call it before first use. Results include a render_with hint; the server expects the client to render tables rather than paste raw JSON.

A workflow that works

The sequence we use, which is also documented in our own repository's instructions for future sessions:

  1. Seed from the offering. List 10 to 15 terms per theme from your positioning, not from what the tools suggest.
  2. Query per market, questions mode and phrase mode, with a filter such as volume above 150 and difficulty below 25.
  3. Rank by traffic potential over difficulty, not by volume. A 400-a-month query whose top page pulls 50 000 visits beats a 5 000-a-month query whose top page pulls 250.
  4. Check what you already rank for with Site Explorer so you do not cannibalise.
  5. Check the SERP for each target: if the top ten are all DR 70 news sites, move on.
  6. Write the cluster, pillar first, then the questions.

Packaged as a skill, that becomes a repeatable content-planning routine any marketer on the team can run.

API units

Ahrefs bills the API in units, separately from seats. Each MCP call reports its cost, for example:

rows: 100, units-cost-row: 54, units-cost-total: 5400

The cost scales with rows returned and columns selected; difficulty and traffic-potential columns cost more than volume. Practical rules: select only the columns you need, use limit and where filters aggressively, and prefer one query with a good filter over ten exploratory ones. A planning session for a content cluster runs to tens of thousands of units; check your plan's monthly allowance before letting an agent loop.

For a team

An Ahrefs login through MCP grants the whole API allowance to whoever holds the session. In a team, that belongs behind a gateway with per-user access and a log of who spent the units on what. Walma AI Hub runs Ahrefs alongside Search Console, Google Analytics and Google Ads in the customer's own EU region, which is how our own marketing runs. Book a walkthrough if you want the same.

Frequently asked questions

Does Ahrefs have an MCP server?+

Yes, an official remote server at Ahrefs' API endpoint with OAuth login. It works with Claude, Claude Code, Cursor and other MCP clients and requires an Ahrefs plan with API access.

How do I add Ahrefs to Claude Code?+

Run claude mcp add ahrefs https://api.ahrefs.com/mcp/mcp -t http, then /mcp in a session to log in with your Ahrefs account.

Does the Ahrefs MCP server cost extra?+

It consumes API units from your Ahrefs API subscription. Each request costs units based on the rows returned and the columns selected; the response reports the cost. A single keyword research query with 100 rows and several metrics can cost a few thousand units.

What can I do with Ahrefs through MCP?+

Keyword ideas with volume, difficulty, CPC and traffic potential; a site's organic keywords and pages; SERP overviews with the ranking pages' domain rating; rank tracking; site audit issues; and Brand Radar data on how often a brand appears in AI answers.

Walma AI Hub

The same tools, in your EU region, under your control

A 20-minute walkthrough with an engineer. We map it to your tools, your MCP servers and your budget model.

About AI Hub