The DataForSEO MCP Server provides a standardized interface to access multiple SEO-related APIs for comprehensive data retrieval and analysis:
SERP API: Retrieve real-time search results from Google, Bing, and Yahoo with available location data
KEYWORDS_DATA API: Access keyword research metrics including search volume, CPC, and clickstream data
BACKLINKS API: Analyze backlink profiles, referring domains, anchor text usage, and track changes over time
ONPAGE API: Crawl websites to gather SEO performance metrics
DATAFORSEO_LABS API: Access proprietary keyword, SERP, and domain databases
BUSINESS_DATA API: Collect business reviews from platforms like Google, Trustpilot, and Tripadvisor
DOMAIN_ANALYTICS API: Identify website technologies and access Whois data
Customization: Enable/disable specific modules via environment variables and extend with new tools
Provides access to Google SERP data through DataForSEO's SERP API, allowing retrieval of real-time search engine results including titles, descriptions, and URLs.
Supports server implementation built on Node.js, requiring v14 or higher for handling DataForSEO API requests and responses.
Offers a TypeScript-based implementation for creating and extending tools that interact with DataForSEO APIs.
Utilizes Zod for schema validation of API parameters, ensuring properly structured requests to the DataForSEO endpoints.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DataForSEO MCP Serverwhat are the top 3 organic results for 'best running shoes' on Google?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DataForSEO MCP Server
Model Context Protocol (MCP) server implementation for DataForSEO, enabling AI assistants to interact with selected DataForSEO APIs and obtain SEO data through a standardized interface.
Features
AI_OPTIMIZATION API: provides data for keyword discovery, conversational optimization, and real-time LLM benchmarking;
SERP API: real-time Search Engine Results Page (SERP) data for Google, Bing, and Yahoo;
KEYWORDS_DATA API: keyword research and clickstream data, including search volume, cost-per-click, and other metrics;
ONPAGE API: allows crawling websites and webpages according to customizable parameters to obtain on-page SEO performance metrics;
DATAFORSEO LABS API: data on keywords, SERPs, and domains based on DataForSEO's in-house databases and proprietary algorithms;
BACKLINKS API: comprehensive backlink analysis including referring domains, anchor text distribution, and link quality metrics;
BUSINESS DATA API: publicly available data on any business entity;
DOMAIN ANALYTICS API: data on website traffic, technologies, and Whois details;
CONTENT ANALYSIS API: robust source of data for brand monitoring, sentiment analysis, and citation management;
Related MCP server: Google Search MCP Server
Prerequisites
Node.js (v14 or higher)
DataForSEO API credentials (API login and password)
Installation
Clone the repository:
Install dependencies:
Set up environment variables:
Installation as an NPM Package
You can install the package globally:
Or run it directly without installation:
Remember to set environment variables before running the command:
Building and Running
Build the project:
Run the server:
HTTP Server Configuration
The server runs on port 3000 by default and supports both Basic Authentication and environment variable-based authentication.
To start the HTTP server, run:
Authentication Methods
Basic Authentication
Send requests with Basic Auth header:
Authorization: Basic <base64-encoded-credentials>Credentials format:
username:password
Environment Variables
If no Basic Auth is provided, the server will use credentials from environment variables:
export DATAFORSEO_USERNAME=your_username export DATAFORSEO_PASSWORD=your_password # Optional export DATAFORSEO_SIMPLE_FILTER="false" export DATAFORSEO_FULL_RESPONSE="true"
Cloudflare Worker Deployment
The DataForSEO MCP Server can be deployed as a Cloudflare Worker for serverless, edge-distributed access to DataForSEO APIs.
Worker Features
Edge Distribution: Deploy globally across Cloudflare's edge network
Serverless: No server management required
Auto-scaling: Handles traffic spikes automatically
MCP Protocol Support: Compatible with both Streamable HTTP and SSE transports
Environment Variables: Secure credential management through Cloudflare dashboard
Quick Start
Install Wrangler CLI:
npm install -g wranglerConfigure Worker:
# Login to Cloudflare wrangler login # Set environment variables wrangler secret put DATAFORSEO_USERNAME wrangler secret put DATAFORSEO_PASSWORDDeploy Worker:
# Build and deploy npm run build wrangler deploy --main build/index-worker.js
Configuration
The worker uses the same environment variables as the standard server:
DATAFORSEO_USERNAME: Your DataForSEO usernameDATAFORSEO_PASSWORD: Your DataForSEO passwordENABLED_MODULES: Comma-separated list of modules to enableENABLED_PROMPTS: Comma-separated list of prompt names to enableDATAFORSEO_FULL_RESPONSE: Set to "true" for full API responses
Worker Endpoints
Once deployed, your worker will be available at https://your-worker.your-subdomain.workers.dev/ with the following endpoints:
POST /mcp: Streamable HTTP transport (recommended)
GET /sse: SSE connection establishment (deprecated)
POST /messages: SSE message handling (deprecated)
GET /health: Health check endpoint
GET /: API documentation page
Advanced Configuration
Edit wrangler.jsonc to customize your deployment:
Usage with Claude
After deployment, configure Claude to use your worker:
Available Modules
The following modules are available to be enabled/disabled:
AI_OPTIMIZATION: provides data for keyword discovery, conversational optimization, and real-time LLM benchmarking;SERP: real-time SERP data for Google, Bing, and Yahoo;KEYWORDS_DATA: keyword research and clickstream data;ONPAGE: crawl websites and webpages to obtain on-page SEO performance metrics;DATAFORSEO_LABS: data on keywords, SERPs, and domains based on DataForSEO's databases and algorithms;BACKLINKS: data on inbound links, referring domains and referring pages for any domain, subdomain, or webpage;BUSINESS_DATA: based on business reviews and business information publicly shared on the following platforms: Google, Trustpilot, Tripadvisor;DOMAIN_ANALYTICS: helps identify all possible technologies used for building websites and offers Whois data;CONTENT_ANALYSIS: help you discover citations of the target keyword or brand and analyze the sentiments around it;
Adding New Tools/Modules
Module Structure
Each module corresponds to a specific DataForSEO API:
AI_OPTIMIZATION: AI Optimization APISERPmodule → SERP APIKEYWORDS_DATAmodule → Keywords Data APIONPAGEmodule → OnPage APIDATAFORSEO_LABSmodule → DataForSEO Labs APIBACKLINKS: module → Backlinks APIBUSINESS_DATA: module → Business Data APIDOMAIN_ANALYTICS: module → Domain Analytics APICONTENT_ANALYSIS: module → Content Analysis API
Implementation Options
You can either:
Add a new tool to an existing module
Create a completely new module
Adding a New Tool
Here's how to add a new tool to any new or pre-existing module:
Creating a New Module
Create a new directory under
src/core/modules/for your module:
Create module files:
Register your module in
src/core/config/modules.config.ts:
Initialize your module in
src/main/index.ts:
Field Configuration
The MCP server supports field filtering to customize which data fields are returned in API responses. This helps reduce response size and focus on the most relevant data for your use case.
Configuration File Format
Create a JSON configuration file with the following structure:
Using Field Configuration
Pass the configuration file using the --configuration parameter:
Configuration Behavior
If a tool is configured: Only the specified fields will be returned in the response
If a tool is not configured: All available fields will be returned (default behavior)
If no configuration file is provided: All tools return all available fields
Example Configuration File
The repository includes an example configuration file field-config.example.json with optimized field selections for common tools:
Nested Field Support
The configuration supports nested field paths using dot notation:
"rating.value"- Access thevaluefield within theratingobject"items.demography.age.keyword"- Access deeply nested fields"meta.description"- Access nested object properties
Field Discovery
To discover available fields for any tool:
Run the tool without field configuration to see the full response
Identify the fields you need from the API response
Add those field paths to your configuration file
Creating Your Own Configuration
Copy the example file:
Modify the field selections based on your needs
Use your custom configuration:
What endpoints/APIs do you want us to support next?
We're always looking to expand the capabilities of this MCP server. If you have specific DataForSEO endpoints or APIs you'd like to see supported, please:
Check the DataForSEO API Documentation to see what's available
Open an issue in our GitHub repository with:
The API/endpoint you'd like to see supported;
A brief description of your use case;
Describe any specific features you'd like to see implemented.
Your feedback helps us prioritize which APIs to support next!