ahrefs-mcp
MCP server for the Ahrefs API v3 that provides live SEO data including keyword research, SERP analysis, backlink profiles, and domain authority to MCP clients like Claude.
README
ahrefs-mcp
Unofficial community server, not affiliated with Ahrefs.
MCP server for the Ahrefs API v3. Gives Claude and any other MCP client live SEO data: keyword research, SERP analysis, backlink profiles, domain authority.
Built to be frugal with API units: narrow select lists per endpoint, in-memory response caching with per-endpoint TTLs (a cache hit costs 0 units), retries with backoff on 429/5xx. Monetary fields arrive from Ahrefs in USD cents and are normalized to dollars.
Tools
16 tools across four groups.
| Group | Tool | What it returns |
|---|---|---|
| Keywords | keyword-metrics |
Keyword ideas with volume, KD, CPC, traffic potential, intents |
| Keywords | keyword-suggestions |
Autocomplete-style queries people actually type |
| Keywords | related-keywords |
Terms top-ranking pages also rank for |
| Keywords | keyword-volume-history |
Monthly volume trend and seasonality |
| Keywords | keyword-volume-by-country |
Demand split by country |
| SERP | serp-overview |
Top results with DR, UR, traffic, page type, AI overview presence |
| Site | domain-rating |
DR and Ahrefs Rank |
| Site | site-metrics |
Organic traffic, keywords, top-3 count, traffic value |
| Site | site-metrics-history |
Monthly organic traffic trajectory |
| Site | site-metrics-by-country |
Traffic split by country |
| Site | backlinks-stats |
Live and all-time backlinks and referring domains |
| Site | referring-domains |
Who links to a site, by authority |
| Site | organic-keywords |
Keywords a domain ranks for, with positions |
| Site | organic-competitors |
Competing domains with keyword overlap |
| Site | top-pages |
Pages pulling the most traffic |
| Account | subscription-usage |
API units used vs plan limit, never cached |
Setup
Requires Node 18+ and an Ahrefs API key with API v3 access (get one here).
git clone https://github.com/newilu/ahrefs-mcp.git
cd ahrefs-mcp
npm install
npm run build
Claude Code
claude mcp add ahrefs -e AHREFS_API_KEY=your_key -- node /absolute/path/to/ahrefs-mcp/dist/index.js
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"ahrefs": {
"command": "node",
"args": ["/absolute/path/to/ahrefs-mcp/dist/index.js"],
"env": { "AHREFS_API_KEY": "your_key" }
}
}
}
Example
Pull the top 20 organic keywords for competitor.com in the US, then check SERP overview for the three with the lowest difficulty. Which ones have no site above DR 40 in the top 10?
The agent chains organic-keywords and serp-overview and answers with live data.
Cost notes
Ahrefs bills per row and per selected field, so limit matters. Defaults here are deliberately small. Check subscription-usage before large batches. Cached responses (SERP 6h, keyword metrics 7d, site metrics 3d) are free.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.