Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrToolNotFound = fmt.Errorf("mcp: tool not found: %w", commonerrors.ErrNotFound) ErrPromptNotFound = fmt.Errorf("mcp: prompt not found: %w", commonerrors.ErrNotFound) ErrResourceNotFound = fmt.Errorf("mcp: resource not found: %w", commonerrors.ErrNotFound) ErrNoMCPRegistries = fmt.Errorf("mcp: no MCP registries attached to consumer: %w", commonerrors.ErrValidation) )
View Source
var ErrAudienceMismatch = errors.New("mcp: inbound token audience does not match the upstream's expected audience")
View Source
var ErrNoPrincipal = errors.New("mcp: downstream auth mode requires an authenticated user identity")
View Source
var ErrNoRoleAccess = errors.New("mcp: no role grants MCP access for this identity")
View Source
var ErrNotSupported = errors.New("mcp upstream does not support this method")
View Source
var ErrUnreachable = errors.New("mcp upstream unreachable")
Functions ¶
func IsRPCError ¶
Types ¶
type Composer ¶
type Composer interface {
ListTools(ctx context.Context, rc *appconsumer.RoutableConsumer) ([]Tool, error)
CallTool(ctx context.Context, rc *appconsumer.RoutableConsumer, name string, arguments json.RawMessage) (json.RawMessage, error)
ListResources(ctx context.Context, rc *appconsumer.RoutableConsumer) ([]Resource, error)
ListResourceTemplates(ctx context.Context, rc *appconsumer.RoutableConsumer) ([]ResourceTemplate, error)
ReadResource(ctx context.Context, rc *appconsumer.RoutableConsumer, uri string) (json.RawMessage, error)
ListPrompts(ctx context.Context, rc *appconsumer.RoutableConsumer) ([]Prompt, error)
GetPrompt(ctx context.Context, rc *appconsumer.RoutableConsumer, name string, arguments map[string]string) (json.RawMessage, error)
}
func NewComposer ¶
func NewComposer(dialer Dialer, creds CredentialResolver, discovery DiscoveryCache, logger *slog.Logger) Composer
type ConsentRequiredError ¶
func (*ConsentRequiredError) Error ¶
func (e *ConsentRequiredError) Error() string
type CredentialResolver ¶
type CredentialResolver interface {
Apply(ctx context.Context, rc *appconsumer.RoutableConsumer, reg *registrydomain.Registry, target *Target) error
}
func NewCredentialResolver ¶
func NewCredentialResolver( exchanger sts.Exchanger, vault vaultdomain.Repository, connect appoauth.ConnectService, provider appoauth.ProviderClient, ) CredentialResolver
type DialerFunc ¶
type DiscoveryCache ¶
type Introspector ¶
type Introspector interface {
ListRegistryTools(ctx context.Context, gatewayID ids.GatewayID, registryID ids.RegistryID) ([]Tool, error)
}
func NewIntrospector ¶
func NewIntrospector(registries appregistry.Finder, dialer Dialer) Introspector
type Prompt ¶
type Prompt struct {
Name string
// contains filtered or unexported fields
}
func (Prompt) MarshalJSON ¶
func (*Prompt) UnmarshalJSON ¶
type RPCError ¶
type RPCError struct {
Code int64 `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
}
type ResourceTemplate ¶
type ResourceTemplate struct {
Name string
URITemplate string
// contains filtered or unexported fields
}
func (ResourceTemplate) MarshalJSON ¶
func (rt ResourceTemplate) MarshalJSON() ([]byte, error)
func (*ResourceTemplate) UnmarshalJSON ¶
func (rt *ResourceTemplate) UnmarshalJSON(data []byte) error
type RoleScoper ¶
type RoleScoper interface {
Scope(ctx context.Context, rc *appconsumer.RoutableConsumer, data *appconsumer.Data) (*appconsumer.RoutableConsumer, error)
}
func NewRoleScoper ¶
func NewRoleScoper(oidcResolver approle.OIDCResolver) RoleScoper
type Target ¶
func StaticTarget ¶
func StaticTarget(reg *registrydomain.Registry) Target
type Tool ¶
type Tool struct {
Name string
// contains filtered or unexported fields
}
func (Tool) MarshalJSON ¶
func (*Tool) UnmarshalJSON ¶
type Upstream ¶
type Upstream interface {
ListTools(ctx context.Context) ([]Tool, error)
CallTool(ctx context.Context, name string, arguments json.RawMessage) (json.RawMessage, error)
ListResources(ctx context.Context) ([]Resource, error)
ListResourceTemplates(ctx context.Context) ([]ResourceTemplate, error)
ReadResource(ctx context.Context, uri string) (json.RawMessage, error)
ListPrompts(ctx context.Context) ([]Prompt, error)
GetPrompt(ctx context.Context, name string, arguments map[string]string) (json.RawMessage, error)
SupportsResources() bool
SupportsPrompts() bool
Close(ctx context.Context)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.