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:
- 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 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
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Ein Model Context Protocol-Server, der Claude die Interaktion mit DataForSEO-APIs ermöglicht und Zugriff auf SEO-Daten einschließlich SERPs, Keyword-Recherche, On-Page-Metriken und Domänenanalysen gewährt.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that allows Claude to make API requests on your behalf, providing tools for testing various APIs including HTTP requests and OpenAI integrations without sharing your API keys in the chat.Last updated -Python
- -securityFlicense-qualityA Model Context Protocol server that enables Claude to perform Google Custom Search operations by connecting to Google's search API.Last updated -2Python
- AsecurityAlicenseAqualityA Model Context Protocol server that enables Claude to perform web research by integrating Google search, extracting webpage content, and capturing screenshots.Last updated -385913MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables Claude to perform advanced web research with intelligent search queuing, enhanced content extraction, and deep research capabilities.Last updated -371TypeScriptMIT License