feat(mcp): support tool-level directTools array and 3-state UI configuration (#297)

* feat(mcp): support tool-level directTools array and 3-state UI configuration

* refactor(mcp): refine tool hint explanation and separate server instructions block

* style(mcp): display tool count in header title and split option hints into 3 lines

* style(mcp): update tools description paragraph and place bulk buttons on a separate row

* fix(mcp): enforce excludeTools in proxy path and align direct-tool counts

- Filter the per-agent tool registry by excludeTools at build time (DB cache
  and lazy-connect paths), so excluded tools are unreachable through the mcp
  proxy (call, search, list, describe) — matching pi-mcp-adapter where
  isToolAllowed gates both direct and gateway exposure.
- Add shared isDirectTool predicate (matches original or prefixed name) used
  by both buildDirectTools and the proxy description counts, so the
  advertised direct/proxy counts can no longer drift from actual
  registration; toolCount now reflects allowed tools only.
- Remove the legacy boolean directTools branch (no legacy data exists).
- Drop the now-unused mcp_excluded_tools_hint i18n key and regenerate
  Paraglide messages.
- Extend unit tests: excluded tools are not counted, listed, searched, or
  callable via the proxy; prefixed-name directTools configs count correctly.
This commit is contained in:
Yiling-J
2026-08-11 15:43:27 +08:00
committed by GitHub
parent 82aee9a291
commit 851ae49c84
33 changed files with 661 additions and 587 deletions
@@ -7,7 +7,6 @@ import {
MoreVertical,
Plus,
Trash2,
Zap,
ShieldCheck,
CheckCircle2,
AlertCircle,
@@ -273,7 +272,6 @@ export const McpConfigCard: React.FC<McpConfigCardProps> = ({ teamId }) => {
) : (
<div className="space-y-4">
{servers.map((server) => {
const isDirectMode = server.config?.directTools
const isAuthenticating = authenticatingServerId === server.id
const needsAuth =
server.status === 'needs_auth' ||
@@ -292,15 +290,6 @@ export const McpConfigCard: React.FC<McpConfigCardProps> = ({ teamId }) => {
<h4 className="font-bold text-foreground flex items-center gap-2 min-w-0">
<Server className="w-4 h-4 text-muted-foreground shrink-0" />
<span className="truncate">{server.name}</span>
{isDirectMode && (
<Badge
variant="outline"
className="text-[10px] bg-primary/5 text-primary border-primary/20 shrink-0"
>
<Zap className="w-3 h-3 mr-0.5" />
{m.mcp_direct_tools_mode()}
</Badge>
)}
<Badge variant="outline" className="text-[10px] uppercase shrink-0">
{server.transport}
</Badge>
@@ -12,7 +12,7 @@ import {
import { Button } from '@/ui/components/ui/button'
import { Input } from '@/ui/components/ui/input'
import { Label } from '@/ui/components/ui/label'
import { Switch } from '@/ui/components/ui/switch'
import { ToggleGroup, ToggleGroupItem } from '@/ui/components/ui/toggle-group'
import { Badge } from '@/ui/components/ui/badge'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import {
@@ -66,7 +66,7 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
)
// Config state
const [directTools, setDirectTools] = useState(false)
const [directTools, setDirectTools] = useState<string[]>([])
const [excludedTools, setExcludedTools] = useState<string[]>([])
// Tools inspector state
@@ -79,7 +79,7 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
setTransport(server.transport || 'streamable_http')
setPermission(server.permission || 'reviewer')
setAuthType(server.authType || 'auto')
setDirectTools(server.config?.directTools ?? false)
setDirectTools(Array.isArray(server.config?.directTools) ? server.config.directTools : [])
setExcludedTools(server.config?.excludeTools ?? [])
setExpandedTools({})
setIsInstructionsExpanded(false)
@@ -93,7 +93,7 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
setClientSecret('')
setScope('')
setGrantType('authorization_code')
setDirectTools(false)
setDirectTools([])
setExcludedTools([])
setExpandedTools({})
setIsInstructionsExpanded(false)
@@ -166,7 +166,7 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
const saveMutation = useMutation({
mutationFn: async () => {
const config = {
directTools,
directTools: directTools.length > 0 ? directTools : undefined,
excludeTools: excludedTools.length > 0 ? excludedTools : undefined,
}
@@ -222,10 +222,37 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
const tools = toolsData?.tools ?? []
const isToolExcluded = (toolName: string) => excludedTools.includes(toolName)
const getToolState = (toolName: string): 'off' | 'on' | 'direct' => {
if (excludedTools.includes(toolName)) return 'off'
if (directTools.includes(toolName)) return 'direct'
return 'on'
}
const toggleToolEnabled = (toolName: string, enabled: boolean) => {
setExcludedTools((prev) => (enabled ? prev.filter((n) => n !== toolName) : [...prev, toolName]))
const setToolState = (toolName: string, state: 'off' | 'on' | 'direct') => {
if (state === 'off') {
setExcludedTools((prev) => (prev.includes(toolName) ? prev : [...prev, toolName]))
setDirectTools((prev) => prev.filter((n) => n !== toolName))
} else if (state === 'on') {
setExcludedTools((prev) => prev.filter((n) => n !== toolName))
setDirectTools((prev) => prev.filter((n) => n !== toolName))
} else if (state === 'direct') {
setExcludedTools((prev) => prev.filter((n) => n !== toolName))
setDirectTools((prev) => (prev.includes(toolName) ? prev : [...prev, toolName]))
}
}
const handleBulkSetState = (state: 'off' | 'on' | 'direct') => {
const allToolNames = tools.map((t) => t.name)
if (state === 'off') {
setExcludedTools(allToolNames)
setDirectTools([])
} else if (state === 'on') {
setExcludedTools([])
setDirectTools([])
} else if (state === 'direct') {
setExcludedTools([])
setDirectTools(allToolNames)
}
}
const toggleExpand = (toolName: string) => {
@@ -286,52 +313,54 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
<span className="text-sm text-foreground">{server.description}</span>
</div>
)}
{server.instructions && (
<div className="flex flex-col">
<span className="text-[10px] uppercase tracking-wider text-muted-foreground font-semibold">
{m.mcp_server_instructions()}
</span>
<p
onClick={() => setIsInstructionsExpanded((prev) => !prev)}
className={`text-xs text-muted-foreground cursor-pointer transition-all ${
isInstructionsExpanded ? '' : 'line-clamp-2'
}`}
title={isInstructionsExpanded ? undefined : server.instructions}
>
{server.instructions}
</p>
</div>
)}
<span className="text-[10px] text-muted-foreground flex items-center gap-1.5">
<Info className="w-3 h-3" />
{m.mcp_server_auto_detected()}
</span>
</div>
{server.instructions && (
<div className="p-3 bg-muted/20 border border-border rounded-lg space-y-1">
<span className="text-[10px] uppercase tracking-wider text-muted-foreground font-semibold block">
{m.mcp_server_instructions()}
</span>
<p
onClick={() => setIsInstructionsExpanded((prev) => !prev)}
className={`text-xs text-muted-foreground whitespace-pre-wrap leading-relaxed cursor-pointer transition-all ${
isInstructionsExpanded ? '' : 'line-clamp-2'
}`}
title={isInstructionsExpanded ? undefined : 'Click to expand instructions'}
>
{server.instructions}
</p>
</div>
)}
{/* Transport & Permission */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div className="space-y-2">
<Label className="text-xs font-semibold">{m.mcp_transport()}</Label>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 pt-3 border-t border-border">
<div className="space-y-1.5">
<Label className="text-xs">{m.mcp_transport()}</Label>
<Select
value={transport}
onValueChange={(val) => setTransport(val as McpTransport)}
onValueChange={(val: McpTransport) => setTransport(val)}
>
<SelectTrigger>
<SelectTrigger className="h-9 text-xs">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="streamable_http">Streamable HTTP (Default)</SelectItem>
<SelectItem value="streamable_http">Streamable HTTP</SelectItem>
<SelectItem value="sse">Server-Sent Events (SSE)</SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-2">
<Label className="text-xs font-semibold">{m.skill_permission()}</Label>
<div className="space-y-1.5">
<Label className="text-xs">{m.skill_permission()}</Label>
<Select
value={permission}
onValueChange={(val) => setPermission(val as McpServerPermission)}
onValueChange={(val: McpServerPermission) => setPermission(val)}
>
<SelectTrigger>
<SelectTrigger className="h-9 text-xs">
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -343,51 +372,48 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
</div>
</div>
{/* Authentication Section */}
{/* Authentication Configuration */}
<div className="space-y-3 pt-3 border-t border-border">
<Label className="text-xs font-semibold flex items-center justify-between">
<span>{m.mcp_auth_type()}</span>
<span className="text-[10px] text-muted-foreground font-normal">
Configures server connection auth
</span>
</Label>
<Select
value={authType}
onValueChange={(val) => setAuthType(val as McpServerAuthType | 'auto')}
>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="auto">{m.mcp_auth_auto()}</SelectItem>
<SelectItem value="none">{m.mcp_auth_none()}</SelectItem>
<SelectItem value="bearer">{m.mcp_auth_bearer()}</SelectItem>
<SelectItem value="oauth">{m.mcp_auth_oauth()}</SelectItem>
</SelectContent>
</Select>
<div className="space-y-1.5">
<Label className="text-xs">{m.mcp_auth_type()}</Label>
<Select
value={authType}
onValueChange={(val: McpServerAuthType | 'auto') => setAuthType(val)}
>
<SelectTrigger className="h-9 text-xs">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="auto">{m.mcp_auth_auto()}</SelectItem>
<SelectItem value="none">{m.mcp_auth_none()}</SelectItem>
<SelectItem value="bearer">{m.mcp_auth_bearer()}</SelectItem>
<SelectItem value="oauth">{m.mcp_auth_oauth()}</SelectItem>
</SelectContent>
</Select>
</div>
{authType === 'bearer' && (
<div className="space-y-2 pl-1 pt-1">
<div className="space-y-1.5">
<Label className="text-xs">{m.mcp_bearer_token()}</Label>
<Input
className="h-9 text-xs font-mono"
type="password"
value={bearerToken}
onChange={(e) => setBearerToken(e.target.value)}
placeholder="Bearer token value"
placeholder="Enter token string"
/>
</div>
)}
{authType === 'oauth' && (
<div className="space-y-3 pl-1 pt-1 border-l-2 border-primary/20 pl-3">
<div className="p-3 bg-muted/20 border border-border rounded-lg space-y-3">
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
<div className="space-y-1.5">
<Label className="text-xs">{m.mcp_oauth_grant_type()}</Label>
<Select
value={grantType}
onValueChange={(val) =>
setGrantType(val as 'authorization_code' | 'client_credentials')
onValueChange={(val: 'authorization_code' | 'client_credentials') =>
setGrantType(val)
}
>
<SelectTrigger className="h-9 text-xs">
@@ -399,14 +425,13 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
</SelectContent>
</Select>
</div>
<div className="space-y-1.5">
<Label className="text-xs">{m.mcp_oauth_client_id()}</Label>
<Input
className="h-9 text-xs"
value={clientId}
onChange={(e) => setClientId(e.target.value)}
placeholder="Optional pre-registered Client ID"
placeholder="Optional Client ID"
/>
</div>
</div>
@@ -419,17 +444,16 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
type="password"
value={clientSecret}
onChange={(e) => setClientSecret(e.target.value)}
placeholder="Optional Client Secret"
placeholder="Optional Secret"
/>
</div>
<div className="space-y-1.5">
<Label className="text-xs">{m.mcp_oauth_scope()}</Label>
<Input
className="h-9 text-xs"
value={scope}
onChange={(e) => setScope(e.target.value)}
placeholder="Optional scope (e.g. read,write)"
placeholder="Optional scope"
/>
</div>
</div>
@@ -437,32 +461,53 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
)}
</div>
{/* Mode */}
{/* Tools list */}
<div className="space-y-3 pt-3 border-t border-border">
<div className="p-3 bg-muted/20 border border-border rounded-lg space-y-1.5">
<div className="flex items-center justify-between">
<span className="text-xs font-semibold text-foreground">
{m.mcp_direct_tools_mode()}
</span>
<Switch checked={directTools} onCheckedChange={setDirectTools} />
</div>
<p className="text-[11px] text-muted-foreground leading-relaxed">
{m.mcp_direct_tools_desc()}
</p>
</div>
</div>
{/* Tools list (excludeTools management) */}
<div className="space-y-3 pt-3 border-t border-border">
<div className="flex items-center justify-between">
<div className="space-y-2.5">
<Label className="text-xs font-semibold flex items-center gap-1.5">
<Wrench className="w-3.5 h-3.5" />
{m.mcp_tools()}
{m.mcp_tools()} ({tools.length})
</Label>
<p className="text-[11px] text-muted-foreground leading-relaxed">
{m.mcp_tools_desc()}
</p>
{tools.length > 0 && (
<div className="flex items-center gap-1.5 pt-0.5">
<Button
type="button"
variant="outline"
size="sm"
className="h-7 text-[11px] px-2.5"
onClick={() => handleBulkSetState('off')}
disabled={refreshMutation.isPending || isToolsLoading}
>
{m.mcp_bulk_all_off()}
</Button>
<Button
type="button"
variant="outline"
size="sm"
className="h-7 text-[11px] px-2.5"
onClick={() => handleBulkSetState('on')}
disabled={refreshMutation.isPending || isToolsLoading}
>
{m.mcp_bulk_all_proxy()}
</Button>
<Button
type="button"
variant="outline"
size="sm"
className="h-7 text-[11px] px-2.5"
onClick={() => handleBulkSetState('direct')}
disabled={refreshMutation.isPending || isToolsLoading}
>
{m.mcp_bulk_all_direct()}
</Button>
</div>
)}
</div>
<p className="text-[11px] text-muted-foreground">
{m.mcp_tools_count({ count: tools.length })} — {m.mcp_excluded_tools_hint()}
</p>
<div className="space-y-2">
{isToolsLoading ? (
@@ -475,7 +520,7 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
</div>
) : (
tools.map((tool) => {
const enabled = !isToolExcluded(tool.name)
const currentState = getToolState(tool.name)
const isExpanded = !!expandedTools[tool.name]
const schemaObj = tool.inputSchema as {
properties?: Record<string, { type?: string; description?: string }>
@@ -488,7 +533,7 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
<div
key={tool.name}
className={`border border-border rounded-lg p-3 transition-colors ${
enabled ? 'bg-card' : 'bg-muted/30 opacity-70'
currentState !== 'off' ? 'bg-card' : 'bg-muted/30 opacity-70'
}`}
>
<div className="flex items-start justify-between gap-3">
@@ -525,13 +570,26 @@ export const McpServerFormDialog: React.FC<McpServerFormDialogProps> = ({
</div>
<div className="flex items-center gap-2 shrink-0">
<Switch
checked={enabled}
<ToggleGroup
type="single"
value={currentState}
onValueChange={(val) => {
if (val) setToolState(tool.name, val as 'off' | 'on' | 'direct')
}}
size="sm"
variant="outline"
disabled={refreshMutation.isPending || isToolsLoading}
onCheckedChange={(checked) =>
toggleToolEnabled(tool.name, checked)
}
/>
>
<ToggleGroupItem value="off" className="text-[11px] px-2 h-7">
{m.mcp_tool_state_disabled()}
</ToggleGroupItem>
<ToggleGroupItem value="on" className="text-[11px] px-2 h-7">
{m.mcp_tool_state_proxy()}
</ToggleGroupItem>
<ToggleGroupItem value="direct" className="text-[11px] px-2 h-7">
{m.mcp_tool_state_direct()}
</ToggleGroupItem>
</ToggleGroup>
</div>
</div>
+7 -3
View File
@@ -374,8 +374,6 @@
"mcp_oauth_client_secret": "Client Secret",
"mcp_oauth_scope": "Scope",
"mcp_oauth_grant_type": "Grant Type",
"mcp_direct_tools_mode": "Direct Tools Mode",
"mcp_direct_tools_desc": "Exposes MCP tools as native agent tools instead of hiding them behind the MCP proxy. This lets the agent see and call selected MCP tools directly, improving tool discovery and reducing unnecessary searches. Use it for frequently used or important tools; keep large MCP servers behind the proxy to avoid increasing context usage.",
"mcp_tools": "MCP Tools",
"mcp_tools_count": "{count} Tools",
"mcp_status_connected": "Connected",
@@ -395,7 +393,13 @@
"add_mcp_server_to_get_started": "Add an MCP server to extend your AI agent tools.",
"search_tools_placeholder": "Search tools by name or description...",
"mcp_server_auto_detected": "Name and description are auto-detected from the server after connecting.",
"mcp_excluded_tools_hint": "Disable a tool to exclude it from this server's toolset.",
"mcp_tool_state_disabled": "Off",
"mcp_tool_state_proxy": "Proxy",
"mcp_tool_state_direct": "Direct",
"mcp_tools_desc": "Configure how MCP tools are exposed to the agent. Proxy mode keeps context usage low by hiding tools behind an MCP proxy, while Direct mode exposes selected tools as native agent tools for better discovery and faster access. Use Direct mode for frequently used or critical tools, and keep large MCP servers behind the proxy to avoid unnecessary context overhead.",
"mcp_bulk_all_off": "All Off",
"mcp_bulk_all_proxy": "All Proxy",
"mcp_bulk_all_direct": "All Direct",
"view_tools": "View Tools",
"tool_parameters": "Parameters",
"no_tools_found": "No tools found matching your search.",
+7 -3
View File
@@ -374,8 +374,6 @@
"mcp_oauth_client_secret": "Client Secret",
"mcp_oauth_scope": "作用域 (Scope)",
"mcp_oauth_grant_type": "授权模式 (Grant Type)",
"mcp_direct_tools_mode": "直连工具模式",
"mcp_direct_tools_desc": "将 MCP 工具直接作为智能体原生工具暴露,而非隐匿在 MCP 代理之后。这使得智能体能直接感知并调用选定的 MCP 工具,提高工具发现率并减少不必要的搜索。建议对于高频或关键工具开启此模式;大型 MCP 服务建议保持代理模式以避免增加上下文消耗。",
"mcp_tools": "MCP 工具",
"mcp_tools_count": "{count} 个工具",
"mcp_status_connected": "已连接",
@@ -395,7 +393,13 @@
"add_mcp_server_to_get_started": "添加 MCP 服务以扩展 AI Agent 的工具能力。",
"search_tools_placeholder": "按名称或描述搜索工具...",
"mcp_server_auto_detected": "连接后将自动从服务端获取名称和描述。",
"mcp_excluded_tools_hint": "关闭某个工具会将其从该服务的工具集中排除。",
"mcp_tool_state_disabled": "关闭",
"mcp_tool_state_proxy": "代理",
"mcp_tool_state_direct": "直连",
"mcp_tools_desc": "配置 MCP 工具向 Agent 的暴露方式。代理模式通过 MCP 代理隐匿工具,以保持较低的上下文占用;直连模式将选定工具直接作为 Agent 原生工具暴露,便于更好地发现与更快地调用。建议对高频或关键工具使用直连模式,对于大型 MCP 服务保持代理模式以避免不必要的上下文开销。",
"mcp_bulk_all_off": "全部关闭",
"mcp_bulk_all_proxy": "全部代理",
"mcp_bulk_all_direct": "全部直连",
"view_tools": "查看工具",
"tool_parameters": "参数列表",
"no_tools_found": "未找到符合搜索条件的工具。",
+7 -3
View File
@@ -356,8 +356,6 @@ export * from "./mcp_oauth_client_id.js";
export * from "./mcp_oauth_client_secret.js";
export * from "./mcp_oauth_scope.js";
export * from "./mcp_oauth_grant_type.js";
export * from "./mcp_direct_tools_mode.js";
export * from "./mcp_direct_tools_desc.js";
export * from "./mcp_tools.js";
export * from "./mcp_tools_count.js";
export * from "./mcp_status_connected.js";
@@ -377,7 +375,13 @@ export * from "./no_mcp_servers_installed.js";
export * from "./add_mcp_server_to_get_started.js";
export * from "./search_tools_placeholder.js";
export * from "./mcp_server_auto_detected.js";
export * from "./mcp_excluded_tools_hint.js";
export * from "./mcp_tool_state_disabled.js";
export * from "./mcp_tool_state_proxy.js";
export * from "./mcp_tool_state_direct.js";
export * from "./mcp_tools_desc.js";
export * from "./mcp_bulk_all_off.js";
export * from "./mcp_bulk_all_proxy.js";
export * from "./mcp_bulk_all_direct.js";
export * from "./view_tools.js";
export * from "./tool_parameters.js";
export * from "./no_tools_found.js";
+7 -3
View File
@@ -358,8 +358,6 @@ export * from './mcp_oauth_client_id.js'
export * from './mcp_oauth_client_secret.js'
export * from './mcp_oauth_scope.js'
export * from './mcp_oauth_grant_type.js'
export * from './mcp_direct_tools_mode.js'
export * from './mcp_direct_tools_desc.js'
export * from './mcp_tools.js'
export * from './mcp_tools_count.js'
export * from './mcp_status_connected.js'
@@ -379,7 +377,13 @@ export * from './no_mcp_servers_installed.js'
export * from './add_mcp_server_to_get_started.js'
export * from './search_tools_placeholder.js'
export * from './mcp_server_auto_detected.js'
export * from './mcp_excluded_tools_hint.js'
export * from './mcp_tool_state_disabled.js'
export * from './mcp_tool_state_proxy.js'
export * from './mcp_tool_state_direct.js'
export * from './mcp_tools_desc.js'
export * from './mcp_bulk_all_off.js'
export * from './mcp_bulk_all_proxy.js'
export * from './mcp_bulk_all_direct.js'
export * from './view_tools.js'
export * from './tool_parameters.js'
export * from './no_tools_found.js'
@@ -1,16 +1,16 @@
/**
* | output |
* | --- |
* | "Direct Tools Mode" |
* | "All Direct" |
*
* @param {Mcp_Direct_Tools_ModeInputs} inputs
* @param {Mcp_Bulk_All_DirectInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_direct_tools_mode: ((inputs?: Mcp_Direct_Tools_ModeInputs, options?: {
export const mcp_bulk_all_direct: ((inputs?: Mcp_Bulk_All_DirectInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Direct_Tools_ModeInputs, {
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Bulk_All_DirectInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Direct_Tools_ModeInputs = {};
export type Mcp_Bulk_All_DirectInputs = {};
+29
View File
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Bulk_All_DirectInputs */
const en_mcp_bulk_all_direct = /** @type {(inputs: Mcp_Bulk_All_DirectInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`All Direct`)
};
const zh_mcp_bulk_all_direct = /** @type {(inputs: Mcp_Bulk_All_DirectInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`全部直连`)
};
/**
* | output |
* | --- |
* | "All Direct" |
*
* @param {Mcp_Bulk_All_DirectInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_bulk_all_direct = /** @type {((inputs?: Mcp_Bulk_All_DirectInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Bulk_All_DirectInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_bulk_all_direct(inputs)
return zh_mcp_bulk_all_direct(inputs)
});
@@ -1,16 +1,16 @@
/**
* | output |
* | --- |
* | "Disable a tool to exclude it from this server's toolset." |
* | "All Off" |
*
* @param {Mcp_Excluded_Tools_HintInputs} inputs
* @param {Mcp_Bulk_All_OffInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_excluded_tools_hint: ((inputs?: Mcp_Excluded_Tools_HintInputs, options?: {
export const mcp_bulk_all_off: ((inputs?: Mcp_Bulk_All_OffInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Excluded_Tools_HintInputs, {
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Bulk_All_OffInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Excluded_Tools_HintInputs = {};
export type Mcp_Bulk_All_OffInputs = {};
+29
View File
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Bulk_All_OffInputs */
const en_mcp_bulk_all_off = /** @type {(inputs: Mcp_Bulk_All_OffInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`All Off`)
};
const zh_mcp_bulk_all_off = /** @type {(inputs: Mcp_Bulk_All_OffInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`全部关闭`)
};
/**
* | output |
* | --- |
* | "All Off" |
*
* @param {Mcp_Bulk_All_OffInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_bulk_all_off = /** @type {((inputs?: Mcp_Bulk_All_OffInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Bulk_All_OffInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_bulk_all_off(inputs)
return zh_mcp_bulk_all_off(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "All Proxy" |
*
* @param {Mcp_Bulk_All_ProxyInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_bulk_all_proxy: ((inputs?: Mcp_Bulk_All_ProxyInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Bulk_All_ProxyInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Bulk_All_ProxyInputs = {};
+29
View File
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Bulk_All_ProxyInputs */
const en_mcp_bulk_all_proxy = /** @type {(inputs: Mcp_Bulk_All_ProxyInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`All Proxy`)
};
const zh_mcp_bulk_all_proxy = /** @type {(inputs: Mcp_Bulk_All_ProxyInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`全部代理`)
};
/**
* | output |
* | --- |
* | "All Proxy" |
*
* @param {Mcp_Bulk_All_ProxyInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_bulk_all_proxy = /** @type {((inputs?: Mcp_Bulk_All_ProxyInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Bulk_All_ProxyInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_bulk_all_proxy(inputs)
return zh_mcp_bulk_all_proxy(inputs)
});
-16
View File
@@ -1,16 +0,0 @@
/**
* | output |
* | --- |
* | "Exposes MCP tools as native agent tools instead of hiding them behind the MCP proxy. This lets the agent see and call selected MCP tools directly, improving ..." |
*
* @param {Mcp_Direct_Tools_DescInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_direct_tools_desc: ((inputs?: Mcp_Direct_Tools_DescInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Direct_Tools_DescInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Direct_Tools_DescInputs = {};
@@ -1,29 +0,0 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Direct_Tools_DescInputs */
const en_mcp_direct_tools_desc = /** @type {(inputs: Mcp_Direct_Tools_DescInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Exposes MCP tools as native agent tools instead of hiding them behind the MCP proxy. This lets the agent see and call selected MCP tools directly, improving tool discovery and reducing unnecessary searches. Use it for frequently used or important tools; keep large MCP servers behind the proxy to avoid increasing context usage.`)
};
const zh_mcp_direct_tools_desc = /** @type {(inputs: Mcp_Direct_Tools_DescInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`将 MCP 工具直接作为智能体原生工具暴露,而非隐匿在 MCP 代理之后。这使得智能体能直接感知并调用选定的 MCP 工具,提高工具发现率并减少不必要的搜索。建议对于高频或关键工具开启此模式;大型 MCP 服务建议保持代理模式以避免增加上下文消耗。`)
};
/**
* | output |
* | --- |
* | "Exposes MCP tools as native agent tools instead of hiding them behind the MCP proxy. This lets the agent see and call selected MCP tools directly, improving ..." |
*
* @param {Mcp_Direct_Tools_DescInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_direct_tools_desc = /** @type {((inputs?: Mcp_Direct_Tools_DescInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Direct_Tools_DescInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_direct_tools_desc(inputs)
return zh_mcp_direct_tools_desc(inputs)
});
@@ -1,29 +0,0 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Direct_Tools_ModeInputs */
const en_mcp_direct_tools_mode = /** @type {(inputs: Mcp_Direct_Tools_ModeInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Direct Tools Mode`)
};
const zh_mcp_direct_tools_mode = /** @type {(inputs: Mcp_Direct_Tools_ModeInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`直连工具模式`)
};
/**
* | output |
* | --- |
* | "Direct Tools Mode" |
*
* @param {Mcp_Direct_Tools_ModeInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_direct_tools_mode = /** @type {((inputs?: Mcp_Direct_Tools_ModeInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Direct_Tools_ModeInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_direct_tools_mode(inputs)
return zh_mcp_direct_tools_mode(inputs)
});
@@ -1,29 +0,0 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Excluded_Tools_HintInputs */
const en_mcp_excluded_tools_hint = /** @type {(inputs: Mcp_Excluded_Tools_HintInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Disable a tool to exclude it from this server's toolset.`)
};
const zh_mcp_excluded_tools_hint = /** @type {(inputs: Mcp_Excluded_Tools_HintInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`关闭某个工具会将其从该服务的工具集中排除。`)
};
/**
* | output |
* | --- |
* | "Disable a tool to exclude it from this server's toolset." |
*
* @param {Mcp_Excluded_Tools_HintInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_excluded_tools_hint = /** @type {((inputs?: Mcp_Excluded_Tools_HintInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Excluded_Tools_HintInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_excluded_tools_hint(inputs)
return zh_mcp_excluded_tools_hint(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Direct" |
*
* @param {Mcp_Tool_State_DirectInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tool_state_direct: ((inputs?: Mcp_Tool_State_DirectInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Tool_State_DirectInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Tool_State_DirectInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Tool_State_DirectInputs */
const en_mcp_tool_state_direct = /** @type {(inputs: Mcp_Tool_State_DirectInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Direct`)
};
const zh_mcp_tool_state_direct = /** @type {(inputs: Mcp_Tool_State_DirectInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`直连`)
};
/**
* | output |
* | --- |
* | "Direct" |
*
* @param {Mcp_Tool_State_DirectInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tool_state_direct = /** @type {((inputs?: Mcp_Tool_State_DirectInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Tool_State_DirectInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_tool_state_direct(inputs)
return zh_mcp_tool_state_direct(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Off" |
*
* @param {Mcp_Tool_State_DisabledInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tool_state_disabled: ((inputs?: Mcp_Tool_State_DisabledInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Tool_State_DisabledInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Tool_State_DisabledInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Tool_State_DisabledInputs */
const en_mcp_tool_state_disabled = /** @type {(inputs: Mcp_Tool_State_DisabledInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Off`)
};
const zh_mcp_tool_state_disabled = /** @type {(inputs: Mcp_Tool_State_DisabledInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`关闭`)
};
/**
* | output |
* | --- |
* | "Off" |
*
* @param {Mcp_Tool_State_DisabledInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tool_state_disabled = /** @type {((inputs?: Mcp_Tool_State_DisabledInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Tool_State_DisabledInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_tool_state_disabled(inputs)
return zh_mcp_tool_state_disabled(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Proxy" |
*
* @param {Mcp_Tool_State_ProxyInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tool_state_proxy: ((inputs?: Mcp_Tool_State_ProxyInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Tool_State_ProxyInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Tool_State_ProxyInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Tool_State_ProxyInputs */
const en_mcp_tool_state_proxy = /** @type {(inputs: Mcp_Tool_State_ProxyInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Proxy`)
};
const zh_mcp_tool_state_proxy = /** @type {(inputs: Mcp_Tool_State_ProxyInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`代理`)
};
/**
* | output |
* | --- |
* | "Proxy" |
*
* @param {Mcp_Tool_State_ProxyInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tool_state_proxy = /** @type {((inputs?: Mcp_Tool_State_ProxyInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Tool_State_ProxyInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_tool_state_proxy(inputs)
return zh_mcp_tool_state_proxy(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Configure how MCP tools are exposed to the agent. Proxy mode keeps context usage low by hiding tools behind an MCP proxy, while Direct mode exposes selected ..." |
*
* @param {Mcp_Tools_DescInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tools_desc: ((inputs?: Mcp_Tools_DescInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Mcp_Tools_DescInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Mcp_Tools_DescInputs = {};
+29
View File
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Mcp_Tools_DescInputs */
const en_mcp_tools_desc = /** @type {(inputs: Mcp_Tools_DescInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Configure how MCP tools are exposed to the agent. Proxy mode keeps context usage low by hiding tools behind an MCP proxy, while Direct mode exposes selected tools as native agent tools for better discovery and faster access. Use Direct mode for frequently used or critical tools, and keep large MCP servers behind the proxy to avoid unnecessary context overhead.`)
};
const zh_mcp_tools_desc = /** @type {(inputs: Mcp_Tools_DescInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`配置 MCP 工具向 Agent 的暴露方式。代理模式通过 MCP 代理隐匿工具,以保持较低的上下文占用;直连模式将选定工具直接作为 Agent 原生工具暴露,便于更好地发现与更快地调用。建议对高频或关键工具使用直连模式,对于大型 MCP 服务保持代理模式以避免不必要的上下文开销。`)
};
/**
* | output |
* | --- |
* | "Configure how MCP tools are exposed to the agent. Proxy mode keeps context usage low by hiding tools behind an MCP proxy, while Direct mode exposes selected ..." |
*
* @param {Mcp_Tools_DescInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const mcp_tools_desc = /** @type {((inputs?: Mcp_Tools_DescInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Mcp_Tools_DescInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_mcp_tools_desc(inputs)
return zh_mcp_tools_desc(inputs)
});