Skip to content

XS✔ ◾ ✨ Custom prompts - Default built-in MCP servers to selected#770

Merged
yaqi-lyu merged 8 commits intomainfrom
copilot/default-mcp-servers-selected
Mar 12, 2026
Merged

XS✔ ◾ ✨ Custom prompts - Default built-in MCP servers to selected#770
yaqi-lyu merged 8 commits intomainfrom
copilot/default-mcp-servers-selected

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

  1. AI Development - Prompt & Model (include prompts/models used or N/A)

GitHub Copilot (claude-sonnet-4-5)

  1. What triggered this change? (PBI link, Email Subject, conversation + reason, etc)

Users had to manually re-select built-in MCP servers every time they created a new custom prompt — repetitive and easy to miss, causing prompts to run without intended tools.

  1. What was changed?

src/shared/utils/mcp-utils.ts (new)

  • Extracted getBuiltinServerIds(servers) — pure utility that filters built-in server IDs from a config list

src/shared/utils/mcp-utils.test.ts (new)

  • Regression tests: normal case, no built-ins, empty list, missing IDs edge case

src/ui/src/components/settings/custom-prompt/PromptForm.tsx

  • New prompts: useEffect pre-selects built-in server IDs on load (shouldDirty: false)
  • Existing prompts with selection: missing built-in IDs are silently merged in without marking the form dirty
  • Existing prompts with no selection: existing behaviour preserved (select all)
  • Rendering: built-in server checkboxes are always checked and disabled — isCheckboxDisabled = isDefault || isBuiltin || isServerDisabled. The (Disabled) label now only appears for enabled === false servers, not built-ins
const isBuiltin = server.builtin ?? false;
// Built-in servers are always checked and cannot be deselected
const isChecked = isBuiltin || (field.value?.includes(server.id) ?? false);
const isCheckboxDisabled = isDefault || isBuiltin || isServerDisabled;
  1. I paired or mob programmed with:

✏️

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node scripts/postinstall.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>✨ Custom prompts - Default built-in MCP servers to selected</issue_title>
<issue_description>Cc: @calumjs @ricksu978 @adamcogan
Hi YakShaver team

Pain

When users create a new custom prompt, they must manually re-select the built-in MCP servers each time. This is repetitive and easy to miss, leading to prompts running without the intended context/tools.

Suggested Solution

When adding a new custom prompt, default the built-in MCP servers to "selected".

Acceptance Criteria

  1. Creating a new custom prompt defaults all built-in MCP servers to selected.
  2. Users can still unselect built-in MCP servers before saving the prompt.
  3. Existing custom prompts are not modified unless the user edits them.

Tasks

  • Identify the source of truth for “built-in MCP servers” in the app.
  • Update the “Add new custom prompt” flow to default built-in MCP servers to selected.
  • Add a regression test to ensure the default selection is applied on new prompts.

More Information

Requested feature: "inside the custom prompt, when the user adds a new prompt, we should make the built-in MCP servers selected by default".

Screenshots

MCP servers preset request screenshot

Thanks!
</issue_description>

<agent_instructions>These built in tools should be auto selected and can't be modified from ui</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…k them in UI

Co-authored-by: yaqi-lyu <121055451+yaqi-lyu@users.noreply.github.com>
Copilot AI changed the title [WIP] Update custom prompt flow to default MCP servers selected ✨ Custom prompts - Default built-in MCP servers to selected Mar 11, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

PR Metrics

Thanks for keeping your pull request small.
Thanks for adding tests.

Lines
Product Code 120
Test Code 136
Subtotal 256
Ignored Code -
Total 256

Metrics computed by PR Metrics. Add it to your Azure DevOps and GitHub PRs!

@github-actions github-actions bot changed the title ✨ Custom prompts - Default built-in MCP servers to selected XS✔ ◾ ✨ Custom prompts - Default built-in MCP servers to selected Mar 11, 2026
@github-actions
Copy link
Contributor

🚀 Pre-release build is available for this PR:
https://github.com/SSWConsulting/SSW.YakShaver.Desktop/releases/tag/0.6.0-beta.770.1773219236

@github-actions
Copy link
Contributor

🚀 Pre-release build is available for this PR:
https://github.com/SSWConsulting/SSW.YakShaver.Desktop/releases/tag/0.6.0-beta.770.1773220681

@yaqi-lyu yaqi-lyu marked this pull request as ready for review March 11, 2026 09:42
Copilot AI review requested due to automatic review settings March 11, 2026 09:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the custom prompt editor UX by automatically selecting built-in MCP servers by default (and keeping them selected), reducing the chance of running prompts without intended built-in tools. It also factors MCP server selection helpers into shared utilities with unit tests.

Changes:

  • Added shared MCP selection utilities (getBuiltinServerIds, getConnectedOrBuiltinIds, ensureBuiltinServerIds) plus tests.
  • Updated PromptForm to pre-select built-in servers for new prompts and to merge missing built-ins into existing selections.
  • Adjusted prompt submit validation + UI messaging around disabled/disconnected servers and “no servers configured” states.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/ui/src/components/settings/custom-prompt/PromptForm.tsx Defaults/locks built-in server selection; adjusts validation and UI copy for server selection.
src/shared/utils/mcp-utils.ts Introduces shared helper functions for built-in/connected server ID selection and merging.
src/shared/utils/mcp-utils.test.ts Adds vitest coverage for the new shared MCP utilities.
src/backend/services/mcp/mcp-server-manager.ts Prevents “builtin” flagged entries from the external/stored list being merged as externals.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

🚀 Pre-release build is available for this PR:
https://github.com/SSWConsulting/SSW.YakShaver.Desktop/releases/tag/0.6.0-beta.770.1773222497

@github-actions
Copy link
Contributor

🚀 Pre-release build is available for this PR:
https://github.com/SSWConsulting/SSW.YakShaver.Desktop/releases/tag/0.6.0-beta.770.1773224096

@yaqi-lyu yaqi-lyu merged commit 2645c36 into main Mar 12, 2026
8 checks passed
@yaqi-lyu yaqi-lyu deleted the copilot/default-mcp-servers-selected branch March 12, 2026 05:04
@github-actions
Copy link
Contributor

Automated Release Created Successfully

Release Details:

You can monitor the build progress in the Actions tab.

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.

✨ Custom prompts - Default built-in MCP servers to selected

4 participants