Skip to content

Commit f2a47f2

Browse files
committed
feat!: rename the required env var token to SYSDIG_MCP_API_TOKEN
1 parent cf06447 commit f2a47f2

File tree

10 files changed

+23
-22
lines changed

10 files changed

+23
-22
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ watch_file *.nix
33
dotenv_if_exists .env # You can create a .env file with your env vars for this project. You can also use .secrets if you are using act. See the line below.
44
dotenv_if_exists .secrets # Used by [act](https://nektosact.com/) to load secrets into the pipelines
55
strict_env
6-
env_vars_required SYSDIG_MCP_API_HOST SYSDIG_MCP_API_SECURE_TOKEN
6+
env_vars_required SYSDIG_MCP_API_HOST SYSDIG_MCP_API_TOKEN

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: just check
3131
env:
3232
SYSDIG_MCP_API_HOST: ${{ vars.SYSDIG_MCP_API_HOST }}
33-
SYSDIG_MCP_API_SECURE_TOKEN: ${{ secrets.SYSDIG_MCP_API_SECURE_TOKEN }}
33+
SYSDIG_MCP_API_TOKEN: ${{ secrets.SYSDIG_MCP_API_SECURE_TOKEN }}
3434
build:
3535
name: Build
3636
runs-on: ubuntu-latest

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Note that if you add more tools you need to also update this file to reflect tha
7171

7272
## Troubleshooting & Tips
7373

74-
- **Missing config:** `SYSDIG_MCP_API_HOST` and `SYSDIG_MCP_API_SECURE_TOKEN` are mandatory in `stdio`. Validation fails early in `internal/config/config.go`.
74+
- **Missing config:** `SYSDIG_MCP_API_HOST` and `SYSDIG_MCP_API_TOKEN` are mandatory in `stdio`. Validation fails early in `internal/config/config.go`.
7575
- **Token scope:** If a tool does not appear, verify the token’s permissions under **Settings > Users & Teams > Roles**. `generate_sysql` currently requires a regular user token, not a Service Account.
7676
- **Remote auth:** When using `streamable-http` or `sse`, pass `Authorization: Bearer <token>` and optionally `X-Sysdig-Host`. These values override env vars via the request context middleware.
7777
- **Environment drift:** Always run inside `nix develop`; lint/test expect binaries like `gofumpt`, `golangci-lint`, and `ginkgo` provided by the flake.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ Get up and running with the Sysdig MCP Server quickly using our pre-built Docker
6565
"-e",
6666
"SYSDIG_MCP_TRANSPORT",
6767
"-e",
68-
"SYSDIG_MCP_API_SECURE_TOKEN",
68+
"SYSDIG_MCP_API_TOKEN",
6969
"ghcr.io/sysdiglabs/sysdig-mcp-server:latest"
7070
],
7171
"env": {
7272
"SYSDIG_MCP_API_HOST": "<your_sysdig_host>",
73-
"SYSDIG_MCP_API_SECURE_TOKEN": "<your_sysdig_secure_api_token>",
73+
"SYSDIG_MCP_API_TOKEN": "<your_sysdig_secure_api_token>",
7474
"SYSDIG_MCP_TRANSPORT": "stdio"
7575
}
7676
}
@@ -122,7 +122,7 @@ The server dynamically filters the available tools based on the permissions asso
122122
The following environment variables are **required** for configuring the Sysdig SDK:
123123

124124
- `SYSDIG_MCP_API_HOST`: The URL of your Sysdig Secure instance (e.g., `https://us2.app.sysdig.com`). **Required when using `stdio` transport.**
125-
- `SYSDIG_MCP_API_SECURE_TOKEN`: Your Sysdig Secure API token. **Required only when using `stdio` transport.**
125+
- `SYSDIG_MCP_API_TOKEN`: Your Sysdig Secure API token. **Required only when using `stdio` transport.**
126126

127127
You can also set the following variables to override the default configuration:
128128

@@ -143,7 +143,7 @@ You can find your API token in the Sysdig Secure UI under **Settings > Sysdig Se
143143
```bash
144144
# Required
145145
SYSDIG_MCP_API_HOST=https://us2.app.sysdig.com
146-
SYSDIG_MCP_API_SECURE_TOKEN=your-api-token-here
146+
SYSDIG_MCP_API_TOKEN=your-api-token-here
147147
148148
# Optional
149149
SYSDIG_MCP_TRANSPORT=stdio
@@ -158,7 +158,7 @@ SYSDIG_MCP_TRANSPORT=streamable-http
158158
159159
# Optional (Host and Token can be provided via HTTP headers)
160160
# SYSDIG_MCP_API_HOST=https://us2.app.sysdig.com
161-
# SYSDIG_MCP_API_SECURE_TOKEN=your-api-token-here
161+
# SYSDIG_MCP_API_TOKEN=your-api-token-here
162162
SYSDIG_MCP_LISTENING_PORT=8080
163163
SYSDIG_MCP_LISTENING_HOST=localhost
164164
SYSDIG_MCP_MOUNT_PATH=/sysdig-mcp-server
@@ -204,13 +204,13 @@ You can run the MCP server using Docker (recommended for production) or directly
204204
The easiest way to run the server is using the pre-built Docker image from GitHub Container Registry (as shown in the [Quickstart Guide](#quickstart-guide)).
205205

206206
```bash
207-
docker run -e SYSDIG_MCP_API_HOST=<your_sysdig_host> -e SYSDIG_MCP_API_SECURE_TOKEN=<your_sysdig_secure_api_token> -e SYSDIG_MCP_TRANSPORT=stdio -p 8080:8080 ghcr.io/sysdiglabs/sysdig-mcp-server:latest
207+
docker run -e SYSDIG_MCP_API_HOST=<your_sysdig_host> -e SYSDIG_MCP_API_TOKEN=<your_sysdig_secure_api_token> -e SYSDIG_MCP_TRANSPORT=stdio -p 8080:8080 ghcr.io/sysdiglabs/sysdig-mcp-server:latest
208208
```
209209

210210
To use the `streamable-http` or `sse` transports (for remote MCP clients), set the `SYSDIG_MCP_TRANSPORT` environment variable accordingly:
211211

212212
```bash
213-
docker run -e SYSDIG_MCP_TRANSPORT=streamable-http -e SYSDIG_MCP_API_HOST=<your_sysdig_host> -e SYSDIG_MCP_API_SECURE_TOKEN=<your_sysdig_secure_api_token> -p 8080:8080 ghcr.io/sysdiglabs/sysdig-mcp-server:latest
213+
docker run -e SYSDIG_MCP_TRANSPORT=streamable-http -e SYSDIG_MCP_API_HOST=<your_sysdig_host> -e SYSDIG_MCP_API_TOKEN=<your_sysdig_secure_api_token> -p 8080:8080 ghcr.io/sysdiglabs/sysdig-mcp-server:latest
214214
```
215215

216216
### Go
@@ -294,12 +294,12 @@ For the Claude Desktop app, you can manually configure the MCP server by editing
294294
"-e",
295295
"SYSDIG_MCP_TRANSPORT",
296296
"-e",
297-
"SYSDIG_MCP_API_SECURE_TOKEN",
297+
"SYSDIG_MCP_API_TOKEN",
298298
"ghcr.io/sysdiglabs/sysdig-mcp-server:latest"
299299
],
300300
"env": {
301301
"SYSDIG_MCP_API_HOST": "<your_sysdig_host>",
302-
"SYSDIG_MCP_API_SECURE_TOKEN": "<your_sysdig_secure_api_token>",
302+
"SYSDIG_MCP_API_TOKEN": "<your_sysdig_secure_api_token>",
303303
"SYSDIG_MCP_TRANSPORT": "stdio"
304304
}
305305
}
@@ -320,7 +320,7 @@ For the Claude Desktop app, you can manually configure the MCP server by editing
320320
],
321321
"env": {
322322
"SYSDIG_MCP_API_HOST": "<your_sysdig_host>",
323-
"SYSDIG_MCP_API_SECURE_TOKEN": "<your_sysdig_secure_api_token>",
323+
"SYSDIG_MCP_API_TOKEN": "<your_sysdig_secure_api_token>",
324324
"SYSDIG_MCP_TRANSPORT": "stdio"
325325
}
326326
}
@@ -362,7 +362,7 @@ For the Claude Desktop app, you can manually configure the MCP server by editing
362362
env_keys:
363363
- SYSDIG_MCP_TRANSPORT
364364
- SYSDIG_MCP_API_HOST
365-
- SYSDIG_MCP_API_SECURE_TOKEN
365+
- SYSDIG_MCP_API_TOKEN
366366
envs:
367367
SYSDIG_MCP_TRANSPORT: stdio
368368
name: sysdig-mcp-server

cmd/server/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func setupHandler(sysdigClient sysdig.ExtendedClientWithResponsesInterface) *mcp
9494
tools.NewToolGetEventProcessTree(sysdigClient),
9595
tools.NewToolRunSysql(sysdigClient),
9696
tools.NewToolGenerateSysql(sysdigClient),
97+
9798
tools.NewKubernetesListClusters(sysdigClient),
9899
)
99100
return handler

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ func (c *Config) Validate() error {
2020
return fmt.Errorf("required configuration missing: SYSDIG_MCP_API_HOST")
2121
}
2222
if c.Transport == "stdio" && c.APIToken == "" {
23-
return fmt.Errorf("required configuration missing: SYSDIG_MCP_API_SECURE_TOKEN")
23+
return fmt.Errorf("required configuration missing: SYSDIG_MCP_API_TOKEN")
2424
}
2525
return nil
2626
}
2727

2828
func Load() (*Config, error) {
2929
cfg := &Config{
3030
APIHost: getEnv("SYSDIG_MCP_API_HOST", ""),
31-
APIToken: getEnv("SYSDIG_MCP_API_SECURE_TOKEN", ""),
31+
APIToken: getEnv("SYSDIG_MCP_API_TOKEN", ""),
3232
Transport: getEnv("SYSDIG_MCP_TRANSPORT", "stdio"),
3333
ListeningHost: getEnv("SYSDIG_MCP_LISTENING_HOST", "localhost"),
3434
ListeningPort: getEnv("SYSDIG_MCP_LISTENING_PORT", "8080"),

internal/config/config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var _ = Describe("Config", func() {
5858
}
5959
err := cfg.Validate()
6060
Expect(err).To(HaveOccurred())
61-
Expect(err.Error()).To(ContainSubstring("SYSDIG_MCP_API_SECURE_TOKEN"))
61+
Expect(err.Error()).To(ContainSubstring("SYSDIG_MCP_API_TOKEN"))
6262
})
6363
})
6464
})
@@ -71,7 +71,7 @@ var _ = Describe("Config", func() {
7171
Context("with required env vars set for stdio", func() {
7272
BeforeEach(func() {
7373
_ = os.Setenv("SYSDIG_MCP_API_HOST", "host")
74-
_ = os.Setenv("SYSDIG_MCP_API_SECURE_TOKEN", "token")
74+
_ = os.Setenv("SYSDIG_MCP_API_TOKEN", "token")
7575
})
7676

7777
It("should load default values", func() {
@@ -105,7 +105,7 @@ var _ = Describe("Config", func() {
105105
Context("with all env vars set", func() {
106106
BeforeEach(func() {
107107
_ = os.Setenv("SYSDIG_MCP_API_HOST", "env-host")
108-
_ = os.Setenv("SYSDIG_MCP_API_SECURE_TOKEN", "env-token")
108+
_ = os.Setenv("SYSDIG_MCP_API_TOKEN", "env-token")
109109
_ = os.Setenv("SYSDIG_MCP_TRANSPORT", "http")
110110
_ = os.Setenv("SYSDIG_MCP_LISTENING_HOST", "0.0.0.0")
111111
_ = os.Setenv("SYSDIG_MCP_LISTENING_PORT", "9090")

internal/infra/sysdig/client_generate_sysql_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var _ = Describe("Sysdig Generate Sysql Client", func() {
1515

1616
BeforeEach(func() {
1717
sysdigURL := os.Getenv("SYSDIG_MCP_API_HOST")
18-
sysdigToken := os.Getenv("SYSDIG_MCP_API_SECURE_TOKEN")
18+
sysdigToken := os.Getenv("SYSDIG_MCP_API_TOKEN")
1919

2020
var err error
2121
client, err = sysdig.NewSysdigClient(sysdig.WithFixedHostAndToken(sysdigURL, sysdigToken))

internal/infra/sysdig/client_permissions_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var _ = Describe("Sysdig Permissions Client", func() {
1717

1818
BeforeEach(func() {
1919
sysdigURL = os.Getenv("SYSDIG_MCP_API_HOST")
20-
sysdigToken = os.Getenv("SYSDIG_MCP_API_SECURE_TOKEN")
20+
sysdigToken = os.Getenv("SYSDIG_MCP_API_TOKEN")
2121
})
2222

2323
Context("when fetching user permissions", func() {

internal/infra/sysdig/client_process_tree_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var _ = Describe("Sysdig Process Tree Client", func() {
1818

1919
BeforeEach(func() {
2020
sysdigURL := os.Getenv("SYSDIG_MCP_API_HOST")
21-
sysdigToken := os.Getenv("SYSDIG_MCP_API_SECURE_TOKEN")
21+
sysdigToken := os.Getenv("SYSDIG_MCP_API_TOKEN")
2222

2323
var err error
2424
client, err = sysdig.NewSysdigClient(sysdig.WithFixedHostAndToken(sysdigURL, sysdigToken))

0 commit comments

Comments
 (0)