mcp

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 25 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 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) 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, 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

func (*Server) ServeStdio

func (s *Server) ServeStdio(ctx context.Context) error

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

Jump to

Keyboard shortcuts

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