Skip to content

Commit 1e5af49

Browse files
committed
refactor!: remove Sysdig Secure tools, redirect to @sysdig/secure-mcp-server
BREAKING CHANGE: list_runtime_events, get_event_info and get_event_process_tree have been removed from this server. Use the dedicated @sysdig/secure-mcp-server npm package for Sysdig Secure workflows. SysQL tools (generate_sysql, run_sysql) remain because they target both Monitor and Secure datasets.
1 parent deedcc2 commit 1e5af49

15 files changed

Lines changed: 119 additions & 1134 deletions

AGENTS.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ This document is a comprehensive guide for an AI agent tasked with developing an
44

55
## 1. Project Overview
66

7-
**Sysdig MCP Server** is a Go-based Model Context Protocol (MCP) server that exposes Sysdig Secure platform capabilities to LLMs. It provides tools for querying runtime security events, Kubernetes metrics, and executing SysQL queries through multiple transport protocols (stdio, streamable-http, SSE).
7+
**Sysdig MCP Server** is a Go-based Model Context Protocol (MCP) server that exposes Sysdig Monitor platform capabilities to LLMs. It provides tools for querying Kubernetes metrics and executing SysQL queries through multiple transport protocols (stdio, streamable-http, SSE). Sysdig Secure-specific tools live in the separate [@sysdig/secure-mcp-server](https://www.npmjs.com/package/@sysdig/secure-mcp-server) package.
88

99
### 1.1. Quick Facts
1010

1111
| Topic | Details |
1212
| --- | --- |
13-
| **Purpose** | Expose vetted Sysdig Secure workflows to LLMs through MCP tools. |
13+
| **Purpose** | Expose vetted Sysdig Monitor workflows (plus shared SysQL tooling) to LLMs through MCP tools. |
1414
| **Tech Stack** | Go 1.25+, `mcp-go`, Cobra CLI, Ginkgo/Gomega, `golangci-lint`, Nix. |
1515
| **Entry Point** | `cmd/server/main.go` (Cobra CLI that wires config, Sysdig client, etc.). |
1616
| **Dev Shell** | `nix develop` provides a consistent development environment. |
@@ -32,10 +32,10 @@ direnv allow
3232

3333
### 2.2. Required Environment Variables
3434

35-
The server requires API credentials to connect to Sysdig Secure.
35+
The server requires API credentials to connect to the Sysdig platform.
3636

37-
- `SYSDIG_MCP_API_HOST`: Sysdig Secure instance URL (e.g., `https://us2.app.sysdig.com`).
38-
- `SYSDIG_MCP_API_TOKEN`: Sysdig Secure API token.
37+
- `SYSDIG_MCP_API_HOST`: Sysdig instance URL (e.g., `https://us2.app.sysdig.com`).
38+
- `SYSDIG_MCP_API_TOKEN`: Sysdig API token.
3939

4040
For a full list of optional variables (e.g., for transport configuration), see the project's `README.md`.
4141

@@ -133,16 +133,6 @@ fix: correct API endpoint URL
133133
chore: update dependencies
134134
```
135135

136-
### 4.5. Known Flaky Integration Tests
137-
138-
The process tree integration tests in `internal/infra/sysdig/client_process_tree_integration_test.go` use a **hardcoded event ID** that points to a real Sysdig event. Since Sysdig events have a retention period, this event will eventually be deleted and the tests will fail with a `not found` error.
139-
140-
**How to fix it:**
141-
142-
1. Use the `list_runtime_events` MCP tool (or the Sysdig API) to find a recent runtime event that originates from a **syscall/workload source** (not cloud/cloudtrail), as only these have process trees. Filter for `category = "runtime"` and `source = "syscall"`.
143-
2. Verify the event has a process tree by calling `get_event_process_tree` with the event ID.
144-
3. Update the `eventID` variable in the test's `BeforeEach` block with the new event ID.
145-
146136
## 5. Guides & Reference
147137

148138
* **Tools & New Tool Creation:** See `internal/infra/mcp/tools/README.md`

README.md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
[![App Test](https://github.com/sysdiglabs/sysdig-mcp-server/actions/workflows/publish.yaml/badge.svg?branch=main)](https://github.com/sysdiglabs/sysdig-mcp-server/actions/workflows/publish.yaml)
44

5+
> [!IMPORTANT]
6+
> **Breaking change — this MCP server now focuses on Sysdig Monitor.**
7+
>
8+
> Starting with the next major release, the dedicated Sysdig Secure tools (`list_runtime_events`, `get_event_info`, `get_event_process_tree`) have been removed from this server. For Sysdig Secure use cases, install the new **[@sysdig/secure-mcp-server](https://www.npmjs.com/package/@sysdig/secure-mcp-server)** package, which provides comprehensive coverage of Sysdig Secure capabilities.
9+
>
10+
> The SysQL tools (`generate_sysql`, `run_sysql`) remain available here because they can be used against both Monitor and Secure datasets.
11+
512
---
613

714
## Table of contents
@@ -28,14 +35,16 @@
2835

2936
## Description
3037

31-
This is an implementation of an [MCP (Model Context Protocol) Server](https://modelcontextprotocol.io/quickstart/server) to allow different LLMs to query information from the Sysdig platform (Monitor and Secure). New tools and functionalities will be added over time following semantic versioning. The goal is to provide a simple and easy-to-use interface for querying information from the Sysdig platform using LLMs.
38+
This is an implementation of an [MCP (Model Context Protocol) Server](https://modelcontextprotocol.io/quickstart/server) that exposes Sysdig Monitor capabilities to LLMs, plus the cross-cutting SysQL tooling. New tools and functionalities will be added over time following semantic versioning. The goal is to provide a simple and easy-to-use interface for querying information from the Sysdig platform using LLMs.
39+
40+
For Sysdig Secure-specific workflows, use the dedicated [@sysdig/secure-mcp-server](https://www.npmjs.com/package/@sysdig/secure-mcp-server).
3241

3342
## Quickstart Guide
3443

3544
Get up and running with the Sysdig MCP Server quickly using our pre-built Docker image.
3645

3746
1. **Get your API Token**:
38-
Go to your Sysdig instance and navigate to **Settings > Sysdig Secure API** (or **Sysdig Monitor API**). Either a Sysdig Secure or Sysdig Monitor API token works. This token is required to authenticate requests to the Sysdig Platform (See the [Configuration](#configuration) section for more details).
47+
Go to your Sysdig instance and navigate to **Settings > Sysdig Monitor API**. This token is required to authenticate requests to the Sysdig Platform (See the [Configuration](#configuration) section for more details).
3948

4049
2. **Configure your MCP client**:
4150

@@ -133,28 +142,6 @@ The server dynamically filters the available tools based on the permissions asso
133142

134143
> **Note:** When a time window is provided, the underlying PromQL is wrapped in the aggregation appropriate for each tool (`avg_over_time`, `max_over_time`, `min_over_time`, `increase`, etc.) and evaluated at `end`. See [`internal/infra/mcp/tools/README.md`](./internal/infra/mcp/tools/README.md) for the per-tool aggregation table.
135144
136-
### Sysdig Secure
137-
138-
- **`list_runtime_events`**
139-
- **Description**: List runtime security events from the last given hours, optionally filtered by severity level.
140-
- **Required Permission**: `policy-events.read`
141-
- **Sample Prompt**: "Show me high severity events from the last 2 hours in cluster1"
142-
143-
- **`get_event_info`**
144-
- **Description**: Retrieve detailed information for a specific security event by its ID.
145-
- **Required Permission**: `policy-events.read`
146-
- **Sample Prompt**: "Get full details for event ID 123abc"
147-
148-
- **`get_event_process_tree`**
149-
- **Description**: Retrieve the process tree for a specific event (if available).
150-
- **Required Permission**: `policy-events.read`
151-
- **Sample Prompt**: "Get the process tree for event ID abc123"
152-
153-
- **`run_sysql`**
154-
- **Description**: Execute a pre-written SysQL query directly (use only when user provides explicit query).
155-
- **Required Permission**: `sage.exec`, `risks.read`
156-
- **Sample Prompt**: "Run this query: MATCH CloudResource WHERE type = 'aws_s3_bucket' LIMIT 10"
157-
158145
### Sysdig Monitor & Sysdig Secure
159146

160147
- **`generate_sysql`**
@@ -163,6 +150,11 @@ The server dynamically filters the available tools based on the permissions asso
163150
- **Sample Prompt**: "List top 10 pods by memory usage in the last hour"
164151
- **Note**: The `generate_sysql` tool currently does not work with Service Account tokens and will return a 500 error. For this tool, use an API token assigned to a regular user account.
165152

153+
- **`run_sysql`**
154+
- **Description**: Execute a pre-written SysQL query directly (use only when user provides explicit query).
155+
- **Required Permission**: `sage.exec`, `risks.read`
156+
- **Sample Prompt**: "Run this query: MATCH CloudResource WHERE type = 'aws_s3_bucket' LIMIT 10"
157+
166158
## Requirements
167159
- [Go](https://go.dev/doc/install) 1.26 or higher (if running without Docker).
168160

@@ -224,7 +216,6 @@ To use the MCP server tools, your API token needs specific permissions in Sysdig
224216
| Permission | Sysdig UI Permission Name |
225217
|----------------------|---------------------------------------------|
226218
| `metrics-data.read` | Data Access Settings: "Metrics Data" (Read) |
227-
| `policy-events.read` | Threats: "Policy Events" (Read) |
228219
| `risks.read` | Risks: "Access to risk feature" (Read) |
229220
| `sage.exec` | SysQL: "AI Query Generation" (Exec) |
230221

cmd/server/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ func setupHandler(sysdigClient sysdig.ExtendedClientWithResponsesInterface) *mcp
113113
systemClock := clock.NewSystemClock()
114114
handler := mcp.NewHandler(Version, sysdigClient)
115115
handler.RegisterTools(
116-
tools.NewToolListRuntimeEvents(sysdigClient, systemClock),
117-
tools.NewToolGetEventInfo(sysdigClient),
118-
tools.NewToolGetEventProcessTree(sysdigClient),
119116
tools.NewToolRunSysql(sysdigClient),
120117
tools.NewToolGenerateSysql(sysdigClient),
121118

internal/infra/mcp/tools/README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,14 @@ The handler filters tools dynamically based on the Sysdig user's permissions. Ea
2323
| `k8s_list_underutilized_pods_cpu_quota` | `tool_k8s_list_underutilized_pods_cpu_quota.go` | List Kubernetes pods with CPU usage below 25% of the quota limit. | `metrics-data.read` | "Show the top 10 underutilized pods by CPU quota in cluster 'production'" |
2424
| `k8s_list_underutilized_pods_memory_quota` | `tool_k8s_list_underutilized_pods_memory_quota.go` | List Kubernetes pods with memory usage below 25% of the limit. | `metrics-data.read` | "Show the top 10 underutilized pods by memory quota in cluster 'production'" |
2525

26-
### Sysdig Secure
27-
28-
| Tool | File | Capability | Required Permissions | Useful Prompts |
29-
|---|---|---|---|---|
30-
| `list_runtime_events` | `tool_list_runtime_events.go` | Query runtime events with filters, cursor, scope. | `policy-events.read` | "Show high severity runtime events from last 2h." |
31-
| `get_event_info` | `tool_get_event_info.go` | Pull full payload for a single policy event. | `policy-events.read` | "Fetch event `abc123` details." |
32-
| `get_event_process_tree` | `tool_get_event_process_tree.go` | Retrieve the process tree for an event when available. | `policy-events.read` | "Show the process tree behind event `abc123`." |
33-
| `run_sysql` | `tool_run_sysql.go` | Execute caller-supplied Sysdig SysQL queries safely. | `sage.exec`, `risks.read` | "Run the following SysQL…". |
34-
3526
### Sysdig Monitor & Sysdig Secure
3627

3728
| Tool | File | Capability | Required Permissions | Useful Prompts |
3829
|---|---|---|---|---|
3930
| `generate_sysql` | `tool_generate_sysql.go` | Convert natural language to SysQL via Sysdig Sage. | `sage.exec` (does not work with Service Accounts) | "Create a SysQL to list S3 buckets." |
31+
| `run_sysql` | `tool_run_sysql.go` | Execute caller-supplied Sysdig SysQL queries safely. | `sage.exec`, `risks.read` | "Run the following SysQL…". |
32+
33+
> Dedicated Sysdig Secure tools (runtime events, event details, process trees) live in the separate [@sysdig/secure-mcp-server](https://www.npmjs.com/package/@sysdig/secure-mcp-server) package.
4034
4135
## Historical range (start / end)
4236

internal/infra/mcp/tools/tool_get_event_info.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

internal/infra/mcp/tools/tool_get_event_info_test.go

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)