Skip to content

Commit 12dc4c3

Browse files
authored
Remove leftover bson tags from the Go structs (#327)
<!-- Provide a brief summary of your changes --> ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> The following PR removes the now obsolete bson tags (we moved away from MongoDB). ## How Has This Been Tested? <!-- Have you tested this in a real application? Which scenarios were tested? --> Locally ## Breaking Changes <!-- Will users need to update their code or configurations? --> No ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ ] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [ ] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context <!-- Add any other context, implementation notes, or design decisions --> Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 53f4d2f commit 12dc4c3

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

pkg/api/v0/types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import (
88

99
// RegistryExtensions represents registry-generated metadata
1010
type RegistryExtensions struct {
11-
ID string `json:"id" bson:"_id"`
12-
PublishedAt time.Time `json:"published_at" bson:"published_at"`
13-
UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"`
14-
IsLatest bool `json:"is_latest" bson:"is_latest"`
15-
ReleaseDate string `json:"release_date" bson:"release_date"`
11+
ID string `json:"id"`
12+
PublishedAt time.Time `json:"published_at"`
13+
UpdatedAt time.Time `json:"updated_at,omitempty"`
14+
IsLatest bool `json:"is_latest"`
15+
ReleaseDate string `json:"release_date"`
1616
}
1717

1818
// ServerRecord represents the unified storage and API response model
1919
type ServerRecord struct {
20-
Server model.ServerJSON `json:"server" bson:"server"` // Pure MCP server.json
21-
XIOModelContextProtocolRegistry RegistryExtensions `json:"x-io.modelcontextprotocol.registry,omitempty" bson:"registry_extensions"` // Registry-generated data
22-
XPublisher map[string]interface{} `json:"x-publisher,omitempty" bson:"publisher_extensions"` // x-publisher extensions
20+
Server model.ServerJSON `json:"server"` // Pure MCP server.json
21+
XIOModelContextProtocolRegistry RegistryExtensions `json:"x-io.modelcontextprotocol.registry,omitempty"` // Registry-generated data
22+
XPublisher map[string]interface{} `json:"x-publisher,omitempty"` // x-publisher extensions
2323
}
2424

2525
// ServerListResponse represents the paginated server list response

pkg/model/types.go

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,44 @@ const (
1111

1212
// ServerJSON represents complete server information as defined in the MCP spec (pure, no registry metadata)
1313
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"`
14+
Schema string `json:"$schema,omitempty"`
15+
Name string `json:"name" minLength:"1" maxLength:"200"`
16+
Description string `json:"description" minLength:"1" maxLength:"100"`
17+
Status Status `json:"status,omitempty" minLength:"1"`
18+
Repository Repository `json:"repository,omitempty"`
19+
VersionDetail VersionDetail `json:"version_detail"`
20+
Packages []Package `json:"packages,omitempty"`
21+
Remotes []Remote `json:"remotes,omitempty"`
2222
}
2323

2424
// Package represents a package configuration
2525
type Package struct {
2626
// RegistryType indicates how to download packages (e.g., "npm", "pypi", "docker-hub", "mcpb")
27-
RegistryType string `json:"registry_type,omitempty" bson:"registry_type,omitempty"`
27+
RegistryType string `json:"registry_type,omitempty"`
2828
// RegistryBaseURL is the base URL of the package registry
29-
RegistryBaseURL string `json:"registry_base_url,omitempty" bson:"registry_base_url,omitempty"`
29+
RegistryBaseURL string `json:"registry_base_url,omitempty"`
3030
// 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"`
31+
Identifier string `json:"identifier,omitempty"`
32+
Version string `json:"version,omitempty"`
33+
FileSHA256 string `json:"file_sha256,omitempty"`
34+
RunTimeHint string `json:"runtime_hint,omitempty"`
35+
RuntimeArguments []Argument `json:"runtime_arguments,omitempty"`
36+
PackageArguments []Argument `json:"package_arguments,omitempty"`
37+
EnvironmentVariables []KeyValueInput `json:"environment_variables,omitempty"`
3838
}
3939

4040
// Remote represents a remote connection endpoint
4141
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"`
42+
TransportType string `json:"transport_type"`
43+
URL string `json:"url" format:"uri"`
44+
Headers []KeyValueInput `json:"headers,omitempty"`
4545
}
4646

4747
// Repository represents a source code repository as defined in the spec
4848
type Repository struct {
49-
URL string `json:"url" bson:"url"`
50-
Source string `json:"source" bson:"source"`
51-
ID string `json:"id,omitempty" bson:"id,omitempty"`
49+
URL string `json:"url"`
50+
Source string `json:"source"`
51+
ID string `json:"id,omitempty"`
5252
}
5353

5454
// Format represents the input format type
@@ -63,25 +63,25 @@ const (
6363

6464
// Input represents a configuration input
6565
type Input struct {
66-
Description string `json:"description,omitempty" bson:"description,omitempty"`
67-
IsRequired bool `json:"is_required,omitempty" bson:"is_required,omitempty"`
68-
Format Format `json:"format,omitempty" bson:"format,omitempty"`
69-
Value string `json:"value,omitempty" bson:"value,omitempty"`
70-
IsSecret bool `json:"is_secret,omitempty" bson:"is_secret,omitempty"`
71-
Default string `json:"default,omitempty" bson:"default,omitempty"`
72-
Choices []string `json:"choices,omitempty" bson:"choices,omitempty"`
66+
Description string `json:"description,omitempty"`
67+
IsRequired bool `json:"is_required,omitempty"`
68+
Format Format `json:"format,omitempty"`
69+
Value string `json:"value,omitempty"`
70+
IsSecret bool `json:"is_secret,omitempty"`
71+
Default string `json:"default,omitempty"`
72+
Choices []string `json:"choices,omitempty"`
7373
}
7474

7575
// InputWithVariables represents an input that can contain variables
7676
type InputWithVariables struct {
77-
Input `json:",inline" bson:",inline"`
78-
Variables map[string]Input `json:"variables,omitempty" bson:"variables,omitempty"`
77+
Input `json:",inline"`
78+
Variables map[string]Input `json:"variables,omitempty"`
7979
}
8080

8181
// KeyValueInput represents a named input with variables
8282
type KeyValueInput struct {
83-
InputWithVariables `json:",inline" bson:",inline"`
84-
Name string `json:"name" bson:"name"`
83+
InputWithVariables `json:",inline"`
84+
Name string `json:"name"`
8585
}
8686

8787
// ArgumentType represents the type of argument
@@ -94,14 +94,14 @@ const (
9494

9595
// Argument defines a type that can be either a PositionalArgument or a NamedArgument
9696
type Argument struct {
97-
InputWithVariables `json:",inline" bson:",inline"`
98-
Type ArgumentType `json:"type" bson:"type"`
99-
Name string `json:"name,omitempty" bson:"name,omitempty"`
100-
IsRepeated bool `json:"is_repeated,omitempty" bson:"is_repeated,omitempty"`
101-
ValueHint string `json:"value_hint,omitempty" bson:"value_hint,omitempty"`
97+
InputWithVariables `json:",inline"`
98+
Type ArgumentType `json:"type"`
99+
Name string `json:"name,omitempty"`
100+
IsRepeated bool `json:"is_repeated,omitempty"`
101+
ValueHint string `json:"value_hint,omitempty"`
102102
}
103103

104104
// VersionDetail represents the version details of a server (pure MCP spec, no registry metadata)
105105
type VersionDetail struct {
106-
Version string `json:"version" bson:"version"`
106+
Version string `json:"version"`
107107
}

0 commit comments

Comments
 (0)