@rsc-kit/mcp 0.24.2 → 0.24.3
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/README.md +23 -5
- package/guides/go.md +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
An MCP server over an [rsc-kit](https://rsc-kit.dev) app: what the build
|
|
4
4
|
decided, and how to build things the way this framework expects.
|
|
5
5
|
|
|
6
|
+
A scaffolded project already has it in `.mcp.json`. To add it by hand:
|
|
7
|
+
|
|
6
8
|
```sh
|
|
7
|
-
claude mcp add rsc-kit -- npx -y @rsc-kit/mcp
|
|
9
|
+
claude mcp add rsc-kit -- bunx @rsc-kit/mcp # or: npx -y @rsc-kit/mcp
|
|
8
10
|
```
|
|
9
11
|
|
|
10
12
|
Point it at a project other than the working directory by passing the path:
|
|
11
13
|
|
|
12
14
|
```sh
|
|
13
|
-
claude mcp add rsc-kit --
|
|
15
|
+
claude mcp add rsc-kit -- bunx @rsc-kit/mcp /path/to/app
|
|
14
16
|
```
|
|
15
17
|
|
|
18
|
+
Any other MCP client takes the same stdio entry: command `bunx` (or `npx`),
|
|
19
|
+
argument `@rsc-kit/mcp`. Run by hand, it waits on stdin for a client, so
|
|
20
|
+
printing nothing is it working.
|
|
21
|
+
|
|
16
22
|
## What it answers
|
|
17
23
|
|
|
18
24
|
**From the last build** — `build-report.json`, which every build writes:
|
|
@@ -25,9 +31,12 @@ claude mcp add rsc-kit -- npx -y @rsc-kit/mcp /path/to/app
|
|
|
25
31
|
**From the guides** — the patterns that differ from Next and plain React in
|
|
26
32
|
ways that compile either way:
|
|
27
33
|
|
|
28
|
-
- `list_topics` / `how_to` — forms, prefetching, validation,
|
|
29
|
-
client, data loading with TanStack Query or SWR, Suspense,
|
|
30
|
-
api routes, authorization, and why a page is
|
|
34
|
+
- `list_topics` / `how_to` — the short answer: forms, prefetching, validation,
|
|
35
|
+
the action client, data loading with TanStack Query or SWR, Suspense,
|
|
36
|
+
offline, PWA, no-javascript, api routes, authorization, and why a page is
|
|
37
|
+
dynamic
|
|
38
|
+
- `list_guides` / `read_guide` / `search_guides` — the full docs guides,
|
|
39
|
+
bundled into the package at build time, so they match the installed version
|
|
31
40
|
|
|
32
41
|
## Notes
|
|
33
42
|
|
|
@@ -38,3 +47,12 @@ is one that can change it while answering a question about it.
|
|
|
38
47
|
Answers come from the last build, and every one of them says how old it is. If
|
|
39
48
|
there has been no build, it says so rather than reporting that there are no
|
|
40
49
|
routes.
|
|
50
|
+
|
|
51
|
+
bunx caches the copy it downloaded first. To pick up a newer release, clear
|
|
52
|
+
that cache:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
rm -rf "$TMPDIR"bunx-*-@rsc-kit
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Docs: https://docs.rsc-kit.dev/guides/mcp
|
package/guides/go.md
CHANGED
|
@@ -57,6 +57,32 @@ The renderer forwards any url its route tree does not own to `RSC_BACKEND`,
|
|
|
57
57
|
so a Go route on that mux — `/login`, a webhook, an upload — is reachable at
|
|
58
58
|
the renderer's origin too.
|
|
59
59
|
|
|
60
|
+
### Running it locally
|
|
61
|
+
|
|
62
|
+
Two processes: the Go program, and Vite, which is the renderer in
|
|
63
|
+
development. Run Go with `RSC_DEBUG=1`, so a failure says where in Go it
|
|
64
|
+
happened:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
RSC_DEBUG=1 go run . # the backend, on 127.0.0.1:8080
|
|
68
|
+
bun run dev # the renderer; open its address
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Never set `RSC_DEBUG` in production: a trace names your files.
|
|
72
|
+
|
|
73
|
+
### Environment variables
|
|
74
|
+
|
|
75
|
+
| Variable | Read by | What it is |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `RSC_BACKEND` | the renderer | Where the Go endpoint is, e.g. `http://127.0.0.1:8080`. Falls back to `APP_URL`. Read from `.env` by `vite`, and from the environment by the built server; the url forwarding is fixed at build time. |
|
|
78
|
+
| `RSC_HOST_CALL_SECRET` | both | The shared secret. The renderer sends it; your Go code passes it to `NewCallbackHandler`. Without it neither side talks. |
|
|
79
|
+
| `RSC_HOST_CALL_PATH` | the renderer | The endpoint's path. Default `/__rsc/host-call`. |
|
|
80
|
+
| `RSC_DEBUG` | Go | `1` sends a failure's trace with its answer. Development only. |
|
|
81
|
+
| `RSC_TRUST_FORWARDED` | the renderer | `1` passes the visitor's `X-Forwarded-For` through to Go. Only behind a proxy you control that writes it. |
|
|
82
|
+
|
|
83
|
+
The Go adapter reads only `RSC_DEBUG` itself. The secret reaches it through
|
|
84
|
+
your code, as above.
|
|
85
|
+
|
|
60
86
|
## Reading from Go
|
|
61
87
|
|
|
62
88
|
Register an ordinary Go function with `Handle`, and its types reach the app:
|
package/package.json
CHANGED