@@ -329,3 +329,92 @@ Absolutely! Here are the two new features in your exact `mkdocs-material` + `adm
329
329
- Supports TLS verification toggle (`--skipSSLVerify`).
330
330
331
331
---
332
+
333
+
334
+ ---
335
+
336
+ ### 🧭 Epic: One-Click Download of Ready-to-Use Client Config
337
+
338
+ ???+ "Copy Config for Claude or CLI"
339
+ ** Goal:**
340
+ As a user viewing a virtual server in the Admin UI, I want a button to ** download a pre-filled Claude JSON config**
341
+
342
+ **So that** I can immediately use the selected server in `Claude Desktop`, `mcpgateway.wrapper`, or any stdio/SSE-based client.
343
+
344
+ **Use Cases:**
345
+
346
+ - **Claude Desktop (stdio wrapper):**
347
+ Download a `.json` config that launches the wrapper with correct `MCP_SERVER_CATALOG_URLS` and token pre-set.
348
+ - **Browser / SSE Client:**
349
+ Download a `.json` or `.env` snippet with `Authorization` header, SSE URL, and ready-to-paste curl/Javascript.
350
+
351
+ **Implementation Details:**
352
+
353
+ - Button appears in the Admin UI under each virtual server's **View** panel.
354
+ - Config supports:
355
+ - `mcpgateway.wrapper` (for stdio clients)
356
+ - `/sse` endpoint with token (for browser / curl)
357
+ - JWT token is generated or reused on demand.
358
+ - Filled-in config includes:
359
+ - Virtual server ID
360
+ - Base gateway URL
361
+ - Short-lived token (`MCP_AUTH_TOKEN`)
362
+ - Optional Docker or pipx run command
363
+ - Claude Desktop format includes `command`, `args`, and `env` block.
364
+
365
+ **API Support:**
366
+
367
+ - Add endpoint:
368
+ ```http
369
+ GET /servers/{id}/client-config
370
+ ```
371
+ - Optional query params:
372
+ - `type=claude` (default)
373
+ - `type=sse`
374
+ - Returns JSON config with headers:
375
+ ```
376
+ Content-Disposition: attachment; filename="claude-config.json"
377
+ Content-Type: application/json
378
+ ```
379
+
380
+ **Example (Claude-style JSON):**
381
+
382
+ ```json
383
+ {
384
+ "mcpServers": {
385
+ "server-alias": {
386
+ "command": "python3",
387
+ "args": ["-m", "mcpgateway.wrapper"],
388
+ "env": {
389
+ "MCP_AUTH_TOKEN": "example-token",
390
+ "MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/3",
391
+ "MCP_TOOL_CALL_TIMEOUT": "120"
392
+ }
393
+ }
394
+ }
395
+ }
396
+ ```
397
+
398
+ **Example (curl-ready SSE config):**
399
+
400
+ ```bash
401
+ curl -H "Authorization: ..." \
402
+ http://localhost:4444/servers/3/sse
403
+ ```
404
+
405
+ **Acceptance Criteria:**
406
+ - UI exposes a single **Download Config** button per server.
407
+ - Endpoint `/servers/{id}/client-config` returns fully populated config.
408
+ - Tokens are scoped, short-lived, or optionally ephemeral.
409
+ - Claude Desktop accepts the file without user edits.
410
+
411
+ **Security:**
412
+ - JWT token is only included if the requester is authenticated.
413
+ - Download links are protected behind user auth and audit-logged.
414
+ - Expiry and scope settings match user profile or server defaults.
415
+
416
+ **Bonus Ideas:**
417
+ - Toggle to choose between Claude, curl, or Docker styles.
418
+ - QR code output or "Copy to Clipboard" button. QR might work with the phone app, etc.
419
+
420
+ ---
0 commit comments