Supports deployment as a Cloudflare Worker for serverless, edge-distributed access to DataForSEO APIs
Provides access to Google search engine results page (SERP) data through the SERP API module
Runs on Node.js (v14 or higher) as the server runtime environment
Offers access to business reviews and publicly shared business information from Tripadvisor through the BUSINESS_DATA API
Provides access to business reviews and publicly shared business information from Trustpilot through the BUSINESS_DATA API
Implements the MCP server in TypeScript, allowing for type-safe interaction with DataForSEO APIs
Uses Zod for schema validation and parameter definition in the API tools
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
- 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:
- Credentials format:
username:password
- Environment Variables
- If no Basic Auth is provided, the server will use credentials from environment variables:
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:
- Configure Worker:
- Deploy Worker:
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 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:
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:
SERP
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
This server cannot be installed
Enables AI assistants to interact with DataForSEO APIs and obtain SEO data including SERP results, keyword research, on-page metrics, backlink analysis, and domain analytics through a standardized interface.
Related MCP Servers
- AsecurityAlicenseAqualityAI assistants to query and analyze Azure Data Explorer databases through standardized interfaces.Last updated -444PythonMIT License
- -securityFlicense-qualityA stdio-based server that enables interaction with the DataForSEO API through the Model Context Protocol, allowing users to fetch SEO data including search results, keywords data, backlinks, on-page analysis, and more.Last updated -127JavaScript
- -securityFlicense-qualityEnables LLMs to interact with DataForSEO and other SEO APIs through natural language, allowing for keyword research, SERP analysis, backlink analysis, and local SEO tasks.Last updated -63447TypeScript
- -securityFlicense-qualityProvides AI assistants with access to Semrush SEO API functionality including domain analytics, keyword research, backlink analysis, and competitor insights.Last updated -5TypeScript