Semrush Integration for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Semrush MCP or direct API to run keyword research, analyze competitors, audit SEO health, and optimize ad campaigns through natural language.
Semrush Logo
Gradient Top
Gradient Middle
Gradient Bottom
divider

Supported Tools

Tools
Get ad copiesRetrieves unique ad copies semrush has observed for a specified domain from a regional database, detailing ads seen in google's paid search results.
Get anchor textsUse this action to get a csv report of anchor texts for backlinks pointing to a specified, publicly accessible domain, root domain, or url.
Get authority score profileRetrieves the authority score (as) profile for a specified target, showing the count of referring domains that link to the target for each as value from 0 to 100.
Get backlinksFetches backlinks for a specified domain or url as a csv-formatted string, allowing customization of columns, sorting, and filtering; ensure `display limit` surpasses `display offset` when an offset is used, and note the `urlanchor` filter may have limitations for targets with extensive backlinks.
Backlinks overviewProvides a csv-formatted summary of backlinks, including authority score and link type breakdowns, for a specified and publicly accessible domain, root domain, or url.
Batch comparisonCompares backlink profiles for multiple specified targets (domains, subdomains, or urls) to analyze and compare link-building efforts.
Batch keyword overviewFetches a keyword overview report from a semrush regional database for up to 100 keywords, providing metrics like search volume, cpc, and keyword difficulty.
Broad match keywordFetches broad match keywords for a given phrase; `display sort` and `display filter` parameters are defined but currently not utilized by the api call.
Get categoriesRetrieves categories and their 0-1 confidence ratings for a specified domain, subdomain, or url, with results sorted by rating.
Get categories profileRetrieves a profile of content categories from referring domains for a specified target, analyzing its first 10,000 referring domains and sorting results by domain count.
Get competitor dataRetrieves a customizable csv report of competitors for a specified target (root domain, domain, or url) based on shared backlinks or referring domains, ensuring the target is valid and its type is correctly specified.
Get competitors in organic searchUse to get a domain's organic search competitors from semrush as a semicolon-separated string; `display date` requires 'yyyymm15' format if used.
Get competitors in paid searchRetrieves a list of a domain's competitors in paid search results from a specified regional database.
Get domain ad historyRetrieves a domain's 12-month advertising history from semrush (keywords bid on, ad positions, ad copy) for ppc strategy and competitor analysis; most effective when the domain has ad history in the selected database.
Get domain organic pagesFetches a report on a domain's unique organic pages ranking in google's top 100 search results, with options for specifying database, date, columns, sorting, and filtering.
Get domain organic search keywordsRetrieves organic search keywords for a domain from a specified semrush regional database; `display positions` must be set if `display daily=1` for daily updates.
Get domain organic subdomainsRetrieves a report on subdomains of a given domain that rank in google's top 100 organic search results for a specified regional database.
Get domain paid search keywordsFetches keywords driving paid search traffic to a specified, existing domain using a supported semrush regional database.
Get PLA search keywords for a domainRetrieves product listing ad (pla) search keywords for a specified domain from a semrush regional database.
Compare domainsAnalyzes keyword rankings by comparing up to five domains to find common, unique, or gap keywords, using specified organic/paid types and comparison logic in the `domains` string.
Get historical dataRetrieves monthly historical backlink and referring domain data for a specified root domain, returned as a time series string with newest records first.
Get indexed pagesRetrieves a list of indexed pages from semrush for a specified `target` (root domain, domain, or url) and `target type`, ensuring `target` is publicly accessible, semrush-analyzable, and correctly matches `target type`.
Get keyword difficultyDetermines the keyword difficulty (kd) score (0-100, higher means greater difficulty) for a given phrase in a specific semrush regional database to assess its seo competitiveness.
Keyword overview all databasesFetches a keyword overview from semrush for a specified phrase, including metrics like search volume, cpc, and competition.
Get keyword overview for one databaseFetches a keyword summary for a specified phrase from a chosen regional database.
Get keywords ads historyFetches a historical report (last 12 months) of domains advertising on a specified keyword in google ads, optionally for a specific month ('yyyymm15') or the most recent period, returning raw csv-like data.
Get organic resultsRetrieves up to 100,000 domains and urls from google's top 100 organic search results for a keyword and region, returning a raw string; use `display date` in 'yyyymm15' format (day must be '15') for historical data.
Get paid search resultsFetches domains ranking in google's paid search results (adwords) for a specified keyword and regional database.
Phrase questionsFetches question-format keywords semantically related to a given query phrase for a specified regional database, aiding in understanding user search intent and discovering content ideas.
Get PLA competitorsRetrieves domains competing with a specified domain in google's product listing ads (pla) from a given semrush regional database.
Get PLA copiesFetches product listing ad (pla) copies that semrush observed for a domain in google's paid search results.
Get referring domainsRetrieves a report as a text string (e.
Get referring domains by countryGenerates a csv report detailing the geographic distribution of referring domains (by country, determined via ip address) for a specified, publicly accessible target.
Referring i psFetches ip addresses that are sources of backlinks for a specified target domain, root domain, or url.
Find related keywordsCall this to find related keywords (including synonyms and variations) for a target phrase in a specific regional database; `display date` (if used for historical data) must be 'yyyymm15' for a past month.
Get TLD distributionFetches a report on the top-level domain (tld) distribution of referring domains for a specified target, useful for analyzing geographic or categorical backlink diversity.

Why Use Composio?

AI Native Semrush Integration

  • Supports both Semrush MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Semrush data

Managed Auth

  • Built-in API key handling with secure storage and rotation
  • Central place to manage, scope, and revoke Semrush access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Semrush
  • Scoped, least privilege access to Semrush resources
  • Full audit trail of agent actions to support review and compliance

Connect Semrush MCP Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio claude-agent-sdk
Install the Composio SDK and Claude Agent SDK

Create Tool Router Session

python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
Initialize the Composio client and create a Tool Router session

Connect to AI Agent

python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Semrush tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Get authority score profile for example.com')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
Use the MCP server with your AI agent

Connect Semrush API Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio_openai
Install the Composio SDK

Initialize Composio and Create Tool Router Session

python
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
openai = OpenAI()
session = composio.create(user_id='your-user-id')
Import and initialize Composio client, then create a Tool Router session

Execute Semrush Tools via Tool Router with Your Agent

python
tools = session.tools
response = openai.responses.create(
  model='gpt-4.1',
  tools=tools,
  input=[{
    'role': 'user',
    'content': 'Show me a summary of top backlinks for example.com'
  }]
)
result = composio.provider.handle_tool_calls(
  response=response,
  user_id='your-user-id'
)
print(result)
Get tools from Tool Router session and execute Semrush actions with your Agent

Use Semrush with any AI Agent Framework

Choose a Framework you want to connect Semrush with

OpenAI Agents SDK

OpenAI Agents SDK

Use Semrush MCP with OpenAI Agents SDK

Claude Agents SDK

Claude Agents SDK

Use Semrush MCP with Claude Agents SDK

Google ADK

Google ADK

Use Semrush MCP with Google ADK

Langchain

Langchain

Use Semrush MCP with Langchain

AI SDK

AI SDK

Use Semrush MCP with AI SDK

Mastra AI

Mastra AI

Use Semrush MCP with Mastra AI

LlamaIndex

LlamaIndex

Use Semrush MCP with LlamaIndex

CrewAI

CrewAI

Use Semrush MCP with CrewAI

Pydantic AI

Pydantic AI

Use Semrush MCP with Pydantic AI

Autogen

Autogen

Use Semrush MCP with Autogen

Frequently Asked Questions

Do I need my own developer credentials to use Semrush with Composio?

Yes, Semrush requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Used by agents from

Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.