apps

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppExtensionID is the MCP extension identifier for MCP Apps.
	AppExtensionID = "io.modelcontextprotocol/ui"

	// AppMIMEType is the required MIME type for an MCP Apps UI resource.
	AppMIMEType     = "text/html;profile=mcp-app"
	VisibilityModel = "model"
	VisibilityApp   = "app"
)

Variables

This section is empty.

Functions

func DefaultSandboxCSP

func DefaultSandboxCSP() string

DefaultSandboxCSP returns a restrictive CSP suitable for srcdoc iframes hosting untrusted MCP App HTML. With sandbox="allow-scripts" the iframe has a unique opaque origin, so 'self' refers to that opaque origin.

func IsAppMIMEType

func IsAppMIMEType(mime string) bool

IsAppMIMEType returns true if mime is a valid MCP Apps MIME type, tolerating whitespace and additional parameters after the profile.

func ToolVisibleToApp

func ToolVisibleToApp(info *mcpServer.MCPToolAppInfo) bool

ToolVisibleToApp reports whether the tool may be called by an MCP App.

func ToolVisibleToModel

func ToolVisibleToModel(info *mcpServer.MCPToolAppInfo) bool

ToolVisibleToModel reports whether the tool can be exposed to the LLM. A nil/empty visibility list defaults to model+app, so unknown servers don't accidentally hide tools.

func ValidateAppToolInvocation

func ValidateAppToolInvocation(
	p mcpPolicy.MCPAppsPolicy,
	tool mcpServer.MCPToolCapability,
	appServer mcpServer.ServerID,
) error

ValidateAppToolInvocation is the Artifact-backed MCP App authorization check. It is the target API used by the Artifact Store MCP runtime.

Types

This section is empty.

Jump to

Keyboard shortcuts

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