Skip to content

feat(playground): mcp servers listed #3065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

@@ -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

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.

4 participants