Skip to content

Commit 5d09975

Browse files
committed
Add Claude Code example config and docs
1 parent 53793f2 commit 5d09975

3 files changed

Lines changed: 84 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ The server will start on `http://0.0.0.0:8080` by default (configurable via `ser
139139

140140
### Connecting with Claude Code CLI
141141

142+
For complete configuration examples and usage prompts, see [examples/claude-code/](examples/claude-code/).
143+
142144
#### HTTP Transport
143145

144146
Add the MCP server to Claude Code using HTTP transport:

examples/claude-code/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Claude Code Usage Examples
2+
3+
This directory contains configuration examples and usage prompts for integrating StackRox MCP with Claude Code.
4+
5+
## Prerequirements
6+
7+
- **Build binary**:
8+
```bash
9+
make build
10+
```
11+
12+
## Setup
13+
14+
1. **Start the StackRox MCP server**:
15+
```bash
16+
STACKROX_MCP__CENTRAL__URL=<StackRox host with port> ./stackrox-mcp --config=examples/config-read-only.yaml
17+
```
18+
19+
2. **Configure Claude Code**:
20+
21+
Copy the `mcp.json` file to your workspace directory (this will scope claude to use StackRox MCP only in this directory):
22+
```bash
23+
mkdir -p ~/stackrox-workspace
24+
25+
cp examples/claude-code/mcp.json ~/stackrox-workspace/.mcp.json
26+
27+
cd ~/stackrox-workspace
28+
```
29+
30+
3. **Update the API token**:
31+
32+
Edit `~/stackrox-workspace/.mcp.json` and replace `<YOUR_STACKROX_API_TOKEN>` with your actual StackRox API token.
33+
34+
4. **Verify the connection**:
35+
36+
Start Claude Code
37+
```bash
38+
claude
39+
```
40+
41+
You can get prompt to allow using MCP server. After that you can run `/mcp` to see if `stackrox-mcp` is in the list.
42+
43+
## Example Prompts
44+
45+
Once configured, you can use natural language prompts with Claude Code:
46+
47+
### List all clusters
48+
```
49+
Can you list all the clusters secured by StackRox?
50+
```
51+
52+
### Check for a specific CVE
53+
```
54+
Is CVE-2021-44228 detected in any of my clusters?
55+
```
56+
57+
### CVE analysis in specific namespace
58+
```
59+
Check if CVE-2021-44228 is present in deployments in namespace "backend"
60+
```
61+
62+
### Filter by cluster
63+
```
64+
Show me all deployments affected by CVE-2021-44228 in the dev-cluster
65+
```
66+
67+
## Notes
68+
69+
- The server must be running before using Claude Code
70+
- Make sure your API token has appropriate permissions for the operations you want to perform
71+
- The default configuration uses `http://localhost:8080/mcp` - adjust if your server runs on a different port or host

examples/claude-code/mcp.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"mcpServers": {
3+
"stackrox-mcp": {
4+
"type": "http",
5+
"url": "http://localhost:8080/mcp",
6+
"headers": {
7+
"Authorization": "Bearer <YOUR_STACKROX_API_TOKEN>"
8+
}
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)