Ahrefs

Ahrefs

Official

Backlinks, keyword research, and rank tracking from the official Ahrefs remote MCP.

Score 70(?)AhrefsMIT101Verified Top MCPs for Marketing & SEO →

Quick answer

What it does

Connects to the Ahrefs API via a hosted remote MCP endpoint and exposes backlink profiles, referring domains, keyword research with Ahrefs proprietary metrics, and rank-tracking data so an agent can enrich answers with Ahrefs SEO intelligence.

Best for

  • Backlink and referring-domain analysis
  • Keyword research with Ahrefs metrics
  • Rank tracking queries
  • Competitor SEO analysis

Not for

  • Teams without a paid Ahrefs plan
  • Pay-per-request budgets

Source: top-mcps.com/mcp/ahrefs — verified Sep 2026

Setup recipe

Pick your client, then follow the three steps.

  1. 1

    Install

    claude_desktop_config.json
    {
      "mcpServers": {
        "ahrefs": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote",
            "https://api.ahrefs.com/mcp/mcp"
          ]
        }
      }
    }

    Claude Desktop launches stdio servers, so mcp-remote bridges to the hosted endpoint and opens the sign-in in your browser. On Pro, Max, Team and Enterprise you can skip the file: Settings → Connectors → Add custom connector → https://api.ahrefs.com/mcp/mcp. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    CLI or .mcp.json
    claude mcp add --transport http ahrefs https://api.ahrefs.com/mcp/mcp

    Then run /mcp inside Claude Code to finish the sign-in. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    .cursor/mcp.json
    {
      "mcpServers": {
        "ahrefs": {
          "url": "https://api.ahrefs.com/mcp/mcp"
        }
      }
    }

    Global path: ~/.cursor/mcp.json. Cursor shows "Needs login" once it connects — click it to authorize. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    .vscode/mcp.json
    {
      "servers": {
        "ahrefs": {
          "type": "http",
          "url": "https://api.ahrefs.com/mcp/mcp"
        }
      }
    }

    VS Code uses the "servers" key. Run MCP: List Servers → Start Server and allow the sign-in. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    ~/.codeium/windsurf/mcp_config.json
    {
      "mcpServers": {
        "ahrefs": {
          "serverUrl": "https://api.ahrefs.com/mcp/mcp"
        }
      }
    }

    Windsurf uses "serverUrl" for hosted servers. Open via Cascade → hammer icon → Configure. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    cline_mcp_settings.json
    {
      "mcpServers": {
        "ahrefs": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote",
            "https://api.ahrefs.com/mcp/mcp"
          ]
        }
      }
    }

    Bridged through mcp-remote. Open via the Cline sidebar → MCP Servers → Edit. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    ~/.continue/config.json
    {
      "experimental": {
        "modelContextProtocolServers": [
          {
            "transport": {
              "type": "streamable-http",
              "url": "https://api.ahrefs.com/mcp/mcp"
            }
          }
        ]
      }
    }

    Continue takes the hosted URL directly in the transport block. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    CLI
    codex mcp add ahrefs --url https://api.ahrefs.com/mcp/mcp

    Codex detects OAuth support and opens the browser to authorize. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    ~/.config/zed/settings.json
    {
      "context_servers": {
        "ahrefs": {
          "command": {
            "path": "npx",
            "args": [
              "-y",
              "mcp-remote",
              "https://api.ahrefs.com/mcp/mcp"
            ]
          }
        }
      }
    }

    Bridged through mcp-remote under "context_servers". Settings live-reload on save. This endpoint expects an API key, usually as an Authorization header — set it where your client configures headers (mcp-remote: add --header "Authorization: Bearer <key>").

    ChatGPT → Settings → Connectors (remote URL)
    {
      "name": "Ahrefs",
      "transport": "http",
      "url": "https://api.ahrefs.com/mcp/mcp"
    }

    Paste this into Settings → Connectors → Add custom connector. Requires ChatGPT Pro / Team / Enterprise / Edu with Developer mode enabled.

  2. 2

    Set required secrets

    No credentials required — this MCP runs over stdio without authentication.

  3. 3

    Try a minimum working prompt

    Minimum working prompt pending verification. Try any prompt from the MCP’s README once installed.

Tools & permissions

ToolDescriptionArgsSide effects
backlinksReturn backlinks and referring domains for a target from the Ahrefs index.target: stringNetwork
keywords_explorerKeyword research with Ahrefs volume, difficulty, and intent metrics.keywords: string[]Network
rank_trackerReturn rank-tracking positions for a tracked project.—Network
site_explorerReturn Domain Rating, organic traffic, and top pages for a domain.target: stringNetwork

Security & scope

Access scope
Network
Sandbox
Hosted remote MCP reached over Streamable HTTP at api.ahrefs.com/mcp/mcp. Authentication is an Ahrefs API key with an MCP scope; each connection gets its own key for per-integration tracking. No local process runs and no local filesystem access is involved — the trust boundary is the API key and your Ahrefs plan unit allowance.
Gotchas
  • The local @ahrefs/mcp npm package is archived and unmaintained — do not use it; it only supports legacy v3 keys.
  • Calls consume your monthly Ahrefs API unit allowance; an agent that loops can exhaust units before month end.
  • Treat the MCP-scoped API key like any credential — revoke the per-connection key if a client is decommissioned.

Agent prompt pack

— copy into Claude, Cursor, or ChatGPT.
Paste into Claude, Cursor, or ChatGPT. Edit the [brackets] before sending.
Recommend the best MCP servers for [task: e.g. marketing & seo work] in [client: Claude].

Constraints:
- Prefer tools that are [official | open-source | read-only] — pick what matters for my use case.
- Exclude MCPs that require [e.g. a paid plan, OAuth-only flows, remote-only transport].
- Return at most 3 picks, ranked.

For each pick include:
1. One-sentence rationale.
2. The ready-to-paste install snippet for my client.
3. Any required secrets I need to create before installing.

Cross-check the top-mcps.com listing: https://top-mcps.com/top-mcps-for-marketing-seo
Compare Ahrefs against a real alternative. Swap the second MCP in [brackets] if you want a different match.
Compare Ahrefs MCP vs [DataForSEO MCP] for the following job: [describe the job, e.g. "let an agent create GitHub issues on bug triage"].

Judge them on:
- Setup time and complexity (what a new user hits first).
- Auth model (none / API key / OAuth 2.1) and credential risk.
- Transport (stdio / Streamable HTTP / SSE) and where the server runs.
- Required secrets and the blast radius if they leak.
- Operational risk in an unattended agent loop.
- Which one is "good enough" for a weekend prototype vs. production.

End with one sentence: which should I pick for my scenario, which is: [my scenario].

References:
- https://top-mcps.com/mcp/ahrefs
- top-mcps.com listing for DataForSEO
Asks the agent to install and verify. Works inside Claude Code, Cursor Agent, Codex CLI.
Install the Ahrefs MCP server for my [client: Claude] at the default config path for that client.

Use the exact install snippet published at https://top-mcps.com/mcp/ahrefs (fetch https://top-mcps.com/mcp/ahrefs.json for the canonical server.json if you can read URLs).

Before finishing:
1. Create the required secrets (no secrets) and put them in the appropriate env block — do not hard-code them.
2. Restart or reload the client so it picks up the new server.
3. Verify the server is connected (green / running state) and at least one tool is listed.
4. If anything fails, read the client's MCP logs and report the exact error — do not silently retry.

Confirm when done and list the tools the server now exposes.

Frequently asked questions

What changed

— 2 updates tracked.
  1. Refreshed install snippets and fact sheet; verified for 2026.

  2. Initial directory listing.

More Marketing & SEO MCPs

Other tools in the same category worth evaluating.

DataForSEO
Official

Live SERP, keyword, backlink, and on-page SEO data for an AI agent.

seo, serp, keywords, backlinks
10 minMedium
Google Analytics
Official

Query GA4 reports, funnels, and realtime data from an AI agent.

analytics, ga4, google-analytics, reporting
15 minMedium
Google Search Console

Query Search Console clicks, impressions, and queries from an AI agent.

seo, search-console, gsc, organic-search
15 minMedium

Compared with Ahrefs

Side-by-side breakdowns for the choices people most often weigh against this MCP.

Exploring Top MCPs for Marketing & SEO? See all Marketing & SEO MCPs →