mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-21 12:51:17 -05:00
feat: add setting to enable/disable MCP server creation
- Add enableMcpServerCreation setting to control whether MCP server creation is allowed - Add UI toggle in settings view for this feature - Update system prompt to conditionally include MCP server creation documentation - Add tests for new functionality
This commit is contained in:
@@ -45,6 +45,7 @@ describe("AutoApproveMenu", () => {
|
||||
filePaths: [],
|
||||
experiments: experimentDefault,
|
||||
customModes: [],
|
||||
enableMcpServerCreation: false,
|
||||
|
||||
// Auto-approve specific properties
|
||||
alwaysAllowReadOnly: false,
|
||||
@@ -91,6 +92,7 @@ describe("AutoApproveMenu", () => {
|
||||
setExperimentEnabled: jest.fn(),
|
||||
handleInputChange: jest.fn(),
|
||||
setCustomModes: jest.fn(),
|
||||
setEnableMcpServerCreation: jest.fn(),
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -61,6 +61,8 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
|
||||
setExperimentEnabled,
|
||||
alwaysAllowModeSwitch,
|
||||
setAlwaysAllowModeSwitch,
|
||||
enableMcpServerCreation,
|
||||
setEnableMcpServerCreation,
|
||||
} = useExtensionState()
|
||||
const [apiErrorMessage, setApiErrorMessage] = useState<string | undefined>(undefined)
|
||||
const [modelIdErrorMessage, setModelIdErrorMessage] = useState<string | undefined>(undefined)
|
||||
@@ -108,6 +110,7 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
|
||||
})
|
||||
|
||||
vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: alwaysAllowModeSwitch })
|
||||
vscode.postMessage({ type: "enableMcpServerCreation", bool: enableMcpServerCreation })
|
||||
onDone()
|
||||
}
|
||||
}
|
||||
@@ -357,6 +360,17 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div style={{ marginBottom: 5 }}>
|
||||
<VSCodeCheckbox
|
||||
checked={enableMcpServerCreation}
|
||||
onChange={(e: any) => setEnableMcpServerCreation(e.target.checked)}>
|
||||
<span style={{ fontWeight: "500" }}>Enable MCP Server Creation</span>
|
||||
</VSCodeCheckbox>
|
||||
<p style={{ fontSize: "12px", marginTop: "5px", color: "var(--vscode-descriptionForeground)" }}>
|
||||
This option allow user to enable and disable MCP server creation for saved tokens usage
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div style={{ marginBottom: 15 }}>
|
||||
<VSCodeCheckbox
|
||||
checked={alwaysAllowModeSwitch}
|
||||
|
||||
Reference in New Issue
Block a user