Documentation
¶
Index ¶
- Constants
- Variables
- type ClientFactory
- type ClientNotification
- type ClientNotificationKind
- type ClientNotificationSink
- type ClientSession
- type ConnectionAuthorizer
- type InvokeMCPToolRequestBody
- type InvokeMCPToolResponseBody
- type MCPCompleteArgumentRequestBody
- type MCPCompletionResult
- type MCPDiscoveryPageToken
- type MCPDiscoverySnapshot
- type MCPGetPromptResponseBody
- type MCPImplementationInfo
- type MCPPromptRef
- type MCPReadResourceResponseBody
- type MCPResourceRef
- type MCPResourceTemplateRef
- type MCPRuntimeManager
- func (m *MCPRuntimeManager) CallTool(ctx context.Context, ref mcpServer.ServerID, request InvokeMCPToolRequestBody) (*InvokeMCPToolResponseBody, error)
- func (m *MCPRuntimeManager) CallToolDryRun(ctx context.Context, ref mcpServer.ServerID, request InvokeMCPToolRequestBody) (mcpServer.RuntimeConfig, MCPToolCapability, error)
- func (m *MCPRuntimeManager) Close(ctx context.Context) error
- func (m *MCPRuntimeManager) Complete(ctx context.Context, ref mcpServer.ServerID, ...) (*MCPCompletionResult, error)
- func (m *MCPRuntimeManager) Connect(ctx context.Context, ref mcpServer.ServerID) (*MCPServerRuntimeSnapshot, error)
- func (m *MCPRuntimeManager) Disconnect(ctx context.Context, ref mcpServer.ServerID) error
- func (m *MCPRuntimeManager) GetPrompt(ctx context.Context, ref mcpServer.ServerID, name string, ...) (*MCPGetPromptResponseBody, error)
- func (m *MCPRuntimeManager) Invalidate(ctx context.Context, ref mcpServer.ServerID) error
- func (m *MCPRuntimeManager) InvalidateCollection(ctx context.Context, ref mcpServer.CatalogID) error
- func (m *MCPRuntimeManager) ListPrompts(ctx context.Context, ref mcpServer.ServerID) ([]MCPPromptRef, error)
- func (m *MCPRuntimeManager) ListPromptsPage(ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string) (out []MCPPromptRef, next *string, err error)
- func (m *MCPRuntimeManager) ListResourceTemplates(ctx context.Context, ref mcpServer.ServerID) ([]MCPResourceTemplateRef, error)
- func (m *MCPRuntimeManager) ListResourceTemplatesPage(ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string) (out []MCPResourceTemplateRef, next *string, err error)
- func (m *MCPRuntimeManager) ListResources(ctx context.Context, ref mcpServer.ServerID) ([]MCPResourceRef, error)
- func (m *MCPRuntimeManager) ListResourcesPage(ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string) (out []MCPResourceRef, next *string, err error)
- func (m *MCPRuntimeManager) ListTools(ctx context.Context, ref mcpServer.ServerID) ([]MCPToolCapability, error)
- func (m *MCPRuntimeManager) ListToolsPage(ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string) (out []MCPToolCapability, next *string, err error)
- func (m *MCPRuntimeManager) OnClientNotification(ctx context.Context, event ClientNotification)
- func (m *MCPRuntimeManager) ReadResource(ctx context.Context, ref mcpServer.ServerID, uri string) (*MCPReadResourceResponseBody, error)
- func (m *MCPRuntimeManager) Refresh(ctx context.Context, ref mcpServer.ServerID) (*MCPServerRuntimeSnapshot, error)
- func (m *MCPRuntimeManager) SetSessionLifecycleCleaner(cleaner SessionLifecycleCleaner)
- func (m *MCPRuntimeManager) StartConnect(ctx context.Context, ref mcpServer.ServerID) (*MCPServerRuntimeSnapshot, error)
- func (m *MCPRuntimeManager) Status(ctx context.Context, ref mcpServer.ServerID) (*MCPServerRuntimeSnapshot, error)
- type MCPServerCapabilitiesSummary
- type MCPServerRuntimeSnapshot
- type MCPServerStatus
- type MCPTaskSupport
- type MCPToolAppRenderInfo
- type MCPToolCapability
- type PreparedConnection
- type SessionLifecycleCleaner
Constants ¶
const ( DefaultMCPPageSize = mcpServer.DefaultMCPPageSize MaxMCPServerPageSize = mcpServer.MaxMCPServerPageSize NotificationRefreshDebounce = mcpServer.NotificationRefreshDebounce MCPServerStatusDisabled = mcpServer.MCPServerStatusDisabled MCPServerStatusDisconnected = mcpServer.MCPServerStatusDisconnected MCPServerStatusConnecting = mcpServer.MCPServerStatusConnecting MCPServerStatusReady = mcpServer.MCPServerStatusReady MCPServerStatusError = mcpServer.MCPServerStatusError MCPTaskSupportForbidden = mcpServer.MCPTaskSupportForbidden MCPTaskSupportOptional = mcpServer.MCPTaskSupportOptional MCPTaskSupportRequired = mcpServer.MCPTaskSupportRequired )
Variables ¶
var ( ErrMCPInvalidRuntimeRequest = mcpServer.ErrMCPInvalidRuntimeRequest ErrMCPRuntimeNotReady = mcpServer.ErrMCPRuntimeNotReady ErrMCPPolicyDenied = mcpServer.ErrMCPPolicyDenied ErrMCPApprovalNeeded = mcpServer.ErrMCPApprovalNeeded ErrMCPStaleReference = mcpServer.ErrMCPStaleReference )
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶
type ClientFactory interface {
Connect(
ctx context.Context,
config mcpServer.RuntimeConfig,
authorization PreparedConnection,
notifications ClientNotificationSink,
) (ClientSession, error)
}
type ClientNotification ¶
type ClientNotification = mcpServer.ClientNotification
type ClientNotificationKind ¶
type ClientNotificationKind = mcpServer.ClientNotificationKind
type ClientNotificationSink ¶
type ClientNotificationSink = mcpServer.ClientNotificationSink
type ClientSession ¶
type ClientSession interface {
Close(ctx context.Context) error
Discover(
ctx context.Context,
config mcpServer.RuntimeConfig,
) (MCPDiscoverySnapshot, error)
CallTool(
ctx context.Context,
toolName string,
arguments map[string]any,
) (*InvokeMCPToolResponseBody, error)
ReadResource(
ctx context.Context,
uri string,
) (*MCPReadResourceResponseBody, error)
GetPrompt(
ctx context.Context,
name string,
arguments map[string]string,
) (*MCPGetPromptResponseBody, error)
Complete(
ctx context.Context,
request MCPCompleteArgumentRequestBody,
) (*MCPCompletionResult, error)
}
type ConnectionAuthorizer ¶
type ConnectionAuthorizer interface {
PrepareConnection(
ctx context.Context,
config mcpServer.RuntimeConfig,
) (PreparedConnection, error)
ConnectionSucceeded(
ctx context.Context,
config mcpServer.RuntimeConfig,
)
ConnectionFailed(
ctx context.Context,
config mcpServer.RuntimeConfig,
err error,
)
}
ConnectionAuthorizer is a narrow runtime port. The runtime session manager knows nothing about settings, secret persistence, artifact storage, OAuth loopback listeners, or concrete SDK types.
type InvokeMCPToolRequestBody ¶
type InvokeMCPToolRequestBody = mcpServer.InvokeMCPToolRequestBody
type InvokeMCPToolResponseBody ¶
type InvokeMCPToolResponseBody = mcpServer.InvokeMCPToolResponseBody
type MCPCompleteArgumentRequestBody ¶
type MCPCompleteArgumentRequestBody = mcpServer.MCPCompleteArgumentRequestBody
type MCPCompletionResult ¶
type MCPCompletionResult = mcpServer.MCPCompletionResult
type MCPDiscoveryPageToken ¶
type MCPDiscoveryPageToken = mcpServer.MCPDiscoveryPageToken
type MCPDiscoverySnapshot ¶
type MCPDiscoverySnapshot = mcpServer.MCPDiscoverySnapshot
type MCPGetPromptResponseBody ¶
type MCPGetPromptResponseBody = mcpServer.MCPGetPromptResponseBody
type MCPImplementationInfo ¶
type MCPImplementationInfo = mcpServer.MCPImplementationInfo
type MCPPromptRef ¶
type MCPPromptRef = mcpServer.MCPPromptRef
type MCPReadResourceResponseBody ¶
type MCPReadResourceResponseBody = mcpServer.MCPReadResourceResponseBody
type MCPResourceRef ¶
type MCPResourceRef = mcpServer.MCPResourceRef
type MCPResourceTemplateRef ¶
type MCPResourceTemplateRef = mcpServer.MCPResourceTemplateRef
type MCPRuntimeManager ¶
type MCPRuntimeManager struct {
// contains filtered or unexported fields
}
func NewMCPRuntimeManager ¶
func NewMCPRuntimeManager( source mcpServer.ServerSource, authorizer ConnectionAuthorizer, factory ClientFactory, ) (*MCPRuntimeManager, error)
func (*MCPRuntimeManager) CallTool ¶
func (m *MCPRuntimeManager) CallTool( ctx context.Context, ref mcpServer.ServerID, request InvokeMCPToolRequestBody, ) (*InvokeMCPToolResponseBody, error)
func (*MCPRuntimeManager) CallToolDryRun ¶
func (m *MCPRuntimeManager) CallToolDryRun( ctx context.Context, ref mcpServer.ServerID, request InvokeMCPToolRequestBody, ) (mcpServer.RuntimeConfig, MCPToolCapability, error)
func (*MCPRuntimeManager) Complete ¶
func (m *MCPRuntimeManager) Complete( ctx context.Context, ref mcpServer.ServerID, request MCPCompleteArgumentRequestBody, ) (*MCPCompletionResult, error)
func (*MCPRuntimeManager) Connect ¶
func (m *MCPRuntimeManager) Connect( ctx context.Context, ref mcpServer.ServerID, ) (*MCPServerRuntimeSnapshot, error)
Connect resolves and verifies the full Artifact-backed server state once, materializes the runtime configuration, establishes the client session, and captures the session version.
Tool calls do not repeat Source snapshot verification. Mutations explicitly invalidate sessions, while explicit Refresh performs a new full resolution.
func (*MCPRuntimeManager) Disconnect ¶
func (*MCPRuntimeManager) GetPrompt ¶
func (m *MCPRuntimeManager) GetPrompt( ctx context.Context, ref mcpServer.ServerID, name string, arguments map[string]string, ) (*MCPGetPromptResponseBody, error)
func (*MCPRuntimeManager) Invalidate ¶
Invalidate removes the derived runtime session after an MCP lifecycle, policy, installation-overlay, or secret-binding mutation.
It deliberately does not resolve the server again. The mutation path has already established that the prior runtime version is obsolete.
func (*MCPRuntimeManager) InvalidateCollection ¶
func (*MCPRuntimeManager) ListPrompts ¶
func (m *MCPRuntimeManager) ListPrompts( ctx context.Context, ref mcpServer.ServerID, ) ([]MCPPromptRef, error)
func (*MCPRuntimeManager) ListPromptsPage ¶
func (m *MCPRuntimeManager) ListPromptsPage( ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string, ) (out []MCPPromptRef, next *string, err error)
func (*MCPRuntimeManager) ListResourceTemplates ¶
func (m *MCPRuntimeManager) ListResourceTemplates( ctx context.Context, ref mcpServer.ServerID, ) ([]MCPResourceTemplateRef, error)
func (*MCPRuntimeManager) ListResourceTemplatesPage ¶
func (m *MCPRuntimeManager) ListResourceTemplatesPage( ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string, ) (out []MCPResourceTemplateRef, next *string, err error)
func (*MCPRuntimeManager) ListResources ¶
func (m *MCPRuntimeManager) ListResources( ctx context.Context, ref mcpServer.ServerID, ) ([]MCPResourceRef, error)
func (*MCPRuntimeManager) ListResourcesPage ¶
func (m *MCPRuntimeManager) ListResourcesPage( ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string, ) (out []MCPResourceRef, next *string, err error)
func (*MCPRuntimeManager) ListTools ¶
func (m *MCPRuntimeManager) ListTools( ctx context.Context, ref mcpServer.ServerID, ) ([]MCPToolCapability, error)
func (*MCPRuntimeManager) ListToolsPage ¶
func (m *MCPRuntimeManager) ListToolsPage( ctx context.Context, ref mcpServer.ServerID, pageSize int, pageToken string, ) (out []MCPToolCapability, next *string, err error)
func (*MCPRuntimeManager) OnClientNotification ¶
func (m *MCPRuntimeManager) OnClientNotification( ctx context.Context, event ClientNotification, )
func (*MCPRuntimeManager) ReadResource ¶
func (m *MCPRuntimeManager) ReadResource( ctx context.Context, ref mcpServer.ServerID, uri string, ) (*MCPReadResourceResponseBody, error)
func (*MCPRuntimeManager) Refresh ¶
func (m *MCPRuntimeManager) Refresh( ctx context.Context, ref mcpServer.ServerID, ) (*MCPServerRuntimeSnapshot, error)
func (*MCPRuntimeManager) SetSessionLifecycleCleaner ¶
func (m *MCPRuntimeManager) SetSessionLifecycleCleaner( cleaner SessionLifecycleCleaner, )
func (*MCPRuntimeManager) StartConnect ¶
func (m *MCPRuntimeManager) StartConnect( ctx context.Context, ref mcpServer.ServerID, ) (*MCPServerRuntimeSnapshot, error)
func (*MCPRuntimeManager) Status ¶
func (m *MCPRuntimeManager) Status( ctx context.Context, ref mcpServer.ServerID, ) (*MCPServerRuntimeSnapshot, error)
type MCPServerCapabilitiesSummary ¶
type MCPServerCapabilitiesSummary = mcpServer.MCPServerCapabilitiesSummary
type MCPServerRuntimeSnapshot ¶
type MCPServerRuntimeSnapshot = mcpServer.MCPServerRuntimeSnapshot
type MCPServerStatus ¶
type MCPServerStatus = mcpServer.MCPServerStatus
type MCPTaskSupport ¶
type MCPTaskSupport = mcpServer.MCPTaskSupport
type MCPToolAppRenderInfo ¶
type MCPToolAppRenderInfo = mcpServer.MCPToolAppRenderInfo
type MCPToolCapability ¶
type MCPToolCapability = mcpServer.MCPToolCapability
type PreparedConnection ¶
type PreparedConnection struct {
Env map[string]string
Headers map[string]string
SensitiveValues []string
OAuthHandler any
}
PreparedConnection is the runtime-owned result of authorization preparation. OAuthHandler is intentionally opaque to the core runtime. A concrete transport adapter, such as sdkclient, may interpret it.