Ahrefs MCP Server
1234567891011121314151617181920212223const mcpConfig = new MCPConfiguration({ servers: { // Example 1: HTTP-based server (e.g., external web service or API gateway) server: { type: "http", url: "https://mcp.composio.dev/ahrefs/your-api-key-here", // URL of the MCP endpoint }, }, }); // Fetch all tools from all configured MCP servers into a flat array const allTools = await mcpConfig.getTools(); const agent = new Agent({ name: "MCP Agent", instructions: "An assistant that can use MCP tools configured at startup", llm: new VercelAIProvider(), model: openai("gpt-4o"), tools: allTools, // Add MCP tools during initialization }); // Remember to disconnect later // await mcpConfig.disconnect();
Ahrefs MCP Tools
The Ahrefs Model Context Protocol (MCP) server empowers your AI agents with direct access to Ahrefs' powerful SEO toolkit. Discover how your AI agents can automate complex SEO tasks, from in-depth backlink analysis and keyword research to competitor tracking and site audits. Below, explore the specific capabilities and how you can integrate them into your AI agent workflows via MCP for enhanced SEO automation and intelligence.
How to Get Comprehensive Backlink Statistics with Ahrefs?
Get total backlink insight in a matter of clicks. See referring domains, anchor texts, and detect link velocity trends - great for finding new link opportunities and tracking the overall health of your backlink profile.
Backlinks Statistics
stats_retrieval
Analyze Outgoing Link Health to Ensure Profile Quality
Check the quality of your outbound links to avoid any potential SEO issues. Detect potentially negative links, understand your external linking behavior, and be authoritative with presence without hours of handbook reference checking.
Outlinks Statistics
outlinks_stats_composio
How to Track Historical Keyword Ranking Trends
Search your site's keyword historical rankings to see trends over time. Observe how positions have changed, locate emerging keyword opportunities, and understand your site's history of SEO with rich historical data.
Keywords History
site_explorer_keywords_history
How to Retrieve Full Backlink Profiles for Analysis
See your whole backlink profile instantly. Analyze all links pointing to your domain or specific URL, keeping competitive intelligence a breeze and allowing you to find profitable new link building possibilities without the tedium of hand labor.
Backlinks
all_backlinks
How to Decode Anchor Text Profiles for Better SEO
Decipher the way other websites are linking to yours by analyzing anchor text trends. Tweak your anchor text strategy on real data and craft a natural, effective backlink profile that performs.
Anchors
anchor_data
How to Identify and Analyze Organic Search Competitors with Ahrefs MCP?
Discover who you're really competing against in natural search results. Discover competitors you don't even know exist, understand the competitive landscape, and optimize your SEO strategies to outcompete them.
Organic Competitors
competitors_overview
Uncover User Intent with Keyword Search Suggestions
Reveal what people are really searching for using keyword suggestions based on real search data. Understand user intent, create helpful long-tail keyword ideas, and create content that is what your audience is searching for.
Search Suggestions
suggestions_explorer
How to Monitor Keyword Rankings and SEO Performance with Ahrefs MCP?
Track your keyword positions over time with a complete performance dashboard. Automatically monitor position fluctuations and get detailed reports of your SEO performance without the inconvenience of manual tracking.
Rank Tracker Overview
rank_tracker_overview
Analyze SERP Features and Competitive Dynamics
Look at the full SERP landscape for all target keywords. See which URLs are ranking, what SERP features are showing (e.g., featured snippets), and gain insights on the competitive dynamics to maximize your content strategy.
SERP Overview
serp_overview
Access AhrefsBot IP Ranges for Crawler Whitelisting
Get the full list of IP ranges used by the AhrefsBot spider. Perfect for server configuration, granting proper crawler permission, and avoiding unnecessary blocking of valid bots that can impact your site's crawling.
Crawler IP Ranges
crawler_ip_ranges