Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion webview-ui/src/components/mcp/McpView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
VSCodeButton,
VSCodeCheckbox,
VSCodeLink,
VSCodePanels,
VSCodePanelTab,
Expand All @@ -18,7 +19,13 @@ type McpViewProps = {
}

const McpView = ({ onDone }: McpViewProps) => {
const { mcpServers: servers, alwaysAllowMcp, mcpEnabled } = useExtensionState()
const {
mcpServers: servers,
alwaysAllowMcp,
mcpEnabled,
enableMcpServerCreation,
setEnableMcpServerCreation,
} = useExtensionState()

return (
<div
Expand Down Expand Up @@ -67,6 +74,27 @@ const McpView = ({ onDone }: McpViewProps) => {

{mcpEnabled && (
<>
<div style={{ marginBottom: 15 }}>
<VSCodeCheckbox
checked={enableMcpServerCreation}
onChange={(e: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using any for event types. Use React.ChangeEvent<HTMLInputElement> for better type safety.

Suggested change
onChange={(e: any) => {
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {

This is from our Development Standards: https://www.notion.so/Development-Standards-59febcf8ead647fd9c2ec3f60c22f3df?pvs=4#11869ad2d5818051ae9cefd92c3aac2b

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 */}
{servers.length > 0 && (
<div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
Expand Down
14 changes: 0 additions & 14 deletions webview-ui/src/components/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
setExperimentEnabled,
alwaysAllowModeSwitch,
setAlwaysAllowModeSwitch,
enableMcpServerCreation,
setEnableMcpServerCreation,
} = useExtensionState()
const [apiErrorMessage, setApiErrorMessage] = useState<string | undefined>(undefined)
const [modelIdErrorMessage, setModelIdErrorMessage] = useState<string | undefined>(undefined)
Expand Down Expand Up @@ -110,7 +108,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
})

vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: alwaysAllowModeSwitch })
vscode.postMessage({ type: "enableMcpServerCreation", bool: enableMcpServerCreation })
onDone()
}
}
Expand Down Expand Up @@ -360,17 +357,6 @@ 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)" }}>
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 }}>
<VSCodeCheckbox
checked={alwaysAllowModeSwitch}
Expand Down
Loading