Files
ha-gronod-addons/emby-mcp/internal/emby/system.go
gronod d8b642436b feat: Home Assistant add-on with in-process Go REST bridge
Bake the former Python bridge.py into emby-mcp as internal/bridge.
/mcp and /call/{tool} share one process. Session init errors are
returned instead of swallowed, and 401/400/404 trigger a fresh
initialize plus retry with the caller's Authorization header.
2026-09-21 16:31:34 +00:00

21 lines
563 B
Go

package emby
import "context"
// PublicInfo is the subset of GET /System/Info/Public we use.
type PublicInfo struct {
ID string `json:"Id"`
ServerName string `json:"ServerName"`
Version string `json:"Version"`
}
// GetPublicInfo fetches the server's public info; it works unauthenticated and
// is used as the connectivity check in HTTP mode.
func (c *Client) GetPublicInfo(ctx context.Context) (*PublicInfo, error) {
var pi PublicInfo
if err := c.Get(ctx, "/System/Info/Public", nil, &pi); err != nil {
return nil, err
}
return &pi, nil
}