Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ import (

// Server represents the HTTP server
type Server struct {
config *config.Config
registry service.RegistryService
authService auth.Service
router *http.ServeMux
server *http.Server
config *config.Config
server *http.Server
}

// NewServer creates a new HTTP server
Expand All @@ -27,10 +24,7 @@ func NewServer(cfg *config.Config, registryService service.RegistryService, auth
mux := router.New(cfg, registryService, authService)

server := &Server{
config: cfg,
registry: registryService,
authService: authService,
router: mux,
config: cfg,
server: &http.Server{
Addr: cfg.ServerAddress,
Handler: mux,
Expand Down
11 changes: 1 addition & 10 deletions tools/publisher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,14 @@ func publishToRegistry(registryURL string, mcpData []byte, token string) error {
return fmt.Errorf("error parsing mcp.json file: %w", err)
}

// Create the publish request payload (without authentication)
publishReq := mcpDetails

// Convert the request to JSON
jsonData, err := json.Marshal(publishReq)
if err != nil {
return fmt.Errorf("error serializing request: %w", err)
}

// Ensure the URL ends with the publish endpoint
if !strings.HasSuffix(registryURL, "/") {
registryURL += "/"
}
publishURL := registryURL + "v0/publish"

// Create and send the request
req, err := http.NewRequestWithContext(context.Background(), http.MethodPost, publishURL, bytes.NewBuffer(jsonData))
req, err := http.NewRequestWithContext(context.Background(), http.MethodPost, publishURL, bytes.NewBuffer(mcpData))
if err != nil {
return fmt.Errorf("error creating request: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion tools/publisher/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
]
},{
"registry_name": "docker>",
"registry_name": "docker",
"name": "io.github.<owner>/<server-name>-cli",
"version": "0.123.223",
"runtime_hint": "docker",
Expand Down