The DataForSEO MCP server provides a standardized interface to access various DataForSEO API services using the Model Context Protocol (MCP). This server allows you to query search engine results, keyword data, backlinks, and other SEO-related information through a simple JSON-based interface.
You can run the DataForSEO MCP server directly with npx:
npx @skobyn/mcp-dataforseo --config '{"username":"your_username","password":"your_password"}'
Or install it globally for easier access:
npm install -g @skobyn/mcp-dataforseo
mcp-dataforseo --config '{"username":"your_username","password":"your_password"}'
The server operates through standard input/output, accepting JSON requests and returning JSON responses:
echo '{"type":"dataforseo_serp","keyword":"artificial intelligence"}' | npx @skobyn/mcp-dataforseo --config '{"username":"your_username","password":"your_password"}'
Query search engine results:
{
"type": "dataforseo_serp",
"keyword": "artificial intelligence",
"location_code": 2840,
"language_code": "en",
"device": "desktop",
"os": "windows"
}
Get information about specific keywords:
{
"type": "dataforseo_keywords_data",
"keywords": ["seo", "search engine optimization"],
"location_code": 2840,
"language_code": "en"
}
Analyze backlinks for a domain:
{
"type": "dataforseo_backlinks",
"target": "example.com",
"limit": 100
}
Analyze on-page SEO factors:
{
"type": "dataforseo_onpage",
"url": "https://example.com",
"check_spell": true,
"enable_javascript": true
}
Get analytics for a specific domain:
{
"type": "dataforseo_domain_analytics",
"domain": "example.com"
}
Get data about mobile applications:
{
"type": "dataforseo_app_data",
"app_id": "com.example.app"
}
Query e-commerce product data:
{
"type": "dataforseo_merchant",
"keyword": "bluetooth speakers",
"location_code": 2840,
"language_code": "en"
}
Get local business information:
{
"type": "dataforseo_business_data",
"keyword": "pizza delivery",
"location_code": 2840,
"language_code": "en"
}
Here's how to integrate the MCP server in your Node.js code:
const { spawn } = require('child_process');
// Start the MCP server
const server = spawn('npx', ['@skobyn/mcp-dataforseo', '--config', '{"username":"your_username","password":"your_password"}']);
// Define the request
const request = {
type: 'dataforseo_serp',
keyword: 'artificial intelligence'
};
// Send the request
server.stdin.write(JSON.stringify(request) + '\n');
server.stdin.end();
// Process the response
server.stdout.on('data', (data) => {
const response = JSON.parse(data.toString());
console.log(response);
});
// Handle errors
server.stderr.on('data', (data) => {
console.error(`Error: ${data}`);
});
Instead of passing credentials in the config parameter, you can use environment variables:
export DATAFORSEO_USERNAME=your_username
export DATAFORSEO_PASSWORD=your_password
npx @skobyn/mcp-dataforseo
This approach is often preferred for security reasons, especially in production environments.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "dataforseo" '{"command":"npx","args":["@skobyn/mcp-dataforseo"],"config":{"username":"your_username","password":"your_password"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"dataforseo": {
"command": "npx",
"args": [
"@skobyn/mcp-dataforseo"
],
"config": {
"username": "your_username",
"password": "your_password"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"dataforseo": {
"command": "npx",
"args": [
"@skobyn/mcp-dataforseo"
],
"config": {
"username": "your_username",
"password": "your_password"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect