Skip to content

Commit 6fcc386

Browse files
authored
Add registryName path element to Upstream API (#106)
This change adds support for two sets of Upstream API, one under `/registry/v0.1` providing an aggregated view of all servers coming from any configured registry, and one under `/registry/{registryName}/v0.1` providing a list of all servers for a given registry name. In order to maintain compliance with Upstream API, the path element was added _before_ the version number, which is not very elegant, but we favor compatibility over elengance in this case. This is part of #38
1 parent bf7c7d7 commit 6fcc386

File tree

6 files changed

+484
-72
lines changed

6 files changed

+484
-72
lines changed

docs/thv-registry-api/docs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/thv-registry-api/swagger.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/thv-registry-api/swagger.yaml

Lines changed: 192 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,194 @@ paths:
778778
summary: Readiness check
779779
tags:
780780
- system
781+
/registry/{registryName}/v0.1/publish:
782+
post:
783+
description: Publish a server to the registry
784+
parameters:
785+
- description: Registry name
786+
in: path
787+
name: registryName
788+
required: true
789+
schema:
790+
type: string
791+
requestBody:
792+
content:
793+
application/json:
794+
schema:
795+
type: object
796+
responses:
797+
"501":
798+
content:
799+
application/json:
800+
schema:
801+
additionalProperties:
802+
type: string
803+
type: object
804+
description: Not implemented
805+
summary: Publish server
806+
tags:
807+
- registry
808+
- official
809+
/registry/{registryName}/v0.1/servers:
810+
get:
811+
description: Get a list of available servers in the registry
812+
parameters:
813+
- description: Registry name
814+
in: path
815+
name: registryName
816+
required: true
817+
schema:
818+
type: string
819+
- description: Pagination cursor for retrieving next set of results
820+
in: query
821+
name: cursor
822+
schema:
823+
type: string
824+
- description: Maximum number of items to return
825+
in: query
826+
name: limit
827+
schema:
828+
type: integer
829+
- description: Search servers by name (substring match)
830+
in: query
831+
name: search
832+
schema:
833+
type: string
834+
- description: Filter by version ('latest' for latest version, or an exact version
835+
like '1.2.3')
836+
in: query
837+
name: version
838+
schema:
839+
type: string
840+
requestBody:
841+
content:
842+
application/json:
843+
schema:
844+
type: object
845+
responses:
846+
"200":
847+
content:
848+
application/json:
849+
schema:
850+
$ref: '#/components/schemas/v0.ServerListResponse'
851+
description: OK
852+
"400":
853+
content:
854+
application/json:
855+
schema:
856+
additionalProperties:
857+
type: string
858+
type: object
859+
description: Bad request
860+
summary: List servers
861+
tags:
862+
- registry
863+
- official
864+
/registry/{registryName}/v0.1/servers/{serverName}/versions:
865+
get:
866+
description: Returns all available versions for a specific MCP server, ordered
867+
by publication date (newest first)
868+
parameters:
869+
- description: Registry name
870+
in: path
871+
name: registryName
872+
required: true
873+
schema:
874+
type: string
875+
- description: URL-encoded server name (e.g., \
876+
in: path
877+
name: serverName
878+
required: true
879+
schema:
880+
type: string
881+
requestBody:
882+
content:
883+
application/json:
884+
schema:
885+
type: object
886+
responses:
887+
"200":
888+
content:
889+
application/json:
890+
schema:
891+
$ref: '#/components/schemas/v0.ServerListResponse'
892+
description: A list of all versions for the server
893+
"400":
894+
content:
895+
application/json:
896+
schema:
897+
additionalProperties:
898+
type: string
899+
type: object
900+
description: Bad request
901+
"404":
902+
content:
903+
application/json:
904+
schema:
905+
additionalProperties:
906+
type: string
907+
type: object
908+
description: Server not found
909+
summary: List all versions of an MCP server
910+
tags:
911+
- registry
912+
- official
913+
/registry/{registryName}/v0.1/servers/{serverName}/versions/{version}:
914+
get:
915+
description: |-
916+
Returns detailed information about a specific version of an MCP server.
917+
Use the special version `latest` to get the latest version.
918+
parameters:
919+
- description: Registry name
920+
in: path
921+
name: registryName
922+
required: true
923+
schema:
924+
type: string
925+
- description: URL-encoded server name (e.g., \
926+
in: path
927+
name: serverName
928+
required: true
929+
schema:
930+
type: string
931+
- description: URL-encoded version to retrieve (e.g., \
932+
in: path
933+
name: version
934+
required: true
935+
schema:
936+
type: string
937+
requestBody:
938+
content:
939+
application/json:
940+
schema:
941+
type: object
942+
responses:
943+
"200":
944+
content:
945+
application/json:
946+
schema:
947+
$ref: '#/components/schemas/v0.ServerResponse'
948+
description: Detailed server information
949+
"400":
950+
content:
951+
application/json:
952+
schema:
953+
additionalProperties:
954+
type: string
955+
type: object
956+
description: Bad request
957+
"404":
958+
content:
959+
application/json:
960+
schema:
961+
additionalProperties:
962+
type: string
963+
type: object
964+
description: Server or version not found
965+
summary: Get specific MCP server version
966+
tags:
967+
- registry
968+
- official
781969
/registry/v0.1/publish:
782970
post:
783971
description: Publish a server to the registry
@@ -889,7 +1077,8 @@ paths:
8891077
description: Server not found
8901078
summary: List all versions of an MCP server
8911079
tags:
892-
- servers
1080+
- registry
1081+
- official
8931082
/registry/v0.1/servers/{serverName}/versions/{version}:
8941083
get:
8951084
description: |-
@@ -938,7 +1127,8 @@ paths:
9381127
description: Server or version not found
9391128
summary: Get specific MCP server version
9401129
tags:
941-
- servers
1130+
- registry
1131+
- official
9421132
/v0/publish:
9431133
post:
9441134
deprecated: true

0 commit comments

Comments
 (0)