fix(mcp): add optional Context7 Authorization header (#1133)

Context7 should mirror `websearch` by only sending auth when
`CONTEXT7_API_KEY` is set.

Change: set bearer auth in `headers` using `CONTEXT7_API_KEY` if said environment variable is set, otherwise leave `headers` to `undefined`.
This commit is contained in:
0ln
2026-01-27 03:58:55 +01:00
committed by GitHub
parent 352075235e
commit 2ca40b9ba1
2 changed files with 7 additions and 2 deletions
+4
View File
@@ -2,5 +2,9 @@ export const context7 = {
type: "remote" as const,
url: "https://mcp.context7.com/mcp",
enabled: true,
headers: process.env.CONTEXT7_API_KEY
? { Authorization: `Bearer ${process.env.CONTEXT7_API_KEY}` }
: undefined,
// Disable OAuth auto-detection - Context7 uses API key header, not OAuth
oauth: false as const,
}