How to Use OpenSEO for Competitor Analysis: MCP Tools and Strategy Library Guide

OpenSEO orchestrates competitor analysis through a React-based Strategy Library UI, MCP (Multi-Channel Prompt) tools, and DataForSEO Labs APIs, allowing you to discover SERP competitors programmatically via the find_serp_competitors tool.

OpenSEO provides a comprehensive competitor analysis workflow that combines guided UI experiences with AI-driven data retrieval. This open-source SEO platform leverages DataForSEO Labs APIs to identify search competitors while maintaining a lightweight architecture focused on orchestration rather than heavy data processing.

Understanding the Three-Layer Architecture

OpenSEO implements competitor analysis across three distinct layers that work together to provide a seamless research experience.

Frontend Strategy Library

The Strategy Library provides a React-based interface that guides users through four core competitor-research tactics. The available tactics are defined in web/src/lib/strategy-libraries.ts, which exports a structured list of analysis methods. The landing page at /library/competitive-analysis renders an FAQ and navigation links to individual tactic pages.

Each tactic page, such as Find Your Real Competitors, is implemented as a thin wrapper component. These wrappers load Markdown content and pass strategy metadata to a shared LibrarySpokePage component, as seen in web/src/routes/_marketing/library/competitive-analysis/find-your-real-competitors.tsx.

MCP Tools Layer

The MCP (Multi-Channel Prompt) layer exposes server-side TypeScript modules that provide tool endpoints for the OpenSEO AI agent. The primary competitor analysis tool is registered under the name find_serp_competitors in src/server/mcp/tools/dataforseo-research-tools.ts.

This file defines the tool's Zod input schema (domainTargetSchema, keywords, market, etc.) and output handling. When invoked, the tool validates requests against these schemas before forwarding them to the DataForSEO Labs client. The normalized response conforms to competitors: z.array(looseObjectOutputSchema), enabling downstream UI components to render structured tables and charts.

DataForSEO Integration

The DataForSEO Labs integration provides a thin HTTP client wrapper around the official DataForSEO endpoints. The createDataforseoClient function in src/server/lib/dataforseo/labs.ts builds a reusable authenticated client, while labs.serpCompetitors executes the actual "SERP competitors" lookup.

This architecture means OpenSEO manages only authentication and budget tracking (deducting credits per keyword), while DataForSEO handles the heavy lifting of SERP scraping, keyword-ranking aggregation, and traffic modeling.

Calling the find_serp_competitors Tool

The find_serp_competitors tool serves as the primary interface for competitor discovery. It accepts a target domain, seed keywords, and market parameters, then returns a ranked list of competing domains with visibility metrics.

The tool stores competitor lists in the project's shared memory via src/server/mcp/tools/project-context.ts, allowing other MCP tools to reference these competitors in subsequent analyses. This shared context enables complex multi-step workflows where competitor data feeds into gap analysis or link-building strategies.

Three Methods to Execute Competitor Analysis

You can interact with OpenSEO's competitor analysis capabilities through three primary entry points: the MCP HTTP API, the direct library client, or React hooks.

Method 1: MCP HTTP Endpoint

For UI integrations and external applications, call the MCP endpoint with a structured payload:

{
  "tool": "find_serp_competitors",
  "projectId": "proj_12345",
  "target": "example.com",
  "keywords": ["keyword one", "keyword two"],
  "market": { "country": "US" },
  "locationCode": "US",
  "languageCode": "en"
}

The handler validates this payload against the Zod schema in dataforseo-research-tools.ts and returns a structured response:

{
  "competitors": [
    { "domain": "competitorA.com", "visibility": 12.3 },
    { "domain": "competitorB.net", "visibility": 8.7 }
  ]
}

Method 2: Direct DataForSEO Client

For custom scripts or server-side automation, instantiate the client directly:

import { createDataforseoClient } from "@/server/lib/dataforseo";

const client = createDataforseoClient({ 
  apiKey: process.env.DATAFORSEO_KEY 
});

const result = await client.labs.serpCompetitors({
  target: "example.com",
  keywords: ["keyword one", "keyword two"],
  locationCode: "US",
  languageCode: "en"
});

console.log(result.competitors);
// Output: [{ domain: "competitorA.com", visibility: 12.3 }, …]

Method 3: React Component Integration

For frontend applications, use the built-in TanStack Query hook and table components:

import { CompetitorTable } from "@/client/features/backlinks/BacklinksTable";
import { useMcpQuery } from "@/client/tanstack-db/queryClient";

function CompetitorOverview({ domain }: { domain: string }) {
  const { data } = useMcpQuery("find_serp_competitors", {
    target: domain,
    keywords: ["example keyword"]
  });

  return data ? (
    <CompetitorTable rows={data.competitors} />
  ) : (
    <Spinner />
  );
}

Summary

  • OpenSEO's competitor analysis combines a React Strategy Library for UI guidance, MCP tools for AI agent integration, and DataForSEO Labs for data retrieval.
  • The find_serp_competitors tool in src/server/mcp/tools/dataforseo-research-tools.ts serves as the primary interface, handling input validation via Zod schemas.
  • Configuration resides in strategy-libraries.ts, while the DataForSEO client implementation lives in src/server/lib/dataforseo/labs.ts.
  • Three integration patterns are supported: HTTP API endpoints, direct client instantiation, and React hooks with pre-built table components.
  • Competitor data persists in project context, enabling cross-tool workflows for comprehensive SEO analysis.

Frequently Asked Questions

What is the MCP tool in OpenSEO?

The MCP (Multi-Channel Prompt) tool is a server-side TypeScript module that exposes standardized endpoints for OpenSEO's AI agent. Specifically, the find_serp_competitors tool validates inputs using Zod schemas and orchestrates calls to the DataForSEO Labs API, returning normalized competitor data that the frontend can render immediately.

How does OpenSEO store competitor data between sessions?

OpenSEO persists competitor lists in the project's shared memory through src/server/mcp/tools/project-context.ts. This storage mechanism allows the find_serp_competitors tool to save results where other tools—such as those performing keyword gap analysis or backlink research—can access them, creating cohesive multi-step SEO workflows.

Do I need a separate DataForSEO subscription to use competitor analysis?

Yes, OpenSEO acts as an orchestration layer that requires valid DataForSEO API credentials. The createDataforseoClient function manages authentication using your API key, and the platform tracks credit consumption per keyword. All SERP scraping and traffic modeling occur within DataForSEO's infrastructure, keeping the OpenSEO codebase lightweight.

Can I customize the competitor analysis workflow for specific industries?

Absolutely. The Strategy Library architecture in web/src/lib/strategy-libraries.ts defines the four default tactics, but you can extend this by creating new route wrappers in web/src/routes/_marketing/library/competitive-analysis/. Each wrapper can load custom Markdown content and invoke the find_serp_competitors tool with industry-specific keyword sets and market parameters.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →