If you're searching for "Ahrefs MCP", you're asking one of two things: does Ahrefs have an MCP server? or how do I connect Ahrefs to an AI assistant via the Model Context Protocol?
✅ Ahrefs has an official MCP server. Details in the setup section below.
What Is MCP?
Model Context Protocol (MCP) is an open standard developed by Anthropic that lets AI assistants — like Claude — connect to external tools, APIs, and data sources in a standardised way.
Before MCP, every AI integration required bespoke tooling: custom prompts, custom API wrappers, and custom glue code to pass context back and forth. MCP replaces that with a common interface: the AI asks the MCP server for data or actions, the server returns structured results, and the AI uses them to answer your question or complete a task.
In plain terms: MCP is how you give an AI assistant live access to Ahrefs — not just knowledge about it, but real, up-to-date data from your account.
What a Ahrefs MCP Integration Does
Once Ahrefs is connected via MCP, your AI assistant can:
- Read live data — pull records, metrics, activity, and status directly from Ahrefs
- Take actions — create, update, or log records based on your instructions
- Cross-reference context — combine Ahrefs data with other connected tools mid-conversation
The key difference from a standard chatbot: the assistant is not working from training data or memory. It is reading your actual Ahrefs instance, in real time.
Practical Ahrefs MCP Use Cases
Keyword and ranking lookups mid-workflow
Ask the assistant to pull keyword rankings, search volume, or site audit issues from Ahrefs while you're planning content or reviewing a site — no tab-switching.
Competitor analysis on demand
Have the assistant query Ahrefs for competitor data and return a structured comparison without you manually pulling reports.
Content brief generation with live data
Pull SERP data from Ahrefs via MCP and have the assistant generate a content brief — structure, headings, target keywords — in one step.
Ahrefs MCP: The Hosted Server, the Tool Cap, and the Contract Nobody Reads
Ahrefs ships a first-party, Ahrefs-hosted remote MCP server. There is no local install, no npm package to keep updated, no API proxy to build. The connection URL is:
https://api.ahrefs.com/mcp/mcp
Streamable HTTP, OAuth or a manual MCP key, paid plans from Lite upward. That is the whole "how do I connect it" answer, and it is the part every listicle gets right.
The parts they get wrong are the three constraints that decide whether it works in practice: Ahrefs caps how many tools it will advertise, it charges API units for every call the agent makes, and its terms forbid using the endpoint as a general-purpose API. Those three are the reason a connection that looks successful still returns nothing useful at 9am on a Monday.

Ahrefs' own MCP introduction. Note the endpoint shape: /mcp/mcp, a double path segment that is not a typo and is the single most common cause of a 404 on connect.
What the server actually exposes
Ahrefs does not publish a tool count, and the number depends on which groups you request. What it does publish is the group structure, and that is the more useful thing to know, because the group is the unit you filter on:
| Group | What it covers |
|---|---|
site-explorer-overview |
Domain Rating, backlink/outlink stats, organic and paid overview, metrics history |
site-explorer-reports |
Backlinks, referring domains, anchors, organic keywords, competitors, top pages, linked domains |
keywords-explorer |
Keyword overview, volume by country and history, matching terms, related terms, search suggestions |
serp-overview |
SERP overview for a keyword |
rank-tracker |
Rank Tracker overview and competitor reports |
site-audit |
Projects, issues, page explorer, page content |
brand-radar-simple / brand-radar-entities |
Brand Radar at domain/URL level and at entity level |
web-analytics-overview, -sources, -geo, -user-agents, -pages |
Ahrefs Web Analytics: stats, charts, traffic sources, geography, devices, top/entry/exit pages |
gsc |
Google Search Console data — keywords, pages, positions, performance history |
social-media |
Channels, posts, authors, and their metrics |
content-helper |
The core topics the pages ranking for a keyword cover |
batch-analysis |
Batch analysis of multiple targets in one request |
management |
Projects, keyword lists, locations, Brand Radar configuration |
public |
Free endpoints — crawler IP ranges, free Domain Rating |
subscription-info |
Your plan limits and current usage |
The gsc and web-analytics-* groups are the interesting ones for smaller teams, because they mean the assistant can answer "which pages lost clicks last month" from data you already pay for elsewhere, without a second integration.
The tool cap: why your client shows a fraction of the surface
Some MCP clients limit how many tools a server may advertise, and Ahrefs' server goes above that limit for many of them. When a client silently truncates, you get a connector that connects fine and then cannot find site-explorer-refdomains — which reads as "Ahrefs MCP is broken", not "my client accepted 40 tools and dropped the rest".
The fix is a query parameter on the connection URL. Pass tools with a comma-separated list of groups:
https://api.ahrefs.com/mcp/mcp?tools=site-explorer-overview,brand-radar-entities
Omit it and all tools are advertised — correct for clients without a cap, wasteful and fragile for clients with one.
There is also a curated shortcut, tools=essentials, which pulls the most commonly used tools across every group into one set. Two things about it: it is a standalone value, so tools=essentials,site-audit is rejected rather than merged, and a misspelled group name fails the whole connection with an invalid tool category error rather than being ignored. A typo in that URL is a refused connection, not a partial one.

The docs are explicit that documentation and rendering helper tools are always included regardless of which groups you pick, so an apparently empty result is never caused by the group filter.
API units: every agent call is billed like a direct API call
The hosted server is available on paid plans starting from Lite. There is no free tier and no anonymous mode. When a third-party app calls Ahrefs on your behalf through MCP, it consumes API units from your monthly allowance exactly the same way a direct API call does.
Two details that catch people:
- Each plan has a maximum number of rows per request. Ask for the top 10,000 referring domains on a plan that caps lower and the agent gets a truncated list, not an error. The agent will then summarise a partial backlink profile with total confidence.
- OAuth-created keys default to a monthly limit of 200,000 API units per key. Keys you generate manually in the account have no per-key limit by default, though workspace plan limits still apply to all keys. Admins can change or remove the per-key cap in the API keys report.
Watch usage in Account settings → Limits and usage. And treat subscription-info as a real tool: asking the assistant "how many API units do I have left this month" is a one-call answer rather than an archaeology exercise in the dashboard.
Keys: OAuth by default, a manual MCP key when you need one
When you connect an AI agent, you see an authorization consent screen. Approve it and the connection appears in your account with a dedicated API key tagged with the MCP scope. That key is the audit handle: revoking the connection is revoking a key, and the API keys report shows what that key has been doing.
You can also generate an MCP key manually in the account and paste it into a client config, which is the path for anything that cannot complete an OAuth consent flow. Enterprise customers can connect with their existing API keys.
Note the plan thresholds carefully, because the two surfaces disagree and it is not a bug in our copy. Ahrefs' MCP docs state the hosted server works from Lite upward. The public REST API documentation is stricter: it is available on Advanced and Enterprise plans. So the old advice "you need Advanced for the Ahrefs API" is true for REST and wrong for MCP — but the manual MCP key you generate is still an API key, so check which product your plan actually entitles you to before assuming.
The contract clause: this is not your API
This is the sentence worth quoting in full, because it is the one no competitor page reproduces:
Using the external MCP endpoint via custom scripts, bridges, or standalone HTTP/JSON-RPC clients is unsupported and not permitted. The external MCP server is not a general-purpose programmatic API.
That rules out a whole category of advice you will find on other sites. Wrapping https://api.ahrefs.com/mcp/mcp in an mcp-remote bridge to feed a headless script, or calling it directly from a cron job with curl, is outside the terms. If you want programmatic Ahrefs data on a schedule, use the Ahrefs public REST API — that is the supported path, and it is what the API key you generate is really for.
The practical consequence: the Ahrefs MCP server is for interactive agent work, where a human is asking questions in a chat client. Scheduled reporting belongs in a script against the REST API, or in Cody, where the scheduling and the query layer are ours to maintain.
Setup, per client
The connection is OAuth in every case where the client supports it, and a bearer token where it does not.
Claude Desktop / Web has two routes. The simple one: Customize → Connectors → + → search "Ahrefs" in the approved connector list → Connect → pick your workspace and account → Allow. The manual one: Settings → Developer → Edit config, and add an entry that runs mcp-remote with an Authorization header carrying your MCP key. After connecting, enable the connector in the chat settings dropdown — a connected connector is not an enabled one, and that distinction produces a lot of "I connected it and it does nothing" support threads.
Claude Code is one command:
claude mcp add ahrefs https://api.ahrefs.com/mcp/mcp -t http
Then run /mcp inside Claude Code to authenticate, pick the workspace, and Allow. Verify with a query that you know the answer to rather than a novel one.
ChatGPT support is the least mature of the set, and Ahrefs says so plainly: full MCP client access is in beta, available in Developer mode for Pro and Plus accounts on the web. Settings → Apps → Advanced settings → enable Developer mode → Create app → MCP Server URL https://api.ahrefs.com/mcp/mcp, Authentication OAuth, leave the client ID and secret blank, tick "I trust this application", Create, then select the workspace and Allow. Before each conversation you have to reach the connector: + → More → enable it.
While it is in beta, Ahrefs recommends being aggressive about prompt specificity — name the connector, name the tool, say which fields and which sort, and explicitly ask ChatGPT not to use web search. Their example pair is worth copying:
"Using the Ahrefs MCP connector and the
keywords-explorer-matching-termsaction, pull the top 10 keywords related to 'marketing' in Brazil, sorted by search volume."
against
"What are the top keywords related to marketing in Brazil?"
The second question gets answered from the model's memory, not from Ahrefs, and you will not be told which.
OpenClaw uses mcporter:
npm install -g mcporter
mcporter config add ahrefs https://api.ahrefs.com/mcp/mcp
Then generate an MCP key at https://app.ahrefs.com/account/api-keys, open the config JSON that mcporter config list points to, and add the token as a bearer header:
{
"mcpServers": {
"ahrefs": {
"baseUrl": "https://api.ahrefs.com/mcp/mcp",
"headers": {
"Authorization": "Bearer YOUR_AHREFS_MCP_TOKEN_HERE"
}
}
},
"imports": []
}
Test it with a single call rather than a conversation:
mcporter call ahrefs.keywords-explorer-volume-history country=us keyword=seo
That is a real, documented smoke test, and it fails loudly on the things that actually go wrong — a bad token, a missing group, a wrong URL — instead of failing quietly inside a chat turn.

Ahrefs ships an OpenClaw setup page with the exact config JSON and a single-call verification. Use it; the guessing is already done.
Five workflows that hold up in practice
1. The backlink change report. "Using site-explorer-refdomains, list the referring domains for ourdomain.com that first appeared in the last 30 days, sorted by DR descending. Flag any with DR under 20 separately." This is the classic lost-link / spam-link sweep, and it is the workflow where the row cap bites first: the honest instruction is "the most recent N per planning tier", listing N explicitly on lower plans.
2. The striking-distance pull. "Using site-explorer-organic-keywords for ourdomain.com, filter to positions 8 to 20, sort by traffic desc, and return the top 25 with their URLs." This is the same job our own GSC performance work does, and the two disagree often enough that asking both is a legitimate sanity check — Ahrefs estimates, GSC observes.
3. Competitor gap triage. "Compare ourdomain.com and competitor.com on site-explorer-organic-keywords. Return keywords where the competitor ranks in the top 10 and we do not appear at all, sorted by competitor traffic desc, capped at 20." The cap matters: without it the agent happily enumerates thousands of rows and burns the monthly unit budget in one afternoon.
4. SERP read before writing. "Run serp-overview for 'ahrefs mcp server' and describe what type of page each top result is — docs, listicle, product page — and which one I would have to beat." This one is cheap in units and disproportionately useful.
5. Rank Tracker narrative. "Using rank-tracker, summarise which tracked keywords moved more than 3 positions in the last 14 days, split into gains and losses, and name the URL that moved for each." The output is the paragraph a weekly SEO update needs, without exporting a CSV.
Ahrefs-specific pitfalls
The double /mcp/mcp path. The endpoint is https://api.ahrefs.com/mcp/mcp. Clients that append their own path, or people who "correct" the doubled segment, get a 404 that looks like an outage.
A misspelled group name refuses the connection. ?tools=site-explorer-overveiw does not degrade to defaults. It fails with invalid tool category. Copy group names from the table.
essentials does not combine. tools=essentials,site-audit is rejected. Either essentials alone, or an explicit comma-separated list.
Documentation and rendering helpers are always present. If a tool you did not request appears in the list, that is expected — do not read it as the filter being ignored.
Row caps truncate silently. The agent cannot tell you it received 200 of the 4,000 matching rows unless you ask it to state the count. Always put a number in the prompt, and ask for the total alongside the sample.
API units are shared with your direct API usage. A heavy research session through the assistant eats the same monthly allowance your scripts use. OAuth-created keys default to 200,000 units per key per month; manual keys have no per-key cap but still count against the plan.
OAuth is per workspace. The consent screen asks you to choose a workspace. Connect the wrong one and every query answers about the wrong projects, with no error to tell you.
MCP is not the REST API. Connect from a client, not from a cron job. The terms are explicit, and the REST API is the supported path for automation.
Lite versus Advanced is a licensing question. MCP is documented from Lite up; REST is Advanced and Enterprise. Read your plan page before assuming either.
Data is an estimate, not an observation. Ahrefs traffic and volume numbers are modelled. When the assistant reports "traffic down 12%", it is reporting a model, not your analytics.
A connected connector is not an enabled connector. In Claude and ChatGPT the connector must be switched on in the conversation itself.
Do you need MCP for this, or a script?
If your question is fixed — a weekly DR snapshot, a monthly backlink delta — write the script against the REST API and be done. MCP earns its place when the question is variable: "why did organic traffic drop in Spain last week" and then five follow-ups that depend on the answer to the first, with the agent choosing between Site Explorer, Keyword Explorer and GSC on its own.
When that is the shape of the work, the next question is where the assistant lives. Our Ahrefs AI assistant for Slack puts the same data surface where the team already talks, connecting Ahrefs to OpenClaw covers the connection itself if you are running your own agent, and Ahrefs with ChatGPT is the beta-connector route. For the rest of the stack, SEMrush MCP is the direct comparison, and Google Analytics MCP covers observed data rather than estimated.
The honest summary
Ahrefs has one of the cleaner official MCP implementations: hosted, OAuth, no install, a documented group filter for clients that cap tools, and a smoke-test command that will tell you the truth in one call. What it does not offer is unlimited free access. Every call is billed in API units, results are row-capped by plan, and the endpoint is explicitly not a general-purpose API you may bridge or script against. Respect those three, choose your tool groups deliberately, and it is a genuinely useful research surface. Ignore them and you get a connector that appears healthy while quietly answering from partial data.
How to Connect Ahrefs via MCP
There are two main paths:
Option A: Use Ahrefs's official MCP server
Ahrefs maintains an official Ahrefs MCP server. This is the recommended starting point — it's built and maintained by the Ahrefs team, so it stays up to date with API changes.
Note: First-party hosted remote MCP server (Streamable HTTP, OAuth or a manual MCP key) on paid plans from Lite up. Client tool caps are handled with the
toolsquery parameter (comma-separated group names, oressentialsalone). Every call consumes plan API units and results are row-capped by plan. Ahrefs' terms state the endpoint is not a general-purpose API: custom scripts, bridges, and standalone HTTP/JSON-RPC clients are not permitted, so schedule against the public REST API instead.
What the server exposes:
- Site Explorer metrics and reports
- Keyword Explorer
- SERP overview
- Rank Tracker
- Site Audit
- Brand Radar
- Web Analytics
- Google Search Console data
- Social media
- Content Helper
- Batch analysis
- Projects and keyword lists
What you'll need:
- An MCP-compatible client (Claude Desktop, OpenClaw, or another host)
- Ahrefs credentials configured per the server's setup guide
This path gives you the most control but requires you to handle client configuration and credential management yourself.
Option B: Use Cody (OpenClaw-based, managed)
Cody is built on OpenClaw and supports MCP-compatible integrations out of the box. You connect Ahrefs once from the Cody dashboard — no server to run, no code to write — and Cody handles authentication, context passing, and write-back actions with appropriate guardrails.
Cody works where your team already operates: Slack, Telegram, or the web chat. The Ahrefs connection is available to your entire team without each person setting up their own MCP client.
Want Ahrefs Connected to AI Without Running Your Own MCP Server?
Cody gives your team an Ahrefs AI assistant in Slack, so people can monitor backlinks, compare competitors, review keyword opportunities, and share SEO updates without rebuilding the same Ahrefs views by hand.
MCP vs Other AI Integration Patterns
| Approach | What it is | Tradeoff |
|---|---|---|
| MCP | Standardised protocol for live tool access | Requires an MCP server; most powerful when set up correctly |
| RAG (retrieval) | Pre-index Ahrefs content and retrieve it | Good for static docs; not suitable for live/transactional data |
| Manual copy-paste | Paste Ahrefs output into ChatGPT/Claude | Fast to start; breaks for anything recurring or at scale |
| Custom API wrappers | Bespoke integration code per tool | Full control; high maintenance overhead |
MCP wins when you need live data from Ahrefs and want to avoid rebuilding integrations as APIs change.
Common Mistakes
- Using training data when live data is needed — if the AI doesn't have an MCP connection, it will answer from memory, which is often outdated or wrong for account-specific questions
- No write-back guardrails — MCP can write to Ahrefs, so it's worth adding an approval step for any action that modifies records
- Too many tools exposed at once — give the AI access to the Ahrefs actions it actually needs; a scoped connection is easier to reason about and audit
- Skipping structured outputs — ask the AI to return structured JSON or clear fields when writing back to Ahrefs; free-form output is harder to validate
Before You Hand Ahrefs to an Agent
The first thing to decide is not the client, it is the credential. An OAuth connection mints an MCP-scoped API key with a monthly ceiling, which is exactly what you want for an exploratory research agent: it can read the whole Ahrefs surface, it cannot change your projects, and when the budget is gone it stops. Do not paste an existing Advanced-plan API key into a chat client just because it is already in your password manager — that key has management access and no per-key cap.
The second decision is the group filter. Start narrow. Connect with tools=site-explorer-overview,keywords-explorer,serp-overview for a content team and tools=site-explorer-overview,site-explorer-reports,gsc for an SEO who lives in backlinks and Search Console. A broad connection is not just noisy for the model; on a capped client it is how the one tool you needed gets dropped.
The third is the prompt discipline. The server returns rows, not summaries, and it cannot tell you what it truncated. Put the limit in the question, ask for the total, and ask which tool was used. Once the answers name their own sources, a wrong answer becomes a two-minute diagnosis instead of a week of quiet bad decisions.
Related MCP Guides
Want the full workflow picture? See: Ahrefs AI Automation and How to Connect Ahrefs to OpenClaw.