Skip to content

feat(MK8S-196): add WebMCP protocol support to shell-ui#4820

Draft
JBWatenbergScality wants to merge 75 commits intodevelopment/132.0from
feature/MK8S-196-add-webmcp-protocol-support
Draft

feat(MK8S-196): add WebMCP protocol support to shell-ui#4820
JBWatenbergScality wants to merge 75 commits intodevelopment/132.0from
feature/MK8S-196-add-webmcp-protocol-support

Conversation

@JBWatenbergScality
Copy link
Contributor

Summary

Implements the WebMCP standard so that shell-ui can expose AI-agent tools registered by micro-apps via navigator.modelContext.registerTool(). Tools are declared in each micro-app's WebFinger spec and loaded by shell-ui through the existing Module Federation infrastructure.

  • ConfigurationProviders – adds optional mcpTools: FederatedModuleInfo field to BuildtimeWebFinger.spec, parallel to existing navbarUpdaterComponents
  • src/mcp/types.ts – ambient Navigator.modelContext types + MCPToolDefinition / ToolContext contracts
  • src/mcp/userAgent.tsisAIUserAgent(): UA-pattern-based detection of known AI agent crawlers (GPTBot, ClaudeBot, Gemini, Perplexity, …) to suppress Keycloak auto-redirect
  • src/mcp/MCPRegistrar.tsx – uses ComponentWithFederatedImports (same pattern as InstanceName.tsx) to load each micro-app's tool module and call registerTool() for every exported tool; authRequired: true tools are wrapped with a PKCE auth modal via OidcClient + requestUserInteraction
  • AuthProvider – exposes userManager from useAuth(); adds autoSignIn: !isAIUserAgent() so the app loads without redirecting to Keycloak in AI sessions
  • FederatedApp – mounts <MCPRegistrar /> inside the status === 'success' block alongside SolutionsNavbar
  • rspack.config.ts – copies @mcp-b/webmcp-local-relay browser assets (embed.js, widget.html) to build output via CopyRspackPlugin; patches widget.html to raise the relay request timeout from 10 s → 60 s; excludes @mcp-b/* from Module Federation shared config

How a micro-app declares tools

Add mcpTools to spec in the app's micro-app-configuration WebFinger:

{
  "spec": {
    "mcpTools": { "module": "./MCPTools", "scope": "my-app" }
  }
}

Expose the module in rspack:

exposes: { './MCPTools': './src/mcp/index.ts' }

The module exports a plain { tools: MCPToolDefinition[] } — no React component required.

Example: a weather micro-app

// src/mcp/tools/getCurrentWeatherTool.ts
export const getCurrentWeatherTool = {
  name: 'getCurrentWeather',
  description: 'Returns the current weather for a given city displayed in the app.',
  authRequired: false,
  inputSchema: {
    type: 'object',
    properties: {
      city: { type: 'string', description: 'City name, e.g. "Paris"' },
    },
    required: ['city'],
  },
  execute: async ({ city }: { city: string; context: ToolContext }) => {
    const res = await fetch(`/api/weather?city=${encodeURIComponent(city)}`);
    return res.json(); // { temperature: 18, unit: 'C', condition: 'Cloudy' }
  },
};

// src/mcp/tools/setLocationTool.ts
export const setLocationTool = {
  name: 'setLocation',
  description: 'Changes the city shown in the weather dashboard.',
  authRequired: true,           // triggers PKCE modal if not logged in
  inputSchema: {
    type: 'object',
    properties: {
      city: { type: 'string' },
    },
    required: ['city'],
  },
  execute: async ({ city, context }: { city: string; context: ToolContext }) => {
    const token = await context.getToken();
    await fetch('/api/location', {
      method: 'PUT',
      headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
      body: JSON.stringify({ city }),
    });
    return { success: true, city };
  },
};

// src/mcp/index.ts
export const tools = [getCurrentWeatherTool, setLocationTool];

An AI agent connected via the WebMCP local relay can then call getCurrentWeather({ city: "Paris" }) or setLocation({ city: "Tokyo" }) directly against the running UI.

Test plan

  • Normal browser session: autoSignIn remains true → existing Keycloak redirect behaviour unchanged
  • AI agent session (matching UA): page loads without redirect; tools appear in navigator.modelContext
  • Calling an authRequired tool when unauthenticated shows PKCE modal; cancelling returns { success: false, error: { code: 'AUTH_REQUIRED' } }
  • Existing NavbarUpdaterComponents and InstanceName patterns unaffected

🤖 Generated with Claude Code

ezekiel-alexrod and others added 30 commits December 11, 2025 13:58
…/octopus/w/133.0/improvement/ARTESCA-16560-rspack-bump
…mp/octopus/w/133.0/improvement/bump-core-ui-to-remove-vega
…n-0.21.6' into tmp/octopus/w/133.0/improvement/ARTESCA-16630-bump-module-federation-0.21.6
…topus/w/133.0/improvement/MK8S-68-use-smart-cron-trigger
…pus/w/133.0/improvement/bump-core-ui-0.193.0
…/4745/132.0/improvement/bump-ui-operator-1.0.13' into tmp/octopus/q/133.0
…0/feature/merge-131.0.7-tag' into tmp/octopus/q/133.0
…ion-0.21.6' and 'development/133.0' into tmp/octopus/w/133.0/improvement/ARTESCA-16630-bump-module-federation-0.21.6
…tmp/octopus/w/133.0/bugfix/ARTESCA-15796-refresh-token-issue
…p/octopus/w/133.0/bugfix/email-template-url-is-incorrect
…p/octopus/w/133.0/bugfix/email-template-url-is-incorrect
… tmp/octopus/w/133.0/improvement/change-ui-dev-configuration-2
…e' into tmp/octopus/w/133.0/improvement/ARTESCA-16840-exclamation-triangle-to-circle
…/w/133.0/improvement/navbar-style-improvements
…e-to-circle' and 'q/w/4760/132.0/improvement/ARTESCA-16840-exclamation-triangle-to-circle' into tmp/octopus/q/133.0
…/w/4755/132.0/improvement/navbar-style-improvements' into tmp/octopus/q/133.0
This commit adds support for etcd distroless images for Kubernetes 1.33+.
Above etcd 3.5.21, etcd images are now distroless and upstreamed to the etcd project.

It modifies the backup script to use the correct etcdctl command to snapshot the etcd data instead of using `sh -c` to execute the command in the etcd container.
It modifies the remove node action to use the correct etcdctl command to list and remove etcd members and

It also enforces the use of `=` for the arguments of etcdctl in the disaster recovery documentation, the remove node action and the backup script.

Closes: MK8S-94
…ase 133.0.0

Kubernetes v1.33.7

We pick the last patch version available at date while respecting the major.minor for theses packages
etcd 3.5.26
CoreDNS v1.12.4
The previous implementation tried to access the snapshot file from the
container rootfs, which fails with distroless etcd images where the
root filesystem is read-only.

Save the snapshot directly to /var/lib/etcd (writable mounted volume)
and retrieve it from the host mount point instead of navigating through
containerd runtime paths.

This fixes backup failures with etcd 3.5.21+ distroless images.
TeddyAndrieux and others added 28 commits February 19, 2026 07:57
…e and pin version 1.28.0

The `k8s-sidecar` image will be bump in another PR, surely in the `grafana` one
We do not use kubectl nor crictl to execute commands in containers,
since some commands may restart kube-apiserver and/or containerd and/or
kubelet. That's why we use runc directly to execute commands in containers

Especially since for `crictl exec` if we lose connection to the containerd
socket, the command silently exit with exit code 0, which is really misleading
This salt execution module is not used so let's remove it
…mp/octopus/w/133.0/improvement/MK8S-176-fix-broken-link-in-volumes
…o tmp/octopus/w/133.0/improvement/fix-biomejs-when-run-from-root
…/4804/132.0/improvement/MK8S-178-hide-logs-link' into tmp/octopus/q/133.0
…nd 'q/w/4805/132.0/improvement/fix-biomejs-when-run-from-root' into tmp/octopus/q/133.0
This PR adds the ability to deploy a Service and a ServiceMonitor for
solutions operators in order to allow Prometheus to scrape metrics from
them.
Before this the solution-next ISO was not used at all,
so let's fix it and add a simple test for solution upgrade
Implements the WebMCP standard (navigator.modelContext.registerTool()) so
that micro-apps can expose AI-agent tools through their WebFinger
configuration. Shell-ui owns the full registration lifecycle.

Changes:
- ConfigurationProviders: add optional `mcpTools: FederatedModuleInfo` to
  BuildtimeWebFinger spec so micro-apps can declare their tool module
- MCPRegistrar (new): uses ComponentWithFederatedImports to load each
  micro-app's tool module and calls navigator.modelContext.registerTool()
  for every tool; wraps authRequired tools with a PKCE auth modal via
  OidcClient + requestUserInteraction
- AuthProvider: expose `userManager` from useAuth(); add
  `autoSignIn: !isAIUserAgent()` to suppress Keycloak redirect in AI
  agent sessions (detection via UA pattern matching in mcp/userAgent.ts)
- FederatedApp: mount <MCPRegistrar /> alongside SolutionsNavbar
- rspack.config.ts: copy @mcp-b/webmcp-local-relay browser assets to
  build output (embed.js + widget.html); patch widget.html to raise the
  request timeout from 10 s to 60 s to accommodate STS + SDK round trips;
  exclude @mcp-b/* from Module Federation shared config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bert-e
Copy link
Contributor

bert-e commented Mar 17, 2026

Hello jbwatenbergscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Mar 17, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants