@rsc-kit/mcp 0.41.0 → 0.42.1
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/dist/recipes.js +18 -2
- package/dist/recipes.js.map +1 -1
- package/guides/admin-plugins.md +206 -6
- package/guides/api-routes.md +159 -215
- package/guides/authorization.md +103 -114
- package/guides/backend-answered-pages.md +301 -252
- package/guides/bap-vs-inertia.md +67 -25
- package/guides/blueprints.md +300 -169
- package/guides/bun.md +42 -25
- package/guides/caching.md +46 -49
- package/guides/coming-from-inertia.md +2 -2
- package/guides/commands.md +251 -200
- package/guides/connection.md +50 -54
- package/guides/content-security-policy.md +133 -84
- package/guides/domains.md +190 -149
- package/guides/edge-caching.md +242 -268
- package/guides/emails.md +96 -45
- package/guides/errors.md +116 -137
- package/guides/feature-flags.md +100 -30
- package/guides/file-uploads.md +101 -26
- package/guides/fonts.md +139 -110
- package/guides/forms.md +520 -542
- package/guides/images.md +87 -28
- package/guides/index.json +13 -33
- package/guides/instrumentation.md +134 -95
- package/guides/isr.md +3 -3
- package/guides/live-data-in-production.md +695 -0
- package/guides/live-data.md +170 -839
- package/guides/mcp.md +83 -59
- package/guides/metadata.md +124 -179
- package/guides/navigation.md +118 -147
- package/guides/no-javascript.md +49 -57
- package/guides/offline.md +118 -153
- package/guides/openapi.md +100 -35
- package/guides/pages.md +160 -50
- package/guides/ppr.md +178 -256
- package/guides/pwa.md +270 -216
- package/guides/queries.md +171 -300
- package/guides/react-compiler.md +90 -50
- package/guides/redirects.md +141 -177
- package/guides/response-headers.md +76 -74
- package/guides/route-interception.md +112 -111
- package/guides/routing.md +216 -322
- package/guides/sections.md +63 -66
- package/guides/seo-files.md +127 -65
- package/guides/server-actions.md +285 -357
- package/guides/static-generation.md +131 -199
- package/guides/testing.md +269 -147
- package/guides/third-party-scripts.md +94 -47
- package/guides/typed-routes.md +115 -113
- package/guides/url-validation.md +113 -61
- package/guides/validation.md +53 -62
- package/guides/view-transitions.md +159 -132
- package/guides/where-it-runs.md +226 -162
- package/package.json +2 -2
- package/guides/admin.md +0 -520
- package/guides/deployment.md +0 -598
- package/guides/go.md +0 -539
- package/guides/laravel.md +0 -787
- package/guides/your-own-backend.md +0 -602
package/guides/mcp.md
CHANGED
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
> An MCP server that answers from your actual build, and the AGENTS.md written into every project.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Every project ships with two things for an agent. `AGENTS.md` states the
|
|
6
|
+
rules, and an MCP server answers questions from your actual build:
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
```text title="explain_route /locale"
|
|
9
|
+
/locale — a stored shell, with the rest rendered per request (from the last build, 5 minutes ago)
|
|
10
|
+
Rendered by app/locale/page.
|
|
11
|
+
Ships 85 kB of javascript, gzipped.
|
|
12
|
+
|
|
13
|
+
Why it is not stored whole: cookies(), headers() stream per request; the rest is stored
|
|
14
|
+
```
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
`AGENTS.md` is short on purpose: it sits in an agent's context on every turn.
|
|
17
|
+
The MCP server holds everything that doesn't fit in that budget.
|
|
13
18
|
|
|
14
|
-
## Connecting
|
|
19
|
+
## Connecting the server
|
|
15
20
|
|
|
16
21
|
The scaffold already did. Every project gets a `.mcp.json` at its root:
|
|
17
22
|
|
|
@@ -23,33 +28,54 @@ The scaffold already did. Every project gets a `.mcp.json` at its root:
|
|
|
23
28
|
}
|
|
24
29
|
```
|
|
25
30
|
|
|
26
|
-
On a Node project
|
|
27
|
-
same server, launched by the runtime the project has. The scaffold writes
|
|
31
|
+
On a Node project it is `"command": "npx", "args": ["-y", "@rsc-kit/mcp"]`:
|
|
32
|
+
the same server, launched by the runtime the project has. The scaffold writes
|
|
28
33
|
whichever fits.
|
|
29
34
|
|
|
30
35
|
Claude Code reads that as project-scoped configuration and asks you to approve
|
|
31
36
|
it the first time it starts the server. Nothing is installed until then, and
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
your build and dev server don't change. Commit the file; it is the same for
|
|
38
|
+
everyone on the project.
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
### In an older project
|
|
41
|
+
|
|
42
|
+
`create-rsc-kit init` writes the file, and leaves one that is already there
|
|
43
|
+
alone. Or add it by hand:
|
|
37
44
|
|
|
38
45
|
```sh
|
|
39
46
|
claude mcp add rsc-kit -- bunx @rsc-kit/mcp # or: npx -y @rsc-kit/mcp
|
|
40
47
|
```
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
(or `npx`), argument `@rsc-kit/mcp` — in its own file: `.cursor/mcp.json`
|
|
44
|
-
under `mcpServers`, `.vscode/mcp.json` under `servers`. If a client reports
|
|
45
|
-
the server as unreachable, run the command by hand: `bunx @rsc-kit/mcp`
|
|
46
|
-
waits on stdin for a client, and printing nothing is it working.
|
|
49
|
+
### In another client
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
Any MCP client takes the same entry — a stdio server, command `bunx` (or
|
|
52
|
+
`npx`), argument `@rsc-kit/mcp` — in its own file:
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
```json title=".cursor/mcp.json"
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"rsc-kit": { "command": "bunx", "args": ["@rsc-kit/mcp"] }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```json title=".vscode/mcp.json"
|
|
63
|
+
{
|
|
64
|
+
"servers": {
|
|
65
|
+
"rsc-kit": { "command": "bunx", "args": ["@rsc-kit/mcp"] }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If a client reports the server as unreachable, run the command by hand.
|
|
71
|
+
`bunx @rsc-kit/mcp` waits on stdin for a client, and printing nothing is it
|
|
72
|
+
working.
|
|
73
|
+
|
|
74
|
+
## Asking about your app
|
|
75
|
+
|
|
76
|
+
Every build writes `build-report.json`: the same rows it printed, plus every
|
|
77
|
+
server action and whether a client built it. These tools read it, so nothing
|
|
78
|
+
runs a build or imports your code:
|
|
53
79
|
|
|
54
80
|
| tool | answers |
|
|
55
81
|
| --- | --- |
|
|
@@ -58,21 +84,16 @@ it, so nothing runs a build or imports your code:
|
|
|
58
84
|
| `what_is_dynamic` | the routes that are not stored, with reasons |
|
|
59
85
|
| `heaviest_routes` | what costs the browser most |
|
|
60
86
|
|
|
61
|
-
The reason a page is dynamic is **recorded, not guessed
|
|
87
|
+
The reason a page is dynamic is **recorded, not guessed** — the call that made
|
|
88
|
+
it dynamic is in the answer above. Asked to "make this page faster", an agent
|
|
89
|
+
without it guesses at a cause and edits something.
|
|
62
90
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Why it is not stored whole: cookies(), headers() stream per request; the rest is stored
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
That matters more than it sounds. Asked to "make this page faster", an agent
|
|
72
|
-
without this guesses at a cause and edits something. With it, the call that did
|
|
73
|
-
it is on the screen.
|
|
91
|
+
**Every answer says how old it is.** It reports the last build, and your files
|
|
92
|
+
may have changed since, so `(from the last build, 5 minutes ago)` is on every
|
|
93
|
+
response. With no build at all it says to run one, rather than reporting that
|
|
94
|
+
there are no routes.
|
|
74
95
|
|
|
75
|
-
##
|
|
96
|
+
## Asking about the framework
|
|
76
97
|
|
|
77
98
|
| tool | answers |
|
|
78
99
|
| --- | --- |
|
|
@@ -84,16 +105,16 @@ it is on the screen.
|
|
|
84
105
|
| `search_guides` | every line in the guides mentioning a word, with the guide it is in |
|
|
85
106
|
|
|
86
107
|
`how_to` is the opinionated summary an agent should read first; `read_guide`
|
|
87
|
-
is for when the summary
|
|
108
|
+
is for when the summary isn't enough. Both come from the same source, and the
|
|
88
109
|
guides are copied in at build time, so what an agent reads is what this site
|
|
89
110
|
says for the version it has.
|
|
90
111
|
|
|
91
112
|
These exist because the patterns here differ from Next and plain React **in
|
|
92
|
-
ways that compile either way
|
|
93
|
-
action, a hand-parsed query string, `"use server"` at the top of a page.
|
|
94
|
-
agent that
|
|
113
|
+
ways that compile either way**: a check written in the component instead of
|
|
114
|
+
the action, a hand-parsed query string, `"use server"` at the top of a page.
|
|
115
|
+
An agent that hasn't been told writes those confidently.
|
|
95
116
|
|
|
96
|
-
## The rules
|
|
117
|
+
## The rules in AGENTS.md
|
|
97
118
|
|
|
98
119
|
`bun create rsc-kit` writes an `AGENTS.md`, and `rsc-kit init` adds a section
|
|
99
120
|
to the one you have. It opens with **Rules** - the things an agent gets wrong
|
|
@@ -115,33 +136,30 @@ in ways that compile:
|
|
|
115
136
|
- generated files are never edited; secrets are generated, never committed;
|
|
116
137
|
- ask `how_to` before reaching for a pattern from another framework.
|
|
117
138
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
139
|
+
A Laravel app gets the same rules from its Boost skill, in Laravel's terms.
|
|
140
|
+
|
|
141
|
+
## Keeping AGENTS.md current
|
|
121
142
|
|
|
122
143
|
```sh
|
|
123
144
|
bunx rsc-kit agents # rewrites the rsc-kit section only; review it in git
|
|
124
145
|
```
|
|
125
146
|
|
|
126
|
-
The
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
first is never working from an outdated file. A Laravel app gets the same
|
|
131
|
-
rules from its Boost skill, in Laravel's terms.
|
|
147
|
+
The section is rsc-kit's - between `<!-- rsc-kit:start -->` and
|
|
148
|
+
`<!-- rsc-kit:end -->`, stamped with the version that wrote it - and
|
|
149
|
+
everything around it is yours. The dev server says when the section is older
|
|
150
|
+
than the rsc-kit installed.
|
|
132
151
|
|
|
133
|
-
|
|
152
|
+
An `AGENTS.md` from before the stamp needs `--host` and `--source-dir` once:
|
|
134
153
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
there are no routes.
|
|
154
|
+
```sh
|
|
155
|
+
bunx rsc-kit agents --host bun --source-dir src/app
|
|
156
|
+
```
|
|
139
157
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
158
|
+
One with no section at all is only rewritten with `--replace`. The `rules`
|
|
159
|
+
tool answers the same rules for the installed version, so an agent that reads
|
|
160
|
+
it first is never working from an outdated file.
|
|
143
161
|
|
|
144
|
-
##
|
|
162
|
+
## Reading the docs as markdown
|
|
145
163
|
|
|
146
164
|
Every page on this site is also a markdown file at the same url with
|
|
147
165
|
`index.md` added — `/guides/forms/index.md` — and
|
|
@@ -150,8 +168,14 @@ Every page on this site is also a markdown file at the same url with
|
|
|
150
168
|
server, or one asked about a version other than the one installed, reads
|
|
151
169
|
those. `read_guide` is the same text, offline, at the installed version.
|
|
152
170
|
|
|
153
|
-
##
|
|
171
|
+
## Checking the build report in CI
|
|
154
172
|
|
|
155
173
|
`build-report.json` is an ordinary file. A CI step can assert on it — that
|
|
156
174
|
nothing stopped being prerendered, that no route crossed a size budget — which
|
|
157
175
|
is the check most likely to catch a regression nobody would otherwise see.
|
|
176
|
+
|
|
177
|
+
## Why it is read-only
|
|
178
|
+
|
|
179
|
+
Nothing here edits, builds or deploys. Your agent already has a shell for
|
|
180
|
+
those, and a server that can change a project is one that can change it while
|
|
181
|
+
answering a question about it.
|