Skip to content

Tool UI and @frontmcp/react: bugs and doc gaps (found writing frontmcp.dev's UI reference) #645

Closed

Description

@frontegg-david

Found while writing frontmcp.dev's Tool UI and @frontmcp/react reference. Each item was checked against the published 1.8.4 packages, whose UI code 1.8.5 doesn't change. The checks used Playground examples, Node and jsdom projects, and Chromium pages against a real server.

@frontmcp/react

  • It doesn't start in a browser. A plain Vite build of the smallest app succeeds, then fails on load with (0 , A.createRequire) is not a function.
  • The subpath entry points are disconnected from the provider. @frontmcp/react/state, /api and /ai each carry their own FrontMcpContext and serverRegistry. As a result:
    • useStoreResource, useReduxResource, useValtioResource and useApiClient register nothing.
    • useAITools and useTools stay { tools: null, loading: true }.
  • Inline schemas loop forever. useDynamicTool({ schema: z.object(…) }) written inside a component, under anything that reads server state, never settles. AgentSearch always does this, and AgentContent does without an inputSchema.
  • Router entries can't go into create(). create({ tools: createRouterEntries().tools }) throws a ZodError at tools.0.name.
  • ToolForm submits an untouched enum field as "".
  • Store resources don't update subscribers. A root useStoreResource("state://…") keeps its first value until refetch().
  • useServer() ignores the provider's name; it always reads "default".
  • The docs are wrong in several places:
    • data is the whole MCP result, so String(data) shows [object Object].
    • Tool failures arrive in data with isError: true, not in error.
    • Plain objects in create({ resources }) fail with "Expected a class or a resource function".
    • z isn't re-exported.

Tool UI (ui option)

  • With ui, outputSchema stops stripping fields. Returning { name, passwordHash } with outputSchema: { name } sends the hash in structuredContent, in content and to the page, for every client except "gemini".
  • ui.csp never reaches the page's own CSP. connect-src lists only the five CDNs, so a widget's fetch to a declared connectDomains origin is blocked.
  • The widget resource carries CSP only after a call. resources/read before any tools/call has no _meta.
  • Widget URIs are wrong in two ways. resourceUri: "ui://my-app/card.html" is advertised, but reading it returns -32602 Resource not found. An unknown ui://widget/<name>.html returns a placeholder page instead of an error.
  • A capitalized template function, or any React component used as template, renders nothing. The page gets an empty <div id="root"> and stays on "Loading widget...".
  • Markdown and MDX template strings aren't converted.
  • .tsx widgets don't build in ES-module projects (Dynamic require of "path" is not supported).
  • Serving modes: hybrid mode sends no code (_meta["ui/component"] is only { type, hash, toolName }), and direct-url and custom-url behave as inline.
  • Options that do nothing:
    • Accepted with no effect: widgetDescription, widgetAccessible, displayMode, prefersBorder, sandboxDomain, contentSecurity, hydrate, runtimeOptions, mdxComponents, bundlingMode, uiType and htmlResponsePrefix.
    • Nothing is sanitized. <script>, onclick and javascript: in trusted markup reach the page.
  • Host settings are ignored. extApps.enabled: false still answers ui/* requests. Capabilities put in extApps.hostCapabilities (openLink, modelContextUpdate, widgetTools) have no implementation and fail with -32003.
  • MCP Apps clients aren't detected on 2026-07-28. A client declaring the capability gets platform "unknown".
  • Tool output handling is wrong for two hosts. After an MCP Apps host's tool-result, useToolOutput() holds the content array instead of the object. Static widgets under the OpenAI Apps SDK show {}.
  • @frontmcp/ui hooks misbehave in real pages.
    • useHostContext() is always null.
    • In MCP Apps hosts, useTheme() stays "light", and useCapability("canCallTools") stays false after the handshake.
  • autoResize: false doesn't stop ui/setSize.
  • The bridge's minifier removes spaces in messages (…on this platform(ext-apps)).
  • The docs don't match the code in five places:
    • card(), badge(), descriptionList(), button(), form() and input() aren't exported from @frontmcp/ui.
    • useCallTool returns a tuple.
    • There's no openai/outputTemplate.
    • There's no dual payload.
    • Markup isn't sanitized by default.

Activity

  1. added
    bug
    on Sep 29, 2026
  2. frontegg-david commented on Sep 30, 2026

    @frontegg-david
    ContributorAuthor

    Fixed in #664 (release/1.8.x), back-ported to main in #669: browser start-up, shared provider context, and Tool UI output, CSP and URI handling, with tests. Ships in the next 1.8.x release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions