{
  "id": 193657,
  "title": "Ahrefs MCP Server: Setup for Claude, Codex and the Rest",
  "url": "https://urgent.news/2026/08/05/ahrefs-mcp-server-setup-for-claude-codex-and-the-rest",
  "topic": "ai",
  "section": "AI",
  "published": "2026-08-05T22:28:46.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/studiomeyer_io/ahrefs-mcp-server-setup-for-claude-codex-and-the-rest-l46"
  },
  "original_language": "en",
  "account": "When connecting Ahrefs to an AI client like Claude or Codex, it is crucial to understand the setup process. First, note that Ahrefs ships two distinct MCP servers and two kinds of API keys, but only one pairing is suitable for use. This guide outlines the correct setup based on my experience.\n\nUpon connecting Ahrefs to an AI client, no immediate error or indication appears. Instead, a server remains idle, seemingly connected. My issue stemmed from using an incorrect pairing of the two possible options. This guide aims to clarify the process and prevent similar confusion.\n\nThe primary server Ahrefs utilizes is located at https://api.ahrefs.com/mcp/mcp, adhering to the Streamable HTTP protocol. Older local servers, published on npm as @ahrefs/mcp, are now archived and no longer functional. The current remote server requires an MCP-scoped key, which must be generated separately in your Ahrefs account.\n\nThe API key and MCP key are not interchangeable, as stated explicitly by Ahrefs. There are four pairing combinations, but only one is sensible today: using an API v3 key with an MCP-scoped key. Connecting to the wrong server will result in an unauthorized error or a server with no tools, leading to confusion and wasted time.\n\nAuthentication can be achieved through OAuth or a bearer token. OAuth is suitable for interactive work, but for headless operations, a bearer token is more practical. The bearer token allows for immediate authentication without the need for a browser or token refresh.\n\nClaude Code and Codex both support connecting to the Ahrefs MCP server. Claude Code utilizes a project scope for key storage, while Codex relies on a globally accessible configuration file. Both services have unique nuances that may cause confusion during setup.\n\nIn summary, connecting Ahrefs to an AI client requires careful server selection, authentication method choice, and understanding the tools and endpoints available. By following this guide, users can avoid the common pitfalls and setup process that led to wasted time and frustration.",
  "summary": "The first thing that will happen when you connect Ahrefs to an AI client is that nothing happens. No error, no tools, just a server that sits there looking connected. In my case the cause was mundane: Ahrefs ships two different MCP servers and two different kinds of API key, and only one of the four possible pairings is the one you want today. Nobody tells you which one you picked. That is the…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}