@winstonsayno/mcp-gateway 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [1.1.0] - 2026-10-07
13
+
14
+ ### Added
15
+ - **Dashboard v2** (`/dashboard`, still one self-contained HTML file: no build step, no CDN, no runtime dependencies):
16
+ - First-run **guided onboarding** (dismissible, reopen with **?**): connect with an API key (tested live), see the upstream servers, try a tool (`tools` list → form generated from the tool's JSON schema, or raw JSON → call → result), and copy-paste snippets for Claude Desktop (via `mcp-remote`), Cursor, Claude Code, the JS and Kotlin clients and curl, all pointing at this gateway's `/mcp` URL.
17
+ - **Live overview**: requests/min, p50 / p95 / p99 latency, error rate and servers-online cards with sparklines; hand-drawn SVG charts for request rate, latency and error rate (5 m / 15 m / 1 h / 6 h windows, hover / touch tooltips); top tools; usage per API key; live request stream; server health.
18
+ - Servers page with tool chips and one-click reconnect; Playground; request history with filters and cursor paging (cards on phones); Connect page.
19
+ - English / 中文 toggle, dark / light theme, responsive down to phone widths with a bottom tab bar, keyboard navigation (arrow-key tabs, focus-trapped dialog, Esc), `prefers-reduced-motion`, View Transitions, skeleton loaders; animations use transform / opacity only.
20
+ - `GET /api/v1/stats`: windowed time series (count, errors, p50 / p95 per bucket), summary, top tools, per-server and per-client usage (`?window=`, `?bucket=`).
21
+ - `GET /api/v1/events`: Server-Sent Events stream with a `request` event per recorded call and a `snapshot` (server health + summary) every 2 s; heartbeats, max 50 concurrent streams, closed on shutdown. Both new endpoints require auth and show restricted clients only their own calls. The dashboard falls back to polling every 2 s when the stream is unavailable.
22
+
23
+ ## [1.0.1] - 2026-10-07
24
+
25
+ Bug-fix release; no API or configuration changes.
26
+
27
+ ### Fixed
28
+ - A server whose MCP handshake (`initialize` → `notifications/initialized` → `tools/list`) was still in progress was already reported as connected: `mcp_gateway_server_up` / `up` in `/api/v1/metrics` showed `1`, `/health/ready` counted it, and REST / `/mcp` calls could be forwarded to it before `initialize` had been answered. `McpProxy#isConnected` and `McpProxy#request` now require a completed handshake (calls during it get the usual "not connected" / `503`).
29
+ - Flaky tests: `GET /api/v1/tools?format=mcp` assertion depended on server connect order; the reconnect-metrics test could observe a handshaking server as up (fixed by the above).
30
+
31
+ ### Changed (maintenance)
32
+ - Dependabot ignores semver-major updates (npm root + JS client, Gradle) and keeps the Docker base image on Node 22; majors are adopted deliberately.
33
+
12
34
  ## [1.0.0] - 2026-10-07
13
35
 
14
36
  First stable release. From here on mcp-gateway follows semver: `/api/v1`, `/mcp`, configuration keys, CLI and
package/README.md CHANGED
@@ -228,6 +228,8 @@ What the endpoint does:
228
228
  | `GET` | `/api/v1/prompts` | Prompts of all servers (`?server=`) |
229
229
  | `POST` | `/api/v1/prompts/get` | Get a prompt: `{"name": "...", "server"?: "...", "arguments"?: {...}}` |
230
230
  | `GET` | `/api/v1/requests` | Request history, newest first (`?limit=` max 500, `server`, `tool`, `client`, `success`, `via`, `kind`, `since`, `until`, `cursor`) |
231
+ | `GET` | `/api/v1/stats` | Live dashboard data: time series (count, errors, p50/p95 per bucket), summary, top tools, per-server and per-key usage (`?window=`, `?bucket=` ms) |
232
+ | `GET` | `/api/v1/events` | Server-Sent Events: a `request` event per call, a `snapshot` (health + summary) every 2 s |
231
233
  | `POST` `GET` `DELETE` | `/mcp` | MCP Streamable HTTP endpoint (see [above](#use-the-gateway-as-an-mcp-server-mcp)) |
232
234
 
233
235
  `/health` and `/metrics` are unauthenticated by default; set `auth.protect.health` / `auth.protect.metrics`
@@ -538,10 +540,18 @@ readinessProbe:
538
540
 
539
541
  ## Dashboard
540
542
 
541
- Open `http://localhost:4000/dashboard`. When auth is enabled, paste an API key (or JWT) in the header:
542
- it is kept in the browser tab (`sessionStorage`, or `localStorage` with “remember”) and sent as
543
- `Authorization: Bearer …` on every API call. The page itself contains no data; set `dashboard.enabled: false`
544
- to stop serving it.
543
+ Open `http://localhost:4000/dashboard`. The first visit opens a short guided setup: connect with an API key,
544
+ see the upstream servers, call a tool from a form generated from its JSON schema, and copy a ready-made
545
+ config for Claude Desktop, Cursor, Claude Code, the JS / Kotlin clients or curl. Reopen it any time with the
546
+ **?** button. After that the dashboard shows live request rate, p50 / p95 latency, error rate, top tools,
547
+ usage per key, a live request stream, server health (with reconnect) and the filterable request history.
548
+ It is one static file with no build step and no CDN; English / 中文, dark / light, and it works on phones.
549
+
550
+ ![Dashboard overview](docs/images/dashboard-overview.png)
551
+
552
+ When auth is enabled the key is kept in the browser tab (`sessionStorage`, or `localStorage` with
553
+ “remember”) and sent as `Authorization: Bearer …` on every API call. The page itself contains no data; set
554
+ `dashboard.enabled: false` to stop serving it. See [dashboard/README.md](dashboard/README.md).
545
555
 
546
556
  ## Embed as a Library
547
557
 
@@ -1,27 +1,72 @@
1
1
  # mcp-gateway Dashboard
2
2
 
3
- A lightweight, zero-dependency web dashboard for monitoring your mcp-gateway instance in real time.
3
+ A guided, real-time web dashboard for mcp-gateway. It is **one self-contained file** (`index.html`):
4
+ no build step, no CDN, no runtime dependencies. Charts are hand-drawn SVG.
4
5
 
5
- ## Features
6
-
7
- - Live server status (online / degraded / reconnecting / offline) with next retry and reconnect count
8
- - Tool inventory across all registered servers
9
- - Request log with method, tool name, duration, and HTTP status
10
- - Aggregate metrics: total requests, error rate, average / p95 latency, uptime
11
- - Works with auth enabled: paste an API key or JWT in the header (kept in `sessionStorage`, or `localStorage` with “remember”), sent as `Authorization: Bearer …`
12
- - Auto-refreshes every 10 seconds; manual refresh button available
6
+ ![Overview](../docs/images/dashboard-overview.png)
13
7
 
14
8
  ## Access
15
9
 
16
- When the gateway is running, the dashboard is served at:
17
-
18
10
  ```
19
11
  http://localhost:4000/dashboard
20
12
  ```
21
13
 
22
- It reads data exclusively from the gateway's own REST API (`/api/v1/*`), so no additional backend is needed.
23
- The page itself is a static shell without data; disable it with `dashboard: { enabled: false }`.
14
+ The page itself contains no data. It reads everything from the gateway's own API (`/api/v1/*`), so no extra
15
+ backend is needed. Disable it with `dashboard: { enabled: false }`. Add `?guide` to the URL to force the
16
+ onboarding guide open.
17
+
18
+ ## Guided onboarding
19
+
20
+ Shown on the first visit (and whenever a key is required but missing). Dismiss it with **Skip**, **Esc** or ✕;
21
+ reopen it any time from the **?** button.
22
+
23
+ 1. **Connect**: paste an API key or JWT and test it (leave empty when auth is off).
24
+ 2. **Upstream servers**: what is behind the gateway, with status, transport and tool count.
25
+ 3. **Try a tool**: pick any tool your key may use; a form is generated from its JSON schema (strings, numbers,
26
+ integers, booleans, enums, arrays / objects as JSON, required fields, defaults, descriptions), or switch to
27
+ raw JSON. Call it and see the result.
28
+ 4. **Connect your client**: copy-paste config for Claude Desktop (through `mcp-remote`), Cursor, Claude Code,
29
+ the TypeScript client (`clients/js`), the Kotlin client (`clients/kotlin`) and curl, all pointing at this
30
+ gateway's `/mcp` URL. Snippets use `<YOUR_API_KEY>` unless you choose to insert your key.
31
+
32
+ ## Pages
33
+
34
+ | Page | What it shows |
35
+ |---|---|
36
+ | **Overview** | Requests/min, p50 / p95 / p99 latency, error rate and servers online (with sparklines); request-rate, latency and error-rate charts (5 m – 6 h windows, hover / touch tooltips); top tools; usage per API key; live request stream (pausable); server health |
37
+ | **Servers** | One card per upstream server: status, transport, last ping, tools (click to try one), last error and next retry, **Reconnect** |
38
+ | **Playground** | The same schema-driven tool runner as the guide, with search and *copy as curl* |
39
+ | **History** | `GET /api/v1/requests` with server / tool / client / result / via / kind filters and cursor paging (audit log when enabled) |
40
+ | **Connect** | The client snippets from the guide |
41
+
42
+ ## Live data
43
+
44
+ - `GET /api/v1/events` (Server-Sent Events) pushes every request as it happens plus a health / summary
45
+ snapshot every 2 s. The dashboard reads it with `fetch()` so the API key travels in the `Authorization`
46
+ header (`EventSource` cannot send headers). If the stream is unavailable it polls every 2 s and keeps
47
+ retrying the stream with backoff. The header pill shows **Live**, **Polling** or **Offline**.
48
+ - `GET /api/v1/stats?window=…` provides the time series and breakdowns.
49
+
50
+ See [docs/api-reference.md](../docs/api-reference.md#live-data-dashboard).
51
+
52
+ ## Auth
53
+
54
+ When auth is enabled, the key is kept in the browser tab (`sessionStorage`) or, with “Remember on this device”,
55
+ in `localStorage`, and sent as `Authorization: Bearer …`. Scoped keys only see their own calls and in-scope
56
+ servers and tools.
57
+
58
+ ## Accessibility & UX
59
+
60
+ - English / 中文 toggle (defaults to the browser language), dark / light theme (defaults to the OS setting).
61
+ - Responsive down to phone widths, with a bottom tab bar on small screens; safe-area aware.
62
+ - Keyboard: arrow keys move between tabs, the guide is a focus-trapped modal, **Esc** closes dialogs,
63
+ visible focus rings, a skip link.
64
+ - Respects `prefers-reduced-motion`. Animations only use `transform` / `opacity`; page and theme switches use
65
+ View Transitions where the browser supports them; skeleton loaders while data loads.
24
66
 
25
- ## Screenshot
67
+ ## Screenshots
26
68
 
27
- The dashboard uses a GitHub-dark colour scheme and is fully responsive down to mobile widths.
69
+ | | |
70
+ |---|---|
71
+ | ![Onboarding](../docs/images/dashboard-onboarding-try-tool.png) | ![Playground (中文)](../docs/images/dashboard-playground-zh.png) |
72
+ | ![Light theme](../docs/images/dashboard-overview-light.png) | ![Mobile](../docs/images/dashboard-mobile-zh.png) |