Documentation
¶
Overview ¶
Package config loads the MCP server configuration and token store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Brain ¶
type Brain struct {
Graph string `json:"graph"`
Backend string `json:"backend"`
Sensitive bool `json:"sensitive"`
}
Brain maps a logical brain name to the graph that stores it and the kb-query backend that can reach that graph. A family entry, keyed "client-*" with graph "brain-client-*", serves every "client-<suffix>" brain from graph "brain-client-<suffix>", so a new sub-project needs no config.
type Config ¶
type Config struct {
// Listen must be a VPN-only address; the server is never exposed publicly.
Listen string `json:"listen"`
TokensFile string `json:"tokens_file"`
Brains map[string]Brain `json:"brains"`
// DefaultBudget is the token budget for get_context when the caller sets none.
DefaultBudget int `json:"default_budget"`
}
Config is the server configuration file.
type Token ¶
type Token struct {
ID string `json:"id"`
SHA256 string `json:"sha256"`
Brains []string `json:"brains"`
Expires time.Time `json:"expires"`
}
Token is one entry in the token store. Only the SHA-256 of the secret is stored.
type Tokens ¶
type Tokens struct {
// contains filtered or unexported fields
}
Tokens is a loaded token store.
func LoadTokens ¶
LoadTokens reads the token store and checks every granted brain exists.
func (*Tokens) Verifier ¶
func (t *Tokens) Verifier() auth.TokenVerifier
Verifier returns a bearer-token verifier for the MCP auth middleware. TokenInfo.Scopes carries the granted brains; UserID carries the token id.