Back to MCP Servers
Ahrefs mcp logo
mcp-server6

Ahrefs mcp

Ahrefs MCP is the official hosted MCP server for connecting AI assistants to live Ahrefs SEO, backlink, keyword, rank tracking, site audit, and brand visibility data. It uses the remote Ahrefs MCP endpoint with OAuth or MCP-key authorization and is available on paid Ahrefs plans starting from Lite.

About

Ahrefs MCP is Ahrefs' official hosted Model Context Protocol server for connecting AI assistants to Ahrefs data. It lets compatible AI tools query Ahrefs through a remote MCP endpoint instead of requiring a local server install.

Key Features

  • Hosted remote MCP server with Streamable HTTP as the recommended transport.
  • Legacy SSE endpoint is documented for tools that still require SSE, but Ahrefs notes it is deprecated in many tools.
  • Supports OAuth connection flows and manually generated MCP keys.
  • Documented example tools include site-explorer-refdomains, keywords-explorer-matching-terms, and keywords-explorer-volume-history.
  • The underlying Ahrefs API data areas include Site Explorer, Keywords Explorer, SERP Overview, Rank Tracker, Site Audit, Batch Analysis, Brand Radar, Web Analytics, GSC Insights, Social Media, Management, Subscription Information, and Public endpoints.

Use Cases

  • Run keyword research, content planning, content gap analysis, and keyword volume checks from an AI assistant.
  • Compare competitors, backlink profiles, referring domains, domain growth, and top-ranking pages.
  • Pull Ahrefs data into agent workflows for SEO audits, brand visibility analysis, and reporting.
  • Use n8n, Copilot Studio, OpenClaw, or other MCP-capable tools to build automated SEO workflows.

Setup or Requirements

Ahrefs MCP is available on paid Ahrefs plans starting from Lite. It consumes the Integration API units included in the subscription, and plan tier determines rows per request and monthly unit allowance. Setup details belong in mcpSetup because each client uses a different connection flow.

Compatibility

Ahrefs publishes setup guides for Claude Desktop/Web, Claude Mobile, Claude Code, Copilot Studio, ChatGPT Web, Lovable, n8n, Manus, Mistral's Le Chat, and OpenClaw. The current official Ahrefs MCP docs do not publish separate setup pages for Cursor, Codex, VS Code, or Windsurf.

Limitations

Local MCP setup is no longer supported by Ahrefs. The old GitHub and npm local server path is archived, outdated, works with API v3 keys only, and is not recommended for current MCP-key workflows. Ahrefs also states that the external MCP endpoint is for MCP-compatible AI clients in interactive workflows, not for custom scripts or standalone HTTP/JSON-RPC clients.

Sources

  • Ahrefs MCP product page: https://ahrefs.com/mcp/
  • Ahrefs MCP documentation: https://docs.ahrefs.com/en/mcp/docs/introduction
  • Claude Desktop and Web setup: https://docs.ahrefs.com/en/mcp/docs/claude-desktop-web
  • Claude Code setup: https://docs.ahrefs.com/en/mcp/docs/claude-code
  • ChatGPT Web setup: https://docs.ahrefs.com/en/mcp/docs/chatgpt-web
  • Lovable setup: https://docs.ahrefs.com/en/mcp/docs/lovable
  • Copilot Studio setup: https://docs.ahrefs.com/en/mcp/docs/copilot-studio
  • n8n setup: https://docs.ahrefs.com/en/mcp/docs/n8n
  • OpenClaw setup: https://docs.ahrefs.com/en/mcp/docs/openclaw
  • Ahrefs API introduction: https://docs.ahrefs.com/en/api/docs/introduction
  • Archived local MCP GitHub repository: https://github.com/ahrefs/ahrefs-mcp-server
  • OpenAI ChatGPT Developer Mode docs: https://developers.openai.com/api/docs/guides/developer-mode

MCP Setup

Prerequisites

  • Paid Ahrefs plan required; Ahrefs documents availability from Lite plan and higher
  • Ahrefs account and workspace access required
  • No local MCP server install is required for the current hosted remote MCP server
  • API-unit allowance is consumed when AI tools call Ahrefs through MCP
  • Node.js and npx are required only for client setups that use mcp-remote, such as the Claude Desktop developer configuration method

Access requirements

  • OAuth authorization is supported for clients that can connect to the remote endpoint directly
  • Manual MCP key generation is supported from Ahrefs Account Settings > API Keys for clients that use Bearer authentication
  • Workspace admins can set monthly API unit limits for MCP keys
  • Enterprise customers may connect with their API keys where Ahrefs documents that option
  • MCP keys and old API v3 keys are not interchangeable with the archived local MCP server workflow

Companion app or plugin

Name: Ahrefs account API keys report Install URL: https://app.ahrefs.com/account/api-keys

  • Open Ahrefs workspace Account Settings.
  • Go to API Keys.
  • Generate a new MCP key when the target client requires Bearer-token authentication.
  • Use OAuth instead when the target client supports Ahrefs' OAuth consent flow.

The current Ahrefs MCP server is hosted by Ahrefs. The archived local GitHub server is no longer maintained and is not recommended.

Client setup

Claude Code

Transport: HTTP

claude mcp add ahrefs https://api.ahrefs.com/mcp/mcp -t http
  • Run the documented claude mcp add command from a terminal.
  • Launch Claude Code.
  • Run /mcp.
  • Authenticate the Ahrefs MCP server.
  • Select the Ahrefs workspace and allow access.
  • Verify that a query returns Ahrefs data.

Auth:

  • Authenticate through the browser consent flow opened by Claude Code.
  • Sign in to Ahrefs, select the workspace, and click Allow.

Ahrefs documents Claude Code setup with the remote HTTP endpoint.

Claude Desktop

Transport: HTTP

npx mcp-remote https://api.ahrefs.com/mcp/mcp --header "Authorization:${AUTH_HEADER}"
{
  "mcpServers": {
    "Ahrefs": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.ahrefs.com/mcp/mcp",
        "--header",
        "Authorization:${AUTH_HEADER}"
      ],
      "env": {
        "AUTH_HEADER": "Bearer $MCP Key"
      }
    }
  }
}
  • In Claude Desktop, open Settings > Developer > Edit config.
  • Add the documented Ahrefs mcp-remote configuration to claude_desktop_config.json.
  • Generate an MCP key in Ahrefs Account Settings > API Keys.
  • Replace $MCP Key in the config with the generated MCP key.
  • Save the file and restart Claude Desktop.
  • Enable the Ahrefs connector in chat settings before running queries.

Auth:

  • Use an MCP key as a Bearer token in AUTH_HEADER, or use Claude's connector OAuth flow where available.
  • If the Claude connector is set to always ask permission, approve the connector before each query or change the connector setting.

Ahrefs documents both Claude connector OAuth setup and a Claude Desktop developer configuration using npx mcp-remote.

Lovable

Transport: HTTP

  • Open Lovable Settings.
  • Select Connectors.
  • Click Custom in the Personal connectors section.
  • Use https://api.ahrefs.com/mcp/mcp as the server URL.
  • Select OAuth as the authentication method.
  • Select the Ahrefs workspace and allow access.

Auth:

  • Authenticate through Ahrefs OAuth and grant workspace access.

Ahrefs documents Lovable setup with the remote endpoint and OAuth.

Other

Transport: HTTP

  • In ChatGPT Web, go to Settings > Apps > Advanced settings.
  • Enable Developer mode.
  • Click Create app.
  • Set MCP Server URL to https://api.ahrefs.com/mcp/mcp.
  • Set Authentication to OAuth.
  • Leave OAuth Client ID and Client Secret blank.
  • Create the connector, trust the application, select the Ahrefs workspace, and allow access.
  • Activate the connector in chat before starting a query.

Auth:

  • Use OAuth in ChatGPT Web.
  • Sign in to Ahrefs, select the workspace, and click Allow.

This platform entry covers ChatGPT Web. Ahrefs documents the connection steps, but ChatGPT developer mode availability and plan requirements are controlled by OpenAI and should be verified in the current OpenAI Developer Mode docs.

Other

Transport: HTTP

  • In Copilot Studio, create or open an agent.
  • Under Tools, choose Add a tool.
  • Choose Model Context Protocol and create a new tool.
  • Set Server URL to https://api.ahrefs.com/mcp/mcp.
  • Set Authentication to API Key, Type to Header, and Header name to Authorization.
  • Generate an MCP key in Ahrefs Account Settings > API Keys.
  • Paste the key into Copilot Studio with the Bearer prefix and add the tool to the agent.

Auth:

  • Use an Ahrefs MCP key in the Authorization header as Bearer YOUR_API_KEY.

This platform entry covers Microsoft Copilot Studio.

Other

Transport: HTTP

  • In n8n, add a new MCP client node.
  • Set Server transport to HTTP Streamable.
  • Set MCP Endpoint URL to https://api.ahrefs.com/mcp/mcp.
  • Set Authentication to Bearer Auth.
  • Create Bearer Auth credentials using an Ahrefs MCP key.
  • Refresh the list of tools and select the tool needed for the workflow.

Auth:

  • Generate an MCP key in Ahrefs Account Settings > API Keys.
  • Paste the key into n8n Bearer Auth credentials.

This platform entry covers n8n.

Other

Transport: HTTP

  • In Manus Settings, select Connectors and Add connectors.
  • Open the Custom MCP tab.
  • Choose Add custom MCP server and Direct configuration.
  • Set Transport type to HTTP.
  • Set Server URL to https://api.ahrefs.com/mcp/mcp.
  • Set the custom header name to Authorization and the value to Bearer MCP_TOKEN.

Auth:

  • Generate an MCP token in Ahrefs Account Settings > API Keys and use it as the Bearer token.

This platform entry covers Manus.

Other

Transport: HTTP

  • In Mistral's Le Chat, log in and open the Context tab.
  • Open Connectors and add a connector.
  • Choose Custom MCP Connector.
  • Set the connector URL to https://api.ahrefs.com/mcp/mcp.
  • Name the connector Ahrefs-MCP.
  • Click Connect, sign in to Ahrefs, select the workspace, and allow access.

Auth:

  • Authenticate through Ahrefs OAuth and grant workspace access.
  • Optionally choose what level of access to grant to each MCP tool in Le Chat.

This platform entry covers Mistral's Le Chat.

Other

Transport: HTTP

mcporter config add ahrefs https://api.ahrefs.com/mcp/mcp
{
  "mcpServers": {
    "ahrefs": {
      "baseUrl": "https://api.ahrefs.com/mcp/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_AHREFS_MCP_TOKEN_HERE"
      }
    }
  },
  "imports": []
}
  • Install mcporter with npm install -g mcporter or from the Gateway dashboard under Skills.
  • Run mcporter config add ahrefs https://api.ahrefs.com/mcp/mcp.
  • Generate an MCP token in Ahrefs Account Settings > API Keys.
  • Run mcporter config list, open the listed config JSON file, and add the Authorization Bearer header.
  • Test the connection with mcporter call ahrefs.keywords-explorer-volume-history country=us keyword=seo.

Auth:

  • Use the generated Ahrefs MCP token as a Bearer token in the mcporter config.

This platform entry covers OpenClaw using mcporter.

Cursor

The current official Ahrefs MCP docs do not publish a Cursor-specific setup page. Use the documented remote endpoint only if your Cursor version supports remote MCP configuration, and verify the exact Cursor config in Cursor's own MCP docs.

Codex

Exact public Codex setup is not documented in the current official Ahrefs MCP docs.

Windsurf

Exact public Windsurf setup is not documented in the current official Ahrefs MCP docs.

VS Code

Exact public VS Code setup is not documented in the current official Ahrefs MCP docs.

Authorization flow

  • For clients with OAuth support, connect to https://api.ahrefs.com/mcp/mcp and approve access on the Ahrefs consent screen.
  • For clients that use Bearer authentication, generate an MCP key in Ahrefs Account Settings > API Keys and pass it as Authorization: Bearer <MCP key>.
  • Once approved, the connection appears in the Ahrefs account with a dedicated API key tagged with MCP scope.
  • Workspace admins can set a monthly API unit limit for each MCP key to prevent over-usage.

Environment variables

  • AUTH_HEADER
  • Authorization
  • MCP_TOKEN
  • YOUR_AHREFS_MCP_TOKEN_HERE

Setup docs: https://docs.ahrefs.com/en/mcp/docs/introduction

Tags

MCPAhrefsSEOmarketingHTTPOAuthAPI

Alternatives

Comparable tools and resources explicitly connected to Ahrefs mcp.

SemrushDataForSEOSimilarwebMozSerpApiGoogle Search ConsolePipedream Ahrefs MCPComposio Ahrefs

Related Entries

Keep exploring similar tools and resources in this category.

Browse MCP Servers