|
9 | 9 | StatusDeleted Status = "deleted"
|
10 | 10 | )
|
11 | 11 |
|
| 12 | +// ServerJSON represents complete server information as defined in the MCP spec (pure, no registry metadata) |
| 13 | +type ServerJSON struct { |
| 14 | + Schema string `json:"$schema,omitempty" bson:"$schema,omitempty"` |
| 15 | + Name string `json:"name" minLength:"1" maxLength:"200" bson:"name"` |
| 16 | + Description string `json:"description" minLength:"1" maxLength:"100" bson:"description"` |
| 17 | + Status Status `json:"status,omitempty" minLength:"1" bson:"status,omitempty"` |
| 18 | + Repository Repository `json:"repository,omitempty" bson:"repository"` |
| 19 | + VersionDetail VersionDetail `json:"version_detail" bson:"version_detail"` |
| 20 | + Packages []Package `json:"packages,omitempty" bson:"packages,omitempty"` |
| 21 | + Remotes []Remote `json:"remotes,omitempty" bson:"remotes,omitempty"` |
| 22 | +} |
| 23 | + |
| 24 | +// Package represents a package configuration |
| 25 | +type Package struct { |
| 26 | + // RegistryType indicates how to download packages (e.g., "npm", "pypi", "docker-hub", "mcpb") |
| 27 | + RegistryType string `json:"registry_type,omitempty" bson:"registry_type,omitempty"` |
| 28 | + // RegistryBaseURL is the base URL of the package registry |
| 29 | + RegistryBaseURL string `json:"registry_base_url,omitempty" bson:"registry_base_url,omitempty"` |
| 30 | + // Identifier is the package identifier - either a package name (for registries) or URL (for direct downloads) |
| 31 | + Identifier string `json:"identifier,omitempty" bson:"identifier,omitempty"` |
| 32 | + Version string `json:"version,omitempty" bson:"version,omitempty"` |
| 33 | + FileSHA256 string `json:"file_sha256,omitempty" bson:"file_sha256,omitempty"` |
| 34 | + RunTimeHint string `json:"runtime_hint,omitempty" bson:"runtime_hint,omitempty"` |
| 35 | + RuntimeArguments []Argument `json:"runtime_arguments,omitempty" bson:"runtime_arguments,omitempty"` |
| 36 | + PackageArguments []Argument `json:"package_arguments,omitempty" bson:"package_arguments,omitempty"` |
| 37 | + EnvironmentVariables []KeyValueInput `json:"environment_variables,omitempty" bson:"environment_variables,omitempty"` |
| 38 | +} |
| 39 | + |
| 40 | +// Remote represents a remote connection endpoint |
| 41 | +type Remote struct { |
| 42 | + TransportType string `json:"transport_type" bson:"transport_type"` |
| 43 | + URL string `json:"url" format:"uri" bson:"url"` |
| 44 | + Headers []KeyValueInput `json:"headers,omitempty" bson:"headers,omitempty"` |
| 45 | +} |
| 46 | + |
12 | 47 | // Repository represents a source code repository as defined in the spec
|
13 | 48 | type Repository struct {
|
14 | 49 | URL string `json:"url" bson:"url"`
|
@@ -66,42 +101,7 @@ type Argument struct {
|
66 | 101 | ValueHint string `json:"value_hint,omitempty" bson:"value_hint,omitempty"`
|
67 | 102 | }
|
68 | 103 |
|
69 |
| -// Package represents a package configuration |
70 |
| -type Package struct { |
71 |
| - // RegistryType indicates how to download packages (e.g., "npm", "pypi", "docker-hub", "mcpb") |
72 |
| - RegistryType string `json:"registry_type,omitempty" bson:"registry_type,omitempty"` |
73 |
| - // RegistryBaseURL is the base URL of the package registry |
74 |
| - RegistryBaseURL string `json:"registry_base_url,omitempty" bson:"registry_base_url,omitempty"` |
75 |
| - // Identifier is the package identifier - either a package name (for registries) or URL (for direct downloads) |
76 |
| - Identifier string `json:"identifier,omitempty" bson:"identifier,omitempty"` |
77 |
| - Version string `json:"version,omitempty" bson:"version,omitempty"` |
78 |
| - FileSHA256 string `json:"file_sha256,omitempty" bson:"file_sha256,omitempty"` |
79 |
| - RunTimeHint string `json:"runtime_hint,omitempty" bson:"runtime_hint,omitempty"` |
80 |
| - RuntimeArguments []Argument `json:"runtime_arguments,omitempty" bson:"runtime_arguments,omitempty"` |
81 |
| - PackageArguments []Argument `json:"package_arguments,omitempty" bson:"package_arguments,omitempty"` |
82 |
| - EnvironmentVariables []KeyValueInput `json:"environment_variables,omitempty" bson:"environment_variables,omitempty"` |
83 |
| -} |
84 |
| - |
85 |
| -// Remote represents a remote connection endpoint |
86 |
| -type Remote struct { |
87 |
| - TransportType string `json:"transport_type" bson:"transport_type"` |
88 |
| - URL string `json:"url" format:"uri" bson:"url"` |
89 |
| - Headers []KeyValueInput `json:"headers,omitempty" bson:"headers,omitempty"` |
90 |
| -} |
91 |
| - |
92 | 104 | // VersionDetail represents the version details of a server (pure MCP spec, no registry metadata)
|
93 | 105 | type VersionDetail struct {
|
94 | 106 | Version string `json:"version" bson:"version"`
|
95 | 107 | }
|
96 |
| - |
97 |
| -// ServerJSON represents complete server information as defined in the MCP spec (pure, no registry metadata) |
98 |
| -type ServerJSON struct { |
99 |
| - Schema string `json:"$schema,omitempty" bson:"$schema,omitempty"` |
100 |
| - Name string `json:"name" minLength:"1" maxLength:"200" bson:"name"` |
101 |
| - Description string `json:"description" minLength:"1" maxLength:"100" bson:"description"` |
102 |
| - Status Status `json:"status,omitempty" minLength:"1" bson:"status,omitempty"` |
103 |
| - Repository Repository `json:"repository,omitempty" bson:"repository"` |
104 |
| - VersionDetail VersionDetail `json:"version_detail" bson:"version_detail"` |
105 |
| - Packages []Package `json:"packages,omitempty" bson:"packages,omitempty"` |
106 |
| - Remotes []Remote `json:"remotes,omitempty" bson:"remotes,omitempty"` |
107 |
| -} |
0 commit comments