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
@@ -297,9 +297,20 @@ user_data_collection:
297
297
298
298
**Note**: The `run.yaml` configuration is currently an implementation detail. In the future, all configuration will be available directly from the lightspeed-core config.
299
299
300
+
**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.
301
+
300
302
#### Configuring MCP Servers
301
303
302
-
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`:
304
+
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
312
+
313
+
**Minimal Example:**
303
314
304
315
```yaml
305
316
mcp_servers:
@@ -309,24 +320,126 @@ mcp_servers:
309
320
- name: "git-tools"
310
321
provider_id: "model-context-protocol"
311
322
url: "http://localhost:3001"
312
-
- name: "database-tools"
323
+
```
324
+
325
+
In addition to the basic configuration above, you can configure authentication headers for your MCP servers to securely communicate with services that require credentials.
326
+
327
+
#### Configuring MCP Server Authentication
328
+
329
+
Lightspeed Core Stack supports three methods for authenticating with MCP servers, each suited for different use cases:
330
+
331
+
##### 1. Static Tokens from Files (Recommended for Service Credentials)
332
+
333
+
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:
334
+
335
+
```yaml
336
+
mcp_servers:
337
+
- name: "api-service"
313
338
provider_id: "model-context-protocol"
314
-
url: "http://localhost:3002"
339
+
url: "http://api-service:8080"
340
+
authorization_headers:
341
+
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.
345
+
The secret files should contain only the header value (tokens are automatically stripped of whitespace):
318
346
319
-
#### Configuring MCP Headers
347
+
```bash
348
+
# /var/secrets/api-token
349
+
Bearer sk-abc123def456...
320
350
321
-
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:
351
+
# /var/secrets/api-key
352
+
my-api-key-value
353
+
```
354
+
355
+
##### 2. Kubernetes Service Account Tokens (For K8s Deployments)
356
+
357
+
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.
435
+
436
+
**Examples:**
437
+
- A server with `Authorization: "kubernetes"` will be skipped if the user's request doesn't include a Kubernetes token
438
+
- A server with `Authorization: "client"` will be skipped if no `MCP-HEADERS` are provided in the request
439
+
- A server with multiple headers will be skipped if**any** required header cannot be resolved
440
+
441
+
Skipped servers are logged as warnings. Check Lightspeed Core logs to see which servers were skipped and why.
442
+
330
443
331
444
### Llama Stack project and configuration
332
445
@@ -995,6 +1108,36 @@ The version X.Y.Z indicates:
995
1108
* Y is the minor version (backward-compatible), and
996
1109
* Z is the patch version (backward-compatible bug fix).
997
1110
1111
+
# Development Tools
1112
+
1113
+
Lightspeed Core Stack includes development utilities to help with local testing and debugging. These tools are located in the `dev-tools/` directory.
1114
+
1115
+
## MCP Mock Server
1116
+
1117
+
A lightweight mock MCP server for testing MCP integrations locally without requiring real MCP infrastructure.
1118
+
1119
+
**Quick Start:**
1120
+
```bash
1121
+
# Start the mock server
1122
+
python dev-tools/mcp-mock-server/server.py
1123
+
1124
+
# Configure Lightspeed Core Stack to use it
1125
+
# Add to lightspeed-stack.yaml:
1126
+
mcp_servers:
1127
+
- name: "mock-test"
1128
+
url: "http://localhost:3000"
1129
+
authorization_headers:
1130
+
Authorization: "/tmp/test-token"
1131
+
```
1132
+
1133
+
**Features:**
1134
+
- Test authorization header configuration
1135
+
- Debug MCP connectivity issues
1136
+
- Inspect captured headers via debug endpoints
1137
+
- No external dependencies (pure Python stdlib)
1138
+
1139
+
For detailed usage instructions, see [`dev-tools/mcp-mock-server/README.md`](dev-tools/mcp-mock-server/README.md).
1140
+
998
1141
# Konflux
999
1142
1000
1143
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