Skip to content

/doctor reports MCP server invalid for missing DD_API_KEY/DD_APPLICATION_KEY on OAuth installs #18

@nicoyoung

Description

@nicoyoung

Describe the bug

On a default (OAuth) installation with no Datadog API keys set, /doctor reports the MCP server as invalid for missing DD_API_KEY / DD_APPLICATION_KEY, even though the server authenticates via OAuth and works correctly.

The root cause: in .dd_claude-code_mcp.json the two headers are declared as ${DD_API_KEY} / ${DD_APPLICATION_KEY} with no default. Claude Code's static MCP-config validator treats a ${VAR} reference without a default as required, so on OAuth installs (where these are unset) it flags the server. The ${DD_MCP_TOOLSETS:-} variable in the same file already uses an empty default and is not flagged.

To reproduce

  1. Install the datadog plugin and leave auth at the default (OAuth, no API keys set).
  2. Authenticate: /mcp, select plugin:datadog:mcp, choose the authentication option. The server connects and tools load.
  3. Run /doctor.
  4. Observe:
MCP server mcp invalid: Missing environment variables: DD_API_KEY, DD_APPLICATION_KEY

Expected behavior

With OAuth auth and no API keys set, /doctor should report the server as valid. The API-key headers should be optional.

Environment

  • OS: macOS (Darwin 25.3.0)
  • Client version: 2.1.170
  • Plugin version: 0.7.13

Proposed fix: #17

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions