diff --git a/packages/insomnia/src/ui/components/modals/new-workspace-modal.tsx b/packages/insomnia/src/ui/components/modals/new-workspace-modal.tsx index ef52f80da8..96b936daa8 100644 --- a/packages/insomnia/src/ui/components/modals/new-workspace-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/new-workspace-modal.tsx @@ -25,7 +25,7 @@ import { useGitProjectRepositoryTreeLoaderFetcher } from '~/routes/git.repositor import { useWorkspaceNewActionFetcher } from '~/routes/organization.$organizationId.project.$projectId.workspace.new'; import { isGitProject, type Project } from '../../../models/project'; -import { type WorkspaceScope, WorkspaceScopeKeys } from '../../../models/workspace'; +import { isMcp, type WorkspaceScope, WorkspaceScopeKeys } from '../../../models/workspace'; import { safeToUseInsomniaFileName, safeToUseInsomniaFileNameWithExt } from '../../../sync/git/insomnia-filename'; import { Icon } from '../icon'; @@ -66,8 +66,12 @@ export const NewWorkspaceModal = ({ const isEnterprise = currentPlan?.type.includes('enterprise'); const isSelfHostedDisabled = !isEnterprise || !storageRules.enableLocalVault; const isCloudProjectDisabled = isLocalProject || !storageRules.enableCloudSync; + const isMcpWorkspace = isMcp({ scope }); + // Mcp workspaces do not support Git sync for now + const isGitProjectAndNotMcpWorkspace = isGitProject(project) && !isMcpWorkspace; const canOnlyCreateSelfHosted = isLocalProject && isEnterprise; + const defaultFileName = safeToUseInsomniaFileName(defaultNameByScope[scope]); const [workspaceData, setWorkspaceData] = useState<{ name: string; @@ -80,7 +84,8 @@ export const NewWorkspaceModal = ({ name: defaultNameByScope[scope], scope, folderPath: '', - fileName: safeToUseInsomniaFileName(defaultNameByScope[scope]), + // Add a unique timestamp for mcp file name to avoid conflicts since we hide the Git file and folder selector for it. + fileName: isGitProject(project) && isMcpWorkspace ? `${defaultFileName}_${Date.now()}` : defaultFileName, mockServerType: canOnlyCreateSelfHosted ? 'self-hosted' : 'cloud', mockServerUrl: '', }); @@ -115,7 +120,7 @@ export const NewWorkspaceModal = ({ className="fixed left-0 top-0 z-10 flex h-[--visual-viewport-height] w-full items-center justify-center bg-black/30" > - {isGitProject(project) && ( + {/* Mcp workspaces do not support Git sync for now */} + {isGitProjectAndNotMcpWorkspace && ( <>