Skip to content

PoC: MCP Apps integration for interactive UI extensions #753

@manusa

Description

@manusa

Summary

Implement support for MCP Apps — the official MCP extension (spec version 2026-01-26) that enables tools to return interactive UI components rendered in sandboxed iframes by MCP hosts.

This will allow the kubernetes-mcp-server to provide rich, interactive experiences such as:

  • Interactive resource tables with sorting, filtering, and actions
  • Visual dashboards for cluster metrics and status
  • Forms for resource creation/editing
  • Topology visualizations for workloads and networking

This is an opt-in feature, disabled by default, controlled by the apps_enabled configuration flag / --apps CLI flag.

Background

MCP Apps extend the Model Context Protocol by letting tools declare UI resources:

  1. Tool definition — Tools declare a _meta.ui.resourceUri field pointing to a ui:// resource
  2. Tool call — LLM invokes the tool on the server
  3. Host renders — Host fetches the HTML resource via resources/read and displays it in a sandboxed iframe
  4. Bidirectional communication — Host passes tool data via postMessage notifications; UI can call other server tools via JSON-RPC over postMessage

Supported hosts: VS Code (Insiders + Stable), Claude (web/desktop), ChatGPT, Goose, Postman, MCPJam.

References

Research and Implementation Plan

Detailed research document with all findings, architectural decisions, and implementation guidance:
docs/mcp-apps-research.md (on branch feat/mcp-apps)

Key decisions

Decision Choice Rationale
Opt-in apps_enabled config / --apps CLI Zero overhead when disabled
Frontend Preact + HTM + Signals-core (~19 KB) Smaller than Alpine.js, component model fits widgets
Build step None Libraries inlined in HTML
ext-apps SDK Not used — protocol implemented directly SDK is 314 KB. Protocol is ~100 lines
Airgap support Vendored JS committed to repo make vendor-js for updates
HTML Single generic viewer Adapts per tool via hostContext.toolInfo.tool.name
Meta injection Centralized in registerTool() No changes to individual toolset files

Acceptance Criteria

  • Feature is opt-in via apps_enabled config / --apps flag (disabled by default)
  • At least one tool demonstrates full MCP Apps integration with interactive UI
  • Works with VS Code Copilot and other MCP Apps-compatible hosts
  • Zero behavioral change when apps_enabled = false
  • No build step required (no Node.js/npm dependency)
  • Compatible with airgapped environments (vendored JS)
  • Documentation for the feature and configuration

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions