Skip to content

Commit e3d90a9

Browse files
committed
update config.md
Signed-off-by: Anxhela Coba <acoba@redhat.com>
1 parent 99f8a5b commit e3d90a9

1 file changed

Lines changed: 55 additions & 2 deletions

File tree

docs/configuration.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ embedding:
107107
This section configures the inference API for generating the responses. It can be any Lightspeed-Core compatible API.
108108
Note that it can be easily integrated with other APIs with a minimal change.
109109

110-
Authentication via `API_KEY` environment variable only for MCP server.
111-
112110
| Setting (api.) | Default | Description |
113111
|----------------|---------|-------------|
114112
| enabled | `"true"` | Enable/disable API calls |
@@ -121,6 +119,30 @@ Authentication via `API_KEY` environment variable only for MCP server.
121119
| system_prompt | `null` | Custom system prompt (optional) |
122120
| cache_dir | `".caches/api_cache"` | Directory with cached API responses |
123121
| cache_enabled | `true` | Is API cache enabled? |
122+
| mcp_headers | `null` | MCP headers configuration for authentication (see below) |
123+
| num_retries | `3` | Maximum number of retry attempts for API calls on 429 errors |
124+
125+
### MCP Server Authentication
126+
127+
The framework supports two methods for MCP server authentication:
128+
129+
#### 1. New MCP Headers Configuration (Recommended)
130+
The `mcp_headers` configuration provides a flexible way to configure authentication for individual MCP servers:
131+
132+
| Setting (api.mcp_headers.) | Default | Description |
133+
|----------------------------|---------|-------------|
134+
| enabled | `true` | Enable/disable MCP headers functionality |
135+
| servers | `{}` | Dictionary of MCP server configurations |
136+
137+
For each server in `servers`, you can configure:
138+
139+
| Setting (api.mcp_headers.servers.<server_name>.) | Default | Description |
140+
|---------------------------------------------------|---------|-------------|
141+
| auth_type | `"bearer"` | Authentication type (currently only "bearer" is supported) |
142+
| env_var | required | Environment variable containing the authentication token |
143+
144+
#### 2. Legacy Authentication (Fallback)
145+
When `mcp_headers.enabled` is `false`, the system falls back to using the `API_KEY` environment variable for all MCP server authentication.
124146

125147
### API Modes
126148

@@ -137,6 +159,8 @@ Authentication via `API_KEY` environment variable only for MCP server.
137159
- **Reproducible results**: Same response data used across runs
138160
### Example
139161

162+
#### Example Configuration
163+
140164
```yaml
141165
api:
142166
enabled: true
@@ -150,8 +174,37 @@ api:
150174
system_prompt: null
151175
cache_dir: ".caches/api_cache"
152176
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+
)
153204
```
154205

206+
This change allows the authorization headers to be properly passed through to MCP servers.
207+
155208
## Metrics
156209
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`
157210

0 commit comments

Comments
 (0)