App instance, and the host decides which requests it supports.
Use this guide when you are choosing which client API to call from the View.
Quick Choice
Check Host Capabilities First
Hosts may implement only part of the MCP Apps API. Read capabilities afterapp.connect(), then hide or disable UI that depends on missing host support.
message.text does not mean the host accepts images in sendMessage(), and updateModelContext.image does not mean it accepts structured content.
Server Tool or Server Resource?
Use a server tool when the View needs computation, authorization, mutation, search, filtering, pagination, or fresh data:callServerTool(). If a menu lists files, call listServerResources() and then readServerResource().
Model Context or Chat Message?
UseupdateModelContext() when the model should know what the user is viewing next time, but should not respond yet.
sendMessage() when a user action should continue the conversation immediately.
Sampling or Conversation?
UsecreateSamplingMessage() for work that belongs inside the View, such as generating a short label, grouping visible rows, or summarizing a selected passage before the user commits it.
sendMessage() when the output should become part of the chat transcript or when the model should decide which server tools to call next.
App-side Tool or Server Tool?
Use an app-side tool when the host needs information that only exists inside the rendered View.Errors and Fallbacks
Tool execution errors come back as results, so checkisError. Protocol, transport, and host rejection failures may throw.
isError when the method returns it.
Related Reference
Requests
Full method signatures for View-to-host requests.
Event Handlers
Incoming notifications and host-to-View requests.
App Tools
Expose View-local tools to the host and model.
Core Types
Host capabilities, context, metadata, display modes, and content types.