Skip to content

Commit d461400

Browse files
rdimitrovtadasant
andauthored
Add a status field indicating if a server is deprecated or active (#210)
The following PR adds a new server `status` field to support the status of servers, like deprecated or active Details: * Add status field to server.json schema with 'active' and 'deprecated' values * Update OpenAPI spec to include status field in Server responses * Add ServerStatus enum and field to Go model structs * Update examples to demonstrate status field usage (`active` and `deprecated`) Since this is my first PR there's a good chance I might have missed something so I'll appreciate any feedback to make this and any PRs in the future easier for you to review 😃 Fixes: #181 ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> The main goal is to have a way for server authors to notify registry consumers that a server may no longer be maintained and shouldn't be considered for using. ## How Has This Been Tested? <!-- Have you tested this in a real application? Which scenarios were tested? --> ## Breaking Changes <!-- Will users need to update their code or configurations? --> ## 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) - [x] 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. --> - [x] 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]> Co-authored-by: Tadas Antanavicius <[email protected]>
1 parent 651c8df commit d461400

File tree

9 files changed

+78
-3
lines changed

9 files changed

+78
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ cmd/registry/registry
77
publisher
88
validate-examples
99
validate-schemas
10+
.idea/

docs/server-json/examples.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{
77
"name": "io.modelcontextprotocol/brave-search",
88
"description": "MCP server for Brave Search API integration",
9+
"status": "active",
910
"repository": {
1011
"url": "https://github.com/modelcontextprotocol/servers",
1112
"source": "github",
@@ -71,6 +72,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
7172
{
7273
"name": "io.modelcontextprotocol/filesystem",
7374
"description": "Node.js server implementing Model Context Protocol (MCP) for filesystem operations.",
75+
"status": "active",
7476
"repository": {
7577
"url": "https://github.com/modelcontextprotocol/servers",
7678
"source": "github",
@@ -385,4 +387,37 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
385387
}
386388
]
387389
}
390+
```
391+
392+
## Deprecated Server Example
393+
394+
```json
395+
{
396+
"name": "io.legacy/old-weather-server",
397+
"description": "Legacy weather server - DEPRECATED: Use weather-v2 instead for new projects",
398+
"status": "deprecated",
399+
"repository": {
400+
"url": "https://github.com/example/old-weather",
401+
"source": "github",
402+
"id": "legacy-abc123-def456-789012-345678-901234567890"
403+
},
404+
"version_detail": {
405+
"version": "0.9.5"
406+
},
407+
"packages": [
408+
{
409+
"registry_name": "npm",
410+
"name": "@legacy/old-weather-server",
411+
"version": "0.9.5",
412+
"environment_variables": [
413+
{
414+
"name": "WEATHER_API_KEY",
415+
"description": "Weather API key",
416+
"is_required": true,
417+
"is_secret": true
418+
}
419+
]
420+
}
421+
]
422+
}
388423
```

docs/server-json/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
"description": "Human-readable description of the server's functionality",
6161
"example": "Node.js server implementing Model Context Protocol (MCP) for filesystem operations."
6262
},
63+
"status": {
64+
"type": "string",
65+
"enum": ["active", "deprecated"],
66+
"default": "active",
67+
"description": "Server lifecycle status. 'deprecated' indicates the server is no longer recommended for new usage."
68+
},
6369
"repository": {
6470
"$ref": "#/$defs/Repository"
6571
},

docs/server-registry-api/examples.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ GET /v0/servers?limit=5000&offset=0
1717
"id": "a5e8a7f0-d4e4-4a1d-b12f-2896a23fd4f1",
1818
"name": "io.modelcontextprotocol/filesystem",
1919
"description": "Node.js server implementing Model Context Protocol (MCP) for filesystem operations.",
20+
"status": "active",
2021
"repository": {
2122
"url": "https://github.com/modelcontextprotocol/servers",
2223
"source": "github",
@@ -49,6 +50,7 @@ GET /v0/servers/a5e8a7f0-d4e4-4a1d-b12f-2896a23fd4f1?version=0.0.3
4950
"id": "a5e8a7f0-d4e4-4a1d-b12f-2896a23fd4f1",
5051
"name": "io.modelcontextprotocol/filesystem",
5152
"description": "Node.js server implementing Model Context Protocol (MCP) for filesystem operations.",
53+
"status": "active",
5254
"repository": {
5355
"url": "https://github.com/modelcontextprotocol/servers",
5456
"source": "github",
@@ -143,6 +145,7 @@ API Response:
143145
"id": "brave-search-12345",
144146
"name": "io.modelcontextprotocol/brave-search",
145147
"description": "MCP server for Brave Search API integration",
148+
"status": "active",
146149
"repository": {
147150
"url": "https://github.com/modelcontextprotocol/servers",
148151
"source": "github",
@@ -195,6 +198,7 @@ API Response:
195198
"id": "filesystem-67890",
196199
"name": "io.modelcontextprotocol/filesystem",
197200
"description": "Node.js server implementing Model Context Protocol (MCP) for filesystem operations",
201+
"status": "active",
198202
"repository": {
199203
"url": "https://github.com/modelcontextprotocol/servers",
200204
"source": "github",
@@ -268,6 +272,7 @@ API Response:
268272
"id": "remote-fs-54321",
269273
"name": "Remote Brave Search Server",
270274
"description": "Cloud-hosted MCP Brave Search server",
275+
"status": "active",
271276
"repository": {
272277
"url": "https://github.com/example/remote-fs",
273278
"source": "github",

docs/server-registry-api/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ components:
109109
description:
110110
type: string
111111
example: "Node.js server implementing Model Context Protocol (MCP) for filesystem operations."
112+
status:
113+
type: string
114+
enum: [active, deprecated]
115+
default: active
116+
description: "Server lifecycle status. 'deprecated' indicates the server is no longer recommended for new usage."
117+
example: "active"
112118
repository:
113119
$ref: '#/components/schemas/Repository'
114120
version_detail:

internal/model/model.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ const (
1010
AuthMethodNone AuthMethod = "none"
1111
)
1212

13+
// ServerStatus represents the lifecycle status of a server
14+
type ServerStatus string
15+
16+
const (
17+
// ServerStatusActive represents an actively maintained server (as asserted by the publisher)
18+
ServerStatusActive ServerStatus = "active"
19+
// ServerStatusDeprecated represents a server that is no longer actively maintained
20+
ServerStatusDeprecated ServerStatus = "deprecated"
21+
)
22+
1323
// Authentication holds information about the authentication method and credentials
1424
type Authentication struct {
1525
Method AuthMethod `json:"method,omitempty"`
@@ -114,6 +124,7 @@ type Server struct {
114124
ID string `json:"id" bson:"id"`
115125
Name string `json:"name" bson:"name"`
116126
Description string `json:"description" bson:"description"`
127+
Status ServerStatus `json:"status,omitempty" bson:"status,omitempty"`
117128
Repository Repository `json:"repository" bson:"repository"`
118129
VersionDetail VersionDetail `json:"version_detail" bson:"version_detail"`
119130
}

tools/publisher/main.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type Package struct {
5555
type ServerJSON struct {
5656
Name string `json:"name"`
5757
Description string `json:"description"`
58+
Status string `json:"status,omitempty"`
5859
Repository Repository `json:"repository"`
5960
VersionDetail VersionDetail `json:"version_detail"`
6061
Packages []Package `json:"packages"`
@@ -176,6 +177,7 @@ func createCommand() error {
176177
var repoURL string
177178
var repoSource string
178179
var output string
180+
var status string
179181

180182
// Package information flags
181183
var registryName string
@@ -198,6 +200,7 @@ func createCommand() error {
198200
createFlags.StringVar(&repoSource, "repo-source", "github", "Repository source")
199201
createFlags.StringVar(&output, "output", "server.json", "Output file path")
200202
createFlags.StringVar(&output, "o", "server.json", "Output file path (shorthand)")
203+
createFlags.StringVar(&status, "status", "active", "Server status (active or deprecated)")
201204

202205
createFlags.StringVar(&registryName, "registry", "npm", "Package registry name")
203206
createFlags.StringVar(&packageName, "package-name", "", "Package name (defaults to server name)")
@@ -229,6 +232,7 @@ func createCommand() error {
229232
fmt.Fprint(os.Stdout, " --description/-d string Server description (required)\n")
230233
fmt.Fprint(os.Stdout, " --repo-url string Repository URL (required)\n")
231234
fmt.Fprint(os.Stdout, " --version/-v string Server version (default: 1.0.0)\n")
235+
fmt.Fprint(os.Stdout, " --status string Server status (active or deprecated) (default: active)\n")
232236
fmt.Fprint(os.Stdout, " --execute/-e string Command to execute the server\n")
233237
fmt.Fprint(os.Stdout, " --output/-o string Output file path (default: server.json)\n")
234238
fmt.Fprint(os.Stdout, " --registry string Package registry name (default: npm)\n")
@@ -255,6 +259,11 @@ func createCommand() error {
255259
return errors.New("--repo-url is required")
256260
}
257261

262+
// Validate status field
263+
if status != "active" && status != "deprecated" {
264+
return errors.New("--status must be either 'active' or 'deprecated'")
265+
}
266+
258267
// Set defaults
259268
if packageName == "" {
260269
packageName = name
@@ -275,7 +284,7 @@ func createCommand() error {
275284

276285
// Create server structure
277286
server := createServerStructure(name, description, version, repoURL, repoSource,
278-
registryName, packageName, packageVersion, runtimeHint, execute, envVars, packageArgs)
287+
registryName, packageName, packageVersion, runtimeHint, execute, envVars, packageArgs, status)
279288

280289
// Convert to JSON
281290
jsonData, err := json.MarshalIndent(server, "", " ")
@@ -352,7 +361,7 @@ func publishToRegistry(registryURL string, mcpData []byte, token string) error {
352361
}
353362

354363
func createServerStructure(name, description, version, repoURL, repoSource, registryName,
355-
packageName, packageVersion, runtimeHint, execute string, envVars []string, packageArgs []string) ServerJSON {
364+
packageName, packageVersion, runtimeHint, execute string, envVars []string, packageArgs []string, status string) ServerJSON {
356365
// Parse environment variables
357366
var environmentVariables []EnvironmentVariable
358367
for _, envVar := range envVars {
@@ -442,6 +451,7 @@ func createServerStructure(name, description, version, repoURL, repoSource, regi
442451
return ServerJSON{
443452
Name: name,
444453
Description: description,
454+
Status: status,
445455
Repository: Repository{
446456
URL: repoURL,
447457
Source: repoSource,

tools/publisher/server.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"description": "<your description here>",
33
"name": "io.github.<owner>/<server-name>",
4+
"status": "active",
45
"packages": [
56
{
67
"registry_name": "npm",

tools/validate-examples/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
// IMPORTANT: Only change this count if you have intentionally added or removed examples
2323
// from the examples.md file. This check prevents accidental formatting changes from
2424
// causing examples to be skipped during validation.
25-
expectedExampleCount = 8
25+
expectedExampleCount = 9
2626
)
2727

2828
func main() {

0 commit comments

Comments
 (0)