A Model Context Protocol server to connect Claude desktop and other compatible AI assistants to Ahrefs.
npm commands need to be executed in a terminal:
- macOS: open the Terminal from your Applications folder
- Windows: press Windows + R, type
cmd, and press Enter
- Download Node.js from nodejs.org
- Follow the installation instructions for your operating system
- Verify installation by running:
npm -v- A version number will be printed if installation was successful
npm install --prefix=~/.global-node-modules @ahrefs/mcp -gIf you've installed our MCP server before, and just want to upgrade, run this command:
npm install --prefix=~/.global-node-modules @ahrefs/mcp@latest -gYou can now add the Ahrefs MCP to your favourite AI assistant app by adding the ahrefs part to your app's configuration file: