KosmoKrator

seo

Ahrefs MCP, CLI, and Lua Integration for AI Agents

Ahrefs integration docs for AI agents: MCP gateway setup, Ahrefs CLI commands, Lua API reference, credentials, and function schemas.

7 functions 7 read 0 write API key auth

Ahrefs for agents

Credentials can be configured manually in web or CLI hosts.

Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.

Machine-Readable Metadata
integration_slug
ahrefs
route_slug
ahrefs
package
ahrefs
auth_strategy
api_key API key
cli_setup_supported
true
cli_runtime_supported
true
mcp_gateway_supported
true
lua_supported
true
supports_multi_account
true

Quick Links

Ahrefs MCP Client Matrix

Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for Ahrefs.

Ahrefs CLI Matrix

Use these pages for direct Ahrefs CLI workflows in scripts, CI, cron, and agent wrappers.

Function Catalog

FunctionTypeParametersDescription
ahrefs.ahrefs_list_backlinks Read read 4 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.
ahrefs.ahrefs_list_referring_domains Read read 4 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.
ahrefs.ahrefs_list_organic_keywords Read read 4 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.
ahrefs.ahrefs_list_pages Read read 4 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.
ahrefs.ahrefs_list_paid_keywords Read read 3 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.
ahrefs.ahrefs_list_anchors Read read 3 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.
ahrefs.ahrefs_get_current_user Read read 0 Get the authenticated Ahrefs user's profile information. Returns account details like name, email, and subscription plan. Use this to verify API connectivity.