Help us shape the future of Go! Take the 2026 Go Developer Survey

appcheck

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package appcheck checks the server side of MCP Apps (io.modelcontextprotocol/ui, SEP-1865, stable 2026-01-26): tools that link a ui:// resource, the resources themselves (MIME type, HTML) and their security metadata (CSP domains, permissions), which is what a host shows before it renders an app.

Index

Constants

View Source
const Extension = "io.modelcontextprotocol/ui"

Extension is the identifier of the MCP Apps extension.

View Source
const MIMEType = "text/html;profile=mcp-app"

MIMEType is the only content type the extension defines so far.

Variables

This section is empty.

Functions

func Declare

func Declare(opts *mcp.ClientOptions)

Declare adds the host capability to client options, so servers that register UI tools only for capable hosts expose them.

Types

type AppInfo

type AppInfo struct {
	URI         string              `json:"uri"`
	Tools       []string            `json:"tools"`         // tools rendering with it
	AppOnly     []string            `json:"appOnlyTools"`  // hidden from the model
	CSP         map[string][]string `json:"csp,omitempty"` // connectDomains, resourceDomains, …
	Permissions []string            `json:"permissions"`   // camera, microphone, …
	Domain      string              `json:"domain,omitempty"`
	Bytes       int                 `json:"bytes"`
}

AppInfo summarizes one UI resource and what it asks the host for.

type Report

type Report struct {
	Declared bool      `json:"declared"` // server lists the extension in its capabilities
	Apps     []AppInfo `json:"apps"`
	Results  []Result  `json:"results"`
}

Report is the outcome of a check run.

func Run

func Run(ctx context.Context, session *mcp.ClientSession) *Report

Run checks every tool that links a UI resource.

func (*Report) Failed

func (r *Report) Failed() bool

Failed reports whether any check failed.

type Result

type Result struct {
	Name   string `json:"name"`
	Status Status `json:"status"`
	Detail string `json:"detail,omitempty"`
}

Result is the outcome of one check.

type Status

type Status string

Status of one check.

const (
	Pass Status = "PASS"
	Fail Status = "FAIL" // a MUST is violated
	Warn Status = "WARN" // a SHOULD is violated, deprecated or overly broad
	Info Status = "INFO"
)

Jump to

Keyboard shortcuts

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