How to Use the Ahrefs MCP in Claude Code
Pipe Ahrefs data into your shell scripts with Claude Code. Automate SEO checks, track keywords, and monitor domains from the terminal.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Ahrefs MCP to Claude Code
Create your Vinkius account to connect Ahrefs to Claude Code and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Ahrefs MCP Server for CI/CD
Bring SEO metrics directly into your deployment pipeline. Add a script to your GitHub Actions or Jenkinsfile that has Claude Code call `get_domain_overview`. You can then write a simple condition to fail the build if your Domain Rating drops below a certain threshold. Use it for pre-flight checks before deploying. Before a merge, run a script that uses `list_broken_backlinks` on the staging URL. If it finds any new 404s, the action fails, preventing you from shipping dead links to production.
Track Keywords with Cron and Shell
Monitor your keyword performance without any fancy dashboards. Set up a simple cron job that executes a shell script with Claude Code. The script can call `get_keyword_overview` for your most important keywords and append the results to a log file. Because Claude Code outputs raw JSON, you can pipe the data anywhere. Use `jq` to parse the output, send it to a monitoring service, or insert it into a database. It's a simple, powerful way to build your own rank tracker.
Headless Competitive Analysis
Run large-scale SEO research from any server with an SSH connection. Write a shell script that reads a list of competitor domains from a text file. For each domain, have Claude Code call `list_organic_keywords` and `list_top_pages`. This is perfect for backend data gathering. You can run the script in a Docker container or a `screen` session, dumping gigabytes of raw JSON to disk for later analysis with other tools. No browser, no GUI, just pure data extraction.
Set up Ahrefs MCP in Claude Code
Prerequisites
- Claude Code CLI installed (
npm install -g @anthropic-ai/claude-code) - Active Vinkius subscription with a valid endpoint token
- 1
Run the add command
Open your terminal and run the command shown on the right. Replace
[YOUR_TOKEN_HERE]with your endpoint token from cloud.vinkius.com. Use--scope userto make it available across all projects. - 2
Verify the connection
Start a Claude Code session and type
/mcpto list connected servers. You should seeahrefs-mcpwith a green status indicator. - 3
Start using tools
Ask Claude Code something like "Check my latest Ahrefs transactions." It will automatically discover and invoke the available Ahrefs tools.
claude mcp add --transport http ahrefs-mcp https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Ahrefs MCP in Claude Code
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Ahrefs MCP today
We host it, we monitor it, we maintain it. You just paste one token.