You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/suseconnect-mcp/suseconnect_mcp.go
+67Lines changed: 67 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,30 @@ package main
2
2
3
3
import (
4
4
"context"
5
+
"errors"
5
6
"flag"
7
+
"fmt"
6
8
"log/slog"
7
9
"net/http"
8
10
9
11
"github.com/SUSE/connect-ng/internal/connect"
12
+
"github.com/SUSE/connect-ng/pkg/registration"
10
13
"github.com/modelcontextprotocol/go-sdk/mcp"
11
14
)
12
15
13
16
typeToolInputstruct{}
14
17
18
+
typeRegisterInputstruct {
19
+
Regcodestring`json:"regcode" jsonschema:"The subscription registration code to register the system with"`
20
+
Emailstring`json:"email,omitempty" jsonschema:"Email Address to associate the registration with"`
21
+
}
22
+
23
+
typeActivateInputstruct {
24
+
Regcodestring`json:"regcode,omitempty" jsonschema:"The subscription registration code to register the system with"`
25
+
Productstring`json:"product" jsonschema:"The product to activate on the system, e.g. 'sle-module-basesystem/15.5/x86_64'. The system needs to be registered first. Available extensions and modules to activate can be found via the ListExtensions tool."`
26
+
Emailstring`json:"email,omitempty" jsonschema:"Email Address to associate the registration with"`
27
+
}
28
+
15
29
typeJSONOutputstruct {
16
30
Responsestring`json:"response" jsonschema:"the response from the tool"`
17
31
Errorstring`json:"error,omitempty" jsonschema:"the error message if the tool failed"`
returnnil, JSONOutput{Error: "Please provide the product identifier in this format: <internal name>/<version>/<architecture>. You can find these values in the ListExtensions tool"}, err
listenAddr:=flag.String("http", "", "address for http transport, defaults to stdio")
60
119
flag.Parse()
@@ -69,6 +128,14 @@ func main() {
69
128
Name: "ListExtensions",
70
129
Description: "List available extension products for your SUSE system. Your system's base product must be activated first.",
71
130
}, ListExtensions)
131
+
mcp.AddTool(server, &mcp.Tool{
132
+
Name: "RegisterSystem",
133
+
Description: "Registers and activates your SUSE system. This will enable access to online repositories and additional extensions and modules.",
134
+
}, RegisterSystem)
135
+
mcp.AddTool(server, &mcp.Tool{
136
+
Name: "ActivateProduct",
137
+
Description: "Activates and additional extension product or module on your SUSE system. Available extensions can get queried with the ListExtensions tool.",
0 commit comments