You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When `mcp_headers.enabled` is `false`, the system falls back to using the `API_KEY` environment variable for all MCP server authentication.
124
146
125
147
### API Modes
126
148
@@ -137,6 +159,8 @@ Authentication via `API_KEY` environment variable only for MCP server.
137
159
- **Reproducible results**: Same response data used across runs
138
160
### Example
139
161
162
+
#### Example Configuration
163
+
140
164
```yaml
141
165
api:
142
166
enabled: true
@@ -150,8 +174,37 @@ api:
150
174
system_prompt: null
151
175
cache_dir: ".caches/api_cache"
152
176
cache_enabled: true
177
+
num_retries: 3
178
+
179
+
# MCP Server Authentication Configuration
180
+
mcp_headers:
181
+
enabled: true # Enable MCP headers functionality
182
+
servers: # MCP server configurations
183
+
filesystem-tools:
184
+
auth_type: bearer # Authentication type: only bearer is supported
185
+
env_var: API_KEY # Environment variable containing the token/key
186
+
another-mcp-server:
187
+
auth_type: bearer
188
+
env_var: ANOTHER_API_KEY # Use a different environment variable
189
+
```
190
+
191
+
#### Lightspeed Stack API Compatibility
192
+
193
+
**Important Note for lightspeed-stack API users**: To use the MCP headers functionality with the lightspeed-stack API, you need to modify the `llama_stack_api/openai_responses.py` file in your lightspeed-stack installation:
194
+
195
+
In the `OpenAIResponsesToolMCP` class, change the `authorization` parameter's `exclude` field from `True` to `False`:
196
+
197
+
```python
198
+
# In llama_stack_api/openai_responses.py
199
+
class OpenAIResponsesToolMCP:
200
+
authorization: Optional[str] = Field(
201
+
default=None,
202
+
exclude=False # Change this from True to False
203
+
)
153
204
```
154
205
206
+
This change allows the authorization headers to be properly passed through to MCP servers.
207
+
155
208
## Metrics
156
209
Metrics are enabled globally (as described below) or within the input data for each individual conversation or individual turn (question/answer pair). To enable a metrics globally you need to set `default` meta data attribute to `true`
0 commit comments