Skip to main content
All connectors
qbash Connectors / Ahrefs

Ahrefs MCP serverand Python AI tasks

qbash hosts a Ahrefs MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.

Developers use qbash Tasks to write cloud-hosted Python functions that pair Ahrefs with models such as Claude and GPT.

MCP server

Build a Ahrefs MCP server

Give ChatGPT, Claude and your other AI tools access to Ahrefs through one server. You pick which Ahrefs tools it shares, and you can add other connectors, memory folders and Tasks to the same server.

How to set it up

  1. Connect Ahrefs on the qbash Connectors page.
  2. Create an MCP server and add the Ahrefs tools you want to share.
  3. Paste the server URL into your client. It connects with OAuth or an access token.

Python AI task

Write a Ahrefs task in Python

A qbash Task is a hosted Python function that calls Ahrefs and AI models.

Find keywords close to page one

Review up to 100 organic keywords and ask an inline prompt to identify those ranking just outside the top ten.

main.py
report = qbash.integrations.ahrefs.organic_keywords(
target="example.com", country="us", limit=100,
)
keywords = [row for row in report["keywords"]
if 11 <= (row.get("position") or 0) <= 20]
if keywords:
analysis = qbash.ai.run_prompt(
slug="ahrefs-keyword-review",
variables={"keywords": json.dumps(keywords)},
)
qbash.output(analysis)
else:
qbash.output("No positions 11–20 in this page of keywords.")
Sample organic_keywords response
{
"status": "success",
"target": "example.com",
"keywords": [
{
"keyword": "python workflow scheduling",
"position": 14,
"volume": 900,
"traffic": 12
}
],
"count": 1
}

What the Ahrefs connector can do

  • Get Domain Rating and Ahrefs Rank for a domain
  • Get overall SEO metrics: traffic, keywords, backlinks
  • List backlinks pointing to a domain
  • Get referring domains with their metrics
  • Get organic keywords a domain ranks for
  • Get top pages by organic traffic
  • Get organic competitors in SERPs
  • Get keyword metrics: volume, difficulty, CPC
  • List broken backlinks pointing to a domain or URL
  • Summarize backlink anchor text for a domain or URL
  • Find keyword ideas that contain one or more terms
See every Ahrefs method in the SDK Reference

qbash Tasks: AI applications in Python

A Task is a Python function that calls Ahrefs, your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.

AnthropicOpenAIGeminixAI

Run Tasks on a schedule or from your team's tools

OpenAIAnthropicGrokGmailSlackGitHub+ more
  • Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
  • Version controlled Every save is a revision you can compare and roll back.
  • Logged Each run records its inputs, output, errors and what started it.
  • Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.

Ahrefs MCP questions

Does Ahrefs have an official MCP server?

Yes. Ahrefs hosts a remote MCP server at api.ahrefs.com/mcp/mcp, and the qbash connector uses that server. qbash adds the Python side, where scheduled tasks call Ahrefs API v3 directly.

Why does Ahrefs need two different keys?

The Ahrefs MCP server accepts an MCP key, which Ahrefs offers on Lite plans and above. The Python methods call API v3, which takes its own key. Both are managed at ahrefs.com/account/api.

Build a Ahrefs task

Write it in Python with AI steps, and qbash hosts it with versions and run logs.

Build a task

Build a Ahrefs MCP server

Pick the Ahrefs tools to share and connect ChatGPT, Claude or Grok Bot.

Build an MCP server