Ahrefs MCP Server
Connect Ahrefs SEO data — backlinks, keywords, rank tracking, site audits — to your AI agent over MCP.
Updated
What is Ahrefs MCP?
The Ahrefs MCP server is a Model Context Protocol server that connects live Ahrefs SEO and marketing data to AI assistants and agents, so they can pull backlinks, keyword metrics, rank-tracking data, and site-audit results in plain language with no code.
Ahrefs offers it as an officially hosted, remote server at https://api.ahrefs.com/mcp/mcp. (An earlier local @ahrefs/mcp package exists on GitHub but is deprecated in favor of this remote server, which needs no local install.) Clients connect over HTTP and authenticate with a bearer token — specifically an MCP key you generate in your Ahrefs workspace under Account Settings → API Keys.
Once connected, an agent can reach Ahrefs' core toolsets — Keywords Explorer, Site Explorer, Rank Tracker, Site Audit, and Brand Radar — letting you research keywords, analyze competitors' backlinks, monitor rankings, and surface technical SEO issues directly inside Claude, Cursor, ChatGPT, or your own agent workflow.
Tools the Ahrefs MCP server exposes
| Tool | What it does |
|---|---|
| Keywords Explorer | Pull keyword volume, difficulty, CPC, and related/matching terms for research. |
| Site Explorer | Analyze a domain's or URL's backlinks, organic traffic, and referring domains. |
| Rank Tracker | Track keyword ranking positions and visibility over time. |
| Site Audit | Surface technical and on-page SEO issues from crawl-based site audits. |
| Brand Radar | Monitor brand and competitor mentions and share of voice. |
Connect the Ahrefs MCP server
Claude (Desktop / Code)
- 1
Generate an Ahrefs MCP key
In your Ahrefs workspace, go to Account Settings → API Keys and click "Generate MCP key". Copy the key.
- 2
Add the remote server to your MCP config
Add an entry that runs: npx mcp-remote https://api.ahrefs.com/mcp/mcp --header "Authorization:Bearer <YOUR_MCP_KEY>" (in Claude Desktop, claude_desktop_config.json under mcpServers).
- 3
Restart and verify
Restart Claude. The Ahrefs tools (Keywords Explorer, Site Explorer, Rank Tracker, etc.) should appear and be callable in chat.
Generate an MCP key in Ahrefs: Account Settings → API Keys → Generate MCP key. Requires a paid Ahrefs plan.
Cursor
- 1
Generate an Ahrefs MCP key
In Ahrefs, go to Account Settings → API Keys → Generate MCP key and copy it.
- 2
Edit your Cursor MCP config
Open ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project) and add an Ahrefs server running npx mcp-remote https://api.ahrefs.com/mcp/mcp with header Authorization:Bearer <YOUR_MCP_KEY>.
- 3
Reload Cursor
Restart or reload Cursor, then confirm the Ahrefs MCP server shows as connected in Settings → MCP.
Uses the same remote URL and bearer MCP key as Claude.
Sample use cases
Security & permissions
The Ahrefs MCP server authenticates with a bearer token — an MCP key generated in your Ahrefs Account Settings (distinct from the API v3 key). Anyone holding the key can query your account's Ahrefs data and consumes your plan's API unit allowance, so treat it like a credential: store it in a secret manager or environment variable, never commit it, and rotate or revoke it from the API Keys page if exposed. The token grants read access to Ahrefs SEO datasets (backlinks, keywords, rankings, audits) scoped to your subscription's limits; it does not grant access to billing or account-management functions.
Using Ahrefs MCP with Gamut
In a Gamut workflow, a scheduled or event-triggered agent can call the Ahrefs MCP server as one of its tools — Gamut manages the bearer-authenticated connection — to fetch SEO data as part of a larger automation. For example, a weekly run could pull Rank Tracker positions and Site Explorer backlink changes, then hand the results to downstream steps that flag regressions, draft a report, or post a summary to your team. The agent only does what your plan's API limits allow, and each call draws on your Ahrefs unit allowance.
Frequently asked questions
What data can an agent access through the Ahrefs MCP integration?
The integration exposes Keywords Explorer (volume, difficulty, CPC, related terms), Site Explorer (backlinks, organic traffic, referring domains, top pages), Rank Tracker (position history), Site Audit (technical issues), and Brand Radar (mention monitoring). All queries run against Ahrefs' live index.
Does using the Ahrefs MCP server count against my Ahrefs API credits?
Yes. Every query the agent makes uses your Ahrefs API allocation the same way a direct API call would. The MCP layer handles authentication and formatting but does not add any separate metering.
Can the agent write data back to Ahrefs or only read?
The current integration is read-only. It can pull keyword data, backlink profiles, audit results, and ranking history, but it cannot create projects, add keywords to Rank Tracker, or modify Site Audit settings inside Ahrefs.
Which Ahrefs plan do I need for the MCP integration?
You need an Ahrefs plan that includes API access. The Lite plan does not include API. Standard and above provide API credits, with higher plans offering larger monthly allocations.