seo
Ahrefs MCP Integration for OpenAI Agents SDK
Connect Ahrefs to OpenAI Agents SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.
Connect Ahrefs to OpenAI Agents SDK
Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.
Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with
--write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.
Ahrefs MCP Config for OpenAI Agents SDK
Use headless JSON commands for CI-style execution and MCP for agent tool discovery.
{
"mcpServers": {
"kosmokrator-ahrefs": {
"type": "stdio",
"command": "kosmo",
"args": [
"mcp:serve",
"--integration=ahrefs",
"--write=deny"
]
}
}
} Run the Gateway Manually
kosmokrator mcp:serve --integration=ahrefs --write=deny Why Use KosmoKrator Here
Expose only Ahrefs instead of a broad multi-service tool list.
Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.
Start read-only, then opt into ask or allow for trusted workspaces.
Ahrefs Tools Visible to OpenAI Agents
OpenAI Agents sees stable MCP tool names generated from the Ahrefs integration catalog.
| MCP tool | Source function | Type | Description |
|---|---|---|---|
integration__ahrefs__ahrefs_list_backlinks | ahrefs.ahrefs_list_backlinks | Read | List backlinks pointing to a target website or URL. Use this to analyze a site's link profile, find linking pages, anchor texts, and backlink quality metrics. |
integration__ahrefs__ahrefs_list_referring_domains | ahrefs.ahrefs_list_referring_domains | Read | List referring domains that link to a target website. Shows domain-level metrics like domain rating (DR), the number of backlinks from each domain, and first/last seen dates. |
integration__ahrefs__ahrefs_list_organic_keywords | ahrefs.ahrefs_list_organic_keywords | Read | List organic keywords that a target website or URL ranks for in search results. Returns keyword, position, search volume, traffic, keyword difficulty, and the ranking URL. |
integration__ahrefs__ahrefs_list_pages | ahrefs.ahrefs_list_pages | Read | List top pages for a target website ranked by traffic or other metrics. Returns page URLs along with traffic data, keyword counts, and backlink information. |
integration__ahrefs__ahrefs_list_paid_keywords | ahrefs.ahrefs_list_paid_keywords | Read | List paid (PPC) keywords that a target website bids on in search advertising. Returns keyword, position, search volume, CPC, traffic, and the landing page URL. |
integration__ahrefs__ahrefs_list_anchors | ahrefs.ahrefs_list_anchors | Read | List anchor texts used in backlinks pointing to a target website. Shows anchor text distribution, the number of referring pages using each anchor, and backlink counts. |
integration__ahrefs__ahrefs_get_current_user | ahrefs.ahrefs_get_current_user | Read | Get the authenticated Ahrefs user's profile information. Returns account details like name, email, and subscription plan. Use this to verify API connectivity. |