Skip to content

Commit 9357e76

Browse files
authored
Add a PUT method to the OpenAPI specification (#838)
<!-- Provide a brief summary of your changes --> ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> The following PR adds a PUT method for updating a server version (optional, not implemented by the registry but still provides the ability for other registry implementations to standardise on it) **Details:** - Path: PUT /v0.1/servers/{serverName}/versions/{version} - Purpose: Update a specific version of an MCP server in the registry - Authentication: Uses bearer token authentication (registry-specific) - Request Body: Accepts a ServerDetail schema - Response: Returns a ServerResponse on success (200) - Error Handling: Includes proper HTTP status codes: - 401: Unauthorized - 403: Forbidden - Insufficient permissions - 404: Server or version not found - 500: Internal server error - 501: Not Implemented - Registry doesn't support updates ## 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) - [ ] 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 c179f71 commit 9357e76

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

docs/reference/api/generic-registry-api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The official registry has some more endpoints and restrictions on top of this. S
1818
- **`GET /v0.1/servers/{serverName}/versions`** - List all versions of a server
1919
- **`GET /v0.1/servers/{serverName}/versions/{version}`** - Get specific version of server. Use the special version `latest` to get the latest version.
2020
- **`POST /v0.1/publish`** - Publish new server (optional, registry-specific authentication)
21+
- **`PUT /v0.1/servers/{serverName}/versions/{version}`** - Update specific server version (optional, not implemented by official registry)
2122
- **`DELETE /v0.1/servers/{serverName}/versions/{version}`** - Delete specific server version (optional, not implemented by official registry)
2223

2324
Server names and version strings should be URL-encoded in paths.

docs/reference/api/openapi.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,95 @@ paths:
135135
error:
136136
type: string
137137
example: "Server not found"
138+
put:
139+
tags: [publish]
140+
summary: Update specific MCP server version (Optional)
141+
description: |
142+
Update a specific version of an MCP server in the registry.
143+
144+
**Note**: This endpoint is optional for registry implementations and is not implemented by the official MCP registry. It is included in the specification to standardize the update mechanism for registry implementations that choose to support it.
145+
146+
Authentication mechanism is registry-specific and may vary between implementations.
147+
security:
148+
- bearerAuth: []
149+
parameters:
150+
- name: serverName
151+
in: path
152+
required: true
153+
description: URL-encoded server name (e.g., "com.example%2Fmy-server")
154+
schema:
155+
type: string
156+
example: "com.example%2Fmy-server"
157+
- name: version
158+
in: path
159+
required: true
160+
description: URL-encoded version to update (e.g., "1.0.0" or "1.0.0%2B20130313144700" for versions with build metadata)
161+
schema:
162+
type: string
163+
example: "1.0.0"
164+
requestBody:
165+
required: true
166+
content:
167+
application/json:
168+
schema:
169+
$ref: '#/components/schemas/ServerDetail'
170+
responses:
171+
'200':
172+
description: Successfully updated server version
173+
content:
174+
application/json:
175+
schema:
176+
$ref: '#/components/schemas/ServerResponse'
177+
'401':
178+
description: Unauthorized - Invalid or missing authentication token
179+
content:
180+
application/json:
181+
schema:
182+
type: object
183+
properties:
184+
error:
185+
type: string
186+
example: "Invalid or expired Registry JWT token"
187+
'403':
188+
description: Forbidden - Insufficient permissions
189+
content:
190+
application/json:
191+
schema:
192+
type: object
193+
properties:
194+
error:
195+
type: string
196+
example: "You do not have permission to update this server"
197+
'404':
198+
description: Server or version not found
199+
content:
200+
application/json:
201+
schema:
202+
type: object
203+
properties:
204+
error:
205+
type: string
206+
example: "Server version not found"
207+
'500':
208+
description: Internal server error
209+
content:
210+
application/json:
211+
schema:
212+
type: object
213+
properties:
214+
error:
215+
type: string
216+
example: "Failed to update server version"
217+
'501':
218+
description: Not Implemented - Registry does not support updates
219+
content:
220+
application/json:
221+
schema:
222+
type: object
223+
properties:
224+
error:
225+
type: string
226+
example: "Updates are not supported by this registry"
138227
delete:
139228
tags: [publish]
140229
summary: Delete specific MCP server version (Optional)

0 commit comments

Comments
 (0)