MCP ExplorerExplorer

Semrush Mcp

@ProfSynapseon a year ago
1 MIT
FreeCommunity
AI Systems
Semrush MCP Server implements Bounded Context Packs for organized API tools.

Overview

What is Semrush Mcp

Semrush MCP is a Model Context Protocol (MCP) server designed for the Semrush API, utilizing a Bounded Context Packs (BCP) architecture to organize tools into self-contained bundles that correspond to specific domains.

Use cases

Use cases for Semrush MCP include analyzing domain rankings, identifying competitors, conducting keyword research, and exploring related keywords for content optimization.

How to use

To use Semrush MCP, you can call various tools provided by the server, such as semrushDomain for domain analysis and semrushKeyword for keyword research, by specifying the desired operation and parameters in your requests.

Key features

Key features of Semrush MCP include an organized structure of tools into logical bounded contexts, clear boundaries for each BCP, and a maintainable codebase that allows for easy addition of new operations.

Where to use

Semrush MCP can be used in digital marketing, SEO analysis, and competitive research, providing insights into domain performance and keyword strategies.

Content

Semrush MCP Server

A Model Context Protocol (MCP) server for Semrush API with Bounded Context Packs (BCP) architecture.

What is BCP?

Bounded Context Packs (BCP) is an architecture pattern for MCP servers that organizes tools into self-contained bundles that map to a single bounded context. This approach solves the problem of “tool bloat” in MCP servers by:

  1. Organized Structure: Tools are organized into logical bounded contexts
  2. Clear Boundaries: Each BCP has a clear responsibility and domain
  3. Maintainable Codebase: Easy to add new operations to existing BCPs

Architecture

semrush-bcp/
├── src/
│   ├── core/
│   │   ├── types.ts           # Shared type definitions
│   │   ├── server.ts          # MCP server implementation
│   │   └── api-client.ts      # Semrush API client
│   │
│   ├── bcps/
│   │   ├── Domain/
│   │   │   ├── ranks.tool.ts
│   │   │   ├── competitors.tool.ts
│   │   │   └── index.ts       # Domain BCP barrel
│   │   │
│   │   ├── Keyword/
│   │   │   ├── overview.tool.ts
│   │   │   ├── related.tool.ts
│   │   │   ├── difficulty.tool.ts
│   │   │   └── index.ts       # Keyword BCP barrel
│   │   │
│   │   └── Backlinks/
│   │       ├── list.tool.ts
│   │       ├── refdomains.tool.ts
│   │       └── index.ts       # Backlinks BCP barrel
│   │
│   └── index.ts               # Entry point

Available Tools

Domain Tool

The semrushDomain tool provides domain analysis capabilities:

// Get domain ranks
semrushDomain({
  operation: "ranks",
  domain: "example.com",
  database: "us"
})

// Get domain competitors
semrushDomain({
  operation: "competitors",
  domain: "example.com",
  limit: 20
})

Keyword Tool

The semrushKeyword tool provides keyword research capabilities:

// Get keyword overview
semrushKeyword({
  operation: "overview",
  keyword: "digital marketing",
  database: "us"
})

// Get related keywords
semrushKeyword({
  operation: "related",
  keyword: "digital marketing",
  database: "us",
  limit: 50
})

// Get keyword difficulty
semrushKeyword({
  operation: "difficulty",
  keyword: "digital marketing",
  database: "us"
})

Backlinks Tool

The semrushBacklinks tool provides backlink analysis capabilities:

// Get backlinks list
semrushBacklinks({
  operation: "list",
  target: "example.com",
  limit: 100
})

// Get referring domains
semrushBacklinks({
  operation: "refdomains",
  target: "example.com",
  limit: 50
})

Usage

Claude Desktop Configuration

{
  "mcpServers": {
    "semrush": {
      "command": "node",
      "args": [
        "c:\\path\\to\\dist\\index.js"
      ],
      "env": {
        "SEMRUSH_API_KEY": "INSERT_KEY"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Example Conversation

User: I want to analyze example.com

Claude: I can help you analyze example.com using the Semrush API.
[Calls semrushDomain with operation="ranks", domain="example.com"]
Here are the domain metrics for example.com...

User: What are some related keywords to "digital marketing"?

Claude: Let me find related keywords for "digital marketing".
[Calls semrushKeyword with operation="related", keyword="digital marketing"]
Here are some related keywords for "digital marketing"...

Development

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

Adding a New Operation

  1. Create a new tool file in the appropriate BCP directory
  2. Update the main tool’s schema and handler to include the new operation
  3. Update the API client if needed

Example tool file:

import { ToolDefinition } from '../../core/types.js';
import { createSemrushApiClient } from '../../core/api-client.js';

export const tool: ToolDefinition = {
  name: 'example',
  description: 'Example tool',
  inputSchema: {
    type: 'object',
    properties: {
      param: {
        type: 'string',
        description: 'Example parameter'
      }
    },
    required: ['param']
  },
  handler: async (params) => {
    const apiClient = createSemrushApiClient('api-key');
    return await apiClient.someMethod(params.param);
  }
};

License

MIT

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers