MCP server for DataForSEO API integration
npm install @cdilorenzo/mcp-dataforseobash
npm install
`
3. Copy the environment template and fill in your DataForSEO credentials:
`bash
cp .env.template .env
`
4. Edit .env and add your DataForSEO login and password
Running the Server
Development mode with auto-reload:
`bash
npm run dev
`
Production mode:
`bash
npm start
`
Available Endpoints
$3
`
GET /health
`
$3
`
POST /api/serp/google/organic/live
POST /api/serp/google/local_pack/live
POST /api/serp/google/news/live
`
$3
`
POST /api/keywords/google/search_volume/live
POST /api/keywords/google/keywords_for_site/live
POST /api/keywords/google/search_suggestions/live
`
$3
`
POST /api/domain_analytics/rank_tracking/live
POST /api/domain_analytics/domain_intersection/live
`
$3
`
POST /api/backlinks/summary/live
POST /api/backlinks/anchors/live
POST /api/backlinks/competitors/live
`
$3
`
POST /api/on_page/lighthouse/live
POST /api/on_page/instant_pages
`
$3
`
POST /api/content_analysis/search/live
POST /api/content_analysis/categories
`
$3
`
POST /api/business_data/google/my_business_info/live
POST /api/business_data/google/reviews/live
`
$3
`
POST /api/app_data/google/app_info/live
POST /api/app_data/google/app_reviews/live
`
$3
`
POST /api/merchant/google/products/live
POST /api/merchant/google/sellers/live
`
$3
`
POST /api/dataforseo_labs/google/historical_serps/live
POST /api/dataforseo_labs/google/competitors_domain/live
`
Example Requests
$3
`json
POST /api/serp/google/organic/live
{
"target": "google.com",
"location_name": "United States",
"keywords": ["example search term"]
}
`
$3
`json
POST /api/keywords/google/search_volume/live
{
"keywords": [
"example keyword 1",
"example keyword 2"
],
"location_name": "United States"
}
`
$3
`json
POST /api/backlinks/summary/live
{
"target": "example.com"
}
`
$3
`json
POST /api/business_data/google/reviews/live
{
"business_id": "ChIJ...",
"location_name": "United States"
}
`
Error Handling
The server includes comprehensive error handling and will return appropriate HTTP status codes along with error messages when issues occur. All API responses follow this format:
Success:
`json
{
"status_code": 20000,
"status_message": "Ok.",
"tasks": [
{
"status_code": 20000,
"status_message": "Ok.",
"result": [
// ... result data
]
}
]
}
`
Error:
`json
{
"error": "Error message",
"details": {
"status_code": 40000,
"status_message": "Error details"
}
}
``