Documentation
¶
Overview ¶
Package mcp serves remora's management tools over the Model Context Protocol: at /mcp on the main listener and over stdio by `remora mcp`. Every tool calls the management API through the generated client, so a tool call gets exactly the API's authentication, validation and errors.
Index ¶
- func Handler(s *sdk.Server, a *auth.Service) http.Handler
- func InProcess(h http.Handler) (*gen.ClientWithResponses, error)
- func New(c *gen.ClientWithResponses) *sdk.Server
- func WithAuthorization(ctx context.Context, v string) context.Context
- type AccountIn
- type ConfigApplyIn
- type ConfigApplyOut
- type ConfigExportOut
- type ConfigIn
- type ConfigPlanOut
- type DeleteIn
- type DeleteOut
- type InspectIn
- type LogsIn
- type Overview
- type ProviderTestIn
- type StatsIn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler serves /mcp: stateless Streamable HTTP with JSON responses, for API tokens only. The session cookie, the one credential a browser sends on its own, is dropped before authentication, so a request without a bearer API token is 401. The go-sdk's DNS-rebinding guard is off: it 403s a reverse proxy on the same host, and it protects unauthenticated servers, while every request here needs a token a rebinding page can neither read nor send.
func InProcess ¶
func InProcess(h http.Handler) (*gen.ClientWithResponses, error)
InProcess returns a management client whose every call is served by h in process. Each request carries the Authorization in its context (WithAuthorization) and no credential otherwise, so h authenticates the caller itself.
Types ¶
type AccountIn ¶
type AccountIn struct {
Op string `` /* 126-byte string literal not displayed */
ID string `json:"id,omitempty" jsonschema:"account id; for login_complete and login_cancel the login state"`
Provider string `json:"provider,omitempty" jsonschema:"login_start, import, refresh_quota for a whole provider"`
Priority *int `json:"priority,omitempty" jsonschema:"set_priority; higher is tried first"`
RedirectURL string `json:"redirect_url,omitempty" jsonschema:"login_complete: the address the browser ended on"`
Credential map[string]any `json:"credential,omitempty" jsonschema:"import: the provider's credential JSON"`
}
AccountIn is remora_account's input.
type ConfigApplyIn ¶
type ConfigApplyIn struct {
ConfigIn
PlanHash string `json:"plan_hash" jsonschema:"the plan_hash remora_config_plan returned for these same inputs"`
}
ConfigApplyIn is remora_config_apply's input.
type ConfigApplyOut ¶
type ConfigApplyOut struct {
Applied bool `json:"applied"`
Changes []gen.Change `json:"changes"` // made, or on a refusal the fresh plan
PlanHash string `json:"plan_hash,omitempty"` // set on a refusal
Message string `json:"message,omitempty"`
}
ConfigApplyOut is remora_config_apply's answer.
type ConfigExportOut ¶
type ConfigExportOut struct {
Document string `json:"document"`
}
ConfigExportOut is remora_config_export's answer.
type ConfigIn ¶
type ConfigIn struct {
Document string `json:"document" jsonschema:"remora.yaml, whole or partial"`
Secrets map[string]string `` /* 141-byte string literal not displayed */
Prune bool `` /* 142-byte string literal not displayed */
}
ConfigIn is remora_config_plan's input.
type ConfigPlanOut ¶
type ConfigPlanOut struct {
Changes []gen.Change `json:"changes"`
PlanHash string `json:"plan_hash"`
}
ConfigPlanOut is remora_config_plan's answer.
type DeleteIn ¶
type DeleteIn struct {
Kind string `json:"kind" jsonschema:"provider|alias|key|account"`
ID string `json:"id" jsonschema:"provider or alias name, key id, account id"`
}
DeleteIn is remora_delete's input.
type DeleteOut ¶
type DeleteOut struct {
Deleted string `json:"deleted"`
}
DeleteOut is remora_delete's answer, such as "alias fast".
type InspectIn ¶
type InspectIn struct {
Kind string `json:"kind" jsonschema:"providers|accounts|aliases|keys|tokens|cooling|quota|account_strategies|logins|audit"`
Operation string `json:"operation,omitempty" jsonschema:"exact OpenAPI operationId filter for audit"`
ID string `json:"id,omitempty" jsonschema:"name or id; omitted lists. For logins the login state, required. For quota a provider name"`
Q string `json:"q,omitempty" jsonschema:"free-text search when listing"`
Limit int `json:"limit,omitempty" jsonschema:"page size when listing, default 50"`
Offset int `json:"offset,omitempty"`
}
InspectIn is remora_inspect's input.
type LogsIn ¶
type LogsIn struct {
ID string `json:"id,omitempty" jsonschema:"one entry by id; the filters are ignored"`
From string `json:"from,omitempty" jsonschema:"RFC 3339; default 24 hours before to"`
To string `json:"to,omitempty" jsonschema:"RFC 3339; default now"`
Q string `json:"q,omitempty"`
Key string `json:"key,omitempty"`
Alias string `json:"alias,omitempty"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
Status string `json:"status,omitempty" jsonschema:"success|error"`
Limit int `json:"limit,omitempty" jsonschema:"default 20"`
Offset int `json:"offset,omitempty"`
}
LogsIn is remora_logs' input.
type Overview ¶
type Overview struct {
Status string `json:"status"`
Components map[string]string `json:"components"`
Version string `json:"version"`
Providers int `json:"providers"`
Aliases int `json:"aliases"`
Keys int `json:"keys"`
Accounts int `json:"accounts"`
OutOfPool []gen.AccountPool `json:"out_of_pool"`
Cooling int `json:"cooling"`
Quota []gen.QuotaProvider `json:"quota"` // per provider, account rows dropped
}
Overview is remora_overview's answer. Engine versions are left out: engine names stay in /api/system/version.
type ProviderTestIn ¶
type ProviderTestIn struct {
Name string `json:"name" jsonschema:"the provider's name"`
}
ProviderTestIn is remora_provider_test's input.
type StatsIn ¶
type StatsIn struct {
From string `json:"from,omitempty" jsonschema:"RFC 3339; default 24 hours before to"`
To string `json:"to,omitempty" jsonschema:"RFC 3339; default now"`
GroupBy string `json:"group_by,omitempty" jsonschema:"none|key|alias|provider|model"`
Key string `json:"key,omitempty"`
Alias string `json:"alias,omitempty"`
Provider string `json:"provider,omitempty"`
}
StatsIn is remora_stats' input.