# Configure the Semrush MCP Server

Connect Semrush's official hosted MCP server to a Dtwo gateway via OAuth.

## Overview

Semrush operates an official hosted MCP server at `mcp.semrush.com` for domain, keyword, backlink, traffic, and site audit research. Access is authorized through OAuth 2.1 with dynamic client registration, so there's no OAuth app to create in Semrush first — the gateway registers itself when a user authorizes. Semrush does need to add your gateway's callback URL to its allowlist before the first authorization.

## 1. Configure Semrush

1. Go to <a href="https://www.semrush.com/company/contacts/" target="_blank" rel="noopener noreferrer">Semrush's contact page</a> and click **Contact Support**.
2. In the chat window, ask Semrush to add your gateway to their MCP allowlist. For example:

   ```text
   Request: add an OAuth redirect URI to the Semrush MCP allowlist
   Agent name: <AGENT_NAME>
   Callback URL: <CALLBACK_URL>
   Context: I'm connecting to the Semrush MCP server through a gateway.
   ```

   Replace `<AGENT_NAME>` with whatever name you want Semrush to show for your agent, and `<CALLBACK_URL>` with your gateway's OAuth callback URL, found in the Overview tab for your gateway in the Dtwo UI.
3. Semrush support will open a ticket for your request. Wait for confirmation that the ticket has been resolved before moving on to the next step.

## 2. Add the MCP server to your gateway config

Go to your gateway in the Dtwo UI and open **Configuration → Advanced**. In the `mcp_servers` section add the following entry:

```yaml
  - name: semrush
    description: "Semrush's official hosted MCP server for keyword, domain, backlink, and traffic research."
    url: https://mcp.semrush.com/v2/mcp
    transport_type: streamablehttp
    authentication:
      type: oauth
      grant_type: authorization_code
      issuer: "https://oauth.semrush.com"
      redirect_uri: "<CALLBACK_URL>"
      scopes:
        - mcp.access
      dcr_enabled: true
```

Replace the placeholder value:

- `<CALLBACK_URL>` — your Dtwo gateway's OAuth callback URL, found in the Overview tab for your gateway in the Dtwo UI.

## 3. Deploy and verify

Save the configuration and deploy the gateway.

Then, in your AI client, ask it to authorize Semrush via the gateway. This opens the Semrush sign-in and consent screen — sign in as the user whose permissions the agent should inherit, and approve the consent prompt. Once authorized, confirm the server's tools appear and run a quick call, such as a `domain_overview` for a domain you already track, to make sure the connection works.

If the tools don't appear after you authorize, refresh the tool list in your AI client — some clients don't pick it up automatically.

---

Having trouble? Email [support@dtwo.ai](mailto:support@dtwo.ai).