Skip to content

Commit 182c251

Browse files
authored
Merge pull request #3 from DopplerHQ/mike/code-auth
Add device code authentication
2 parents 17ba18a + ae78f7e commit 182c251

10 files changed

Lines changed: 961 additions & 276 deletions

File tree

README.md

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,76 +4,53 @@ MCP (Model Context Protocol) server that provides AI assistants with access to t
44

55
## Quick Start
66

7-
Add to your MCP client configuration (e.g., Claude Desktop):
7+
**1. Authenticate:**
8+
9+
```bash
10+
npx @dopplerhq/mcp-server login
11+
```
12+
13+
**2. Add to your MCP client configuration (e.g., Claude Desktop):**
814

915
```json
1016
{
1117
"mcpServers": {
1218
"doppler": {
1319
"command": "npx",
14-
"args": ["-y", "@dopplerhq/mcp-server"],
15-
"env": {
16-
"DOPPLER_TOKEN": "<your-doppler-token>"
17-
}
20+
"args": ["-y", "@dopplerhq/mcp-server"]
1821
}
1922
}
2023
}
2124
```
2225

23-
See [Service Tokens](https://docs.doppler.com/docs/service-tokens) to create a token.
26+
### With Service Token
2427

25-
### Alternative: CLI Authentication (No Token in Config)
26-
27-
If you have the [Doppler CLI](https://docs.doppler.com/docs/cli) installed, you can use your CLI session instead of a service token. This keeps credentials out of your config file entirely.
28-
29-
**Prerequisites:**
30-
31-
1. Install the Doppler CLI
32-
2. Run `doppler login` (creates a global/root session stored in your OS keychain)
33-
3. Create a Doppler project to store your `DOPPLER_TOKEN` for the MCP server
34-
35-
**Configuration:**
28+
Alternatively, use a service token instead of logging in:
3629

3730
```json
3831
{
3932
"mcpServers": {
4033
"doppler": {
41-
"command": "doppler",
42-
"args": [
43-
"run",
44-
"--project",
45-
"mcp-server-tokens",
46-
"--config",
47-
"dev",
48-
"--",
49-
"npx",
50-
"-y",
51-
"@dopplerhq/mcp-server",
52-
"--project",
53-
"my-app",
54-
"--read-only"
55-
]
34+
"command": "npx",
35+
"args": ["-y", "@dopplerhq/mcp-server"],
36+
"env": {
37+
"DOPPLER_TOKEN": "<your-doppler-token>"
38+
}
5639
}
5740
}
5841
}
5942
```
6043

61-
**How it works:**
62-
63-
- `doppler run --project mcp-server-tokens --config dev` fetches secrets (including `DOPPLER_TOKEN`) from the specified Doppler project and injects them as environment variables
64-
- The MCP server receives `DOPPLER_TOKEN` and uses it to access the Doppler API
65-
- `--project my-app --read-only` on the MCP server scopes what the LLM can access
44+
See [Service Tokens](https://docs.doppler.com/docs/service-tokens) to create a config-scoped token.
6645

67-
**Two levels of scoping:**
46+
## Commands
6847

69-
| Level | Controls | Example |
70-
| -------------------------------- | ------------------------------------- | ---------------------------------------------------------- |
71-
| `doppler run --project/--config` | Which token the MCP server uses | `mcp-server-tokens/dev` contains `DOPPLER_TOKEN=dp.st.xxx` |
72-
| MCP server `--project/--config` | What the LLM can access via the token | Restrict to `my-app/production` |
73-
74-
This pattern is ideal for local development where you don't want any tokens in config files.
48+
```
49+
login Authenticate with Doppler (interactive)
50+
logout Clear cached auth credentials
51+
```
7552

76-
## CLI Options
53+
## Options
7754

7855
```
7956
--read-only Only expose read operations (GET endpoints)
@@ -92,8 +69,7 @@ This pattern is ideal for local development where you don't want any tokens in c
9269
"mcpServers": {
9370
"doppler": {
9471
"command": "npx",
95-
"args": ["-y", "@dopplerhq/mcp-server", "--read-only"],
96-
"env": { "DOPPLER_TOKEN": "dp.pt.xxx" }
72+
"args": ["-y", "@dopplerhq/mcp-server", "--read-only"]
9773
}
9874
}
9975
}
@@ -106,8 +82,7 @@ This pattern is ideal for local development where you don't want any tokens in c
10682
"mcpServers": {
10783
"doppler": {
10884
"command": "npx",
109-
"args": ["-y", "@dopplerhq/mcp-server", "--project", "my-app"],
110-
"env": { "DOPPLER_TOKEN": "dp.pt.xxx" }
85+
"args": ["-y", "@dopplerhq/mcp-server", "--project", "my-app"]
11186
}
11287
}
11388
}
@@ -127,8 +102,7 @@ This pattern is ideal for local development where you don't want any tokens in c
127102
"my-app",
128103
"--config",
129104
"production"
130-
],
131-
"env": { "DOPPLER_TOKEN": "dp.pt.xxx" }
105+
]
132106
}
133107
}
134108
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
},
3737
"dependencies": {
3838
"@modelcontextprotocol/sdk": "^0.5.0",
39+
"@napi-rs/keyring": "^1.1.6",
3940
"fastmcp": "^3.10.0",
4041
"zod": "^3.22.0"
4142
},

pnpm-lock.yaml

Lines changed: 132 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)