Documentation
¶
Index ¶
- func ChoiceID(serverID spec.MCPServerID, toolName string) string
- func EnsureDigest(expected, got string, allowStale bool) error
- func Evaluate(in EvaluationInput) spec.MCPApprovalEvaluation
- func ExecutionMode(server spec.MCPServerConfig, tool spec.MCPToolCapability) spec.MCPExecutionMode
- func ProviderToolName(serverID spec.MCPServerID, toolName string) string
- type ApprovalManager
- func (m *ApprovalManager) Create(ctx context.Context, summary spec.MCPApprovalSummary) (string, error)
- func (m *ApprovalManager) LookupDecision(summary spec.MCPApprovalSummary) (spec.MCPApprovalResolution, bool)
- func (m *ApprovalManager) Resolve(ctx context.Context, id string, res spec.MCPApprovalResolution) (*spec.MCPApprovalToken, error)
- func (m *ApprovalManager) VerifyAndConsume(ctx context.Context, id, token string) error
- func (m *ApprovalManager) VerifyAndConsumeToken(ctx context.Context, token string, expected spec.MCPApprovalSummary) (string, error)
- type ClientFactory
- type ClientNotification
- type ClientNotificationKind
- type ClientNotificationSink
- type ClientSession
- type EvaluationInput
- type MCPRuntimeManager
- func (m *MCPRuntimeManager) CallTool(ctx context.Context, bundleID bundleitemutils.BundleID, ...) (*spec.InvokeMCPToolResponseBody, spec.MCPServerConfig, spec.MCPToolCapability, ...)
- func (m *MCPRuntimeManager) CallToolDryRun(ctx context.Context, bundleID bundleitemutils.BundleID, ...) (*spec.InvokeMCPToolResponseBody, spec.MCPServerConfig, spec.MCPToolCapability, ...)
- func (m *MCPRuntimeManager) Close(ctx context.Context) error
- func (m *MCPRuntimeManager) Complete(ctx context.Context, req *spec.MCPCompleteArgumentRequest) (*spec.MCPCompletionResult, error)
- func (m *MCPRuntimeManager) Connect(ctx context.Context, req *spec.ConnectMCPServerRequest) (*spec.ConnectMCPServerResponse, error)
- func (m *MCPRuntimeManager) Disconnect(ctx context.Context, req *spec.DisconnectMCPServerRequest) (*spec.DisconnectMCPServerResponse, error)
- func (m *MCPRuntimeManager) ForgetLastKnownSnapshot(ctx context.Context, bundleID bundleitemutils.BundleID, ...)
- func (m *MCPRuntimeManager) GetPrompt(ctx context.Context, req *spec.MCPGetPromptRequest) (*spec.MCPGetPromptResponse, error)
- func (m *MCPRuntimeManager) ListPrompts(ctx context.Context, req *spec.ListMCPServerPromptsRequest) (*spec.ListMCPServerPromptsResponse, error)
- func (m *MCPRuntimeManager) ListResourceTemplates(ctx context.Context, req *spec.ListMCPServerResourceTemplatesRequest) (*spec.ListMCPServerResourceTemplatesResponse, error)
- func (m *MCPRuntimeManager) ListResources(ctx context.Context, req *spec.ListMCPServerResourcesRequest) (*spec.ListMCPServerResourcesResponse, error)
- func (m *MCPRuntimeManager) ListTools(ctx context.Context, req *spec.ListMCPServerToolsRequest) (*spec.ListMCPServerToolsResponse, error)
- func (m *MCPRuntimeManager) OnClientNotification(ctx context.Context, event ClientNotification)
- func (m *MCPRuntimeManager) ReadResource(ctx context.Context, req *spec.MCPReadResourceRequest) (*spec.MCPReadResourceResponse, error)
- func (m *MCPRuntimeManager) Refresh(ctx context.Context, req *spec.RefreshMCPServerRequest) (*spec.RefreshMCPServerResponse, error)
- func (m *MCPRuntimeManager) Status(ctx context.Context, req *spec.GetMCPServerStatusRequest) (*spec.GetMCPServerStatusResponse, error)
- type ToolBridge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDigest ¶
func Evaluate ¶
func Evaluate(in EvaluationInput) spec.MCPApprovalEvaluation
func ExecutionMode ¶
func ExecutionMode(server spec.MCPServerConfig, tool spec.MCPToolCapability) spec.MCPExecutionMode
func ProviderToolName ¶
func ProviderToolName(serverID spec.MCPServerID, toolName string) string
Types ¶
type ApprovalManager ¶
type ApprovalManager struct {
// contains filtered or unexported fields
}
func NewApprovalManager ¶
func NewApprovalManager(ttl time.Duration) *ApprovalManager
func (*ApprovalManager) Create ¶
func (m *ApprovalManager) Create(ctx context.Context, summary spec.MCPApprovalSummary) (string, error)
func (*ApprovalManager) LookupDecision ¶
func (m *ApprovalManager) LookupDecision(summary spec.MCPApprovalSummary) (spec.MCPApprovalResolution, bool)
func (*ApprovalManager) Resolve ¶
func (m *ApprovalManager) Resolve( ctx context.Context, id string, res spec.MCPApprovalResolution, ) (*spec.MCPApprovalToken, error)
func (*ApprovalManager) VerifyAndConsume ¶
func (m *ApprovalManager) VerifyAndConsume(ctx context.Context, id, token string) error
func (*ApprovalManager) VerifyAndConsumeToken ¶
func (m *ApprovalManager) VerifyAndConsumeToken( ctx context.Context, token string, expected spec.MCPApprovalSummary, ) (string, error)
type ClientFactory ¶
type ClientFactory interface {
Connect(
ctx context.Context,
cfg spec.MCPServerConfig,
resolved auth.ResolvedTransportAuth,
events ClientNotificationSink,
) (ClientSession, error)
}
type ClientNotification ¶
type ClientNotification struct {
BundleID bundleitemutils.BundleID
ServerID spec.MCPServerID
Kind ClientNotificationKind
ResourceURI string
LoggerName string
LoggingLevel string
LogData any
Progress float64
Total float64
Message string
}
type ClientNotificationKind ¶
type ClientNotificationKind string
const ( ClientNotificationToolListChanged ClientNotificationKind = "toolsListChanged" ClientNotificationResourceListChanged ClientNotificationKind = "resourcesListChanged" ClientNotificationPromptListChanged ClientNotificationKind = "promptsListChanged" ClientNotificationResourceUpdated ClientNotificationKind = "resourceUpdated" ClientNotificationProgress ClientNotificationKind = "progress" )
type ClientNotificationSink ¶
type ClientNotificationSink interface {
OnClientNotification(ctx context.Context, event ClientNotification)
}
type ClientSession ¶
type ClientSession interface {
Close(ctx context.Context) error
Ping(ctx context.Context) error
Discover(
ctx context.Context,
serverID spec.MCPServerID,
policy spec.MCPServerPolicy,
trustLevel spec.MCPTrustLevel,
) (spec.MCPDiscoverySnapshot, error)
CallTool(ctx context.Context, toolName string, args map[string]any) (*spec.InvokeMCPToolResponseBody, error)
ReadResource(ctx context.Context, uri string) (*spec.MCPReadResourceResponseBody, error)
GetPrompt(ctx context.Context, name string, args map[string]string) (*spec.MCPGetPromptResponseBody, error)
Complete(ctx context.Context, req spec.MCPCompleteArgumentRequestBody) (*spec.MCPCompletionResult, error)
}
type EvaluationInput ¶
type EvaluationInput struct {
Server spec.MCPServerConfig
Tool spec.MCPToolCapability
Req spec.InvokeMCPToolRequestBody
}
type MCPRuntimeManager ¶
type MCPRuntimeManager struct {
// contains filtered or unexported fields
}
func NewMCPRuntimeManager ¶
func NewMCPRuntimeManager(st *store.Store, authMgr *auth.AuthManager, factory ClientFactory) *MCPRuntimeManager
func (*MCPRuntimeManager) CallTool ¶
func (m *MCPRuntimeManager) CallTool( ctx context.Context, bundleID bundleitemutils.BundleID, serverID spec.MCPServerID, req spec.InvokeMCPToolRequestBody, ) (*spec.InvokeMCPToolResponseBody, spec.MCPServerConfig, spec.MCPToolCapability, error)
func (*MCPRuntimeManager) CallToolDryRun ¶
func (m *MCPRuntimeManager) CallToolDryRun( ctx context.Context, bundleID bundleitemutils.BundleID, serverID spec.MCPServerID, req spec.InvokeMCPToolRequestBody, ) (*spec.InvokeMCPToolResponseBody, spec.MCPServerConfig, spec.MCPToolCapability, error)
func (*MCPRuntimeManager) Complete ¶
func (m *MCPRuntimeManager) Complete( ctx context.Context, req *spec.MCPCompleteArgumentRequest, ) (*spec.MCPCompletionResult, error)
func (*MCPRuntimeManager) Connect ¶
func (m *MCPRuntimeManager) Connect( ctx context.Context, req *spec.ConnectMCPServerRequest, ) (*spec.ConnectMCPServerResponse, error)
func (*MCPRuntimeManager) Disconnect ¶
func (m *MCPRuntimeManager) Disconnect( ctx context.Context, req *spec.DisconnectMCPServerRequest, ) (*spec.DisconnectMCPServerResponse, error)
func (*MCPRuntimeManager) ForgetLastKnownSnapshot ¶ added in v0.1.13
func (m *MCPRuntimeManager) ForgetLastKnownSnapshot( ctx context.Context, bundleID bundleitemutils.BundleID, serverID spec.MCPServerID, )
func (*MCPRuntimeManager) GetPrompt ¶
func (m *MCPRuntimeManager) GetPrompt( ctx context.Context, req *spec.MCPGetPromptRequest, ) (*spec.MCPGetPromptResponse, error)
func (*MCPRuntimeManager) ListPrompts ¶
func (m *MCPRuntimeManager) ListPrompts( ctx context.Context, req *spec.ListMCPServerPromptsRequest, ) (*spec.ListMCPServerPromptsResponse, error)
func (*MCPRuntimeManager) ListResourceTemplates ¶
func (m *MCPRuntimeManager) ListResourceTemplates( ctx context.Context, req *spec.ListMCPServerResourceTemplatesRequest, ) (*spec.ListMCPServerResourceTemplatesResponse, error)
func (*MCPRuntimeManager) ListResources ¶
func (m *MCPRuntimeManager) ListResources( ctx context.Context, req *spec.ListMCPServerResourcesRequest, ) (*spec.ListMCPServerResourcesResponse, error)
func (*MCPRuntimeManager) ListTools ¶
func (m *MCPRuntimeManager) ListTools( ctx context.Context, req *spec.ListMCPServerToolsRequest, ) (*spec.ListMCPServerToolsResponse, error)
func (*MCPRuntimeManager) OnClientNotification ¶
func (m *MCPRuntimeManager) OnClientNotification(ctx context.Context, event ClientNotification)
func (*MCPRuntimeManager) ReadResource ¶
func (m *MCPRuntimeManager) ReadResource( ctx context.Context, req *spec.MCPReadResourceRequest, ) (*spec.MCPReadResourceResponse, error)
func (*MCPRuntimeManager) Refresh ¶
func (m *MCPRuntimeManager) Refresh( ctx context.Context, req *spec.RefreshMCPServerRequest, ) (*spec.RefreshMCPServerResponse, error)
func (*MCPRuntimeManager) Status ¶
func (m *MCPRuntimeManager) Status( ctx context.Context, req *spec.GetMCPServerStatusRequest, ) (*spec.GetMCPServerStatusResponse, error)
type ToolBridge ¶
type ToolBridge struct {
// contains filtered or unexported fields
}
func NewToolBridge ¶
func NewToolBridge(rt *MCPRuntimeManager, approvals *ApprovalManager) *ToolBridge
func (*ToolBridge) Evaluate ¶
func (b *ToolBridge) Evaluate( ctx context.Context, req *spec.EvaluateMCPToolCallRequest, ) (*spec.EvaluateMCPToolCallResponse, error)
func (*ToolBridge) Invoke ¶
func (b *ToolBridge) Invoke( ctx context.Context, req *spec.InvokeMCPToolRequest, ) (*spec.InvokeMCPToolResponse, error)
Click to show internal directories.
Click to hide internal directories.