Ruirui Wan 7981c86613
fix: add EXA_API_KEY header support for websearch_exa MCP (#499)
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>
2026-01-07 06:12:22 +09:00

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
}