@winstonsayno/mcp-gateway 1.0.1 → 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 +11 -0
- package/README.md +14 -4
- package/dashboard/README.md +60 -15
- package/dashboard/index.html +1529 -419
- package/dist/gateway/index.d.ts +1 -0
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +6 -0
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/live.d.ts +85 -0
- package/dist/gateway/live.d.ts.map +1 -0
- package/dist/gateway/live.js +206 -0
- package/dist/gateway/live.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,17 @@ 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
|
+
|
|
12
23
|
## [1.0.1] - 2026-10-07
|
|
13
24
|
|
|
14
25
|
Bug-fix release; no API or configuration changes.
|
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`.
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
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
|
+

|
|
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
|
|
package/dashboard/README.md
CHANGED
|
@@ -1,27 +1,72 @@
|
|
|
1
1
|
# mcp-gateway Dashboard
|
|
2
2
|
|
|
3
|
-
A
|
|
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
|
-
|
|
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
|
+

|
|
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
|
|
23
|
-
|
|
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
|
-
##
|
|
67
|
+
## Screenshots
|
|
26
68
|
|
|
27
|
-
|
|
69
|
+
| | |
|
|
70
|
+
|---|---|
|
|
71
|
+
|  |  |
|
|
72
|
+
|  |  |
|