
This is a two-part setup: generate an API key in Ahrefs and paste it into SourcetoMCP, then add SourcetoMCP as a custom connector inside Claude. Ahrefs is the one source here where reads cost you money, so it is worth understanding the unit budget before you point an agent at it. For the full list of what the connector can pull, see the Ahrefs MCP server page.
Before you start
You'll need a SourcetoMCP account with at least one brand created, an Ahrefs subscription that includes API access, and a Claude account. Ahrefs includes an API unit allowance from its Lite plan upwards, and those units are shared across the API, Ahrefs Connect and Ahrefs' own MCP server, so anything you spend here comes out of the same monthly pool.
Generate an Ahrefs API key
- 1In Ahrefs, open Account settings, then API keys.
- 2Create a new key and give it a label you will recognise later.
- 3Copy it straight away and keep the tab open until the connection is done.
Two things about Ahrefs keys that catch people out. They expire one year after creation, and they stop working if the person who created them leaves the workspace. There is no refresh step in either case: a dead key is replaced by pasting a new one. If a shared workspace is involved, generate the key from an account that is not about to change hands.
Connect Ahrefs to SourcetoMCP
- 1From your dashboard, go to
Connectors→Add a connection. - 2Find the Ahrefs card and select Connect.
- 3Paste the API key and confirm. SourcetoMCP checks it against Ahrefs directly.
Your workspace then appears on the Connections page like any other source. There is no consent screen to approve, because this connector uses your own key rather than an Ahrefs app.
Add SourcetoMCP as a connector in Claude
Claude adds every custom connector the same way, under Customize then Connectors. These steps are that flow pointed at SourcetoMCP.
- 1In SourcetoMCP, open
Connect an agentfrom the dashboard sidebar and copy your server address (it looks likehttps://sourcetomcp.com/api/mcp). - 2In Claude, open Customize, then Connectors.
- 3Select +, then Add custom connector.
- 4Paste in your server address. You can leave Advanced settings alone, because SourcetoMCP runs its own OAuth and never needs a client ID or secret from you.
- 5Click Add.
- 6The first time Claude uses it, you'll be asked to sign in to SourcetoMCP and approve access. After that it reconnects on its own.
On a Team or Enterprise plan, only an Owner can add a connector, from Organization settings, then Connectors. Everyone else then opens Customize → Connectors and clicks Connect to sign in with their own SourcetoMCP account.
Ask Claude about any domain
Switch the connector on per conversation: select the + button, choose Connectors, and toggle SourcetoMCP on.
The useful part is that you do not have to own or verify a domain to ask about it, which is what separates this from Search Console. Competitors are as readable as your own site. Try something like:
- 1
Who links to my closest competitor but not to me? - 2
Which of my backlinks are broken? - 3
What are the top pages on this domain by organic traffic? - 4
Give me keyword ideas around this term with volume and difficulty.
If you also connect Search Console and Google Analytics, one question can span all three: what Ahrefs says a competitor ranks for, what you actually get impressions on, and what those visitors then do.
What each question costs you
Every Ahrefs read consumes API units from your own allowance. Ahrefs prices a request at the greater of 50 units or the per-row cost multiplied by the number of rows, where the per-row cost depends on which fields are involved. A careless request against a large backlink profile can eat a visible slice of a month.
SourcetoMCP is built around that. Each operation fixes the fields it asks for rather than letting an agent request everything, caps how many rows it will pull well below the Ahrefs default, and reports the units actually consumed back to Claude with the result. So you can ask Claude what a query cost, and it can tell you from the response rather than estimating. Ask it to check your remaining allowance before a big analysis and it can do that too.
Nothing here writes
All 17 Ahrefs operations read. There is no write surface at all: Claude cannot change a project, edit a workspace setting, or alter anything in your Ahrefs account. It is the only connector in SourcetoMCP where that is true of every single operation, so the usual caution about confirming write actions does not apply.
Troubleshooting
The key was rejected: it is wrong, has been revoked, or has passed its one-year expiry. Generate a fresh one under Account settings → API keys and reconnect.
It worked last month and now fails: check whether the person who created the key still belongs to the workspace. Ahrefs invalidates keys when their creator leaves.
Claude reports running out of units: the allowance is monthly and shared with anything else using your Ahrefs API, including Ahrefs' own MCP server if you use that too. Ask Claude to check the remaining allowance before large requests.
There is no Connectors option under Customize: on Team and Enterprise plans an Owner adds connectors for the whole organisation. Ask an Owner to add it from Organization settings → Connectors.
Revoking access
Remove the workspace from your Connections page in SourcetoMCP, or delete the key in Ahrefs under Account settings → API keys. Deleting the key is the more thorough option, since it also cuts off anything else that key was used for.
Still stuck?
Reach us at [email protected].