feat: configure built-in MCP access
Built-in MCP servers were always granted to supported runtimes without per-server controls. They now have persistent enablement and runtime assignments for direct models, managed OpenCode, and Continue, while DeepSeek Harness remains visibly unsupported and cannot be assigned. MCP settings are reorganized into Built-in MCP, Direct model, Custom MCP, and Computer control tabs. Direct-model web search now uses the same accessible collapsible inventory pattern as other tool groups. Release note: 内置 MCP 现在可分别启停并分配给直连模型、OpenCode 和 Continue;MCP 设置分类与直连模型工具列表也更清晰,DeepSeek Harness 会明确显示为暂不支持。
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import type { RuntimeTarget } from './capability-contracts'
|
||||
import type {
|
||||
BuiltinMcpServerId,
|
||||
RuntimeTarget
|
||||
} from './capability-contracts'
|
||||
|
||||
import {
|
||||
knowledgeScopedDataTools,
|
||||
@@ -7,7 +10,7 @@ import {
|
||||
import { goodbuddyConfigTools } from './goodbuddy-config-tools'
|
||||
|
||||
export type BuiltinMcpServerSummary = {
|
||||
id: string
|
||||
id: BuiltinMcpServerId
|
||||
name: string
|
||||
description: string
|
||||
tools: readonly {
|
||||
@@ -15,7 +18,7 @@ export type BuiltinMcpServerSummary = {
|
||||
description: string
|
||||
access: 'read' | 'write'
|
||||
}[]
|
||||
assignments: readonly RuntimeTarget[]
|
||||
supportedAssignments: readonly RuntimeTarget[]
|
||||
access: 'read' | 'mixed'
|
||||
authorization: 'conversation-scoped'
|
||||
requiresFeature?: 'magic-notes'
|
||||
@@ -32,7 +35,7 @@ export const builtinMcpServers = [
|
||||
description: summary,
|
||||
access
|
||||
})),
|
||||
assignments: ['model', 'opencode', 'continue'],
|
||||
supportedAssignments: ['model', 'opencode', 'continue'],
|
||||
access: 'read',
|
||||
authorization: 'conversation-scoped'
|
||||
},
|
||||
@@ -46,7 +49,7 @@ export const builtinMcpServers = [
|
||||
description: summary,
|
||||
access
|
||||
})),
|
||||
assignments: ['model', 'opencode', 'continue'],
|
||||
supportedAssignments: ['model', 'opencode', 'continue'],
|
||||
access: 'mixed',
|
||||
authorization: 'conversation-scoped',
|
||||
requiresFeature: 'magic-notes'
|
||||
@@ -61,7 +64,7 @@ export const builtinMcpServers = [
|
||||
description: summary,
|
||||
access
|
||||
})),
|
||||
assignments: ['model', 'opencode', 'continue'],
|
||||
supportedAssignments: ['model', 'opencode', 'continue'],
|
||||
access: 'mixed',
|
||||
authorization: 'conversation-scoped'
|
||||
}
|
||||
|
||||
@@ -35,6 +35,46 @@ export type CapabilityAssignments = z.infer<
|
||||
typeof capabilityAssignmentsSchema
|
||||
>
|
||||
|
||||
export const builtinMcpServerIdSchema = z.enum([
|
||||
'knowledge-base',
|
||||
'magic-notes',
|
||||
'goodbuddy-config'
|
||||
])
|
||||
export type BuiltinMcpServerId = z.infer<
|
||||
typeof builtinMcpServerIdSchema
|
||||
>
|
||||
|
||||
export const builtinMcpAssignmentsSchema =
|
||||
capabilityAssignmentsSchema.refine(
|
||||
(assignments) => !assignments.includes('deepseek-harness'),
|
||||
'DeepSeek Harness 当前不支持内置 MCP'
|
||||
)
|
||||
|
||||
export const builtinMcpServerToggleInputSchema = z
|
||||
.object({
|
||||
serverId: builtinMcpServerIdSchema,
|
||||
enabled: z.boolean()
|
||||
})
|
||||
.strict()
|
||||
|
||||
export const builtinMcpServerAssignmentsInputSchema = z
|
||||
.object({
|
||||
serverId: builtinMcpServerIdSchema,
|
||||
assignments: builtinMcpAssignmentsSchema
|
||||
})
|
||||
.strict()
|
||||
|
||||
export const builtinMcpServerStateSummarySchema = z
|
||||
.object({
|
||||
id: builtinMcpServerIdSchema,
|
||||
enabled: z.boolean(),
|
||||
assignments: builtinMcpAssignmentsSchema
|
||||
})
|
||||
.strict()
|
||||
export type BuiltinMcpServerStateSummary = z.infer<
|
||||
typeof builtinMcpServerStateSummarySchema
|
||||
>
|
||||
|
||||
export const secretActionSchema = z.discriminatedUnion('action', [
|
||||
z.object({ action: z.literal('keep') }).strict(),
|
||||
z
|
||||
@@ -327,6 +367,10 @@ export type WebSearchCapability = z.infer<
|
||||
export const capabilitySnapshotSchema = z
|
||||
.object({
|
||||
skills: z.array(skillSummarySchema).max(256),
|
||||
builtinMcpServers: z
|
||||
.array(builtinMcpServerStateSummarySchema)
|
||||
.max(3)
|
||||
.optional(),
|
||||
mcpServers: z.array(mcpServerSummarySchema).max(64),
|
||||
webSearch: webSearchCapabilitySchema.optional(),
|
||||
computerCapabilities: z
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
import type {
|
||||
BrowserProfileCreateInput,
|
||||
BrowserProfileRenameInput,
|
||||
BuiltinMcpServerId,
|
||||
CapabilityDiagnosticReport,
|
||||
CapabilityAssignments,
|
||||
CapabilitySnapshot,
|
||||
@@ -1532,6 +1533,14 @@ export type DesktopApi = {
|
||||
skillId: string,
|
||||
assignments: CapabilityAssignments
|
||||
) => Promise<CapabilitySnapshot>
|
||||
setBuiltinMcpServerEnabled: (
|
||||
serverId: BuiltinMcpServerId,
|
||||
enabled: boolean
|
||||
) => Promise<CapabilitySnapshot>
|
||||
setBuiltinMcpServerAssignments: (
|
||||
serverId: BuiltinMcpServerId,
|
||||
assignments: CapabilityAssignments
|
||||
) => Promise<CapabilitySnapshot>
|
||||
saveMcpServer: (
|
||||
serverId: string | undefined,
|
||||
input: McpServerInput
|
||||
|
||||
@@ -128,6 +128,8 @@ export const ipcChannels = {
|
||||
capabilitiesRemoveSkill: 'capabilities:skill:remove',
|
||||
capabilitiesToggleSkill: 'capabilities:skill:toggle',
|
||||
capabilitiesAssignSkill: 'capabilities:skill:assign',
|
||||
capabilitiesToggleBuiltinMcp: 'capabilities:builtin-mcp:toggle',
|
||||
capabilitiesAssignBuiltinMcp: 'capabilities:builtin-mcp:assign',
|
||||
capabilitiesSaveMcp: 'capabilities:mcp:save',
|
||||
capabilitiesRemoveMcp: 'capabilities:mcp:remove',
|
||||
capabilitiesTestMcp: 'capabilities:mcp:test',
|
||||
|
||||
Reference in New Issue
Block a user