mcp

package
v0.0.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const TokenScopesContextKey = ContextKey("TokenScopesContextKey")

Variables

This section is empty.

Functions

func NewTextResult

func NewTextResult(content string, err error) *mcp.CallToolResult

func ServerToolToM3LabsServerTool added in v0.0.52

func ServerToolToM3LabsServerTool(s *Server, tools []api.ServerTool) ([]server.ServerTool, 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.52

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) Close

func (s *Server) Close()

func (*Server) GetEnabledTools

func (s *Server) GetEnabledTools() []string

func (*Server) GetTargetParameterName added in v0.0.53

func (s *Server) GetTargetParameterName() string

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, token string, audience string, cluster 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(httpServer *http.Server) *server.StreamableHTTPServer

func (*Server) ServeSse

func (s *Server) ServeSse(baseUrl string, httpServer *http.Server) *server.SSEServer

func (*Server) ServeStdio

func (s *Server) ServeStdio() error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL