Skip to content

XS⚠️ ◾ Moved MCP types to shared folder#656

Merged
babakamyljanovssw merged 1 commit intomainfrom
639-mcp
Feb 4, 2026
Merged

XS⚠️ ◾ Moved MCP types to shared folder#656
babakamyljanovssw merged 1 commit intomainfrom
639-mcp

Conversation

@babakamyljanovssw
Copy link
Member

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

✏️

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

✏️ #639

  1. What was changed?

✏️ Moved MCP types to shared folder

  1. I paired or mob programmed with:

✏️

Copilot AI review requested due to automatic review settings February 4, 2026 01:08
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

PR Metrics

Thanks for keeping your pull request small.
⚠️ Consider adding additional tests.

Lines
Product Code 55
Test Code -
Subtotal 55
Ignored Code -
Total 55

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

@github-actions github-actions bot changed the title Moved MCP types to shared folder XS⚠️ ◾ Moved MCP types to shared folder Feb 4, 2026
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

Refactors MCP server-related types/interfaces so they live in a shared module that can be consumed by both the UI and backend (supporting the broader effort to deduplicate transport/type declarations).

Changes:

  • Moved MCP server config/transport types from UI/backend into src/shared/types/mcp.ts.
  • Updated UI McpServerForm to import/re-export shared MCP types and adjusted new-config id initialization.
  • Updated backend MCP types module to re-export shared types and tweaked in-memory transport option detection in MCPServerManager.

Reviewed changes

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

File Description
src/ui/src/components/settings/mcp/McpServerForm.tsx Switches to shared MCP types and removes local duplicated type declarations.
src/shared/types/mcp.ts Introduces shared Transport + MCP server config interfaces/unions.
src/backend/services/mcp/types.ts Re-exports MCP types from the shared module to eliminate duplication.
src/backend/services/mcp/mcp-server-manager.ts Changes how in-memory transport options are derived from config.
Comments suppressed due to low confidence (1)

src/backend/services/mcp/mcp-server-manager.ts:154

  • This change switches the in-memory options detection from checking property presence ("inMemoryServerId" in config) to a truthy check (config.inMemoryServerId). If inMemoryServerId is missing/empty, the client will now be created without options.inMemoryClientTransport, causing createClientAsync to throw and be swallowed by the creationPromise catch (returning null) rather than failing fast with a clear error. Consider explicitly validating/throwing when config.transport === "inMemory" and inMemoryServerId is not a non-empty string, so misconfigured internal servers don’t fail silently.
    let options: CreateClientOptions | undefined;
    if (config.transport === "inMemory" && config.inMemoryServerId) {
      const transport = MCPServerManager.internalClientTransports.get(config.inMemoryServerId);
      if (!transport) {
        throw new Error(
          `No in-memory transport registered for server '${config.name}'. Ensure it was initialized correctly.`,

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

export type Transport = "streamableHttp" | "stdio" | "inMemory";

export interface MCPBaseConfig {
id: string;
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

MCPBaseConfig.id is typed as a required string, but the UI now creates new configs with id: "" (see McpServerFormWrapper) as a sentinel for “not yet persisted”. That means the shared type doesn’t reflect the real contract and can lead to accidental empty IDs leaking into places that expect a stable identifier. Consider making id optional/nullable for “draft” configs (or introducing a separate Draft/New config type), and keep a non-empty id for persisted configs only (validated server-side).

Suggested change
id: string;
/**
* Unique identifier for persisted configs.
* For draft / not-yet-persisted configs this may be omitted, and the server
* is responsible for assigning and validating a non-empty id.
*/
id?: string;

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

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

@babakamyljanovssw babakamyljanovssw merged commit 4ba9f04 into main Feb 4, 2026
13 checks passed
@babakamyljanovssw babakamyljanovssw deleted the 639-mcp branch February 4, 2026 06:43
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

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.

2 participants