Ahrefs
A Model Context Protocol server that connects Claude desktop and other compatible AI assistants to Ahrefs, allowing them to access Ahrefs functionality.
What is Ahrefs?
Ahrefs is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that connects claude desktop and other compatible ai assistants to ahrefs, allowing them to access ahrefs functionality.
A Model Context Protocol server that connects Claude desktop and other compatible AI assistants to Ahrefs, allowing them to access Ahrefs functionality.
This server falls under the Marketing & SEO category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Model Context Protocol server that connects Claude desktop
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx ahrefs-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Ahrefs
The Ahrefs MCP server connects AI assistants like Claude directly to Ahrefs' powerful SEO data platform, enabling real-time access to backlink analysis, keyword research, domain ratings, competitive intelligence, and technical SEO insights without leaving your chat interface. It bridges the gap between conversational AI and enterprise-grade SEO tooling so marketers, content strategists, and SEO professionals can query Ahrefs data naturally. The official package is now the remote Ahrefs MCP server at @ahrefs/mcp, which requires no local server process and works directly with your Ahrefs API key.
Prerequisites
- Node.js 18 or later installed on your system
- An active Ahrefs account with API access (API v3 key from app.ahrefs.com/api)
- Claude Desktop, Cursor, or another MCP-compatible AI client installed
- npm available in your terminal
Obtain your Ahrefs API key
Log in to your Ahrefs account and navigate to the API section (app.ahrefs.com/api). Generate or copy your API v3 key. Note that MCP keys (used for the remote server) are different from standard API v3 keys — ensure you are using an API v3 key for this local server.
Install the Ahrefs MCP package globally
Install the @ahrefs/mcp package globally into a dedicated prefix directory to avoid permission issues. This places the binary where your MCP client can find it.
npm install --prefix=~/.global-node-modules @ahrefs/mcp -gAdd the server to your Claude Desktop configuration
Open your Claude Desktop config file at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add the Ahrefs server block with your API key.
{
"mcpServers": {
"ahrefs": {
"command": "npx",
"args": [
"--prefix=~/.global-node-modules",
"@ahrefs/mcp"
],
"env": {
"API_KEY": "your_ahrefs_api_v3_key_here"
}
}
}
}Restart Claude Desktop
Fully quit and reopen Claude Desktop so it picks up the updated configuration. You should see the Ahrefs tools available in the tool list within the chat interface.
Verify the connection with a test query
Send a message to Claude asking it to look up domain data for a site you own or are researching. A successful response with DR, traffic estimates, or backlink counts confirms the server is working.
Ahrefs Examples
Client configuration
Add this block to your claude_desktop_config.json to connect Claude Desktop to Ahrefs. Replace the API_KEY value with your actual Ahrefs API v3 key.
{
"mcpServers": {
"ahrefs": {
"command": "npx",
"args": [
"--prefix=~/.global-node-modules",
"@ahrefs/mcp"
],
"env": {
"API_KEY": "your_ahrefs_api_v3_key_here"
}
}
}
}Prompts to try
These prompts demonstrate the Ahrefs MCP server's capabilities for SEO research and competitive analysis.
- "What is the Domain Rating and estimated organic traffic for example.com?"
- "Find the top 10 keywords that example.com ranks for in the top 3 positions."
- "Show me the backlink profile for competitor.com — how many referring domains do they have?"
- "Identify broken backlinks pointing to mysite.com so I can reclaim link equity."
- "Which sites are the organic search competitors of example.com based on common keywords?"
- "What new keywords is competitor.com ranking for this month that I am not?"Troubleshooting Ahrefs
Claude says 'No tools available' or the Ahrefs tools do not appear
Ensure Claude Desktop was fully restarted after editing the config file. Also check that the npm prefix path in the args array resolves correctly — on Windows, substitute the tilde with the full path like C:\Users\YourName\.global-node-modules\node_modules.
API authentication errors or 401 responses from Ahrefs
Confirm you are using an API v3 key, not an MCP key or legacy key. The API_KEY environment variable must be set exactly as shown — check for extra whitespace or quotes around the value in your JSON config.
Package installs but the npx command fails to start the server
Run 'npm install --prefix=~/.global-node-modules @ahrefs/mcp@latest -g' to upgrade to the latest version. If that fails, check Node.js version with 'node --version' — Node 18 or later is required.
Frequently Asked Questions about Ahrefs
What is Ahrefs?
Ahrefs is a Model Context Protocol (MCP) server that model context protocol server that connects claude desktop and other compatible ai assistants to ahrefs, allowing them to access ahrefs functionality. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Ahrefs?
Follow the installation instructions on the Ahrefs GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Ahrefs?
Ahrefs works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Ahrefs free to use?
Yes, Ahrefs is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Ahrefs Alternatives — Similar Marketing & SEO Servers
Looking for alternatives to Ahrefs? Here are other popular marketing & seo servers you can use with Claude, Cursor, and VS Code.
TopRank
★ 2.6kGoogle Ads analysis and operations — read performance, manage keywords, bids, and campaigns.
Open SEO
★ 2.1kOpen source alternative to Semrush and Ahrefs
ASO Skills
★ 1.4kAI agent skills for App Store Optimization (ASO) and app marketing. Built for indie developers, app marketers, and growth teams who want Cursor, Claude Code, or any Agent Skills-compatible AI assistant to help with keyword research, metadata optimiza
Google Meta Ads GA4
★ 994MCP server for Google Ads, Meta Ads & GA4 — works with ChatGPT, Claude, Cursor, n8n, Windsurf & more. 250+ tools for campaign management, analytics & optimization.
Meta Ads
★ 923A Model Context Protocol server that allows AI models to access, analyze, and manage Meta advertising campaigns, enabling LLMs to retrieve performance data, visualize ad creatives, and provide strategic insights for Facebook and Instagram platforms.
Google Search Console
★ 882Connects Google Search Console with Claude AI to enable SEO professionals to analyze their SEO data through natural language conversations, providing access to property information, search analytics, URL inspection, and sitemap management.
Browse More Marketing & SEO MCP Servers
Explore all marketing & seo servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Ahrefs in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Ahrefs?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.