Changes on the server.json format and the API (#562)
This commit is contained in:
parent
4962609697
commit
b21c6f564d
1 changed files with 4056 additions and 5608 deletions
|
|
@ -15,9 +15,9 @@ The official registry has some more endpoints and restrictions on top of this. S
|
|||
|
||||
### Core Endpoints
|
||||
- **`GET /v0/servers`** - List all servers with pagination
|
||||
- **`GET /v0/servers/{server_id}`** - Get latest version of server by server ID
|
||||
- **`GET /v0/servers/{server_id}?version=X.X.X`** - Get specific version of server
|
||||
- **`GET /v0/servers/{server_id}/versions`** - List all versions of a server
|
||||
- **`GET /v0/servers/{serverName}`** - Get latest version of server by server name (URL-encoded)
|
||||
- **`GET /v0/servers/{serverName}/versions/{version}`** - Get specific version of server (both parameters should be URL-encoded)
|
||||
- **`GET /v0/servers/{serverName}/versions`** - List all versions of a server
|
||||
- **`POST /v0/publish`** - Publish new server (optional, registry-specific authentication)
|
||||
|
||||
### Authentication
|
||||
|
|
@ -27,6 +27,16 @@ The official registry has some more endpoints and restrictions on top of this. S
|
|||
### Content Type
|
||||
All requests and responses use `application/json`
|
||||
|
||||
### Pagination
|
||||
List endpoints use cursor-based pagination for efficient, stable results.
|
||||
|
||||
#### Usage
|
||||
1. **Initial request**: Omit the `cursor` parameter
|
||||
2. **Subsequent requests**: Use the `nextCursor` value from the previous response
|
||||
3. **End of results**: When `nextCursor` is null or empty, there are no more results
|
||||
|
||||
**Important**: Always treat cursors as opaque strings. Never manually construct or modify cursor values.
|
||||
|
||||
### Basic Example: List Servers
|
||||
|
||||
```bash
|
||||
|
|
@ -37,15 +47,23 @@ curl https://registry.example.com/v0/servers?limit=10
|
|||
{
|
||||
"servers": [
|
||||
{
|
||||
"name": "io.modelcontextprotocol/filesystem",
|
||||
"description": "Filesystem operations server",
|
||||
"status": "active",
|
||||
"version": "1.0.2"
|
||||
"server": {
|
||||
"name": "io.modelcontextprotocol/filesystem",
|
||||
"description": "Filesystem operations server",
|
||||
"version": "1.0.2"
|
||||
},
|
||||
"_meta": {
|
||||
"io.modelcontextprotocol.registry/official": {
|
||||
"status": "active",
|
||||
"publishedAt": "2025-01-01T10:30:00Z",
|
||||
"isLatest": true
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"count": 10,
|
||||
"next_cursor": "eyJ..."
|
||||
"nextCursor": "com.example/my-server:1.0.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue