mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Move MCP creation checkbox to MCP view
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
VSCodeButton,
|
VSCodeButton,
|
||||||
|
VSCodeCheckbox,
|
||||||
VSCodeLink,
|
VSCodeLink,
|
||||||
VSCodePanels,
|
VSCodePanels,
|
||||||
VSCodePanelTab,
|
VSCodePanelTab,
|
||||||
@@ -18,7 +19,13 @@ type McpViewProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const McpView = ({ onDone }: McpViewProps) => {
|
const McpView = ({ onDone }: McpViewProps) => {
|
||||||
const { mcpServers: servers, alwaysAllowMcp, mcpEnabled } = useExtensionState()
|
const {
|
||||||
|
mcpServers: servers,
|
||||||
|
alwaysAllowMcp,
|
||||||
|
mcpEnabled,
|
||||||
|
enableMcpServerCreation,
|
||||||
|
setEnableMcpServerCreation,
|
||||||
|
} = useExtensionState()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -67,6 +74,27 @@ const McpView = ({ onDone }: McpViewProps) => {
|
|||||||
|
|
||||||
{mcpEnabled && (
|
{mcpEnabled && (
|
||||||
<>
|
<>
|
||||||
|
<div style={{ marginBottom: 15 }}>
|
||||||
|
<VSCodeCheckbox
|
||||||
|
checked={enableMcpServerCreation}
|
||||||
|
onChange={(e: any) => {
|
||||||
|
setEnableMcpServerCreation(e.target.checked)
|
||||||
|
vscode.postMessage({ type: "enableMcpServerCreation", bool: e.target.checked })
|
||||||
|
}}>
|
||||||
|
<span style={{ fontWeight: "500" }}>Enable MCP Server Creation</span>
|
||||||
|
</VSCodeCheckbox>
|
||||||
|
<p
|
||||||
|
style={{
|
||||||
|
fontSize: "12px",
|
||||||
|
marginTop: "5px",
|
||||||
|
color: "var(--vscode-descriptionForeground)",
|
||||||
|
}}>
|
||||||
|
When enabled, Roo can help you create new MCP servers via commands like "add a new tool
|
||||||
|
to...". If you don't need to create MCP servers you can disable this to reduce Roo's
|
||||||
|
token usage.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Server List */}
|
{/* Server List */}
|
||||||
{servers.length > 0 && (
|
{servers.length > 0 && (
|
||||||
<div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
|
<div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
|
|||||||
setExperimentEnabled,
|
setExperimentEnabled,
|
||||||
alwaysAllowModeSwitch,
|
alwaysAllowModeSwitch,
|
||||||
setAlwaysAllowModeSwitch,
|
setAlwaysAllowModeSwitch,
|
||||||
enableMcpServerCreation,
|
|
||||||
setEnableMcpServerCreation,
|
|
||||||
} = useExtensionState()
|
} = useExtensionState()
|
||||||
const [apiErrorMessage, setApiErrorMessage] = useState<string | undefined>(undefined)
|
const [apiErrorMessage, setApiErrorMessage] = useState<string | undefined>(undefined)
|
||||||
const [modelIdErrorMessage, setModelIdErrorMessage] = useState<string | undefined>(undefined)
|
const [modelIdErrorMessage, setModelIdErrorMessage] = useState<string | undefined>(undefined)
|
||||||
@@ -110,7 +108,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: alwaysAllowModeSwitch })
|
vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: alwaysAllowModeSwitch })
|
||||||
vscode.postMessage({ type: "enableMcpServerCreation", bool: enableMcpServerCreation })
|
|
||||||
onDone()
|
onDone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -360,17 +357,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</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)" }}>
|
|
||||||
When enabled, Roo can help you create new MCP servers via commands like "add a new tool to...". If you don't need to create MCP servers you can disable this to reduce Roo's token usage.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style={{ marginBottom: 15 }}>
|
<div style={{ marginBottom: 15 }}>
|
||||||
<VSCodeCheckbox
|
<VSCodeCheckbox
|
||||||
checked={alwaysAllowModeSwitch}
|
checked={alwaysAllowModeSwitch}
|
||||||
|
|||||||
Reference in New Issue
Block a user