-
Notifications
You must be signed in to change notification settings - Fork 16
DD_SITE environment variable ignored for non-default sites (e.g., us5.datadoghq.com) #5
Description
Description
When setting DD_SITE=us5.datadoghq.com, the MCP server ignores this setting and makes requests to api.datadoghq.com instead of api.us5.datadoghq.com, resulting in 403 Forbidden errors.
Steps to Reproduce
- Configure the MCP server with a us5.datadoghq.com account:
{
"mcpServers": {
"datadog": {
"command": "npx",
"args": ["-y", "datadog-mcp-server"],
"env": {
"DD_API_KEY": "<valid_api_key>",
"DD_APP_KEY": "<valid_app_key>",
"DD_SITE": "us5.datadoghq.com"
}
}
}
}-
Make any API call through the MCP server (e.g., list monitors, get logs)
-
Observe 403 Forbidden error
Expected Behavior
Requests should go to api.us5.datadoghq.com
Actual Behavior
Requests go to api.datadoghq.com, which returns 403 Forbidden because the API keys are for a different Datadog site.
Error response from MCP tool:
Error: Client error '403 Forbidden' for url 'https://api.datadoghq.com/api/v2/metrics?page%5Bsize%5D=50'
Verification
The same API keys work correctly when calling the Datadog API directly with the correct site:
curl -s "https://api.us5.datadoghq.com/api/v1/validate" \
-H "DD-API-KEY: $DD_API_KEY" \
-H "DD-APPLICATION-KEY: $DD_APP_KEY"
# Returns 200 OKEnvironment
- datadog-mcp-server: latest (via npx)
- Node.js: v20+
- Datadog site: us5.datadoghq.com
Related
This may be related to #2 but is a distinct issue - #2 was about endpoint differences between logs/metrics on the default site, whereas this issue is about the site setting being completely ignored for non-default regional sites.