Invalid Field: 'language_code' (Error 40501) on DataForSEO Labs endpoints
Fixes dataforseo-mcp-server Labs endpoints failing with Invalid Field: 'language_code' (Error 40501) while other tools work. Use this when only the Labs tools error in Claude Desktop via npx. Not for API key or other field errors.
TL;DR: if the DataForSEO MCP server's Labs tools (dataforseo_labs_google_ranked_keywords, dataforseo_labs_google_domain_rank_overview) fail with Invalid Field: 'language_code' (Code: 40501) while other SERP tools work, a cached old npx build is passing language_code to endpoints that do not accept it. Run npx -y dataforseo-mcp-server@latest so npx fetches the current build instead of reusing its cache. The maintainer verified the current build handles the payload correctly, and the reporter confirmed the error is gone after updating.
Error: API Error: Invalid Field: 'language_code'. (Code: 40501)Steps
- Force the latest build:
npx -y dataforseo-mcp-server@latestRe-run the Labs tool.
Expected: no more 40501. Success check: the Labs endpoint returns data.
When to use this
- dataforseo-mcp-server v2.8.10 via npx in Claude Desktop, only Labs tools fail.
When NOT to use this
- All tools fail; check the API key and setup.
- You already run the latest build; report it fresh.
Compatibility
- dataforseo-mcp-server latest.
Variant phrasings
- "dataforseo labs language_code 40501"
- "dataforseo mcp invalid field language_code"
Root cause
The stale cached build sent a field the Labs endpoints do not accept; the current build does not.
Edge cases
- npx caching is the whole story here; the
-yplus@latestbypasses it.
Source: https://github.com/dataforseo/mcp-server-typescript/issues/45