Ahrefs logo
Analytics & MarketingAuth: Bearer tokenHosting: Official hosted

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

ToolWhat it does
Keywords ExplorerPull keyword volume, difficulty, CPC, and related/matching terms for research.
Site ExplorerAnalyze a domain's or URL's backlinks, organic traffic, and referring domains.
Rank TrackerTrack keyword ranking positions and visibility over time.
Site AuditSurface technical and on-page SEO issues from crawl-based site audits.
Brand RadarMonitor brand and competitor mentions and share of voice.

Connect the Ahrefs MCP server

Claude (Desktop / Code)

  1. 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. 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. 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. 1

    Generate an Ahrefs MCP key

    In Ahrefs, go to Account Settings → API Keys → Generate MCP key and copy it.

  2. 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. 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

An agent runs keyword research before drafting content

Pulls volume, difficulty, and related terms from Keywords Explorer to pick targets.

A weekly scheduled agent monitors SEO health

Reports Rank Tracker movement and Site Audit issues without manual dashboard checks.

Competitive analysis on demand in chat

Uses Site Explorer to surface a competitor's top backlinks and organic pages.

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 is the Ahrefs MCP server?

It is the official Model Context Protocol server from Ahrefs that lets AI assistants and agents query live Ahrefs SEO data — backlinks, keywords, rank tracking, and site audits — in natural language. It runs as a hosted remote server at https://api.ahrefs.com/mcp/mcp.

Is the Ahrefs MCP server free?

No. There is no free tier — the MCP server requires a paid Ahrefs plan (Lite or higher), and its usage draws on your plan's monthly API unit allowance.

How do I connect Ahrefs MCP to Claude or Cursor?

Generate an MCP key in Ahrefs (Account Settings → API Keys → Generate MCP key), then add a remote MCP server pointing to https://api.ahrefs.com/mcp/mcp with an Authorization: Bearer <key> header (via npx mcp-remote). Add it to claude_desktop_config.json for Claude or ~/.cursor/mcp.json for Cursor, then restart the client.

Is the Ahrefs MCP server hosted or self-hosted?

It is officially hosted by Ahrefs as a remote server, so no local install is needed. An older self-hosted local package (@ahrefs/mcp) exists on GitHub but is deprecated in favor of the remote server.