Skip to content

MCP InputSchema and empty Properties #33

@manusa

Description

@manusa

We're progressively migrating Kubernetes MCP Server to the go-sdk.

As a first step, we've decoupled the MCP tool definitions from any MCP implementation by describing them using jsonschema (this implementation).

We've noticed some users having issues with how the inputSchema is marshalled for tools definitions with no arguments (see containers/kubernetes-mcp-server#340).

I understand that the issue is with:

Properties map[string]*Schema `json:"properties,omitempty"`

Since it's configured to omitempty the field is not marshalled.

I implemented a workaround to add the field manually here:
https://github.com/containers/kubernetes-mcp-server/blob/c69e90c70dca03fee3b910c2a3580a1187a2e470/pkg/mcp/m3labs.go#L33-L39

Have you faced this issue in any of you MCPs?

I see that go-sdk might be facing a similar issue for this case: https://github.com/modelcontextprotocol/go-sdk/blob/07f6c490c68284a1f152ec9c0f71e2861b0e687d/mcp/server.go#L210-L213

I'm not sure if we can find a way to deal with this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions