Skip to content

OLS-2568: Add mcp app pods top UI#143

Draft
onmete wants to merge 4 commits intoopenshift:mainfrom
onmete:add-mcp-app-pods-top-ui
Draft

OLS-2568: Add mcp app pods top UI#143
onmete wants to merge 4 commits intoopenshift:mainfrom
onmete:add-mcp-app-pods-top-ui

Conversation

@onmete
Copy link

@onmete onmete commented Feb 12, 2026

Draft with example UI resource for pods_top tool - feel free to close

Purpose: Introduce the MCP App resource serving infrastructure and the first concrete UI app -- a Pods Resource Usage dashboard for pods_top.

Rebase after:
#141
#142

Files changed:

  • **New directory: mcp-app/**
    • mcpapp.go -- Go embed package with AppResource type, ToolMeta() helper, Resources() registry, embedded dist/pods-top-app.html
    • package.json, tsconfig.json, vite.config.ts -- Node.js build tooling using Vite + vite-plugin-singlefile to produce a single self-contained HTML file
    • pods-top-app.html -- HTML template with CSS for the dashboard
    • src/pods-top-app.ts -- TypeScript source using @modelcontextprotocol/ext-apps SDK for sorting, formatting, refresh, and dark/light theme support
    • dist/pods-top-app.html -- Built artifact (should NOT be committed; it should be .gitignored or built in CI)
  • pkg/mcp/mcp.go -- Enable Resources capability (&mcp.ResourceCapabilities{}), add registerMCPAppResources() method, import mcpapp package
  • pkg/toolsets/core/pods.go -- Add podsTopContainerMetric / podsTopPodMetric structs, return structured content from podsTop(), set Meta with UI resource URI on pods_top tool definition
  • Makefile -- Add build-mcp-app target, add it as dependency of build
  • 5 test data JSON files -- Add _meta.ui.resourceUri to pods_top tool definition

onmete and others added 4 commits February 12, 2026 08:42
Allow tool handlers to return structured JSON data alongside text
content via the new StructuredContent field in ToolCallResult. This
enables MCP Apps to consume typed data for rich UI rendering while
maintaining backward compatibility with existing text-only responses.

- Add StructuredContent field to ToolCallResult
- Add NewToolCallResultWithStructuredContent constructor
- Add NewTextResultWithStructuredContent in the MCP layer
- Bridge StructuredContent through the Go SDK handler

Co-authored-by: Cursor <cursoragent@cursor.com>
Test the new constructors and MCP result functions:
- NewToolCallResultWithStructuredContent in pkg/api
- NewTextResultWithStructuredContent in pkg/mcp
- Verify structured content is omitted when nil
- Verify error results ignore structured content

Co-authored-by: Cursor <cursoragent@cursor.com>
Allow tool definitions to carry a _meta map, which the MCP Apps spec
uses for ui.resourceUri to link a tool to its UI resource. The field
is omitted from JSON serialization when nil.

- Add Meta map[string]any field with json:"_meta,omitempty" to Tool struct
- Pass Meta through to Go SDK tool in ServerToolToGoSdkTool
- Add JSON serialization tests for the _meta field

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce the MCP App resource serving infrastructure and the first
concrete UI app - a Pods Resource Usage dashboard for the pods_top tool.

MCP App framework:
- Add mcp-app/ directory with Go embed, Vite build system, and
  vite-plugin-singlefile to produce self-contained HTML files
- Register embedded HTML resources via MCP Resources capability
- Add mcpapp package with AppResource type, ToolMeta helper, and
  resource registry

Pods Top UI:
- TypeScript/HTML dashboard using @modelcontextprotocol/ext-apps SDK
- Sortable table with CPU/memory bar charts, dark/light theme support
- Refresh button to re-invoke pods_top tool
- Return structured content from pods_top alongside text output
- Link pods_top tool to its UI via _meta.ui.resourceUri

Build system:
- Add build-mcp-app Makefile target
- Add it as dependency of the build target

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 12, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 12, 2026

@onmete: This pull request references OLS-2568 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Purpose: Introduce the MCP App resource serving infrastructure and the first concrete UI app -- a Pods Resource Usage dashboard for pods_top.

Rebase after:
#141
#142

Files changed:

  • **New directory: mcp-app/**
  • mcpapp.go -- Go embed package with AppResource type, ToolMeta() helper, Resources() registry, embedded dist/pods-top-app.html
  • package.json, tsconfig.json, vite.config.ts -- Node.js build tooling using Vite + vite-plugin-singlefile to produce a single self-contained HTML file
  • pods-top-app.html -- HTML template with CSS for the dashboard
  • src/pods-top-app.ts -- TypeScript source using @modelcontextprotocol/ext-apps SDK for sorting, formatting, refresh, and dark/light theme support
  • dist/pods-top-app.html -- Built artifact (should NOT be committed; it should be .gitignored or built in CI)
  • pkg/mcp/mcp.go -- Enable Resources capability (&mcp.ResourceCapabilities{}), add registerMCPAppResources() method, import mcpapp package
  • pkg/toolsets/core/pods.go -- Add podsTopContainerMetric / podsTopPodMetric structs, return structured content from podsTop(), set Meta with UI resource URI on pods_top tool definition
  • Makefile -- Add build-mcp-app target, add it as dependency of build
  • 5 test data JSON files -- Add _meta.ui.resourceUri to pods_top tool definition

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link

openshift-ci bot commented Feb 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: onmete
Once this PR has been reviewed and has the lgtm label, please assign cali0707 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link

openshift-ci bot commented Feb 12, 2026

@onmete: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 20, 2026
@openshift-merge-robot
Copy link

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@onmete onmete marked this pull request as draft February 23, 2026 07:24
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 23, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 23, 2026

@onmete: This pull request references OLS-2568 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Draft with example UI resource for pods_top tool - feel free to close

Purpose: Introduce the MCP App resource serving infrastructure and the first concrete UI app -- a Pods Resource Usage dashboard for pods_top.

Rebase after:
#141
#142

Files changed:

  • **New directory: mcp-app/**
  • mcpapp.go -- Go embed package with AppResource type, ToolMeta() helper, Resources() registry, embedded dist/pods-top-app.html
  • package.json, tsconfig.json, vite.config.ts -- Node.js build tooling using Vite + vite-plugin-singlefile to produce a single self-contained HTML file
  • pods-top-app.html -- HTML template with CSS for the dashboard
  • src/pods-top-app.ts -- TypeScript source using @modelcontextprotocol/ext-apps SDK for sorting, formatting, refresh, and dark/light theme support
  • dist/pods-top-app.html -- Built artifact (should NOT be committed; it should be .gitignored or built in CI)
  • pkg/mcp/mcp.go -- Enable Resources capability (&mcp.ResourceCapabilities{}), add registerMCPAppResources() method, import mcpapp package
  • pkg/toolsets/core/pods.go -- Add podsTopContainerMetric / podsTopPodMetric structs, return structured content from podsTop(), set Meta with UI resource URI on pods_top tool definition
  • Makefile -- Add build-mcp-app target, add it as dependency of build
  • 5 test data JSON files -- Add _meta.ui.resourceUri to pods_top tool definition

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants