Skip to content

Commit 0ef6cf4

Browse files
committed
Make Transport required, Version optional and no default value for Format
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent e354bb4 commit 0ef6cf4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/model/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ type Package struct {
3232
// - For MCPB: direct download URL
3333
Identifier string `json:"identifier" minLength:"1" doc:"Package identifier - either a package name (for registries) or URL (for direct downloads)" example:"@modelcontextprotocol/server-brave-search"`
3434
// Version is the package version (used by npm, pypi, nuget; not used by oci, mcpb where version is in the identifier)
35-
Version string `json:"version" minLength:"1" doc:"Package version. Must be a specific version. Version ranges are rejected (e.g., '^1.2.3', '~1.2.3', '>=1.2.3', '1.x', '1.*')." example:"1.0.2"`
35+
Version string `json:"version,omitempty" minLength:"1" doc:"Package version. Must be a specific version. Version ranges are rejected (e.g., '^1.2.3', '~1.2.3', '>=1.2.3', '1.x', '1.*')." example:"1.0.2"`
3636
// FileSHA256 is the SHA-256 hash for integrity verification (required for mcpb, optional for others)
3737
FileSHA256 string `json:"fileSha256,omitempty" pattern:"^[a-f0-9]{64}$" doc:"SHA-256 hash of the package file for integrity verification. Required for MCPB packages and optional for other package types. Authors are responsible for generating correct SHA-256 hashes when creating server.json. If present, MCP clients must validate the downloaded file matches the hash before running packages to ensure file integrity." example:"fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce"`
3838
// RunTimeHint suggests the appropriate runtime for the package
3939
RunTimeHint string `json:"runtimeHint,omitempty" doc:"A hint to help clients determine the appropriate runtime for the package. This field should be provided when runtimeArguments are present." example:"npx"`
4040
// Transport is required and specifies the transport protocol configuration
41-
Transport Transport `json:"transport,omitempty" doc:"Transport protocol configuration for the package"`
41+
Transport Transport `json:"transport" doc:"Transport protocol configuration for the package"`
4242
// RuntimeArguments are passed to the package's runtime command (e.g., docker, npx)
4343
RuntimeArguments []Argument `json:"runtimeArguments,omitempty" doc:"A list of arguments to be passed to the package's runtime command (such as docker or npx). The runtimeHint field should be provided when runtimeArguments are present."`
4444
// PackageArguments are passed to the package's binary
@@ -66,7 +66,7 @@ const (
6666
type Input struct {
6767
Description string `json:"description,omitempty" doc:"A description of the input, which clients can use to provide context to the user."`
6868
IsRequired bool `json:"isRequired,omitempty" default:"false" doc:"Whether the input is required"`
69-
Format Format `json:"format,omitempty" default:"string" enum:"string,number,boolean,filepath" doc:"Specifies the input format. Supported values include filepath, which should be interpreted as a file on the user's filesystem."`
69+
Format Format `json:"format,omitempty" enum:"string,number,boolean,filepath" doc:"Specifies the input format. Supported values include filepath, which should be interpreted as a file on the user's filesystem."`
7070
Value string `json:"value,omitempty" doc:"The value for the input. If this is not set, the user may be prompted to provide a value. Identifiers wrapped in {curly_braces} will be replaced with the corresponding properties from the input variables map."`
7171
IsSecret bool `json:"isSecret,omitempty" default:"false" doc:"Indicates whether the input is a secret value (e.g., password, token). If true, clients should handle the value securely."`
7272
Default string `json:"default,omitempty" doc:"The default value for the input. This should be a valid value for the input. If you want to provide input examples or guidance, use the placeholder field instead."`

0 commit comments

Comments
 (0)