Skip to content

Conversation

manusa
Copy link
Member

@manusa manusa commented May 22, 2025

What does this PR do?

Adds a UI element to be able to (later) activate/deactivate MCP Servers and their specific tools (even later).

This is the first iteration just to validate that the UI is aligned with the current expectation.
The next immediate iteration would be to add functionality to the checkboxes of the servers.
With this regard it would be good to know what effect we want for them.
For example, do we want them to be mapped to the file entries and update them there?

Screenshot / video of UI

podman-desktop-ai-lab-mcp-servers-ui.mp4

What issues does this PR fix or reference?

Part of #2885

How to test this PR?

  • Create or update a file ~/.local/share/containers/podman-desktop/extensions-storage/redhat.ai-lab/mcp-settings.json.
  • Set the following content to the file:
    {
      "servers": {
        "time": {
          "enabled": true,
          "type": "stdio",
          "command": "podman",
          "args": ["run", "-i", "--rm", "docker.io/mcp/time"]
        }
      }
    }
  • Create a new playground.
  • A new button with label MCP Servers should be visible in the Settings pane.
  • Press the button
  • A modal window should be visible with the list of servers and a checkbox nest to each entry.
    • The checkbox has no effect at the moment.
  • By modifying the file: enabling/disabling entries, adding new entries, etc.
    • Entries in the list should get automatically updated
    • If no entries are enabled, the button shouldn't be visible.

@manusa manusa requested review from benoitf, jeffmaury and a team as code owners May 22, 2025 10:10
@manusa manusa requested review from dgolovin and deboer-tim May 22, 2025 10:10
@@ -213,6 +213,7 @@ export class Studio {
*/
this.#catalogManager = new CatalogManager(this.#rpcExtension, appUserDirectory);
this.#catalogManager.init();
this.#extensionContext.subscriptions.push(this.#catalogManager);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was missing, it's my understanding that it should be pushed to the subscriptions for disposal.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now optional as every Disposable it automatically disposed when extension is stopped. Should be moved to a separate PR

Copy link
Member Author

@manusa manusa May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed my additions of what I considered to be missing entries.
However, I'm having a hard time understanding how are the Disposables discovered by the extension for automatic disposal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, for extension-defined disposable, it should be disposed by the extension. The disposable provided by the extension-api are disposed by the core, but I think it is always a good idea to do it, for good practice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @axel7083 and @jeffmaury

This PR has been stalled for 2 weeks now.
I'm unsure of how to proceed.

It is now optional as every Disposable it automatically disposed when extension is stopped. Should be moved to a separate PR

This was addressed in a subsequent commit.

However, Axel did mention that we should dispose this in the extension.

From my side, I'm not sure on how to proceed so that we can move on.
Please, provide guidelines so that I can address them and continue with the task.

@@ -385,6 +386,7 @@ export class Studio {
*/
this.#snippetManager = new SnippetManager(this.#rpcExtension, this.#telemetry);
this.#snippetManager.init();
this.#extensionContext.subscriptions.push(this.#snippetManager);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was missing, it's my understanding that it should be pushed to the subscriptions for disposal.

@manusa manusa force-pushed the feat/mcp-servers-playground-ui branch from c92bbfd to b240506 Compare May 22, 2025 10:37
@gastoner
Copy link
Contributor

Works as described, only similar thing that comes to my mind is changing contexts:
image

  • now you can select only one context, but we might want to update it to support checkboxes?

@manusa
Copy link
Member Author

manusa commented May 22, 2025

For additional reference, this is how a similar UI looks like in VSCode:

image

I tried to use the DropDown component first, but (besides some issues with the parent component's overflow-y:auto) it seemed incompatible with what we're aiming for here.

Copy link
Collaborator

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

@manusa manusa force-pushed the feat/mcp-servers-playground-ui branch from f52c860 to fae6f17 Compare May 28, 2025 14:57
@manusa manusa force-pushed the feat/mcp-servers-playground-ui branch from fae6f17 to 87e6cce Compare June 5, 2025 05:22
Copy link
Collaborator

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM but:

  • the style for the MCP servers is not aligned with other sections titles in the left pane
  • when clicking on MCP servers, the UI is displayed in the middle of the page which seems strange to me
  • once the MCP servers are displayed, clicking Escape to close will close the playground and return to the list of playgrounds

@bmahabirbu
Copy link
Contributor

LGTM codewise as well! probs needs a rebase

@manusa manusa force-pushed the feat/mcp-servers-playground-ui branch from 87e6cce to 8f41027 Compare June 19, 2025 10:41
@manusa
Copy link
Member Author

manusa commented Jun 19, 2025

Hi, sorry for the delayed reply, it's been a really busy week

the style for the MCP servers is not aligned with other sections titles in the left pane

image
Maybe an optical effect? or are you referring to something else?

when clicking on MCP servers, the UI is displayed in the middle of the page which seems strange to me

Where would you want to locate it. Maybe top of the screen?

once the MCP servers are displayed, clicking Escape to close will close the playground and return to the list of playgrounds

Looking into it.

Copy link
Member

@ScrewTSW ScrewTSW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @jeffmaury

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.

6 participants