Skip to content

DD_SITE environment variable ignored for non-default sites (e.g., us5.datadoghq.com) #5

@boringsam

Description

@boringsam

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

  1. 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"
      }
    }
  }
}
  1. Make any API call through the MCP server (e.g., list monitors, get logs)

  2. 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 OK

Environment

  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions