This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.
Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.
Pass metadata to useChatService().initialize():
metadata: {
mcp__assessmentId: assessmentId,
mcp__filter: { active: true },
}
The widget sends mcp__ metadata as AG-UI context
on every run. It uses JSON.stringify for every value, including strings, because
AG-UI context values must be strings. Values that cannot be serialized reject the send.
Reinitializing the same thread replaces its metadata; omitting metadata clears it.
Chat-service forwards keys starting with the case-sensitive mcp__ prefix to every
configured MCP server in tools/call.params._meta.
It removes the prefix once and decodes the JSON value, preserving strings, numbers,
booleans, objects, arrays, and null. No metadata enters the model prompt or tool
schema. Unprefixed fields are ignored.
Direct AG-UI clients must use the same encoding: for example,
{ description: "mcp__assessmentId", value: JSON.stringify(assessmentId) }.
The string "123" stays a string; the number 123 stays a number.
Chat-service rejects MCP metadata that exceeds these limits:
_, -, and .,
starting and ending with a letter or digit. progressToken is reserved.Invalid JSON, duplicate names, and missing AG-UI values are also rejected with
HTTP 422 before a run starts. JSON null is a valid value. Domain validation and
access checks belong to the receiving MCP server; forwarding alone does not restrict retrieval.
This replaces the former metadata-to-prompt behavior. Existing unprefixed fields
such as assessmentId no longer reach the model. Migrate callers to mcp__ when
their receiving tools can consume and enforce the metadata.