feat: implement server publishing endpoint with Bearer token authentication and update documentation
This commit is contained in:
parent
e0a4883465
commit
9c6eebbed0
2 changed files with 190 additions and 48 deletions
|
|
@ -5,6 +5,8 @@
|
|||
summary: Publish a server to the registry
|
||||
description: Adds a new server to the MCP registry with authentication
|
||||
operationId: publishServer
|
||||
security:
|
||||
- bearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
|
|
@ -14,11 +16,9 @@
|
|||
properties:
|
||||
server_detail:
|
||||
$ref: '#/components/schemas/ServerDetail'
|
||||
authentication:
|
||||
$ref: '#/components/schemas/Authentication'
|
||||
auth_status_token:
|
||||
repo_ref:
|
||||
type: string
|
||||
description: Optional status token from a device authorization flow
|
||||
description: Repository reference used for authentication (defaults to server name if not provided)
|
||||
responses:
|
||||
'201':
|
||||
description: Server published successfully
|
||||
|
|
|
|||
|
|
@ -101,6 +101,74 @@ paths:
|
|||
'405':
|
||||
description: Method not allowed
|
||||
|
||||
/v0/publish:
|
||||
post:
|
||||
tags:
|
||||
- servers
|
||||
summary: Publish a server to the registry
|
||||
description: Adds a new server to the MCP registry with authentication
|
||||
operationId: publishServer
|
||||
security:
|
||||
- bearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
server_detail:
|
||||
$ref: '#/components/schemas/ServerDetail'
|
||||
repo_ref:
|
||||
type: string
|
||||
description: Repository reference used for authentication (defaults to server name if not provided)
|
||||
responses:
|
||||
'201':
|
||||
description: Server published successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
example: Server publication successful
|
||||
id:
|
||||
type: string
|
||||
example: 1234567890abcdef12345678
|
||||
'400':
|
||||
description: Invalid request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: Name is required
|
||||
'401':
|
||||
description: Authentication failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: Authentication is required for publishing
|
||||
'405':
|
||||
description: Method not allowed
|
||||
'500':
|
||||
description: Server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: Failed to publish server details
|
||||
|
||||
/v0/servers/{id}:
|
||||
get:
|
||||
tags:
|
||||
|
|
@ -131,6 +199,13 @@ paths:
|
|||
description: Method not allowed
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
bearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
description: "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\""
|
||||
|
||||
schemas:
|
||||
Server:
|
||||
type: object
|
||||
|
|
|
|||
Loading…
Reference in a new issue