Ahrefs
Интегрируйте данные Ahrefs с Claude и другими ИИ-ассистентами с помощью Ahrefs MCP. Получайте SEO-инсайты напрямую в своих AI-воркфлоу. Простая установка и настройка!
Сервер Ahrefs MCP обеспечивает плавную интеграцию между SEO-данными Ahrefs и ИИ-ассистентами, такими как Claude. Установив и настроив этот сервер, пользователи могут напрямую получать доступ к мощной аналитике и инсайтам Ahrefs в своих рабочих процессах с ИИ, улучшая исследования, создание контента и разработку SEO-стратегий.
Ключевые особенности
Варианты использования
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
- When installing Node.js, use the official installer and make sure the folder is added to PATH when selecting installation options.
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:
{
"mcpServers": {
"ahrefs": {
"command": "npx",
"args": [
"--prefix=~/.global-node-modules",
"@ahrefs/mcp"
],
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}{
"mcpServers": {
"ahrefs": {
"command": "npx",
"args": [
"--prefix=C:\\Users\\YOUR_USERNAME_HERE\\.global-node-modules\\node_modules",
"@ahrefs/mcp"
],
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}- Take note of the double escape backslashes
- Take note that the prefix directory is slightly different
- Take note of the forward slash for
@ahrefs/mcp - If you are working with Claude Desktop, run Ctrl-Alt-Del to open Task Manager and kill Claude Desktop. Otherwise, your newly changed config will not be loaded.
To learn more about creating or controlling API keys, refer to the official documentation.
- Download Claude for Desktop
- Select
Settings...
- Click on
Developerin the left panel, thenEdit Config
-
Paste the configuration above into the open file
-
Restart the Claude app! If the installation is successful, it should look like this:
If you prefer directly navigating to the file, the paths are:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
If there are any issues, please refer to the official documentation
Cursor supports configurations that are either project-specific or global: the MCP configuration file will be at .cursor/mcp.json or ~/.cursor/mcp.json respectively.
For more details, read the official documentation.
Symptoms:
- Running
npm -vshows an error likecommand not foundor'npm' is not recognized.
Fix:
- Ensure you've installed Node.js from nodejs.org.
- Restart your terminal after installation.
- On Windows, make sure the Node.js installer added
npmto your PATH.
Platform-Specific Checks:
- Windows:
Open Command Prompt (
Win + R → cmd) and run:node -v npm -v - macOS/Linux:
Open Terminal and run:
which node && which npm
If it returns nothing, Node.js may not be in your $PATH.
Symptoms:
- Errors like
EACCES: permission denied, especially on macOS or Linux.
Fix:
- Install using a user-scoped global prefix as shown in the installation guide:
npm install --prefix=~/.global-node-modules @ahrefs/mcp -g - This avoids requiring elevated privileges (
sudo).
Extra Tip:
If you used sudo previously and created permission issues, reset folder ownership:
sudo chown -R $(whoami) ~/.global-node-modulesSymptoms:
- Terminal shows "Operation not permitted" errors
- Unable to create folders or files
- Permission denied messages when running npm commands
Fix: Check if Terminal has Full Disk Access:
- Open System Settings (or System Preferences)
- Go to Privacy & Security → Full Disk Access
- Make sure Terminal.app is in the list and checked
- If not present, click '+', navigate to Applications → Utilities → Terminal.app
Note: Modern macOS versions require explicit permissions for Terminal access. Without proper permissions, npm installations and other file operations may fail silently or with permission errors.
Symptoms:
- Error:
Cannot find package '@ahrefs/mcp'
Fix: Ensure your config uses the same prefix used during install:
"command": "npx",
"args": [
"--prefix=~/.global-node-modules",
"@ahrefs/mcp"
]Note:
Do not omit the --prefix unless you're installing globally system-wide (not recommended).
Symptoms:
- Claude does not list the MCP under “tools”.
Fix:
- Make sure the config file path is correct:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux: (Rare, but if applicable)
~/.config/Claude/claude_desktop_config.json
- Windows:
- Double-check you pasted the configuration inside the correct section and restarted Claude after saving.
Symptoms:
- MCP fails silently or throws an error about
API_KEY. - Claude responds with a message that it ran into authentication issues.
Fix: Ensure this line is present in the MCP config:
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}Replace YOUR_API_KEY_HERE with your actual key. Ensure that your API key settings give you the necessary permissions.
For more help, refer to Ahrefs API key docs.
Symptoms:
- Error messages containing
ENOENTor "no such file or directory" - npm commands fail with path-related errors
~or environment variables not being expanded correctly
Fix: Use absolute paths instead of relying on path expansion:
Windows:
C:\Users\<username>\.global-node-modulesReplace <username> with your actual Windows username.
macOS:
/Users/<username>/.global-node-modulesReplace <username> with your macOS username.
Linux:
/home/<username>/.global-node-modulesReplace <username> with your Linux username.
Example Configuration:
{
"mcpServers": {
"ahrefs": {
"command": "npx",
"args": [
"--prefix=/Users/username/.global-node-modules", // Replace with your absolute path
"@ahrefs/mcp"
],
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}How to Find Your Absolute Path:
Windows:
- Open Command Prompt
- Type
echo %USERPROFILE%
macOS/Linux:
- Open Terminal
- Type
echo $HOME
Note: Using absolute paths eliminates issues with path expansion and ensures the configuration works regardless of environment variables or shell configurations.
| Issue | Windows Command | macOS/Linux Command |
|---|---|---|
| Check Node version | node -v && npm -v |
node -v && npm -v |
| Check if MCP is installed | npm list -g --prefix=%USERPROFILE%\.global-node-modules @ahrefs/mcp |
npm list -g --prefix=~/.global-node-modules @ahrefs/mcp |
| Clear corrupted install | Delete folder manually | rm -rf ~/.global-node-modules |
| Purpose | Windows | macOS | Linux |
|---|---|---|---|
| Claude config file | %APPDATA%\Claude\claude_desktop_config.json |
~/Library/Application Support/Claude/claude_desktop_config.json |
~/.config/Claude/claude_desktop_config.json (if applicable) |
| Global MCP install location | %USERPROFILE%\.global-node-modules |
~/.global-node-modules |
~/.global-node-modules |
- Check the official MCP documentation
- Or reach out to internal support at Ahrefs through your usual engineering support channel.
Let us know what errors you're seeing, along with your OS and the output of:
npm list -g --prefix=~/.global-node-modules @ahrefs/mcpAhrefs MCP
Сервер MCP для подключения Claude Desktop и других AI-ассистентов к сервису Ahrefs.
Установка
-
Установите Node.js и npm
- Скачайте Node.js с nodejs.org и установите.
- Проверьте установку:
npm -v
-
Установите Ahrefs MCP Server
npm install --prefix=~/.global-node-modules @ahrefs/mcp -g -
Обновление Для обновления до последней версии:
npm install --prefix=~/.global-node-modules @ahrefs/mcp@latest -g
Конфигурация
Добавьте Ahrefs MCP в конфигурацию вашего AI-клиента. Пример для Claude Desktop:
{
"mcpServers": {
"ahrefs": {
"command": "npx",
"args": [
"--prefix=~/.global-node-modules",
"@ahrefs/mcp"
],
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Для Windows
{
"mcpServers": {
"ahrefs": {
"command": "npx",
"args": [
"--prefix=C:\\Users\\YOUR_USERNAME\\.global-node-modules\\node_modules",
"@ahrefs/mcp"
],
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Обратите внимание: двойные обратные слеши и разный путь к префиксу.
Где найти файл конфигурации
- Claude Desktop:
~Library/Application Support/Claude/claude_desktop_config.json(macOS) или%APPDATA%\Claude\claude_desktop_config.json(Windows). - Cursor:
.cursor/mcp.json(проектный) или~/.cursor/mcp.json(глобальный).
После редактирования обязательно перезапустите Claude (на Windows — Ctrl+Alt+Del и завершить процесс).
Получение API-ключа
Создайте и управляйте ключами в документации Ahrefs.
Частые проблемы и решения
1. Node.js/npm не найдены
- Установите Node.js с официального сайта.
- Перезапустите терминал.
- На Windows проверьте, что npm добавлен в PATH.
2. Ошибки доступа при глобальной установке
- Используйте префикс
~/.global-node-modules, как указано выше, чтобы избежатьsudo. - При необходимости сбросьте права:
sudo chown -R $(whoami) ~/.global-node-modules.
3. macOS: Терминал не имеет полного доступа к диску
- Откройте Системные настройки → Конфиденциальность и безопасность → Полный доступ к диску.
- Добавьте Terminal.app.
4. npx не может найти @ahrefs/mcp
- Убедитесь, что в
argsуказан правильный--prefix, совпадающий с путём установки. - Не опускайте
--prefix.
5. Файл конфигурации не применяется
- Проверьте путь к файлу (см. выше).
- Убедитесь, что JSON валиден и секция
mcpServersна месте. - Перезапустите приложение.
6. Проблемы с API_KEY
- Проверьте, что
API_KEYуказан вenvи заменён на реальный ключ. - Убедитесь, что у ключа есть необходимые права.
7. Проблемы с раскрытием путей (~ или переменные)
- Используйте абсолютные пути вместо
~. Пример:- macOS:
/Users/username/.global-node-modules - Windows:
C:\Users\username\.global-node-modules
- macOS:
- Узнать свой абсолютный путь:
echo $HOME(macOS/Linux) илиecho %USERPROFILE%(Windows).
Диагностические команды
| Команда | Windows | macOS/Linux |
|---|---|---|
| Проверка Node | node -v && npm -v |
node -v && npm -v |
| Проверка установки MCP | npm list -g --prefix=%USERPROFILE%\.global-node-modules @ahrefs/mcp |
npm list -g --prefix=~/.global-node-modules @ahrefs/mcp |
| Очистка установки | Удалить папку вручную | rm -rf ~/.global-node-modules |
Краткая сводка путей
| Назначение | Windows | macOS | Linux |
|---|---|---|---|
| Файл конфигурации Claude | %APPDATA%\Claude\claude_desktop_config.json |
~/Library/Application Support/Claude/claude_desktop_config.json |
~/.config/Claude/claude_desktop_config.json (если есть) |
| Глобальная установка MCP | %USERPROFILE%\.global-node-modules |
~/.global-node-modules |
~/.global-node-modules |
Поддержка
Если проблемы остались, обратитесь к официальной документации MCP или в службу поддержки Ahrefs через обычные каналы. При обращении приложите вывод команды:
npm list -g --prefix=~/.global-node-modules @ahrefs/mcp
Что такое Ahrefs MCP?
Ahrefs MCP (Model Context Protocol) — это сервер, который подключает данные Ahrefs к AI-ассистентам, например Claude, позволяя получать SEO-инсайты прямо в AI-воркфлоу.
Какие AI-ассистенты совместимы с Ahrefs MCP?
Ahrefs MCP предназначен для работы с Claude Desktop и другими AI-ассистентами, поддерживающими Model Context Protocol.
Как установить Ahrefs MCP?
Установка включает глобальную установку сервера Ahrefs MCP через npm и последующую настройку AI-ассистента для подключения к нему. Подробные инструкции приведены в README, включая специфические шаги для Windows и macOS.
Где найти файл конфигурации для Claude Desktop?
Для Claude Desktop файл конфигурации находится по пути `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) или `%APPDATA%\Claude\claude_desktop_config.json` (Windows). Доступ к нему: Настройки -> Разработчик -> Редактировать конфиг.
Что делать, если при установке возникает ошибка 'command not found'?
Обычно это означает, что Node.js и npm не установлены должным образом или не добавлены в PATH. Убедитесь, что вы установили Node.js с nodejs.org и что установка добавила npm в PATH (особенно на Windows).
Источник: https://mcpmarket.com/server/ahrefs
Комментарии
Комментариев пока нет. Будьте первым.