feat(mcp): add multi-provider websearch support
This commit is contained in:
+10
-9
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user