Enables deployment as a Cloudflare Worker for serverless, edge-distributed access to DataForSEO APIs with auto-scaling and global distribution
Provides real-time search engine results page (SERP) data from Google search results, including organic and paid listings
Built on Node.js runtime environment for server execution and API interactions
Available as an npm package for easy installation and distribution
Retrieves publicly available business reviews and information from Tripadvisor for business data analysis and monitoring
Accesses publicly available business reviews and information from Trustpilot for business data analysis and monitoring
Implemented in TypeScript for type-safe development and better code maintainability
Uses Zod for runtime type validation and schema definition of API parameters
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;
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 APISERP
module → SERP APIKEYWORDS_DATA
module → Keywords Data APIONPAGE
module → OnPage APIDATAFORSEO_LABS
module → 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 thevalue
field within therating
object"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!
Resources
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Enables AI assistants to access comprehensive SEO data through DataForSEO APIs, including SERP results, keyword research, backlink analysis, on-page metrics, and domain analytics. Supports real-time search engine data from Google, Bing, and Yahoo with customizable filtering and multiple deployment options.