Skip to content

fix: use empty defaults for OAuth-mode API key headers#17

Open
nicoyoung wants to merge 1 commit into
datadog-labs:mainfrom
nicoyoung:fix/oauth-mcp-header-env-defaults
Open

fix: use empty defaults for OAuth-mode API key headers#17
nicoyoung wants to merge 1 commit into
datadog-labs:mainfrom
nicoyoung:fix/oauth-mcp-header-env-defaults

Conversation

@nicoyoung

@nicoyoung nicoyoung commented Jun 9, 2026

Copy link
Copy Markdown

What does this PR do?

The MCP server config declares the DD_API_KEY and DD_APPLICATION_KEY headers as ${DD_API_KEY} / ${DD_APPLICATION_KEY} with no default. The plugin authenticates via OAuth by default, so these are normally unset, and Claude Code's static MCP-config validator treats a ${VAR} reference without a default as a required variable. On a default (OAuth) install it therefore reports the server as invalid:

MCP server mcp invalid: Missing environment variables: DD_API_KEY, DD_APPLICATION_KEY

This surfaces in /doctor for every OAuth user even though the server connects and works. This PR gives the two headers empty defaults (${DD_API_KEY:-} / ${DD_APPLICATION_KEY:-}), matching how ${DD_MCP_TOOLSETS:-} is already handled in the same file. Behavior is unchanged: when the variables are set (advanced API-key usage) their values are used; when unset (OAuth) they resolve to empty strings instead of being flagged as missing.

Checklist

  • Tests added or updated where applicable (n/a, config-only change)
  • Documentation updated where applicable (n/a)
  • No secrets, internal URLs, or other internal references included

Closes #18

@jfree jfree self-requested a review June 11, 2026 13:17
@nicoyoung nicoyoung force-pushed the fix/oauth-mcp-header-env-defaults branch from 2146740 to b495955 Compare June 18, 2026 13:42
@nicoyoung

Copy link
Copy Markdown
Author

Friendly ping @datadog-labs/mcp-server / @m-paternostro — this fixes the not-setup/MCP-domain issue described in #14 for OAuth-mode users. Happy to address any feedback if a maintainer can take a look. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants