@@ -13,163 +13,163 @@ import (
13
13
// Registry represents the top-level structure of the MCP registry
14
14
type Registry struct {
15
15
// Version is the schema version of the registry
16
- Version string `json:"version"`
16
+ Version string `json:"version" yaml:"version" `
17
17
// LastUpdated is the timestamp when the registry was last updated, in RFC3339 format
18
- LastUpdated string `json:"last_updated"`
18
+ LastUpdated string `json:"last_updated" yaml:"last_updated" `
19
19
// Servers is a map of server names to their corresponding server definitions
20
- Servers map [string ]* ImageMetadata `json:"servers"`
20
+ Servers map [string ]* ImageMetadata `json:"servers" yaml:"servers" `
21
21
// RemoteServers is a map of server names to their corresponding remote server definitions
22
22
// These are MCP servers accessed via HTTP/HTTPS using the thv proxy command
23
- RemoteServers map [string ]* RemoteServerMetadata `json:"remote_servers,omitempty"`
23
+ RemoteServers map [string ]* RemoteServerMetadata `json:"remote_servers,omitempty" yaml:"remote_servers,omitempty" `
24
24
}
25
25
26
26
// BaseServerMetadata contains common fields shared between container and remote MCP servers
27
27
type BaseServerMetadata struct {
28
28
// Name is the identifier for the MCP server, used when referencing the server in commands
29
29
// If not provided, it will be auto-generated from the registry key
30
- Name string `json:"name,omitempty"`
30
+ Name string `json:"name,omitempty" yaml:"name,omitempty" `
31
31
// Description is a human-readable description of the server's purpose and functionality
32
- Description string `json:"description"`
32
+ Description string `json:"description" yaml:"description" `
33
33
// Tier represents the tier classification level of the server, e.g., "Official" or "Community"
34
- Tier string `json:"tier"`
34
+ Tier string `json:"tier" yaml:"tier" `
35
35
// Status indicates whether the server is currently active or deprecated
36
- Status string `json:"status"`
36
+ Status string `json:"status" yaml:"status" `
37
37
// Transport defines the communication protocol for the server
38
38
// For containers: stdio, sse, or streamable-http
39
39
// For remote servers: sse or streamable-http (stdio not supported)
40
- Transport string `json:"transport"`
40
+ Transport string `json:"transport" yaml:"transport" `
41
41
// Tools is a list of tool names provided by this MCP server
42
- Tools []string `json:"tools"`
42
+ Tools []string `json:"tools" yaml:"tools" `
43
43
// Metadata contains additional information about the server such as popularity metrics
44
- Metadata * Metadata `json:"metadata,omitempty"`
44
+ Metadata * Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty" `
45
45
// RepositoryURL is the URL to the source code repository for the server
46
- RepositoryURL string `json:"repository_url,omitempty"`
46
+ RepositoryURL string `json:"repository_url,omitempty" yaml:"repository_url,omitempty" `
47
47
// Tags are categorization labels for the server to aid in discovery and filtering
48
- Tags []string `json:"tags,omitempty"`
48
+ Tags []string `json:"tags,omitempty" yaml:"tags,omitempty" `
49
49
// CustomMetadata allows for additional user-defined metadata
50
- CustomMetadata map [string ]any `json:"custom_metadata,omitempty"`
50
+ CustomMetadata map [string ]any `json:"custom_metadata,omitempty" yaml:"custom_metadata,omitempty" `
51
51
}
52
52
53
53
// ImageMetadata represents the metadata for an MCP server image stored in our registry.
54
54
type ImageMetadata struct {
55
55
BaseServerMetadata
56
56
// Image is the Docker image reference for the MCP server
57
- Image string `json:"image"`
57
+ Image string `json:"image" yaml:"image" `
58
58
// TargetPort is the port for the container to expose (only applicable to SSE and Streamable HTTP transports)
59
- TargetPort int `json:"target_port,omitempty"`
59
+ TargetPort int `json:"target_port,omitempty" yaml:"target_port,omitempty" `
60
60
// Permissions defines the security profile and access permissions for the server
61
- Permissions * permissions.Profile `json:"permissions,omitempty"`
61
+ Permissions * permissions.Profile `json:"permissions,omitempty" yaml:"permissions,omitempty" `
62
62
// EnvVars defines environment variables that can be passed to the server
63
- EnvVars []* EnvVar `json:"env_vars,omitempty"`
63
+ EnvVars []* EnvVar `json:"env_vars,omitempty" yaml:"env_vars,omitempty" `
64
64
// Args are the default command-line arguments to pass to the MCP server container.
65
65
// These arguments will be used only if no command-line arguments are provided by the user.
66
66
// If the user provides arguments, they will override these defaults.
67
- Args []string `json:"args,omitempty"`
67
+ Args []string `json:"args,omitempty" yaml:"args,omitempty" `
68
68
// DockerTags lists the available Docker tags for this server image
69
- DockerTags []string `json:"docker_tags,omitempty"`
69
+ DockerTags []string `json:"docker_tags,omitempty" yaml:"docker_tags,omitempty" `
70
70
// Provenance contains verification and signing metadata
71
- Provenance * Provenance `json:"provenance,omitempty"`
71
+ Provenance * Provenance `json:"provenance,omitempty" yaml:"provenance,omitempty" `
72
72
}
73
73
74
74
// Provenance contains metadata about the image's provenance and signing status
75
75
type Provenance struct {
76
- SigstoreURL string `json:"sigstore_url"`
77
- RepositoryURI string `json:"repository_uri"`
78
- RepositoryRef string `json:"repository_ref"`
79
- SignerIdentity string `json:"signer_identity"`
80
- RunnerEnvironment string `json:"runner_environment"`
81
- CertIssuer string `json:"cert_issuer"`
82
- Attestation * VerifiedAttestation `json:"attestation,omitempty"`
76
+ SigstoreURL string `json:"sigstore_url" yaml:"sigstore_url" `
77
+ RepositoryURI string `json:"repository_uri" yaml:"repository_uri" `
78
+ RepositoryRef string `json:"repository_ref" yaml:"repository_ref" `
79
+ SignerIdentity string `json:"signer_identity" yaml:"signer_identity" `
80
+ RunnerEnvironment string `json:"runner_environment" yaml:"runner_environment" `
81
+ CertIssuer string `json:"cert_issuer" yaml:"cert_issuer" `
82
+ Attestation * VerifiedAttestation `json:"attestation,omitempty" yaml:"attestation,omitempty" `
83
83
}
84
84
85
85
// VerifiedAttestation represents the verified attestation information
86
86
type VerifiedAttestation struct {
87
- PredicateType string `json:"predicate_type,omitempty"`
88
- Predicate any `json:"predicate,omitempty"`
87
+ PredicateType string `json:"predicate_type,omitempty" yaml:"predicate_type,omitempty" `
88
+ Predicate any `json:"predicate,omitempty" yaml:"predicate,omitempty" `
89
89
}
90
90
91
91
// EnvVar represents an environment variable for an MCP server
92
92
type EnvVar struct {
93
93
// Name is the environment variable name (e.g., API_KEY)
94
- Name string `json:"name"`
94
+ Name string `json:"name" yaml:"name" `
95
95
// Description is a human-readable explanation of the variable's purpose
96
- Description string `json:"description"`
96
+ Description string `json:"description" yaml:"description" `
97
97
// Required indicates whether this environment variable must be provided
98
98
// If true and not provided via command line or secrets, the user will be prompted for a value
99
- Required bool `json:"required"`
99
+ Required bool `json:"required" yaml:"required" `
100
100
// Default is the value to use if the environment variable is not explicitly provided
101
101
// Only used for non-required variables
102
- Default string `json:"default,omitempty"`
102
+ Default string `json:"default,omitempty" yaml:"default,omitempty" `
103
103
// Secret indicates whether this environment variable contains sensitive information
104
104
// If true, the value will be stored as a secret rather than as a plain environment variable
105
- Secret bool `json:"secret,omitempty"`
105
+ Secret bool `json:"secret,omitempty" yaml:"secret,omitempty" `
106
106
}
107
107
108
108
// Header represents an HTTP header for remote MCP server authentication
109
109
type Header struct {
110
110
// Name is the header name (e.g., X-API-Key, Authorization)
111
- Name string `json:"name"`
111
+ Name string `json:"name" yaml:"name" `
112
112
// Description is a human-readable explanation of the header's purpose
113
- Description string `json:"description"`
113
+ Description string `json:"description" yaml:"description" `
114
114
// Required indicates whether this header must be provided
115
115
// If true and not provided via command line or secrets, the user will be prompted for a value
116
- Required bool `json:"required"`
116
+ Required bool `json:"required" yaml:"required" `
117
117
// Default is the value to use if the header is not explicitly provided
118
118
// Only used for non-required headers
119
- Default string `json:"default,omitempty"`
119
+ Default string `json:"default,omitempty" yaml:"default,omitempty" `
120
120
// Secret indicates whether this header contains sensitive information
121
121
// If true, the value will be stored as a secret rather than as plain text
122
- Secret bool `json:"secret,omitempty"`
122
+ Secret bool `json:"secret,omitempty" yaml:"secret,omitempty" `
123
123
// Choices provides a list of valid values for the header (optional)
124
- Choices []string `json:"choices,omitempty"`
124
+ Choices []string `json:"choices,omitempty" yaml:"choices,omitempty" `
125
125
}
126
126
127
127
// OAuthConfig represents OAuth/OIDC configuration for remote server authentication
128
128
type OAuthConfig struct {
129
129
// Issuer is the OAuth/OIDC issuer URL (e.g., https://accounts.google.com)
130
130
// Used for OIDC discovery to find authorization and token endpoints
131
- Issuer string `json:"issuer,omitempty"`
131
+ Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty" `
132
132
// AuthorizeURL is the OAuth authorization endpoint URL
133
133
// Used for non-OIDC OAuth flows when issuer is not provided
134
- AuthorizeURL string `json:"authorize_url,omitempty"`
134
+ AuthorizeURL string `json:"authorize_url,omitempty" yaml:"authorize_url,omitempty" `
135
135
// TokenURL is the OAuth token endpoint URL
136
136
// Used for non-OIDC OAuth flows when issuer is not provided
137
- TokenURL string `json:"token_url,omitempty"`
137
+ TokenURL string `json:"token_url,omitempty" yaml:"token_url,omitempty" `
138
138
// ClientID is the OAuth client ID for authentication
139
- ClientID string `json:"client_id,omitempty"`
139
+ ClientID string `json:"client_id,omitempty" yaml:"client_id,omitempty" `
140
140
// Scopes are the OAuth scopes to request
141
141
// If not specified, defaults to ["openid", "profile", "email"] for OIDC
142
- Scopes []string `json:"scopes,omitempty"`
142
+ Scopes []string `json:"scopes,omitempty" yaml:"scopes,omitempty" `
143
143
// UsePKCE indicates whether to use PKCE for the OAuth flow
144
144
// Defaults to true for enhanced security
145
- UsePKCE bool `json:"use_pkce,omitempty"`
145
+ UsePKCE bool `json:"use_pkce,omitempty" yaml:"use_pkce,omitempty" `
146
146
}
147
147
148
148
// RemoteServerMetadata represents the metadata for a remote MCP server accessed via HTTP/HTTPS.
149
149
// Remote servers are accessed through the thv proxy command which handles authentication and tunneling.
150
150
type RemoteServerMetadata struct {
151
151
BaseServerMetadata
152
152
// URL is the endpoint URL for the remote MCP server (e.g., https://api.example.com/mcp)
153
- URL string `json:"url"`
153
+ URL string `json:"url" yaml:"url" `
154
154
// Headers defines HTTP headers that can be passed to the remote server for authentication
155
155
// These are used with the thv proxy command's authentication features
156
- Headers []* Header `json:"headers,omitempty"`
156
+ Headers []* Header `json:"headers,omitempty" yaml:"headers,omitempty" `
157
157
// OAuthConfig provides OAuth/OIDC configuration for authentication to the remote server
158
158
// Used with the thv proxy command's --remote-auth flags
159
- OAuthConfig * OAuthConfig `json:"oauth_config,omitempty"`
159
+ OAuthConfig * OAuthConfig `json:"oauth_config,omitempty" yaml:"oauth_config,omitempty" `
160
160
// EnvVars defines environment variables that can be passed to configure the client
161
161
// These might be needed for client-side configuration when connecting to the remote server
162
- EnvVars []* EnvVar `json:"env_vars,omitempty"`
162
+ EnvVars []* EnvVar `json:"env_vars,omitempty" yaml:"env_vars,omitempty" `
163
163
}
164
164
165
165
// Metadata represents metadata about an MCP server
166
166
type Metadata struct {
167
167
// Stars represents the popularity rating or number of stars for the server
168
- Stars int `json:"stars"`
168
+ Stars int `json:"stars" yaml:"stars" `
169
169
// Pulls indicates how many times the server image has been downloaded
170
- Pulls int `json:"pulls"`
170
+ Pulls int `json:"pulls" yaml:"pulls" `
171
171
// LastUpdated is the timestamp when the server was last updated, in RFC3339 format
172
- LastUpdated string `json:"last_updated"`
172
+ LastUpdated string `json:"last_updated" yaml:"last_updated" `
173
173
}
174
174
175
175
// ParsedTime returns the LastUpdated field as a time.Time
0 commit comments