Commit 2e1005b
committed
fix: pass API key as Bearer token in MCP server httpx client
FastMCP.from_fastapi() uses an internal httpx client to call the
FastAPI routes. Without auth headers, every tool call (run_command,
read_file, etc.) hits the verify_api_key guard and returns 401.
Fixes tool calls returning: 'HTTP error 401: Unauthorized - Invalid API key'1 parent 8a491e8 commit 2e1005b
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments