Documentation
¶
Overview ¶
Package mcpserver serves Svarog's MCP endpoint as an OAuth protected resource.
Index ¶
Constants ¶
View Source
const ( Path = "/mcp" ResourceMetadataPath = "/.well-known/oauth-protected-resource" + Path )
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler serves MCP over stateless Streamable HTTP, so any replica can answer any request. Every request needs an access token issued for Resource.
Types ¶
type AccessTokens ¶
type ArchiveLinks ¶
type ArchiveLinks interface {
Sign(claims archivelink.Claims) string
}
type Archives ¶
type Archives interface {
List(ctx context.Context, scope archive.Scope, query archive.ListQuery) (archive.Page, error)
Search(ctx context.Context, scope archive.Scope, query archive.SearchQuery) (archive.SearchResult, error)
Get(ctx context.Context, scope archive.Scope, archiveID uuid.UUID) (archive.Archive, error)
}
type LogReader ¶
type LogReader interface {
Page(ctx context.Context, query logstore.PageQuery) (logstore.Page, error)
Around(ctx context.Context, scope logstore.Scope, id int64, limit int, bounds *logstore.TimeRange) (logstore.Page, bool, error)
Instances(ctx context.Context, scope logstore.Scope) ([]string, error)
}
type Options ¶
type Options struct {
// Issuer is the OAuth authorization server and the public base URL of
// links; Resource is this endpoint's URL.
Issuer string
Resource string
Tokens AccessTokens
Users Users
Projects Projects
Logs LogReader
Archives Archives
ArchiveLinks ArchiveLinks
}
type Projects ¶
type Projects interface {
All(ctx context.Context) ([]projects.Project, error)
ByIDs(ctx context.Context, ids []string) ([]projects.Project, error)
ClientsForProjects(ctx context.Context, projectIDs []uuid.UUID) ([]projects.ProjectClient, error)
ClientBelongsToProject(ctx context.Context, projectID, clientID string) (bool, error)
}
Click to show internal directories.
Click to hide internal directories.