Skip to content
Open
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
15 changes: 12 additions & 3 deletions internal/mcp/registryserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"strings"
"time"

restv0 "github.com/agentregistry-dev/agentregistry/internal/registry/api/handlers/v0"
Expand Down Expand Up @@ -369,10 +370,14 @@ func addDeploymentTools(server *mcp.Server, registry service.RegistryService) {
}
outIdx := 0
for _, d := range deployments {
if args.ResourceType != "" && d.ResourceType != args.ResourceType {
if args.ResourceType != "" && !strings.EqualFold(d.ResourceType, args.ResourceType) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i'm personally a bit iffy on this. it makes sense, but as far as I could tell this is the only place in the code we'd support case-insensitive

continue
}
resp.Deployments[outIdx] = *d
dep := *d
if dep.Config == nil {
dep.Config = map[string]string{}
}
resp.Deployments[outIdx] = dep
Comment on lines +376 to +380
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid a nil Config, would it be better to update the list method so it gets instantiated there and we wouldn't need to do this check here?

so in registry_service.go, when listing k8s deployments listKubernetesDeployments, we'd simply

config := labels
if config == nil {
  config = make(map[string]string)
}
d := {
...
  config: config
...
}

for what it's worth, our db listing code already does something similar to this, so we'd essentially be matching its behavior in the k8s listing

		if d.Config == nil {
			d.Config = make(map[string]string)
		}

outIdx++
}
resp.Deployments = resp.Deployments[:outIdx]
Expand All @@ -392,7 +397,11 @@ func addDeploymentTools(server *mcp.Server, registry service.RegistryService) {
if err != nil {
return nil, models.Deployment{}, err
}
return nil, *deployment, nil
dep := *deployment
if dep.Config == nil {
dep.Config = map[string]string{}
}
return nil, dep, nil
})

// Deploy server
Expand Down
5 changes: 3 additions & 2 deletions internal/registry/service/registry_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/agentregistry-dev/agentregistry/internal/runtime/translation/kagent"
"github.com/agentregistry-dev/agentregistry/internal/runtime/translation/registry"
"github.com/agentregistry-dev/agentregistry/pkg/models"
"github.com/agentregistry-dev/agentregistry/pkg/registry/auth"
"github.com/agentregistry-dev/agentregistry/pkg/registry/database"
"github.com/jackc/pgx/v5"
apiv0 "github.com/modelcontextprotocol/registry/pkg/api/v0"
Expand Down Expand Up @@ -195,7 +196,7 @@ func (s *registryServiceImpl) createServerInTransaction(ctx context.Context, tx
// Generate embedding asynchronously (non-blocking, best-effort)
if s.shouldGenerateEmbeddingsOnPublish() { //nolint:nestif
go func() {
bgCtx := context.Background()
bgCtx := auth.WithSystemContext(context.Background())
payload := embeddings.BuildServerEmbeddingPayload(&serverJSON)
if strings.TrimSpace(payload) == "" {
return
Expand Down Expand Up @@ -594,7 +595,7 @@ func (s *registryServiceImpl) createAgentInTransaction(ctx context.Context, tx p
// Generate embedding asynchronously (non-blocking, best-effort)
if s.shouldGenerateEmbeddingsOnPublish() { //nolint:nestif
go func() {
bgCtx := context.Background()
bgCtx := auth.WithSystemContext(context.Background())
payload := embeddings.BuildAgentEmbeddingPayload(&agentJSON)
if strings.TrimSpace(payload) == "" {
return
Expand Down
4 changes: 4 additions & 0 deletions internal/runtime/translation/kagent/kagent_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ func (t *translator) translateLocalMCPServer(server *api.MCPServer) (*kmcpv1alph
case api.TransportTypeStdio:
spec.TransportType = kmcpv1alpha1.TransportType("stdio")
spec.StdioTransport = &kmcpv1alpha1.StdioTransport{}
// Default port for transport adapter (matches KMCP CLI default)
if spec.Deployment.Port == 0 {
spec.Deployment.Port = 3000
}
default:
return nil, fmt.Errorf("unsupported MCP transport type %q for %s", server.Local.TransportType, server.Name)
}
Expand Down