Ahrefs

Merge lets you securely connect your agents to Ahrefs and thousands of tools instantly

Available tools

View all tools by creating a free accountSee more tools

How to set up
Merge Agent Handler

In an mcp.json file, add the configuration below, and restart Cursor.

Learn more in the official documentation ↗

1{
2  "mcpServers": {
3    "agent-handler": {
4      "url": "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
5      "headers": {
6        "Authorization": "Bearer yMt*****"
7      }
8    }
9  }
10}
Copy Code

Open your Claude Desktop configuration file and add the server configuration below. You'll also need to restart the application for the changes to take effect.

Make sure Claude is using the Node v20+.

Learn more in the official documentation ↗

1{
2  "mcpServers": {
3    "agent-handler": {
4      "command": "npx",
5      "args": [
6        "-y",
7        "mcp-remote@latest",
8        "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
9        "--header",
10        "Authorization: Bearer ${AUTH_TOKEN}"
11      ],
12      "env": {
13        "AUTH_TOKEN": "yMt*****"
14      }
15    }
16  }
17}
Copy Code
Copied!

Open your Windsurf MCP configuration file and add the server configuration below.
Click on the refresh button in the top right of the Manage MCP server page or in the top right of the chat box in the box icon.

Learn more in the official documentation ↗

1{
2    "mcpServers": {
3      "agent-handler": {
4        "command": "npx",
5        "args": [
6          "-y",
7          "mcp-remote@latest",
8          "https://ah-api.merge.dev/api/v1/tool-packs/<tool-pack-id>/registered-users/<registered-user-id>/mcp",
9          "--header",
10          "Authorization: Bearer ${AUTH_TOKEN}"
11        ],
12        "env": {
13          "AUTH_TOKEN": "<ah-production-access-key>"
14        }
15      }
16    }
17  }
Copy Code

In Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows), run "MCP: Open User Configuration".

You can then add the configuration below and press "start" right under servers. Enter the auth token when prompted.

Learn more in the official documentation ↗

1{
2  "inputs": [
3    {
4      "type": "promptString",
5      "id": "agent-handler-auth",
6      "description": "Agent Handler AUTH_TOKEN", // "yMt*****" when prompt
7      "password": true
8    }
9  ],
10  "servers": {
11    "agent-handler": {
12      "type": "stdio",
13      "command": "npx",
14      "args": [
15        "-y",
16        "mcp-remote@latest",
17        "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
18        "--header",
19        "Authorization: Bearer ${input:agent-handler-auth}"
20      ]
21    }
22  }
23}
Copy Code

FAQ on integrating with
Google Drive’s API

Heading

What is an Ahrefs MCP?

It's an MCP server that gives your agents access to Ahrefs' SEO data platform via tools. Your agents can invoke these tools to research keywords, analyze backlink profiles, track organic rankings, identify competitor traffic, and more.

Ahrefs offers an official MCP server, but you can also use one from a third-party platform, like Merge Agent Handler.

How can I use the Ahrefs MCP server?

The use cases naturally depend on the agent you've built, but here are a few common ones:

  • Automated content brief generation: When a target keyword is added to a planning spreadsheet, an agent calls Ahrefs to pull search volume, difficulty, top-ranking pages, and related terms, then compiles a content brief and drops it into a Notion doc or Google Doc for the writer
  • Weekly rank tracking digest: An agent pulls the latest keyword positions for a project from Ahrefs on a weekly schedule, compares them to the prior week, flags significant drops or gains, and sends a summary to the SEO team in Slack
  • Competitor content gap analysis: When a competitor's high-traffic page is detected via a monitoring tool, an agent queries Ahrefs to find which keywords that page ranks for that the client's site doesn't cover, then adds them to a prioritized keyword list for the content team
  • Backlink monitoring and outreach triage: An agent checks Ahrefs daily for new backlinks pointing to a domain, filters for links from high-DR sources, and creates a follow-up task in a CRM or project tool for the outreach team to engage those linking domains

What are popular tools for Ahrefs's MCP server?

Here are some of the most commonly used tools:

  • get_keyword_overview: returns search volume, keyword difficulty, CPC, and SERP features for a given keyword. Use this when an agent needs a quick snapshot of a keyword's competitive and commercial profile before prioritizing content
  • list_matching_terms: finds keyword variations containing a seed term, with volume and difficulty for each result. Helpful when an agent is building a keyword list for a topic cluster or populating a content calendar
  • list_organic_keywords: lists the organic keywords a domain ranks for, along with position, traffic share, and difficulty data. Good for workflows that map a competitor's ranking footprint or identify gaps in a site's own coverage
  • list_top_pages: returns the pages on a domain receiving the most estimated organic traffic, with keyword counts and traffic values. Call this when an agent needs to pinpoint a competitor's highest-value content or analyze a site's traffic distribution
  • list_backlinks: returns backlinks pointing to a specified domain or URL, including source domain rating, anchor text, and link type. Use this when an agent needs to audit a link profile or identify high-authority domains for an outreach campaign
  • list_organic_competitors: identifies domains with overlapping keyword rankings, ranked by competitive overlap score. Useful for agents that need to assemble a competitor set for benchmarking or gap analysis

What makes Merge Agent Handler's Ahrefs MCP server better than alternative Ahrefs MCP servers?

Even though Ahrefs has its own official MCP server, routing it through Merge Agent Handler adds a layer of control that matters at enterprise scale:

  • Enterprise-grade security and DLP: Merge Agent Handler includes built-in data loss prevention controls that let you block or redact sensitive fields before they reach an agent. For Ahrefs, this means you can prevent keyword data, backlink profiles, and domain metrics that reflect proprietary SEO strategy from being surfaced beyond the agents that specifically need them
  • Managed authentication and credentials: Merge stores and manages your Ahrefs API credentials on your behalf. You never expose API keys to an agent directly or rebuild your auth flow when keys rotate
  • Real-time observability and audit trail: Every tool call against Ahrefs is logged with full context: which tool ran, what query was submitted, and what data came back. Your team can audit exactly what SEO data an agent accessed without writing any custom logging
  • Tool Packs and controlled access: Tool Packs let you bundle specific Ahrefs tools with tools from other connectors into a single MCP endpoint, scoped to a specific use case. An agent gets exactly the tools it needs, nothing more

How can I start using Merge Agent Handler's Ahrefs MCP server?

You can take the following steps:

1. Create or log into your Merge Agent Handler account and navigate to Tool Packs (collections of connector tools scoped to a specific use case).

2. Create a new Tool Pack, then find and enable the Ahrefs connector. Choose the tools that match your use case: keyword research tools like get_keyword_overview and list_matching_terms are enough for content workflows, while tools like list_backlinks and list_organic_competitors are needed for link and competitive analysis.

3. Add a Registered User inside the Tool Pack. This is the identity context under which your agent operates. Merge generates a unique MCP URL scoped to this user once it's created.

4. From the Registered User detail page, authenticate Ahrefs by entering your API credentials. Merge stores and manages those credentials going forward.

5. Copy the MCP URL from the Tool Pack detail page and generate an API key from Settings. You'll need both to connect your agent.

6. Add the MCP server to your agent or IDE using the MCP URL and API key. Your Ahrefs tools are now accessible through that endpoint.

Can employees use Merge Agent Handler to connect their AI tools to Ahrefs?

Yes, Agent Handler for Employees lets your employees connect Claude, ChatGPT, Microsoft Copilot, Cursor, and other MCP-compatible AI tools to Ahrefs without bypassing IT governance.

Instead of setting up direct connections with personal credentials that IT can't monitor or revoke, each employee authenticates through Agent Handler and gets individual credentials tied to their identity.

IT also provisions access by role or group via SCIM. An SEO specialist, for example, gets Ahrefs access to track keyword rankings and backlink profiles, Google Sheets to report on performance trends, and Slack to share insights with the content team; while a content strategist gets Ahrefs access to research keyword opportunities and competitor content gaps, Notion to organize content plans, and HubSpot to align SEO data with lead generation metrics.

Every tool call an employee's AI makes to Ahrefs is also inspected against your DLP rules and logged to a searchable audit trail, giving security teams full visibility into what data was accessed and by whom.

Explore other MCP servers built and managed by Merge

View Docs
Google Forms
Google Forms
Google Maps
Google Maps
Google Meet
Google Meet
Google Sheets
Google Sheets
Google Slides
Google Slides
Google Tasks
Google Tasks
Google Workspace
Google Workspace
Gorgias
Gorgias
Grafana
Grafana
Grain
Grain
Granola
Granola
Granola MCP Server
Granola MCP Server
Greenhouse
Greenhouse
Guru
Guru
Harmonic
Harmonic
Heroku
Heroku
Hex
Hex
HeyGen
HeyGen
HiBob
HiBob
Hive Intelligence
Hive Intelligence
Honeycomb
Honeycomb
HubSpot
HubSpot
Hugging Face
Hugging Face
incident.io
incident.io

Ready to try it out?

Whether you're an engineer experimenting with agents or a product manager looking to add tools, you can get started for free now