Skip to content

Commit 2982fe9

Browse files
authored
Merge pull request #106 from huss-mo/fix/mcp-server-auth
fix: pass API key as Bearer token in MCP server httpx client
2 parents 9162e80 + 2e1005b commit 2982fe9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

open_terminal/mcp_server.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
"""MCP server — exposes every FastAPI endpoint as an MCP tool."""
22

33
from fastmcp import FastMCP
4-
54
from open_terminal.main import app
5+
from open_terminal.env import API_KEY
66

7-
mcp = FastMCP.from_fastapi(app=app, name="Open Terminal")
7+
mcp = FastMCP.from_fastapi(
8+
app=app,
9+
name="Open Terminal",
10+
httpx_client_kwargs={
11+
"headers": {
12+
"Authorization": f"Bearer {API_KEY}",
13+
}
14+
},
15+
)

0 commit comments

Comments
 (0)