Skip to content

feat: check if mcp is supported #1460

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

Merged
merged 1 commit into from
May 29, 2025
Merged

Conversation

yueny2020
Copy link
Contributor

Problem

  • MCP is not supported by old version and some extensions(vsc and jetBrain) first,

Solution

  • Add check when initialize MCP and show the MCP button in UI.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yueny2020 yueny2020 requested a review from a team as a code owner May 28, 2025 19:59
@@ -39,7 +40,7 @@ export const QAgenticChatServer =
},
],
},
mcpServers: true,
mcpServers: isMCPSupported(params),
Copy link
Contributor

Choose a reason for hiding this comment

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

This will disable all the UI buttons? Also, please check to make sure tools is not available in chat.

Copy link
Contributor Author

@yueny2020 yueny2020 May 28, 2025

Choose a reason for hiding this comment

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

This will disable all the UI buttons?

yes, this will disable the UI button.

Also, please check to make sure tools is not available in chat.

what to check? could you please elaborate it? thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, please check to make sure tools is not available in chat.

directly return false from isMCPSupported and test that tools are not available in chat.

Copy link
Contributor

@awschristou awschristou left a comment

Choose a reason for hiding this comment

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

Please streamline the logic so that the client controls whether or not mcp is enabled. You do this by passing a bool value through the q capabilities portion of the LSP initialization payload.

sequenceDiagram

    participant toolkit
    participant flare
    participant chatui

    Note over toolkit: User Starts IDE
    Note over toolkit: Toolkit launches Flare

    toolkit ->>+ flare: LSP Initialization request

    alt <br/>IF client set aws capability 'mcpServers' to true<br/>(You MUST update extensions to pass true in order to enable MCP)<BR/>(Your internal testers need to use this new extension version)
        Note over flare: Flare enables MCP
        Note over flare: initialization response indicates<br/>mcpServers: true<br/>as server capability
    else ELSE IF client set 'mcpServers' to false<br/>This represents your older extension versions.
        Note over flare: Flare disables MCP
        Note over flare: initialization response indicates<br/>mcpServers: false<br/>as server capability
    end 

    flare ->>-toolkit: LSP initialization response

    Note over toolkit: Toolkit retains the initialization response,<br/>which contains server capabilities.<br/>the server capability mcpServers will be used for starting chat UI.

    Note over toolkit: User opens Chat UI<br/><br/>mcpServers is set based on the returned server capability value

    toolkit ->> chatui: createChat {<br/>pairProgrammingAcknowledged: bool, <br/>agenticMode: bool, <br/>mcpServers: bool, ... }

    Note over chatui: Chat UI opens up
    Note over chatui: Chat UI shows MCP things if mcpServers is true


Loading

@leigaol
Copy link
Contributor

leigaol commented May 29, 2025

@yueny2020 yueny2020 merged commit 0df7aa6 into aws:agentic-mcp May 29, 2025
@yueny2020
Copy link
Contributor Author

Please streamline the logic so that the client controls whether or not mcp is enabled. You do this by passing a bool value through the q capabilities portion of the LSP initialization payload.

sequenceDiagram

    participant toolkit
    participant flare
    participant chatui

    Note over toolkit: User Starts IDE
    Note over toolkit: Toolkit launches Flare

    toolkit ->>+ flare: LSP Initialization request

    alt <br/>IF client set aws capability 'mcpServers' to true<br/>(You MUST update extensions to pass true in order to enable MCP)<BR/>(Your internal testers need to use this new extension version)
        Note over flare: Flare enables MCP
        Note over flare: initialization response indicates<br/>mcpServers: true<br/>as server capability
    else ELSE IF client set 'mcpServers' to false<br/>This represents your older extension versions.
        Note over flare: Flare disables MCP
        Note over flare: initialization response indicates<br/>mcpServers: false<br/>as server capability
    end 

    flare ->>-toolkit: LSP initialization response

    Note over toolkit: Toolkit retains the initialization response,<br/>which contains server capabilities.<br/>the server capability mcpServers will be used for starting chat UI.

    Note over toolkit: User opens Chat UI<br/><br/>mcpServers is set based on the returned server capability value

    toolkit ->> chatui: createChat {<br/>pairProgrammingAcknowledged: bool, <br/>agenticMode: bool, <br/>mcpServers: bool, ... }

    Note over chatui: Chat UI opens up
    Note over chatui: Chat UI shows MCP things if mcpServers is true


Loading

Thanks for this workflow chart, will update the logic in a follow up pr.

@yueny2020
Copy link
Contributor Author

this is the follow up pr: #1473

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.

5 participants