DEV Community
Follow
Two undocumented bugs in MCP Apps I found building a task panel for Claude
The author developed Wingman, an open-source MCP server that displays a persistent task panel within Claude conversations. This involved utilizing MCP Apps and the associated SDK, which the author found to be robust. However, two significant undocumented bugs consumed considerable development time. The first bug concerned the placement of `resourceUri`, which needs to be on the top-level `_meta` of a `CallToolResult` object, not within `structuredContent`. Returning a plain dictionary from a tool can lead to `_meta` being incorrectly nested, causing the host to not find the resource to render.
The fix involves returning a proper `CallToolResult` object with the `_meta` correctly positioned. The second major bug stemmed from CSS specificity issues overriding the `[hidden]` attribute. Explicit `display` rules in custom stylesheets were preventing elements from being hidden as intended by JavaScript. A single line adding `!important` to the `[hidden]` CSS rule resolved three separate UI issues simultaneously.
Additionally, three iframe sandbox constraints within MCP Apps hosts were encountered: `confirm()` fails silently, `navigator.clipboard.writeText` is unavailable, and `Blob`/`URL.createObjectURL` downloads are blocked. These limitations require workarounds like using inline confirmations and routing content back through `sendMessage`. The author emphasizes that these API failures typically result in silent non-operation rather than errors, making them difficult to diagnose. Ultimately, both major bugs involved issues one layer removed from the initial inspection point, highlighting the importance of checking these intermediate layers during debugging. Wingman is MIT licensed and available on PyPI.