Skip to main content
Glama
metehan777

Semrush MCP Server

by metehan777

competitor_research

Identify organic competitors for any domain to analyze market positioning and inform SEO strategy.

Instructions

Find organic competitors for a domain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes
databaseNo
limitNo

Implementation Reference

  • Implements the handler logic for the 'competitor_research' tool by parsing input arguments using the schema and calling the Semrush API 'domain_organic_competitors' endpoint to fetch organic competitors data for the given domain.
    case 'competitor_research': {
      const { domain, database, limit } = CompetitorResearchSchema.parse(args);
      data = await callSemrushAPI('domain_organic_competitors', { 
        domain,
        database,
        display_limit: limit,
        export_columns: 'Dn,Cr,Np,Or,Ot,Oc,Ad,At,Ac',
      });
      break;
  • Zod schema defining the input structure for the 'competitor_research' tool, including required domain and optional database and limit parameters.
    const CompetitorResearchSchema = z.object({
      domain: z.string().describe('Domain to analyze'),
      database: z.string().default('us').describe('Database code'),
      limit: z.coerce.number().default(10).describe('Number of competitors'),
    });
  • src/index.ts:210-218 (registration)
    Registers the 'competitor_research' tool in the MCP server's listTools response, specifying its name, description, and referencing the input schema.
    {
      name: 'competitor_research',
      description: 'Find organic competitors for a domain',
      inputSchema: {
        type: 'object',
        properties: CompetitorResearchSchema.shape,
        required: ['domain'],
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/metehan777/semrush-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server