|
| 1 | +package types |
| 2 | + |
| 3 | +// RegistryServerList represents the paginated list response from /v0.1/servers |
| 4 | +type RegistryServerList struct { |
| 5 | + Servers []RegistryServerResponse `json:"servers"` |
| 6 | + Metadata *RegistryMetadata `json:"metadata,omitempty"` |
| 7 | +} |
| 8 | + |
| 9 | +// RegistryMetadata contains pagination metadata |
| 10 | +type RegistryMetadata struct { |
| 11 | + NextCursor string `json:"nextCursor,omitempty"` |
| 12 | + Count int `json:"count,omitempty"` |
| 13 | +} |
| 14 | + |
| 15 | +// RegistryServerResponse wraps a server with registry metadata |
| 16 | +type RegistryServerResponse struct { |
| 17 | + Server ServerDetail `json:"server"` |
| 18 | + Meta RegistryMeta `json:"_meta,omitzero"` |
| 19 | +} |
| 20 | + |
| 21 | +// ServerDetail matches the Registry API ServerDetail schema |
| 22 | +// For Obot, configured servers always use Remotes (never Packages) |
| 23 | +type ServerDetail struct { |
| 24 | + Name string `json:"name"` |
| 25 | + Description string `json:"description"` |
| 26 | + Title string `json:"title,omitempty"` |
| 27 | + Version string `json:"version"` |
| 28 | + WebsiteURL string `json:"websiteUrl,omitempty"` |
| 29 | + Icons []RegistryIcon `json:"icons,omitempty"` |
| 30 | + Remotes []RegistryRemote `json:"remotes,omitempty"` |
| 31 | + Repository *RegistryRepository `json:"repository,omitempty"` |
| 32 | + Schema string `json:"$schema,omitempty"` |
| 33 | +} |
| 34 | + |
| 35 | +// RegistryIcon represents an icon for display |
| 36 | +type RegistryIcon struct { |
| 37 | + Src string `json:"src"` |
| 38 | + MimeType string `json:"mimeType,omitempty"` |
| 39 | + Sizes []string `json:"sizes,omitempty"` |
| 40 | + Theme string `json:"theme,omitempty"` |
| 41 | +} |
| 42 | + |
| 43 | +// RegistryRemote represents a remote server configuration |
| 44 | +// All Obot servers are exposed as streamable-http remotes via mcp-connect |
| 45 | +type RegistryRemote struct { |
| 46 | + Type string `json:"type"` // Always "streamable-http" for configured Obot servers |
| 47 | + URL string `json:"url"` // The mcp-connect URL |
| 48 | +} |
| 49 | + |
| 50 | +// RegistryRepository represents repository metadata |
| 51 | +type RegistryRepository struct { |
| 52 | + URL string `json:"url"` |
| 53 | + Source string `json:"source"` |
| 54 | + ID string `json:"id,omitempty"` |
| 55 | + Subfolder string `json:"subfolder,omitempty"` |
| 56 | +} |
| 57 | + |
| 58 | +// RegistryMeta contains registry-managed metadata |
| 59 | +type RegistryMeta struct { |
| 60 | + Obot *RegistryObotMeta `json:"ai.obot/server,omitempty"` |
| 61 | + Official Official `json:"io.modelcontextprotocol.registry/official,omitempty"` |
| 62 | +} |
| 63 | + |
| 64 | +type Official struct { |
| 65 | + Status string `json:"status,omitempty"` |
| 66 | + CreatedAt string `json:"createdAt,omitempty"` |
| 67 | +} |
| 68 | + |
| 69 | +// RegistryObotMeta contains Obot-specific metadata |
| 70 | +type RegistryObotMeta struct { |
| 71 | + ConfigurationRequired bool `json:"configurationRequired,omitempty"` |
| 72 | + ConfigurationMessage string `json:"configurationMessage,omitempty"` |
| 73 | +} |
0 commit comments