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
Copy file name to clipboardExpand all lines: README.md
+151-8Lines changed: 151 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -294,9 +294,20 @@ user_data_collection:
294
294
295
295
**Note**: The `run.yaml` configuration is currently an implementation detail. In the future, all configuration will be available directly from the lightspeed-core config.
296
296
297
+
**Important**: Only MCP servers defined in the `lightspeed-stack.yaml` configuration are available to the agents. Tools configured in the llama-stack `run.yaml` are not accessible to lightspeed-core agents.
298
+
297
299
#### Configuring MCP Servers
298
300
299
-
MCP (Model Context Protocol) servers provide tools and capabilities to the AI agents. These are configured in the `mcp_servers` section of your `lightspeed-stack.yaml`:
301
+
MCP (Model Context Protocol) servers provide tools and capabilities to the AI agents. These are configured in the `mcp_servers` section of your `lightspeed-stack.yaml`.
- `url`: The endpoint where the MCP server is running
309
+
310
+
**Minimal Example:**
300
311
301
312
```yaml
302
313
mcp_servers:
@@ -306,24 +317,126 @@ mcp_servers:
306
317
- name: "git-tools"
307
318
provider_id: "model-context-protocol"
308
319
url: "http://localhost:3001"
309
-
- name: "database-tools"
320
+
```
321
+
322
+
In addition to the basic configuration above, you can configure authentication headers for your MCP servers to securely communicate with services that require credentials.
323
+
324
+
#### Configuring MCP Server Authentication
325
+
326
+
Lightspeed Core Stack supports three methods for authenticating with MCP servers, each suited for different use cases:
327
+
328
+
##### 1. Static Tokens from Files (Recommended for Service Credentials)
329
+
330
+
Store authentication tokens in secret files and reference them in your configuration. This is ideal for API keys, service tokens, or any credentials that don't change per-user:
331
+
332
+
```yaml
333
+
mcp_servers:
334
+
- name: "api-service"
310
335
provider_id: "model-context-protocol"
311
-
url: "http://localhost:3002"
336
+
url: "http://api-service:8080"
337
+
authorization_headers:
338
+
Authorization: "/var/secrets/api-token" # Path to file containing token
**Important**: Only MCP servers defined in the `lightspeed-stack.yaml` configuration are available to the agents. Tools configured in the llama-stack `run.yaml`are not accessible to lightspeed-core agents.
342
+
The secret files should contain only the header value (tokens are automatically stripped of whitespace):
315
343
316
-
#### Configuring MCP Headers
344
+
```bash
345
+
# /var/secrets/api-token
346
+
Bearer sk-abc123def456...
317
347
318
-
MCP headers allow you to pass authentication tokens, API keys, or other metadata to MCP servers. These are configured **per request** via the `MCP-HEADERS` HTTP header:
348
+
# /var/secrets/api-key
349
+
my-api-key-value
350
+
```
351
+
352
+
##### 2. Kubernetes Service Account Tokens (For K8s Deployments)
353
+
354
+
Use the special `"kubernetes"` keyword to automatically use the authenticated user's Kubernetes token. This is perfect forMCP servers runningin the same Kubernetes cluster:
**If an MCP server has `authorization_headers` configured but the required tokens cannot be resolved at runtime, the server will be automatically skipped for that request.** This prevents failed authentication attempts to MCP servers.
432
+
433
+
**Examples:**
434
+
- A server with `Authorization: "kubernetes"` will be skipped if the user's request doesn't include a Kubernetes token
435
+
- A server with `Authorization: "client"` will be skipped if no `MCP-HEADERS` are provided in the request
436
+
- A server with multiple headers will be skipped if**any** required header cannot be resolved
437
+
438
+
Skipped servers are logged as warnings. Check Lightspeed Core logs to see which servers were skipped and why.
439
+
327
440
328
441
### Llama Stack project and configuration
329
442
@@ -988,6 +1101,36 @@ The version X.Y.Z indicates:
988
1101
* Y is the minor version (backward-compatible), and
989
1102
* Z is the patch version (backward-compatible bug fix).
990
1103
1104
+
# Development Tools
1105
+
1106
+
Lightspeed Core Stack includes development utilities to help with local testing and debugging. These tools are located in the `dev-tools/` directory.
1107
+
1108
+
## MCP Mock Server
1109
+
1110
+
A lightweight mock MCP server for testing MCP integrations locally without requiring real MCP infrastructure.
1111
+
1112
+
**Quick Start:**
1113
+
```bash
1114
+
# Start the mock server
1115
+
python dev-tools/mcp-mock-server/server.py
1116
+
1117
+
# Configure Lightspeed Core Stack to use it
1118
+
# Add to lightspeed-stack.yaml:
1119
+
mcp_servers:
1120
+
- name: "mock-test"
1121
+
url: "http://localhost:3000"
1122
+
authorization_headers:
1123
+
Authorization: "/tmp/test-token"
1124
+
```
1125
+
1126
+
**Features:**
1127
+
- Test authorization header configuration
1128
+
- Debug MCP connectivity issues
1129
+
- Inspect captured headers via debug endpoints
1130
+
- No external dependencies (pure Python stdlib)
1131
+
1132
+
For detailed usage instructions, see [`dev-tools/mcp-mock-server/README.md`](dev-tools/mcp-mock-server/README.md).
1133
+
991
1134
# Konflux
992
1135
993
1136
The official image of Lightspeed Core Stack is built on [Konflux](https://konflux-ui.apps.kflux-prd-rh02.0fk9.p1.openshiftapps.com/ns/lightspeed-core-tenant/applications/lightspeed-stack).
**Note:** These dependencies are needed for Llama Stack's inline providers (agents, vector_io, eval, etc.) to work in library mode. This is a one-time installation.
31
+
32
+
### 4. Start Lightspeed Core
33
+
34
+
```bash
35
+
# Terminal 2: Start Lightspeed Core with test config (Llama Stack runs as library)
36
+
# Make sure OPENAI_API_KEY is set first!
37
+
export OPENAI_API_KEY="your-api-key-here"
38
+
uv run src/lightspeed_stack.py --config dev-tools/test-configs/mcp-mock-test.yaml
39
+
```
40
+
41
+
Wait for Lightspeed Core to start (you should see "Application startup complete").
42
+
43
+
**Note:** The test configuration uses Llama Stack in library mode with a dedicated test config (`dev-tools/test-configs/llama-stack-mcp-test.yaml`), so you don't need to start it separately!
44
+
45
+
---
46
+
47
+
## Test: All Three Authorization Types in One Request
48
+
49
+
The test configuration defines **3 MCP servers**, which means **every query will contact all 3 servers** to discover their tools. This allows us to test all three authorization types in a single request.
50
+
51
+
### Step 1: Make a Query Request
52
+
53
+
```bash
54
+
# Terminal 3: Make test query with all required headers
55
+
curl -X POST http://localhost:8080/v1/streaming_query \
0 commit comments