PlugWiki

Ahrefs MCP, Ahrefs' own server for SEO data

Official · by AhrefsLocal
Getnpm@ahrefs/mcp

Lets your AI assistant pull Ahrefs SEO data: backlinks, keywords, rankings and competitor traffic.

This is Ahrefs' npm package for bringing Ahrefs data into Claude, Cursor and other assistants. It can look up a site's backlinks, organic keywords, traffic history and competitors, research keywords, and read your Rank Tracker and Site Audit projects. It runs on your machine and uses your Ahrefs API key. Every tool fetches data, so it does not change your Ahrefs projects.

Good for

  • SEO specialists who want backlink and keyword answers without opening Ahrefs
  • Content marketers researching keywords and checking who ranks
  • Agencies comparing a client with competitors in one prompt
  • Link builders hunting broken and lost backlinks

Works in

12 should work

Tap an app to see how to set it up and any known problems.

Install @ahrefs/ MCP

Claude Code

  1. 1

    Copy this prompt.

    Add the @ahrefs/ MCP server to Claude Code. Run this command:
    
    claude mcp add ahrefs -e API_KEY=<API_KEY> -- npx -y @ahrefs/mcp
    
    Ask me for API_KEY and only put the values in that config, nowhere else.
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

Built from the package data we hold. Not yet tested by us.

Tools

  • Gets a site's Domain Rating

    Returns the Domain Rating and related metrics for a domain or URL on a given date.

    Try: “What is the Domain Rating of example.com today?”

    Network · site-explorer-domain-rating

  • Shows how a site's Domain Rating changed

    Returns Domain Rating over a date range, grouped by day, week or month.

    Try: “Chart example.com's Domain Rating over the last year.”

    Network · site-explorer-domain-rating-history

  • Shows how a page's URL Rating changed

    Returns URL Rating history for a URL over a date range.

    Try: “How has the URL Rating of our pricing page changed this year?”

    Network · site-explorer-url-rating-history

  • Gets organic and paid search metrics for a site

    Returns SEO performance metrics for a domain, URL or site section on a given date.

    Try: “Give me the organic traffic and keyword count for example.com.”

    Network · site-explorer-metrics

  • Shows organic and paid traffic over time

    Returns organic and paid traffic and cost history for a domain, URL or path.

    Try: “Show example.com's organic traffic by month for the last two years.”

    Network · site-explorer-metrics-history

  • Breaks a site's search traffic down by country

    Returns organic and paid search metrics by country for one date.

    Try: “Which countries bring example.com the most organic traffic?”

    Network · site-explorer-metrics-by-country

  • Shows how many keywords a site ranks for over time

    Returns the count of organic keywords by position range over a date range.

    Try: “How many top-3 keywords did example.com have each month last year?”

    Network · site-explorer-keywords-history

  • Shows total search volume and traffic value over time

    Returns historical total organic search volume, traffic and traffic value for a site.

    Try: “Show the traffic value of example.com over the past 12 months.”

    Network · site-explorer-total-search-volume-history

  • Shows how many pages a site has over time

    Returns historical page counts for a domain, URL or section.

    Try: “How many pages did example.com have indexed each quarter?”

    Network · site-explorer-pages-history

  • Lists the keywords a site ranks for

    Returns organic keywords for a domain, URL or path with rankings, intent, SERP features, traffic and CPC.

    Try: “List the top 50 keywords example.com ranks for in the US.”

    Network · site-explorer-organic-keywords

  • Finds a site's search competitors

    Returns organic competitors with shared keywords, traffic estimates and domain strength.

    Try: “Who are example.com's biggest organic competitors?”

    Network · site-explorer-organic-competitors

  • Lists a site's top pages by search performance

    Returns top pages with rankings, traffic, top keyword and changes over time.

    Try: “What are example.com's ten best pages by organic traffic?”

    Network · site-explorer-top-pages

Read from the source code

Permissions

low risk · 2 things to watch

Low risk

The assistant can read the Ahrefs data your API key can reach, and nothing more.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • Use a dedicated API key

    Create a separate key for the assistant and check its permissions in Ahrefs. The README says the key must allow what the tools need. npmjs.com

  • Your questions and data go through your AI provider

    Results from Ahrefs are passed to the assistant you use, so they leave Ahrefs. Check your own policy before sharing client data. npmjs.com

Security advisories

No published security advisories as of Nov 1, 2026.

Technical details
Turning on read-onlyNot needed: every tool fetches data and none changes anything in Ahrefs.
Talks toAhrefs API (api.ahrefs.com)
Scopes
  • Ahrefs API key

Questions

Do I need an Ahrefs API key?

Yes. The server reads it from an API_KEY setting. Ahrefs documents how to create and manage API keys in its API reference.

Can it change my Ahrefs projects?

No. All of its tools fetch data, including the project and keyword lists. It does not create, edit or delete anything.

What can it look up?

Site Explorer data such as backlinks, referring domains, organic keywords and traffic history, plus Keywords Explorer, SERP overviews, Rank Tracker and Site Audit project lists. The tool list above has the full set.

Why does the README install it differently?

The README installs the package into a folder in your home directory first, to avoid permission errors with global npm installs. The install box runs it with npx instead. Use the README method if you hit permission errors.

Does it work in Claude Desktop?

Yes. The README gives Claude Desktop setup steps and mentions Cursor too. After you change the config file, restart Claude Desktop fully.

How do I add it to Cursor?

Use the Cursor tab in the install box above and replace the key placeholder with your own.

Information

updated Nov 2, 2026

Publisher
Ahrefs (official)
Package
@ahrefs/mcp
Registry
npm
Transport
stdio
Auth
API key
Version
0.0.11
License
MIT

npm

Other Ahrefs MCP servers

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 1
  1. @ahrefs/mcp on npm · npmjs.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.