Add device code authentication#3
Conversation
ENG-9136 MCP server - Device Code Auth
The MCP server MVP only authenticates via Doppler tokens (personal access, service account token etc). This is fine if we're recommending scoped access as the first solution, but if we want to present the best story with the MCP release, then I think it'd be important to see if we can implement an oauth code authentication flow. Here's what I'm proposing:
This would roughly mirror how the CLI does the code flow login, and could optionally allow users to use the tool without having to manage any local credentials. |
a05d458 to
d824c4f
Compare
another-yijiao
left a comment
There was a problem hiding this comment.
Tested locally in Claude Desktop with CLI flags. LGTM.
amoses12
left a comment
There was a problem hiding this comment.
Tested setting an environment variable, both methods of logging in, and logging out locally. I left one small optional comment, but this all looks great. Really nice work on this.
| } | ||
| } | ||
|
|
||
| public hasToken(): boolean { |
There was a problem hiding this comment.
optional/check: are we using this function anywhere? We may not need it or we may be able to utilize it in if statements where we're looking for this.config.token
There was a problem hiding this comment.
ty, this was left over from a refactor. Removed in the latest force push
Adds `npx @dopplerhq/mcp-server login` and `npx @dopplerhq/mcp-server logout`
d824c4f to
ae78f7e
Compare
Currently, the way to authenticate the MCP server with Doppler requires hardcoding a DOPPLER_TOKEN env var somewhere. This PR adds device code authentication to create and cache CLI tokens, or cache manually entered tokens so that users don't need to declare them as env vars.
Specifically, it
logincommand for browser-based device code authentication in the same vein as our CLI.logoutcommand to clear those cached credentialsWatch the Loom Video Here
Closes ENG-9136
Should be merged along with https://github.com/DopplerHQ/server/pull/7571