Skip to content

Commit 589be20

Browse files
committed
update scanner tool descriptions and asset create-tool
Signed-off-by: rafi <refaei.shikho@hotmail.com>
1 parent 6ba1053 commit 589be20

5 files changed

Lines changed: 30 additions & 13 deletions

File tree

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,26 @@ Add the server to your project or user config via the Claude Code CLI:
106106
claude mcp add devguard /path/to/devguard-mcp -e DEVGUARD_PAT=your-pat-here
107107
```
108108

109-
Or add it to `.claude/settings.json` manually:
109+
Or add it manually to `~/.claude.json` in your user directory:
110110

111111
```json
112112
{
113113
"mcpServers": {
114114
"devguard": {
115-
"command": "/path/to/devguard-mcp-*"
115+
"command": "/path/to/devguard-mcp-*",
116116
"env": {
117-
"DEVGUARD_PAT": "your-pat-here"
117+
"DEVGUARD_PAT": "your-pat-here",
118+
"DEVGUARD_API_URL": "https://your-self-hosted-instance/api/v1"
118119
}
119120
}
120121
}
121122
}
122123
```
123124

124-
The tools will be available in your next Claude Code session.
125+
To verify the server was added successfully, run:
126+
127+
```bash
128+
claude mcp list
129+
```
130+
131+
You should see `devguard` listed. The tools will be available in your next Claude Code session.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ require (
2828
golang.org/x/crypto v0.43.0 // indirect
2929
golang.org/x/oauth2 v0.35.0 // indirect
3030
golang.org/x/sys v0.41.0 // indirect
31+
golang.org/x/text v0.30.0 // indirect
3132
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,9 @@ golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
5555
golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
5656
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
5757
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
58+
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
59+
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
60+
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
61+
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
5862
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
5963
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/tool/asset/tools.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
87
"github.com/modelcontextprotocol/go-sdk/mcp"
98

109
"mcp-server/internal/api"
@@ -70,17 +69,23 @@ func listAssetVersions(client api.Client) registry.Handler {
7069
func createAsset(client api.Client) registry.Handler {
7170
return func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
7271
var args struct {
73-
Organization string `json:"organization"`
74-
Project string `json:"project"`
75-
Name string `json:"name"`
76-
Description string `json:"description"`
72+
Organization string `json:"organization"`
73+
Project string `json:"project"`
74+
Name string `json:"name"`
75+
Description string `json:"description"`
76+
ConfidentialityRequirement string `json:"confidentialityRequirement"`
77+
IntegrityRequirement string `json:"integrityRequirement"`
78+
AvailabilityRequirement string `json:"availabilityRequirement"`
7779
}
7880
if err := json.Unmarshal(req.Params.Arguments, &args); err != nil {
7981
return helpers.Errorf("invalid arguments"), nil
8082
}
8183
body := map[string]any{
82-
"name": args.Name,
83-
"description": args.Description,
84+
"name": args.Name,
85+
"description": args.Description,
86+
"confidentialityRequirement": args.ConfidentialityRequirement,
87+
"integrityRequirement": args.IntegrityRequirement,
88+
"availabilityRequirement": args.AvailabilityRequirement,
8489
}
8590
a, err := api.Post[api.AssetResponse](ctx, client, fmt.Sprintf("/organizations/%s/projects/%s/assets", args.Organization, args.Project), body)
8691
if err != nil {

internal/tool/scanner/tools.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ func Register(r *registry.Registry, _ api.Client) {
5858

5959
r.Add(&mcp.Tool{
6060
Name: "run_sca",
61-
Description: "Run Software Composition Analysis (dependency vulnerability scan) on a project directory or container image",
61+
Description: "Run Software Composition Analysis (dependency vulnerability scan) on a project directory or container image.\n\nAfter the scan completes successfully, ask the user whether they want to call get_vuln_details for each discovered vulnerability to get full details and apply assessment logic.",
6262
InputSchema: json.RawMessage(fmt.Sprintf(`{"type":"object","properties":{%s,%s,"path":{"type":"string","description":"Path to project directory or tar file"}},"required":["assetName","path"]}`, commonProps(), sbomProps)),
6363
}, runSCA)
6464

6565
r.Add(&mcp.Tool{
6666
Name: "run_container_scanning",
67-
Description: "Run vulnerability scan on an OCI container image",
67+
Description: "Run vulnerability scan on an OCI container image.\n\nAfter the scan completes successfully, ask the user whether they want to call get_vuln_details for each discovered vulnerability to get full details and apply assessment logic.",
6868
InputSchema: json.RawMessage(fmt.Sprintf(`{"type":"object","properties":{%s,%s,"image":{"type":"string","description":"OCI image reference, e.g. ghcr.io/org/image:tag"},"path":{"type":"string","description":"Path to a tar file or directory"},"ignoreUpstreamAttestations":{"type":"boolean","description":"Ignore attestations from the scanned image"}},"required":["assetName","path"]}`, commonProps(), sbomProps)),
6969
}, runContainerScanning)
7070

0 commit comments

Comments
 (0)