Skip to content

Commit 1b28bcf

Browse files
author
tytv2
committed
docs: document --vks-auth passthrough (flag, env var, identity semantics)
- vks README: GRN_MCP_VKS_AUTH in the env table, an HTTP-transport example, and an "Upstream VKS identity" section separating inbound auth (who may call the server) from upstream identity (whose credentials hit VKS). - vks CLAUDE.md: passthrough example in the server-flags block. - mcp-core README: http module row notes user_token_var/current_identity.
1 parent 66bef95 commit 1b28bcf

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

src/mcp-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Shared core for GreenNode MCP servers. Product servers
77
|--------|----------|
88
| `config` | `load_profile()``~/.greenode` credentials/config INI + `GRN_*` env overrides |
99
| `auth` | `TokenManager` — GreenNode IAM client-credentials token, auto-refresh (camelCase API) |
10-
| `http` | `BaseClient` — retry on 5xx/timeout (1s→2s→4s), auto-refresh on 401, 30s timeout |
10+
| `http` | `BaseClient` — retry on 5xx/timeout (1s→2s→4s), auto-refresh on 401, 30s timeout; `user_token_var`/`current_identity` for per-request token passthrough + cache isolation |
1111
| `validators` | `validate_id()` — safe resource-ID check before URL construction |
1212
| `cache` | `DiscoveryCache` — per-tool TTL cache with `refresh` bypass |
1313

src/vks-mcp-server/CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ uv run vks-mcp-server --allow-sensitive-data-access
4242

4343
# HTTP transport (default: stdio); Docker image serves this on port 8080
4444
uv run vks-mcp-server --transport streamable-http --host 0.0.0.0 --port 8080
45+
46+
# Per-user upstream identity (caller's IAM token from the Gateway; HTTP only)
47+
uv run vks-mcp-server --transport streamable-http --vks-auth passthrough
4548
```
4649

4750
## Inbound auth (HTTP transport)

src/vks-mcp-server/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ HTTP-transport / auth variables (all optional):
4949
| `GRN_MCP_JWT_ISSUER` / `GRN_MCP_JWT_JWKS_URI` / `GRN_MCP_JWT_AUDIENCE` | JWT verification for `--auth-mode jwt` |
5050
| `GRN_MCP_RESOURCE_URL` | This server's resource URL (Protected Resource Metadata) |
5151
| `GRN_MCP_AUTH_DEBUG` | `1` = redacted inbound-auth diagnostics + `GET /whoami` (never in production) |
52+
| `GRN_MCP_VKS_AUTH` | Upstream VKS identity: `service-account` (default) or `passthrough` (per-user; HTTP only) |
5253

5354
## Running
5455

@@ -81,6 +82,9 @@ Cursor entry:
8182

8283
```bash
8384
uv run vks-mcp-server --transport streamable-http --host 0.0.0.0 --port 8080
85+
86+
# Per-user upstream identity (behind the AgentBase Gateway)
87+
uv run vks-mcp-server --transport streamable-http --port 8080 --vks-auth passthrough
8488
```
8589

8690
`GET /health` is always unauthenticated (liveness/readiness). The Docker image
@@ -100,7 +104,23 @@ serves streamable-http on port 8080.
100104

101105
Behind the GreenNode MCP Gateway: use `api-key` when the Gateway's outbound auth
102106
is API Key, or `jwt` when it is OAuth 2.0. `/health` is always unauthenticated.
103-
Per-user VKS access: run with `--vks-auth passthrough` — the Gateway forwards each caller's IAM bearer token in `Authorization`, and the server uses it for every VKS/vServer call (tokenless requests are rejected; caches are isolated per caller; incompatible with `--auth-mode api-key`).
107+
### Upstream VKS identity (`--vks-auth`)
108+
109+
Independent of inbound auth, `--vks-auth` selects **whose credentials the
110+
server uses against the VKS/vServer APIs**:
111+
112+
- `service-account` (default) — the shared IAM credentials from `~/.greenode`;
113+
every caller sees the same project and permissions.
114+
- `passthrough` (HTTP only) — the AgentBase Gateway forwards each caller's IAM
115+
bearer token in `Authorization`, and the server uses **that token** for every
116+
VKS/vServer call: per-user projects, permissions, and results.
117+
- Requests without a token are rejected (401 + `WWW-Authenticate`) — never a
118+
silent service-account fallback; a rejected user token is not retried
119+
under a different identity.
120+
- All caches (discovery, kubernetes clients, project_id) are isolated per
121+
caller identity.
122+
- Incompatible with `--auth-mode api-key` (both would claim the
123+
`Authorization` header) and with stdio transport.
104124

105125
## Tools
106126

0 commit comments

Comments
 (0)