chore: enhance MCP permission settings (#5178)
* chore: enhance MCP permission settings * chore: bring default mcp servers in * chore: default mcp servers are inactive
This commit is contained in:
parent
307ea39413
commit
de9c59d309
@ -9,9 +9,7 @@ use tokio::{process::Command, sync::Mutex, time::timeout};
|
||||
|
||||
use super::{cmd::get_jan_data_folder_path, state::AppState};
|
||||
|
||||
const DEFAULT_MCP_CONFIG: &str = r#"{
|
||||
"mcpServers": {}
|
||||
}"#;
|
||||
const DEFAULT_MCP_CONFIG: &str = r#"{"mcpServers":{"browsermcp":{"command":"npx","args":["@browsermcp/mcp"],"env":{},"active":false},"fetch":{"command":"uvx","args":["mcp-server-fetch"],"env":{},"active":false},"filesystem":{"command":"npx","args":["-y","/path/to/other/allowed/dir"],"env":{},"active":false},"playwright":{"command":"npx","args":["@playwright/mcp","--isolated"],"env":{},"active":false},"mindmap":{"command":"uvx","args":["mindmap-mcp-server","--return-type","filePath"],"env":{},"active":false}}}"#;
|
||||
|
||||
// Timeout for MCP tool calls (30 seconds)
|
||||
const MCP_TOOL_CALL_TIMEOUT: Duration = Duration::from_secs(30);
|
||||
|
||||
@ -159,7 +159,7 @@ function MCPServers() {
|
||||
<div className="flex flex-col justify-between gap-4 gap-y-3 w-full">
|
||||
<Card
|
||||
header={
|
||||
<div className="flex flex-col">
|
||||
<div className="flex flex-col mb-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-main-view-fg font-medium text-base">
|
||||
MCP Servers
|
||||
@ -197,35 +197,21 @@ function MCPServers() {
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Global MCP Permission Toggle */}
|
||||
<Card
|
||||
header={
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-1">
|
||||
<h1 className="text-main-view-fg font-medium text-base">
|
||||
Allow All MCP Tool Permissions
|
||||
</h1>
|
||||
<p className="text-sm text-main-view-fg/70">
|
||||
When enabled, all MCP tool calls will be automatically
|
||||
approved without showing permission dialogs.
|
||||
<span className="font-semibold text-main-view-fg">
|
||||
{' '}
|
||||
Use with caution
|
||||
</span>{' '}
|
||||
- only enable this if you trust all your MCP servers.
|
||||
</p>
|
||||
</div>
|
||||
>
|
||||
<CardItem
|
||||
title="Allow All MCP Tool Permissions"
|
||||
description="When enabled, all MCP tool calls will be automatically
|
||||
approved without showing permission dialogs."
|
||||
actions={
|
||||
<div className="flex-shrink-0 ml-4">
|
||||
<Switch
|
||||
checked={allowAllMCPPermissions}
|
||||
onCheckedChange={setAllowAllMCPPermissions}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
{Object.keys(mcpServers).length === 0 ? (
|
||||
<div className="py-4 text-center font-medium text-main-view-fg/50">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user