Ahrefs MCP server

Endpoint: https://api.ahrefs.com/mcp/mcp · Authentication: Sign in with OAuth

Queries the Ahrefs API for backlinks, keywords, and site metrics. Requires Ahrefs sign-in through OAuth.

How do I authenticate?

Add the endpoint in your client, start Connect or Sign in, approve the requested scopes, and return to the client. OAuth discovery finds the authorization server; client registration requirements vary by provider. Follow the provider guidance and client setup below.

Authentication and connection guide

Connection specification

Remote endpoint
https://api.ahrefs.com/mcp/mcp
Browser access
Not yet measured
Declared MCP transport
Streamable HTTP
Live-validated MCP transport
Not yet verified — Latest validation did not verify a transport
Declared authentication
OAuth 2.1
Detected authentication
OAuth 2.1 detected or retained from publisher evidence
Protocol lifecycle
Not yet negotiated
Authorization server
https://api.ahrefs.com/
Category
Analytics

Product documentation · Official listing documentation

Provider guidance

  • Available on paid Ahrefs plans; calls consume API units.

More Analytics MCP servers · Browse all MCP servers · Test this endpoint in the MCP Playground

Authorization setup

Registration requirements not verified

The OAuth authorization and app-registration requirements for this exact endpoint have not been verified. A compatible client will request authorization, but follow the publisher documentation and do not guess client credentials or callbacks.

Publisher evidence reviewed .

Publisher documentation

Connect it

Live-validated endpoint: https://api.ahrefs.com/mcp/mcp · Streamable HTTP. Registration requirements not verified: The OAuth authorization and app-registration requirements for this exact endpoint have not been verified. A compatible client will request authorization, but follow the publisher documentation and do not guess client credentials or callbacks.

Agent prompt for Claude Code or Codex
Add the Ahrefs MCP server to my MCP client configuration and verify that it works.

What it is: Queries the Ahrefs API for backlinks, keywords, and site metrics. Requires Ahrefs sign-in through OAuth.
Server URL: https://api.ahrefs.com/mcp/mcp
Transport: Streamable HTTP (remote MCP server, no local install).
Authentication: OAuth 2.1. Registration requirements not verified: The OAuth authorization and app-registration requirements for this exact endpoint have not been verified. A compatible client will request authorization, but follow the publisher documentation and do not guess client credentials or callbacks.
Tools: not yet observed by mcptest; tools/list will show them.
Reference: https://mcptest.io/servers/ahrefs/

Steps:
1. Work out which MCP client I use (Claude Code, Codex, Cursor, VS Code or another) and add the server under the name "ahrefs" in that client's MCP configuration, user scope unless I ask otherwise.
   Claude Code: claude mcp add --transport http --scope user 'ahrefs' 'https://api.ahrefs.com/mcp/mcp'
   Other clients: use the setup for that client on the reference page.
2. Never write a credential value into a file that could be committed; reference an environment variable or the client's secret store, and ask me for any value you need.
3. Verify: connect to the server and call tools/list. Confirm the tools above are listed, and report any sign-in step I still have to complete.
MCP client

Claude Code setup

Run in a terminal. This user-scoped entry is available across projects.

claude mcp add --transport http --scope user 'ahrefs' 'https://api.ahrefs.com/mcp/mcp'
  • After adding the server, open Claude Code, run /mcp, select the server, and follow the browser flow to authenticate.

Codex CLI setup

Run in a terminal; Codex stores the entry in ~/.codex/config.toml.

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

Cursor setup

Add to .cursor/mcp.json for this project, or ~/.cursor/mcp.json for all projects.

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

VS Code setup

Add to .vscode/mcp.json, or run “MCP: Open User Configuration” for a private user-level entry.

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

Claude setup

Add the endpoint above in Claude:

  • Customize > Connectors > Add custom connector
  • Team/Enterprise: Organization settings > Connectors > Add > Custom > Web

Claude Desktop setup

Add the endpoint above in Claude Desktop:

  • Remote: Customize > Connectors (same as claude.ai)
  • Local: Settings > Developer > Edit Config, or Settings > Extensions for .mcpb files
  • ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), local servers only

ChatGPT setup

Add the endpoint above in ChatGPT:

  • ChatGPT web: Plugins > Add custom MCP server, then configure authentication and accept the risk warning

Windsurf setup

Add the endpoint above in Windsurf:

  • ~/.config/devin/mcp_config.json (%APPDATA%\devin\mcp_config.json on Windows), serverUrl or url
  • Cascade panel > ... > MCPs > Open MCP config file

Gemini CLI setup

Add the endpoint above in Gemini CLI:

  • gemini mcp add --transport http <name> <url>
  • ~/.gemini/settings.json (user) or .gemini/settings.json (project), mcpServers

MCP SDK setup

Add the endpoint above in MCP SDK:

  • Programmatic: new Client(...).connect(new StreamableHTTPClientTransport(url))

Notes for every client

  • Publisher evidence (reviewed 2026-10-20): https://docs.ahrefs.com/mcp/docs/introduction.md
  • Provider guidance: Available on paid Ahrefs plans; calls consume API units.

Client compatibility

ClientStatusWhy
Claude CodeSupportedClaude Code supports Streamable HTTP servers and OAuth sign-in.
CodexSupportedCodex supports Streamable HTTP servers and OAuth sign-in.
CursorSupportedCursor supports Streamable HTTP servers and OAuth sign-in.
VS CodeSupportedVS Code supports Streamable HTTP servers and OAuth sign-in.
ClaudeSupportedClaude supports Streamable HTTP servers and OAuth sign-in.
Claude DesktopSupportedClaude Desktop supports Streamable HTTP servers and OAuth sign-in.
ChatGPTSupportedChatGPT supports Streamable HTTP servers and OAuth sign-in.
WindsurfPartialWindsurf's documentation does not state support for OAuth sign-in.
Gemini CLISupportedGemini CLI supports Streamable HTTP servers and OAuth sign-in.
MCP SDKSupportedMCP SDK supports Streamable HTTP servers and OAuth sign-in.

Computed from this server's validated transport, protocol and authentication against documented client support. Checks the catalog has not observed are not counted.

Similar servers

  • Amplitude — Queries Amplitude charts, dashboards, cohorts, experiments, and event taxonomy for product analytics. Requires Amplitude OAuth. OAuth 2.1
  • Mixpanel — Runs Mixpanel insights, funnel, retention, and flow queries, and reads dashboards, events, and properties. Uses OAuth; service-account headers are documented for automated use. OAuth 2.1
  • PostHog — Queries PostHog product analytics, error tracking, feature flags, experiments, and surveys, and can run HogQL. Requires PostHog OAuth, which routes to the US or EU region automatically. OAuth 2.1
  • Pendo — Reads Pendo product usage, guide, page, and account data, and can create feedback items when write tools are enabled. A Pendo admin must enable the server; users sign in with OAuth. OAuth 2.1
  • Hex — Searches Hex projects, asks data questions in threads, and creates, edits, and runs notebook cells. Requires Hex sign-in through OAuth. OAuth 2.1
  • Fullstory — Answers natural-language questions about Fullstory behavioral data, sessions, and events. Supports OAuth or a Fullstory API key as a bearer token. OAuth 2.1

Guides for this server

Watch this server for breaking changes

Share and embed

Maintain Ahrefs? Embed this badge in your README. It follows the latest catalog validation result and links to this server profile.

mcptest.io: auth required

Latest validation evidence

Validation status
Online when last tested
Validation checked at
Oct 26, 2026 at 11:07 AM
Validation detail
Authentication challenge at https://api.ahrefs.com/mcp/mcp returned HTTP 401; endpoint was reachable but did not complete an MCP probe; authentication oauth

Tool inventory

Requires authorization; inventory not observed

The catalog validator lists tools only on servers that answer without credentials. Ahrefs asks for OAuth 2.1 sign-in first, so its tools, resources and prompts were not observed. Connect in the Playground with your own credentials to list them.