The remote MCP endpoint https://mcp.exa.ai/mcp requires API key authentication via x-api-key header. Without this, the connection times out waiting for auth. This change: - Reads EXA_API_KEY from environment variable - Passes it as x-api-key header when available - Updates RemoteMcpConfig type to support optional headers Co-authored-by: Junho Yeo <i@junho.io>
32 lines
698 B
TypeScript
32 lines
698 B
TypeScript
import { websearch } from "./websearch"
|
|
import { context7 } from "./context7"
|
|
import { grep_app } from "./grep-app"
|
|
import type { McpName } from "./types"
|
|
|
|
export { McpNameSchema, type McpName } from "./types"
|
|
|
|
type RemoteMcpConfig = {
|
|
type: "remote"
|
|
url: string
|
|
enabled: boolean
|
|
headers?: Record<string, string>
|
|
}
|
|
|
|
const allBuiltinMcps: Record<McpName, RemoteMcpConfig> = {
|
|
websearch,
|
|
context7,
|
|
grep_app,
|
|
}
|
|
|
|
export function createBuiltinMcps(disabledMcps: string[] = []) {
|
|
const mcps: Record<string, RemoteMcpConfig> = {}
|
|
|
|
for (const [name, config] of Object.entries(allBuiltinMcps)) {
|
|
if (!disabledMcps.includes(name)) {
|
|
mcps[name] = config
|
|
}
|
|
}
|
|
|
|
return mcps
|
|
}
|