Add DELETE method to the OpenAPI specification (#782)
<!-- Provide a brief summary of your changes -->
## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
The following adds a DELETE method to the reference API specification of
the registry.
The endpoint is consistent with the rest of the spec and provides a
standardised way for registry implementations to support deletion if
they choose to.
**Details:**
* Endpoint: DELETE /v0/servers/{serverName}/versions/{version}
* Uses tags: [publish] (same as POST /v0/publish for write operations)
* Requires security: bearerAuth authentication
* Returns ServerResponse on success (200) - matching POST pattern
* Same error responses: 401 (Unauthorized), 403 (Forbidden), 500
(Internal error)
* Added 404 (Not Found) for when server/version doesn't exist
* Parameters match the GET endpoint format with URL-encoding examples
* Marked as "(Optional)" in summary
* Explicit note that it's not implemented by the official registry
* States it's included for standardization purposes
## 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 <radoslav@stacklok.com>
This commit is contained in:
parent
df06235a02
commit
3134575712
2 changed files with 94 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ The official registry has some more endpoints and restrictions on top of this. S
|
|||
- **`GET /v0/servers/{serverName}/versions`** - List all versions of a server
|
||||
- **`GET /v0/servers/{serverName}/versions/{version}`** - Get specific version of server. Use the special version `latest` to get the latest version.
|
||||
- **`POST /v0/publish`** - Publish new server (optional, registry-specific authentication)
|
||||
- **`DELETE /v0/servers/{serverName}/versions/{version}`** - Delete specific server version (optional, not implemented by official registry)
|
||||
|
||||
Server names and version strings should be URL-encoded in paths.
|
||||
|
||||
|
|
|
|||
|
|
@ -135,6 +135,89 @@ paths:
|
|||
error:
|
||||
type: string
|
||||
example: "Server not found"
|
||||
delete:
|
||||
tags: [publish]
|
||||
summary: Delete specific MCP server version (Optional)
|
||||
description: |
|
||||
Delete a specific version of an MCP server from the registry.
|
||||
|
||||
**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 deletion mechanism for registry implementations that choose to support it.
|
||||
|
||||
Authentication mechanism is registry-specific and may vary between implementations.
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: serverName
|
||||
in: path
|
||||
required: true
|
||||
description: URL-encoded server name (e.g., "com.example%2Fmy-server")
|
||||
schema:
|
||||
type: string
|
||||
example: "com.example%2Fmy-server"
|
||||
- name: version
|
||||
in: path
|
||||
required: true
|
||||
description: URL-encoded version to delete (e.g., "1.0.0" or "1.0.0%2B20130313144700" for versions with build metadata)
|
||||
schema:
|
||||
type: string
|
||||
example: "1.0.0"
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully deleted server version
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ServerResponse'
|
||||
'401':
|
||||
description: Unauthorized - Invalid or missing authentication token
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: "Invalid or expired Registry JWT token"
|
||||
'403':
|
||||
description: Forbidden - Insufficient permissions
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: "You do not have permission to delete this server"
|
||||
'404':
|
||||
description: Server or version not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: "Server version not found"
|
||||
'500':
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: "Failed to delete server version"
|
||||
'501':
|
||||
description: Not Implemented - Registry does not support deletion
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: "Deletion is not supported by this registry"
|
||||
/v0/publish:
|
||||
post:
|
||||
tags: [publish]
|
||||
|
|
@ -239,6 +322,16 @@ paths:
|
|||
error:
|
||||
type: string
|
||||
example: "Failed to publish server"
|
||||
'501':
|
||||
description: Not Implemented - Registry does not support publishing
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: "Publishing is not supported by this registry"
|
||||
components:
|
||||
securitySchemes:
|
||||
bearerAuth:
|
||||
|
|
|
|||
Loading…
Reference in a new issue