# Ahrefs MCP server

> Query Ahrefs SEO data such as backlinks, keywords, site metrics and competitor research from your AI assistant.

- Listing: https://mcp.tc/i/ahrefs
- Connect: use the server's own URL `https://api.ahrefs.com/mcp/mcp` (OAuth sign-in at the server); clients connect to it directly. The listing link is a page, not an MCP endpoint.
- Type: remote (Streamable HTTP)
- Auth: OAuth sign-in
- Category: [Marketing & SEO](https://mcp.tc/c/marketing-seo)
- Vendor: Ahrefs
- Verified: yes, mcp.tc checked that this is the official server (https://mcp.tc/verify). It says who runs the server, not that it is safe.
- Homepage: <https://docs.ahrefs.com/mcp/docs/introduction>

## About

Ahrefs MCP connects AI assistants to the Ahrefs API so answers can draw on real Ahrefs marketing and search data, including backlinks, keywords, site metrics and competitor research.

It runs as a hosted Streamable HTTP server at https://api.ahrefs.com/mcp/mcp. Users sign in with OAuth and approve a consent screen, which creates a dedicated MCP-scoped API key in their account. A Lite plan or higher is required, and calls use the account's monthly API units. Use through custom scripts or standalone HTTP clients is not permitted.

## What it can do

- Look up backlink data for a site or page
- Research keywords and search data
- Check site metrics for a domain
- Run competitor research with Ahrefs data

## Example prompts

- "Show the top backlinks for example.com from Ahrefs."
- "Find keyword ideas for 'standing desk' with Ahrefs data."
- "Compare the site metrics of example.com and competitor.com."
- "Which keywords does my competitor rank for that I don't?"

## Install

### Claude Code

1. Run this in a terminal, in your project folder:

```bash
claude mcp add --transport http ahrefs https://api.ahrefs.com/mcp/mcp
```

2. Start Claude Code, type `/mcp`, pick **ahrefs** and choose **Authenticate**. A browser window opens for the Ahrefs sign-in.

Add `--scope user` to make it available in every project, not just this one.

### Claude Desktop

1. Open **Settings → Connectors** and click **Add custom connector**.

2. Name it **Ahrefs** and paste this URL:

```url
https://api.ahrefs.com/mcp/mcp
```

3. Click **Add**, then **Connect**, and sign in when Ahrefs asks.

Claude Desktop’s JSON config file only starts local servers. Remote servers go through Connectors, and connectors you add on claude.ai show up here too.

### claude.ai

1. Open the connector form on claude.ai. This button fills in the name and URL for you:

[Add to claude.ai](<https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Ahrefs&connectorUrl=https%3A%2F%2Fapi.ahrefs.com%2Fmcp%2Fmcp>) (opens connector settings)

2. Check that the URL reads `https://api.ahrefs.com/mcp/mcp` and click **Add**.

3. Click **Connect** and sign in when Ahrefs asks.

Free plans allow one custom connector. On Team and Enterprise plans an owner adds it under **Organization settings → Connectors**.

### ChatGPT

1. On chatgpt.com, open **Settings → Security and login** and turn on **Developer mode**.

2. Go to `chatgpt.com/plugins` and click **+** to create an app for a remote MCP server.

3. Paste `https://api.ahrefs.com/mcp/mcp` as the server URL and choose **OAuth**. ChatGPT sends you to Ahrefs to sign in.

Developer mode is available on the web for Plus, Pro, Business, Enterprise and Education accounts.

### Cursor

[Add to Cursor](<https://cursor.com/install-mcp?name=ahrefs&config=eyJ1cmwiOiJodHRwczovL2FwaS5haHJlZnMuY29tL21jcC9tY3AifQ%3D%3D>) (opens Cursor)

Or add it by hand to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (this project):

`mcp.json`:

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

Cursor shows **Needs login** next to the server. Click it to sign in.

### VS Code

[Install in VS Code](<https://vscode.dev/redirect/mcp/install?name=ahrefs&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.ahrefs.com%2Fmcp%2Fmcp%22%7D>) (opens VS Code)

Or from a terminal:

```bash
code --add-mcp '{"name":"ahrefs","type":"http","url":"https://api.ahrefs.com/mcp/mcp"}'
```

Or commit it to the repo in `.vscode/mcp.json`:

`.vscode/mcp.json`:

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

VS Code asks you to sign in the first time the server starts.

### Devin Desktop

1. Add it to `~/.config/devin/mcp_config.json` (macOS and Linux) or `%APPDATA%\devin\mcp_config.json` (Windows):

`mcp_config.json`:

```json
{
  "mcpServers": {
    "ahrefs": {
      "serverUrl": "https://api.ahrefs.com/mcp/mcp"
    }
  }
}
```

2. Refresh the MCP server list in Cascade and sign in when asked.

Devin Desktop is the new name for Windsurf. It reads `serverUrl` (or `url`) for remote servers.

### Codex

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

Or edit `~/.codex/config.toml` directly:

`config.toml`:

```toml
[mcp_servers.ahrefs]
url = "https://api.ahrefs.com/mcp/mcp"
```

### Gemini CLI

```bash
gemini mcp add --transport http ahrefs https://api.ahrefs.com/mcp/mcp
```

Then, inside Gemini CLI, run `/mcp auth ahrefs` to sign in.

This adds it to the current project. Add `-s user` to use it everywhere.

### Any client

Most clients accept this shape. Some name the URL field differently: `serverUrl` in Devin Desktop, `httpUrl` in Gemini CLI’s settings file.

```json
{
  "mcpServers": {
    "ahrefs": {
      "type": "http",
      "url": "https://api.ahrefs.com/mcp/mcp"
    }
  }
}
```

Zed puts servers under `context_servers` in its settings. Cline needs `"type": "streamableHttp"`, or it assumes SSE.

Client only starts local servers? Bridge it with `npx -y mcp-remote https://api.ahrefs.com/mcp/mcp`.

## Details

- Last checked: 2026-10-03 (reachable, asks for credentials)
- Listed: 2026-10-03
- Updated: 2026-10-04

---
Source: https://mcp.tc/i/ahrefs (mcp.tc is an independent directory, not affiliated with this server's publisher). Corrections: https://mcp.tc/report
