Skip to content

Commit 16651d3

Browse files
authored
Merge branch 'main' into LCORE_598_RBAC_E2E_tests
2 parents ca8e27f + 593a6a7 commit 16651d3

35 files changed

Lines changed: 2022 additions & 72 deletions

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ COPY --from=builder /app-root/LICENSE /licenses/
7979
USER root
8080

8181
# Additional tools for derived images
82-
RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs jq patch
82+
RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs jq patch libpq libtiff openjpeg2 lcms2 libjpeg-turbo libwebp
8383

8484
# Create llama-stack directories for library mode
8585
RUN mkdir -p /opt/app-root/src/.llama/storage /opt/app-root/src/.llama/providers.d && \

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![License](https://img.shields.io/badge/license-Apache-blue)](https://github.com/lightspeed-core/lightspeed-stack/blob/main/LICENSE)
77
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)
88
[![Required Python version](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Flightspeed-core%2Flightspeed-stack%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)](https://www.python.org/)
9-
[![Tag](https://img.shields.io/github/v/tag/lightspeed-core/lightspeed-stack)](https://github.com/lightspeed-core/lightspeed-stack/releases/tag/0.3.1)
9+
[![Tag](https://img.shields.io/github/v/tag/lightspeed-core/lightspeed-stack)](https://github.com/lightspeed-core/lightspeed-stack/releases/tag/0.4.0)
1010

1111
Lightspeed Core Stack (LCS) is an AI-powered assistant that provides answers to product questions using backend LLM services, agents, and RAG databases.
1212

@@ -390,7 +390,7 @@ mcp_servers:
390390
Authorization: "kubernetes" # Uses user's k8s token from request auth
391391
```
392392

393-
The user's Kubernetes token is extracted from the incoming request's `Authorization` header and forwarded to the MCP server.
393+
**Note:** Kubernetes token-based MCP authorization only works when Lightspeed Core Stack is configured with Kubernetes authentication (`authentication.k8s`). For any other authentication types, MCP servers configured with `Authorization: "kubernetes"` are removed from the available MCP servers list.
394394

395395
##### 3. Client-Provided Tokens (For Per-User Authentication)
396396

@@ -418,6 +418,34 @@ curl -X POST "http://localhost:8080/v1/query" \
418418

419419
**Structure**: `MCP-HEADERS: {"<server-name>": {"<header-name>": "<header-value>", ...}, ...}`
420420

421+
##### Client-Authenticated MCP Servers Discovery
422+
423+
To help clients determine which MCP servers require client-provided tokens, use the **MCP Client Auth Options** endpoint:
424+
425+
```bash
426+
GET /v1/mcp-auth/client-options
427+
```
428+
429+
**Response:**
430+
```json
431+
{
432+
"servers": [
433+
{
434+
"name": "user-specific-service",
435+
"client_auth_headers": ["Authorization", "X-User-Token"]
436+
},
437+
{
438+
"name": "github-integration",
439+
"client_auth_headers": ["Authorization"]
440+
}
441+
]
442+
}
443+
```
444+
445+
This endpoint returns only MCP servers configured with `authorization_headers: "client"`, along with the specific header names that need to be provided via `MCP-HEADERS`. Servers using file-based or Kubernetes authentication are not included in this response.
446+
447+
**Use case:** Clients can call this endpoint at startup or before making requests to discover which servers they can authenticate with using their own tokens.
448+
421449
##### Combining Authentication Methods
422450

423451
You can mix and match authentication methods across different MCP servers, and even combine multiple methods for a single server:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.12-slim
2+
3+
WORKDIR /app
4+
5+
# Install curl for health checks
6+
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
7+
8+
# Copy the mock server script
9+
COPY dev-tools/mcp-mock-server/server.py .
10+
11+
# Expose HTTP port (we'll only use HTTP in Docker for simplicity)
12+
EXPOSE 3000
13+
14+
# Run the mock server (HTTP only on port 3000)
15+
CMD ["python", "server.py", "3000"]

docker-compose-library.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
services:
2+
# Mock MCP server for testing
3+
mcp-mock-server:
4+
build:
5+
context: .
6+
dockerfile: dev-tools/mcp-mock-server/Dockerfile
7+
container_name: mcp-mock-server
8+
ports:
9+
- "3000:3000"
10+
networks:
11+
- lightspeednet
12+
healthcheck:
13+
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
14+
interval: 5s
15+
timeout: 3s
16+
retries: 3
17+
start_period: 5s
18+
219
# Lightspeed Stack with embedded llama-stack (library mode)
320
lightspeed-stack:
421
build:
@@ -8,6 +25,11 @@ services:
825
container_name: lightspeed-stack
926
ports:
1027
- "8080:8080"
28+
depends_on:
29+
mcp-mock-server:
30+
condition: service_healthy
31+
networks:
32+
- lightspeednet
1133
volumes:
1234
# Mount both config files - lightspeed-stack.yaml should have library mode enabled
1335
- ./lightspeed-stack.yaml:/app-root/lightspeed-stack.yaml:Z

docker-compose.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
services:
2+
# Mock MCP server for testing
3+
mcp-mock-server:
4+
build:
5+
context: .
6+
dockerfile: dev-tools/mcp-mock-server/Dockerfile
7+
container_name: mcp-mock-server
8+
ports:
9+
- "3000:3000"
10+
networks:
11+
- lightspeednet
12+
healthcheck:
13+
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
14+
interval: 5s
15+
timeout: 3s
16+
retries: 3
17+
start_period: 5s
18+
219
# Red Hat llama-stack distribution with FAISS
320
llama-stack:
421
build:
@@ -70,6 +87,8 @@ services:
7087
depends_on:
7188
llama-stack:
7289
condition: service_healthy
90+
mcp-mock-server:
91+
condition: service_healthy
7392
networks:
7493
- lightspeednet
7594
healthcheck:

0 commit comments

Comments
 (0)