The OpenAI Apps SDK is an integration
of MCP that lets you expose applications to ChatGPT. Zuplo's MCP Server provides
built-in support for the Apps SDK through tools, resources, and the
ZuploMcpSdk class, which allows you to optionally access incoming request
metadata and set response metadata required for ChatGPT widget rendering.
The OpenAI Apps SDK and support for it in Zuplo's mcpServerHandler is in beta
and subject to change!
tools
MCP tools define the functionality of your app. Zuplo MCP servers support tools
for the OpenAI Apps SDK with _meta metadata through the x-zuplo-route.mcp
configuration. Learn more about configuration options for tools in
the MCP Server Tools documentation.
resources
MCP resources are how your app's sandboxed widgets are displayed in the chat
interface. Zuplo MCP servers support resources for the OpenAI Apps SDK with
_meta metadata through the x-zuplo-route.mcp configuration. Learn more about
configuration options for resources in
the MCP Server Resources documentation.
Configuring metadata
When configuring and describing your tools and resources, you may need to set
specific annotations and static _meta for when ChatGPT inspects these
entities. _meta is the main way that the OpenAI Apps SDK interfaces with an
MCP server. For example, an application may want to set a readOnlyHint
annotation on a tool and define that the tool renders a component for your
application with the static _meta["openai/outputTemplate"] metadata:
Code
The resource defined at ui://widget/weather.html can then be used to render
the app. Learn more about this in
the Zuplo MCP Server Tools documentation,
the OpenAI Apps SDK documentation for defining tools
and
the OpenAI Apps SDK documentation for setting up tools and resources.
ZuploMcpSdk
The ZuploMcpSdk class in the @zuplo/runtime provides methods to interact
with an MCP request and response metadata, which is essential for building
ChatGPT Apps that return structuredContent and _meta payloads out of band
of the typical API response flow.
This means that you can still use your existing APIs as MCP tools for your
OpenAI Apps SDK application while wrapping them with a custom module that uses
ZuploMcpSdk in order to propagate _meta application state.
Usage
Import the SDK and create an instance in your custom handler by passing in the request context:
Code
context.invokeRoute keeps the new request within the gateway: it does not go
back out to HTTP. But it's important to keep in mind that an invoked route on
the gateway will re-invoke the inbound and outbound policy pipeline for the
invoked route!
Methods
getRawCallToolRequest()
Retrieves the raw MCP tools/call request object, including any _meta sent by
ChatGPT. Use this to access client context hints like locale or user agent.
Code
setRawCallToolResult(result)
Sets the MCP tool result, including the _meta field that is sent to the
ChatGPT widget but not visible to the model. Use this to pass data that your
widget needs for rendering.
Code
For complete documentation on building ChatGPT Apps, see the OpenAI Apps SDK documentation and the OpenAI Apps SDK guide on setting up your MCP server