Skip to content

Commit 0e6e2ad

Browse files
authored
refactor!: remove SysQL tools (generate_sysql, run_sysql) (#91)
SysQL tooling (generate_sysql, run_sysql) is now covered by [@sysdig/secure-mcp-server](https://www.npmjs.com/package/@sysdig/secure-mcp-server), so this server focuses solely on Sysdig Monitor. Keeping these tools here duplicates surface area and blurs where they live. Breaking change → release v3.0.0. Changes: - Removed `generate_sysql`/`run_sysql` tools (+ tests) and the `GenerateSysql` client extension (+ integration test, mocks regenerated). - Cleaned up orphaned permissions `sage.exec` and `risks.read` (only `metrics-data.read` remains). - Updated docs (README, AGENTS, tools/README, TROUBLESHOOTING) and `.claude/settings.local.json`. - `just update`: bumped Go deps, flake.lock and base images. Note: `QuerySysql*`/`GetSysqlSchema` stay in `client.gen.go` since they're generated from the OpenAPI spec (DO NOT EDIT, they come back on the next `just update`).
1 parent 5949c1f commit 0e6e2ad

19 files changed

Lines changed: 31 additions & 742 deletions

AGENTS.md

Lines changed: 2 additions & 2 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 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.
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 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 Monitor workflows (plus shared SysQL tooling) to LLMs through MCP tools. |
13+
| **Purpose** | Expose vetted Sysdig Monitor workflows to LLMs through MCP tools. |
1414
| **Tech Stack** | Go 1.26+, `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. |

README.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
> **Breaking change — this MCP server now focuses on Sysdig Monitor.**
77
>
88
> 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.
119
1210
---
1311

@@ -35,7 +33,7 @@
3533

3634
## Description
3735

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.
36+
This is an implementation of an [MCP (Model Context Protocol) Server](https://modelcontextprotocol.io/quickstart/server) that exposes Sysdig Monitor capabilities to LLMs. 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.
3937

4038
For Sysdig Secure-specific workflows, use the dedicated [@sysdig/secure-mcp-server](https://www.npmjs.com/package/@sysdig/secure-mcp-server).
4139

@@ -44,7 +42,7 @@ For Sysdig Secure-specific workflows, use the dedicated [@sysdig/secure-mcp-serv
4442
Get up and running with the Sysdig MCP Server quickly using our pre-built Docker image.
4543

4644
1. **Get your API Token**:
47-
Go to your Sysdig instance and navigate to **Settings > Sysdig Monitor API** (or **Sysdig Secure API** — either works, since SysQL tools accept both). This token is required to authenticate requests to the Sysdig Platform (See the [Configuration](#configuration) section for more details).
45+
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).
4846

4947
2. **Configure your MCP client**:
5048

@@ -142,19 +140,6 @@ The server dynamically filters the available tools based on the permissions asso
142140

143141
> **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.
144142
145-
### Sysdig Monitor & Sysdig Secure
146-
147-
- **`generate_sysql`**
148-
- **Description**: Generates a SysQL query from a natural language question.
149-
- **Required Permission**: `sage.exec`
150-
- **Sample Prompt**: "List top 10 pods by memory usage in the last hour"
151-
- **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.
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-
158143
## Requirements
159144
- [Go](https://go.dev/doc/install) 1.26 or higher (if running without Docker).
160145

@@ -216,8 +201,6 @@ To use the MCP server tools, your API token needs specific permissions on the Sy
216201
| Permission | Sysdig UI Permission Name |
217202
|----------------------|---------------------------------------------|
218203
| `metrics-data.read` | Data Access Settings: "Metrics Data" (Read) |
219-
| `risks.read` | Risks: "Access to risk feature" (Read) |
220-
| `sage.exec` | SysQL: "AI Query Generation" (Exec) |
221204

222205
**Additional Permissions:**
223206

@@ -234,9 +217,6 @@ To use the MCP server tools, your API token needs specific permissions on the Sy
234217
235218
For detailed instructions, see the official [Sysdig Roles Administration documentation](https://docs.sysdig.com/en/administration/roles-administration/).
236219

237-
>[!IMPORTANT]
238-
> **Service Account Limitation:** 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.
239-
240220

241221
## Server Setup
242222

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.NewToolRunSysql(sysdigClient),
117-
tools.NewToolGenerateSysql(sysdigClient),
118-
119116
tools.NewK8sListClusters(sysdigClient, systemClock),
120117
tools.NewK8sListNodes(sysdigClient, systemClock),
121118
tools.NewK8sListCronjobs(sysdigClient, systemClock),

docker-base-aarch64.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
imageName = "quay.io/sysdig/sysdig-mini-ubi9";
3-
imageDigest = "sha256:4c41436ce108c1576399e4c624f72238c3a9577b570a97115d941c907bf40909";
4-
hash = "sha256-eLn7KUR4QqmHr5eVIdRy9uR0J1ooCPfUHxTLDMOlV0w=";
3+
imageDigest = "sha256:51a8e50674f95e4e3089e1b44ad3ee61f7b1979e5f9edac8de726c2acd997349";
4+
hash = "sha256-jTmkEwnYSNBMIOr8aBLCGzC+bh+Xjm3to51mqkl3Hyc=";
55
finalImageName = "quay.io/sysdig/sysdig-mini-ubi9";
66
finalImageTag = "1";
77
}

docker-base-amd64.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
imageName = "quay.io/sysdig/sysdig-mini-ubi9";
3-
imageDigest = "sha256:4c41436ce108c1576399e4c624f72238c3a9577b570a97115d941c907bf40909";
4-
hash = "sha256-XLdqxTuzuRc6ariE/Q3ME/pC/PvT/sQtXmXWhWoLT44=";
3+
imageDigest = "sha256:51a8e50674f95e4e3089e1b44ad3ee61f7b1979e5f9edac8de726c2acd997349";
4+
hash = "sha256-6X3VUknvtn8AiNbZHLAmFLoidqqSgnwrPl684za+U0U=";
55
finalImageName = "quay.io/sysdig/sysdig-mini-ubi9";
66
finalImageTag = "1";
77
}

docs/TROUBLESHOOTING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@
1212
**Problem**: Tests failing with "command not found"
1313
- **Solution**: Enter Nix shell with `nix develop` or `direnv allow`. All dev tools are provided by the flake.
1414

15-
**Problem**: `generate_sysql` returning 500 error
16-
- **Solution**: This tool requires a regular user API token, not a Service Account token. Switch to a user-based token.
17-
1815
**Problem**: Pre-commit hooks not running
1916
- **Solution**: Run `pre-commit install` to install git hooks, then `pre-commit run -a` to test all files.

flake.lock

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

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module github.com/sysdiglabs/sysdig-mcp-server
33
go 1.26
44

55
require (
6-
github.com/mark3labs/mcp-go v0.54.1
6+
github.com/mark3labs/mcp-go v0.55.0
77
github.com/oapi-codegen/runtime v1.4.1
8-
github.com/onsi/ginkgo/v2 v2.29.0
9-
github.com/onsi/gomega v1.41.0
8+
github.com/onsi/ginkgo/v2 v2.31.0
9+
github.com/onsi/gomega v1.42.0
1010
github.com/spf13/cobra v1.10.2
1111
go.uber.org/mock v0.6.0
1212
gopkg.in/yaml.v2 v2.4.0
@@ -28,9 +28,9 @@ require (
2828
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
2929
go.yaml.in/yaml/v3 v3.0.4 // indirect
3030
golang.org/x/mod v0.37.0 // indirect
31-
golang.org/x/net v0.55.0 // indirect
31+
golang.org/x/net v0.56.0 // indirect
3232
golang.org/x/sync v0.21.0 // indirect
3333
golang.org/x/sys v0.46.0 // indirect
3434
golang.org/x/text v0.38.0 // indirect
35-
golang.org/x/tools v0.45.0 // indirect
35+
golang.org/x/tools v0.46.0 // indirect
3636
)

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
4141
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
4242
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
4343
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
44-
github.com/mark3labs/mcp-go v0.54.1 h1:Ap/ptEB9FtWzFKM8NDsTA7QDxerQOC06eZigrTldVj0=
45-
github.com/mark3labs/mcp-go v0.54.1/go.mod h1:+8WclSK1ZUweCP3hvktSji8n8ABG/95QaEkeVE/Uwas=
44+
github.com/mark3labs/mcp-go v0.55.0 h1:lJfz2aoctiwK+sI991+uIYwmKNIBciI+O7zsyDsa4U8=
45+
github.com/mark3labs/mcp-go v0.55.0/go.mod h1:+8WclSK1ZUweCP3hvktSji8n8ABG/95QaEkeVE/Uwas=
4646
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
4747
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
4848
github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
@@ -51,10 +51,10 @@ github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/
5151
github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY=
5252
github.com/oapi-codegen/runtime v1.4.1 h1:9nwLoI+KrWxzbBcp0jO/R8uXqbik/HUyCvPeU68Y/qo=
5353
github.com/oapi-codegen/runtime v1.4.1/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU=
54-
github.com/onsi/ginkgo/v2 v2.29.0 h1:rfh+ZFjgJhYWRoIqVf3Uwx/W20yLrcrE2h2GmYVRaag=
55-
github.com/onsi/ginkgo/v2 v2.29.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44=
56-
github.com/onsi/gomega v1.41.0 h1:OwKp4pXNgVxf6sCplzYo794OFNuoL2q2SBMU5NSWOjA=
57-
github.com/onsi/gomega v1.41.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A=
54+
github.com/onsi/ginkgo/v2 v2.31.0 h1:GtuJos5DFUV9EerYJo8RhYxosYNGvOdDE5haKq6Grfs=
55+
github.com/onsi/ginkgo/v2 v2.31.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44=
56+
github.com/onsi/gomega v1.42.0 h1:CJby8u36xb7v34W78F8WKvqTQP7PCMIPB78IVDB73l4=
57+
github.com/onsi/gomega v1.42.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A=
5858
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
5959
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6060
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
@@ -90,16 +90,16 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
9090
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
9191
golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ=
9292
golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0=
93-
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
94-
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
93+
golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o=
94+
golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=
9595
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
9696
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
9797
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
9898
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
9999
golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
100100
golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4=
101-
golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8=
102-
golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
101+
golang.org/x/tools v0.46.0 h1:7jTurBkPZu4moS/Uy4OQT1M+QBlsj3wejyZwsT8Z7rk=
102+
golang.org/x/tools v0.46.0/go.mod h1:FrD85F8l+NWL+9XWBSyVSHO6Ne4jutsfIFba7AWQ5Ys=
103103
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
104104
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
105105
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

internal/infra/mcp/tools/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ 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 Monitor & Sysdig Secure
27-
28-
| Tool | File | Capability | Required Permissions | Useful Prompts |
29-
|---|---|---|---|---|
30-
| `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-
3326
> 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.
3427
3528
## Historical range (start / end)

0 commit comments

Comments
 (0)