Skip to content

Commit e34d981

Browse files
clean works.
Signed-off-by: zhanluxianshen <zhanluxianshen@163.com>
1 parent 2f266c7 commit e34d981

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

internal/api/server.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ import (
1414

1515
// Server represents the HTTP server
1616
type Server struct {
17-
config *config.Config
18-
registry service.RegistryService
19-
authService auth.Service
20-
router *http.ServeMux
21-
server *http.Server
17+
config *config.Config
18+
server *http.Server
2219
}
2320

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

2926
server := &Server{
30-
config: cfg,
31-
registry: registryService,
32-
authService: authService,
33-
router: mux,
27+
config: cfg,
3428
server: &http.Server{
3529
Addr: cfg.ServerAddress,
3630
Handler: mux,

tools/publisher/main.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,23 +311,14 @@ func publishToRegistry(registryURL string, mcpData []byte, token string) error {
311311
return fmt.Errorf("error parsing mcp.json file: %w", err)
312312
}
313313

314-
// Create the publish request payload (without authentication)
315-
publishReq := mcpDetails
316-
317-
// Convert the request to JSON
318-
jsonData, err := json.Marshal(publishReq)
319-
if err != nil {
320-
return fmt.Errorf("error serializing request: %w", err)
321-
}
322-
323314
// Ensure the URL ends with the publish endpoint
324315
if !strings.HasSuffix(registryURL, "/") {
325316
registryURL += "/"
326317
}
327318
publishURL := registryURL + "v0/publish"
328319

329320
// Create and send the request
330-
req, err := http.NewRequestWithContext(context.Background(), http.MethodPost, publishURL, bytes.NewBuffer(jsonData))
321+
req, err := http.NewRequestWithContext(context.Background(), http.MethodPost, publishURL, bytes.NewBuffer(mcpData))
331322
if err != nil {
332323
return fmt.Errorf("error creating request: %w", err)
333324
}

tools/publisher/mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525
]
2626
},{
27-
"registry_name": "docker>",
27+
"registry_name": "docker",
2828
"name": "io.github.<owner>/<server-name>-cli",
2929
"version": "0.123.223",
3030
"runtime_hint": "docker",

0 commit comments

Comments
 (0)