Skip to content

Commit 0a1eed9

Browse files
authored
Merge pull request #40 from kdcokenny/feature/custom-api-headers
feat: support custom upstream headers
2 parents 3604417 + 08f693e commit 0a1eed9

8 files changed

Lines changed: 854 additions & 9 deletions

File tree

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
DOKPLOY_URL=https://your-dokploy-instance.com
33
DOKPLOY_API_KEY=your-api-key-here
44

5+
# Optional: Additional upstream request headers as a JSON object.
6+
# Reserved headers cannot be set here: x-api-key, content-type, accept.
7+
# Example for Cloudflare Access service tokens:
8+
# DOKPLOY_CUSTOM_HEADERS={"CF-Access-Client-Id":"your-client-id.access","CF-Access-Client-Secret":"your-client-secret"}
9+
510
# Optional: Filter which tool categories are loaded (comma-separated)
611
# DOKPLOY_ENABLED_TAGS=project,application,postgres
712

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,18 @@ The configuration on Windows is slightly different compared to Linux or macOS. U
287287
|----------|----------|-------------|
288288
| `DOKPLOY_URL` | Yes | Your Dokploy server URL (e.g., `https://your-dokploy-server.com`) |
289289
| `DOKPLOY_API_KEY` | Yes | Your Dokploy API authentication token |
290+
| `DOKPLOY_CUSTOM_HEADERS` | No | JSON object of additional upstream request headers. Header names and values must be strings. Reserved headers cannot be set here: `x-api-key`, `content-type`, `accept`. |
290291
| `DOKPLOY_ENABLED_TAGS` | No | Comma-separated list of tags to filter which tools are loaded (e.g., `project,application,postgres`) |
291292
| `DOKPLOY_TIMEOUT` | No | Request timeout in milliseconds (default: `30000`) |
292293
| `DOKPLOY_RETRY_ATTEMPTS` | No | Number of retry attempts (default: `3`) |
293294
| `DOKPLOY_RETRY_DELAY` | No | Delay between retries in milliseconds (default: `1000`) |
294295

296+
For Dokploy instances behind Cloudflare Access or a similar reverse proxy, pass service-token headers with placeholder values like this:
297+
298+
```bash
299+
DOKPLOY_CUSTOM_HEADERS='{"CF-Access-Client-Id":"your-client-id.access","CF-Access-Client-Secret":"your-client-secret"}'
300+
```
301+
295302
## Transport Modes
296303

297304
This MCP server supports multiple transport modes to suit different use cases:

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
33
"files": {
4-
"includes": ["src/**/*.ts", "scripts/**/*.ts"]
4+
"includes": ["src/**/*.ts", "scripts/**/*.ts", "!src/generated"]
55
},
66
"formatter": {
77
"indentStyle": "space",

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"type-check": "tsc --noEmit",
2828
"clean": "rm -rf build",
2929
"precommit": "biome check && pnpm run type-check",
30-
"test": "echo \"Error: no test spcified\" && exit 1"
30+
"test": "vitest run"
3131
},
3232
"repository": {
3333
"type": "git",
@@ -57,6 +57,7 @@
5757
"@types/node": "^22.15.21",
5858
"json-schema-to-zod": "^2.8.1",
5959
"tsx": "^4.21.0",
60-
"typescript": "^5.8.3"
60+
"typescript": "^5.8.3",
61+
"vitest": "^4.1.6"
6162
}
6263
}

0 commit comments

Comments
 (0)