Documentation
¶
Index ¶
- Constants
- func NewTextResult(content string, err error) *mcp.CallToolResult
- func ServerToolToGoSdkTool(s *Server, tool api.ServerTool) (*mcp.Tool, mcp.ToolHandler, error)
- type Configuration
- type ContextKey
- type Server
- func (s *Server) Close()
- func (s *Server) GetEnabledTools() []string
- func (s *Server) GetTargetParameterName() string
- func (s *Server) KubernetesApiVerifyToken(ctx context.Context, cluster, token, audience string) (*authenticationapiv1.UserInfo, []string, error)
- func (s *Server) ServeHTTP() *mcp.StreamableHTTPHandler
- func (s *Server) ServeSse() *mcp.SSEHandler
- func (s *Server) ServeStdio(ctx context.Context) error
- type ToolCallRequest
- type ToolFilter
- type ToolMutator
Constants ¶
View Source
const TokenScopesContextKey = ContextKey("TokenScopesContextKey")
Variables ¶
This section is empty.
Functions ¶
func NewTextResult ¶
func NewTextResult(content string, err error) *mcp.CallToolResult
func ServerToolToGoSdkTool ¶ added in v0.0.55
func ServerToolToGoSdkTool(s *Server, tool api.ServerTool) (*mcp.Tool, mcp.ToolHandler, error)
Types ¶
type Configuration ¶
type Configuration struct {
*config.StaticConfig
// contains filtered or unexported fields
}
func (*Configuration) ListOutput ¶
func (c *Configuration) ListOutput() output.Output
func (*Configuration) Toolsets ¶ added in v0.0.51
func (c *Configuration) Toolsets() []api.Toolset
type ContextKey ¶ added in v0.0.48
type ContextKey string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(configuration Configuration) (*Server, error)
func (*Server) GetEnabledTools ¶
func (*Server) GetTargetParameterName ¶ added in v0.0.53
GetTargetParameterName returns the parameter name used for target identification in MCP requests
func (*Server) KubernetesApiVerifyToken ¶ added in v0.0.49
func (s *Server) KubernetesApiVerifyToken(ctx context.Context, cluster, token, audience string) (*authenticationapiv1.UserInfo, []string, error)
KubernetesApiVerifyToken verifies the given token with the audience by sending an TokenReview request to API Server for the specified cluster.
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP() *mcp.StreamableHTTPHandler
func (*Server) ServeSse ¶
func (s *Server) ServeSse() *mcp.SSEHandler
type ToolCallRequest ¶ added in v0.0.55
type ToolCallRequest struct {
Name string
// contains filtered or unexported fields
}
func GoSdkToolCallParamsToToolCallRequest ¶ added in v0.0.55
func GoSdkToolCallParamsToToolCallRequest(toolCallParams *mcp.CallToolParamsRaw) (*ToolCallRequest, error)
func GoSdkToolCallRequestToToolCallRequest ¶ added in v0.0.55
func GoSdkToolCallRequestToToolCallRequest(request *mcp.CallToolRequest) (*ToolCallRequest, error)
func (*ToolCallRequest) GetArguments ¶ added in v0.0.55
func (ToolCallRequest *ToolCallRequest) GetArguments() map[string]any
func (*ToolCallRequest) GetString ¶ added in v0.0.55
func (ToolCallRequest *ToolCallRequest) GetString(key, defaultValue string) string
type ToolFilter ¶ added in v0.0.53
type ToolFilter func(tool api.ServerTool) bool
ToolFilter is a function that takes a ServerTool and returns a boolean indicating whether to include the tool
func CompositeFilter ¶ added in v0.0.53
func CompositeFilter(filters ...ToolFilter) ToolFilter
func ShouldIncludeTargetListTool ¶ added in v0.0.53
func ShouldIncludeTargetListTool(targetName string, targets []string) ToolFilter
type ToolMutator ¶ added in v0.0.53
type ToolMutator func(tool api.ServerTool) api.ServerTool
func WithTargetParameter ¶ added in v0.0.53
func WithTargetParameter(defaultCluster, targetParameterName string, targets []string) ToolMutator
WithTargetParameter adds a target selection parameter to the tool's input schema if the tool is cluster-aware
Click to show internal directories.
Click to hide internal directories.