[Home](/index.md) › [MCP servers](/mcp.md) › Ahrefs MCP server

# Ahrefs MCP server

MCP server

- 0 callable tools
- 4 capabilities

[Installation guide](https://docs.ahrefs.com/mcp/docs/claude-code.md)

## Overview

Ahrefs publishes a hosted MCP server that lets AI agents access the Ahrefs API for an Ahrefs account. It works with Ahrefs SEO and marketing data.

### Capabilities

- Access Ahrefs API data from AI agents
- Enrich AI assistant answers with Ahrefs data
- Connect an Ahrefs account to supported AI tools via OAuth
- Use an MCP API key generated in the Ahrefs account

## Works with

The products your agent can work with through this server.

- [Ahrefs](/tools/ahrefs.md): SEO and AI search platform

## Installation

Follow the installation guide for supported clients, authentication and required permissions.

### Add Ahrefs MCP server to Claude Code

Run this in your terminal:

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

If the server asks you to sign in, run `/mcp` in Claude Code and follow the browser prompt.

### Add Ahrefs MCP server to Cursor

Add it with the Add to Cursor button below, or add it to `.cursor/mcp.json` in your project (`~/.cursor/mcp.json` for every project):

[Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=ahrefs&config=eyJ1cmwiOiJodHRwczovL2FwaS5haHJlZnMuY29tL21jcC9tY3AifQ%3D%3D)

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

### Add Ahrefs MCP server to VS Code

Add it to `.vscode/mcp.json` in your workspace. VS Code uses `servers` rather than `mcpServers`. Or run MCP: Add Server from the Command Palette and choose HTTP.

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

### Add Ahrefs MCP server to Codex

Run this in your terminal:

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

Or add it to `~/.codex/config.toml`:

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

If the server uses OAuth, sign in with `codex mcp login ahrefs`.

### Add Ahrefs MCP server to Claude

Add it as a custom connector with this URL:

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

1. Open Customize, then Connectors.
2. Click + Add, then Add custom connector.
3. Name it, paste the URL and click Continue.
4. Choose how to sign in, then click Add.

On Team and Enterprise plans, an Owner adds it in Organization settings first, then members connect it.

### Add Ahrefs MCP server to other clients

For any other client that connects to remote MCP servers over HTTP, use this URL:

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

[Read the installation guide](https://docs.ahrefs.com/mcp/docs/claude-code.md)

## Sources

Documentation and source code reviewed on 12 November 2026.

- [docs.ahrefs.com/mcp/docs/introduction.md](https://docs.ahrefs.com/mcp/docs/introduction.md)
- [docs.ahrefs.com/mcp/docs/claude-code.md](https://docs.ahrefs.com/mcp/docs/claude-code.md)
- [docs.ahrefs.com/en/mcp/docs/introduction](https://docs.ahrefs.com/en/mcp/docs/introduction)
- [docs.ahrefs.com](https://docs.ahrefs.com/)
