Ahrefs MCP: a keyword research API inside Claude, setup and what it costs in API units
Ahrefs runs an official MCP server over its keyword research API (API v3). How to add it to Claude Code, Claude Desktop and Cursor, what it exposes, how it compares with calling a keyword research API directly, a workflow that works, API unit costs, and running it from Europe.
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.
MCP or calling the keyword research API directly
Ahrefs API v3 is a keyword research API in its own right, and plenty of teams call it from scripts: a nightly job that pulls volumes for a keyword list, a dashboard that tracks rankings. The MCP server does not replace that. It changes who writes the queries.
| Direct API calls | Through MCP | |
|---|---|---|
| Who chooses the endpoint and filters | A developer, in code | The agent, from a plain-language question |
| Best for | Fixed, repeated jobs and dashboards | Exploratory research and one-off analysis |
| Output | JSON you have to process | Tables and a written conclusion |
| Cost control | Predictable, the code is fixed | Needs limits, an agent can loop |
The two work well together. Use MCP to find out which questions are worth asking, then hard-code the ones you ask every week. The best MCP servers for marketing and SEO guide covers the other data sources that sit next to it.
A workflow that works
The sequence we use, which is also documented in our own repository's instructions for future sessions:
- Seed from the offering. List 10 to 15 terms per theme from your positioning, not from what the tools suggest.
- Query per market, questions mode and phrase mode, with a filter such as volume above 150 and difficulty below 25.
- 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.
- Check what you already rank for with Site Explorer so you do not cannibalise.
- Check the SERP for each target: if the top ten are all DR 70 news sites, move on.
- 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.
Running it from Europe
Keyword data is aggregated market data, not personal data, so a keyword research API is rarely a GDPR problem in itself. The exposure is everything around it. A real research session mixes Ahrefs with your own Search Console queries, your Analytics conversions and your positioning documents, and all of it passes through the model. For a European team the question to answer is where that model runs and who can see the log, not where Ahrefs stores its keyword index.
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.
The full set of marketing connections is on AI for marketing.
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.
Is the Ahrefs MCP server a keyword research API?+
It is a front end to one. The server wraps Ahrefs API v3, so the same Keywords Explorer data you would fetch with HTTP calls is available as tools an agent can call. The difference is that the agent picks the endpoint, the filters and the follow-up queries, and you get the analysis back instead of raw JSON.
Can we use a keyword research API from Europe without GDPR problems?+
Keyword volumes, difficulty and SERP data are aggregated market data, not personal data, so the data itself is rarely the issue. The questions are where the rest of the conversation goes: your prompts, your Search Console and Analytics data and the model that reads them. Run the model and the connections in an EU region and log who queried what.
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.
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.