feat(mcp): add multi-provider websearch support

This commit is contained in:
YanzheL
2026-02-02 03:36:48 +08:00
parent 4840864ed8
commit 00f576868b
3 changed files with 54 additions and 19 deletions
+10 -9
View File
@@ -1,7 +1,8 @@
import { websearch } from "./websearch"
import { createWebsearchConfig } from "./websearch"
import { context7 } from "./context7"
import { grep_app } from "./grep-app"
import type { McpName } from "./types"
import type { OhMyOpenCodeConfig } from "../config/schema"
export { McpNameSchema, type McpName } from "./types"
@@ -13,18 +14,18 @@ type RemoteMcpConfig = {
oauth?: false
}
const allBuiltinMcps: Record<McpName, RemoteMcpConfig> = {
websearch,
context7,
grep_app,
}
export function createBuiltinMcps(disabledMcps: string[] = [], config?: OhMyOpenCodeConfig) {
const allBuiltinMcps: Record<McpName, RemoteMcpConfig> = {
websearch: createWebsearchConfig(config?.websearch),
context7,
grep_app,
}
export function createBuiltinMcps(disabledMcps: string[] = []) {
const mcps: Record<string, RemoteMcpConfig> = {}
for (const [name, config] of Object.entries(allBuiltinMcps)) {
for (const [name, mcp] of Object.entries(allBuiltinMcps)) {
if (!disabledMcps.includes(name)) {
mcps[name] = config
mcps[name] = mcp
}
}