@svgrid/mcp 2.6.6 → 2.6.8

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 CHANGED
@@ -1,189 +1,200 @@
1
- <p align="center">
2
- <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
- </p>
4
-
5
- <h1 align="center">@svgrid/mcp</h1>
6
-
7
- <p align="center"><strong>The official Model Context Protocol server for SvGrid.</strong></p>
8
-
9
- <p align="center">
10
- <a href="https://www.npmjs.com/package/@svgrid/mcp"><img src="https://img.shields.io/npm/v/%40svgrid%2Fmcp.svg?label=%40svgrid%2Fmcp" alt="npm version" /></a>
11
- <a href="https://www.npmjs.com/package/@svgrid/mcp"><img src="https://img.shields.io/npm/dm/%40svgrid%2Fmcp.svg" alt="npm downloads" /></a>
12
- <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" /></a>
13
- </p>
14
-
15
- <p align="center">
16
- <a href="https://svgrid.com">Website</a> ·
17
- <a href="https://svgrid.com/docs/help/mcp-server/">Docs</a> ·
18
- <a href="https://svgrid.com/pricing/">Pricing</a>
19
- </p>
20
-
21
- ---
22
-
23
- Point any MCP-capable client - Claude Desktop, Claude Code, Cursor, Zed - at this server and the model answers with **accurate, version-pinned** facts about SvGrid: real prop, method, and event names, plus every demo's source as grounding. No hallucinated APIs, no stale blog posts.
24
-
25
- **Why this beats pasting docs into the chat.** A model working from memory invents plausible SvGrid APIs, because it learned from a mix of other grids and older versions. Pasting docs helps for one question and then falls out of the context window. This server puts the current API surface and 370+ working demo sources one tool call away, for every question, pinned to the version you installed.
26
-
27
- ## Tools exposed
28
-
29
- | Tool | Purpose |
30
- | --- | --- |
31
- | `check_svgrid_code` | **Verify** a file against the real API surface + the Svelte compiler. |
32
- | `list_examples` | Every demo: id, title, and one-line blurb. |
33
- | `get_example_source` | Full `.svelte` source for a demo by id. |
34
- | `list_docs` | Every documentation page (slug + title). |
35
- | `get_doc` | Markdown for a single doc by slug. |
36
- | `search_docs` | Ranked full-text search across the docs. |
37
- | `get_api_reference` | The curated public-API surface, grouped by category. |
38
- | `introspect_source` | Studio: infer an `EntitySchema` from a Drizzle file or sample rows. |
39
- | `scaffold_entity` | Studio: generate SvelteKit files for a single entity. |
40
-
41
- ### `check_svgrid_code` - the one a retrieval server cannot do
42
-
43
- Reading the docs makes a model *likelier* to be right. This makes it *checkable*.
44
- Hand it a file and it answers with line-numbered diagnostics and the exact
45
- replacement for each:
46
-
47
- ```jsonc
48
- {
49
- "ok": false,
50
- "checkedAgainst": "@svgrid/grid@2.6.20",
51
- "compiler": "svelte",
52
- "counts": { "errors": 3, "warnings": 0, "info": 0 },
53
- "diagnostics": [
54
- { "rule": "svgrid/renamed-prop", "severity": "error", "line": 24,
55
- "message": "`rowData` is not a SvGrid prop.", "fix": "Use `data`." },
56
- { "rule": "svgrid/renamed-column-key", "severity": "error", "line": 10,
57
- "message": "`accessorKey` is not a SvGrid column key.", "fix": "Use `field`." },
58
- { "rule": "svelte/legacy-event-directive", "severity": "error", "line": 30,
59
- "message": "`on:rowClick` never fires: SvGrid dispatches no component events, it takes callback props.",
60
- "fix": "Use `onRowClick={...}`." }
61
- ]
62
- }
63
- ```
64
-
65
- What it checks:
66
-
67
- - **Every name, against the installed version.** Importable symbols, `<SvGrid>`
68
- props, `ColumnDef` keys, grid API methods, theme stylesheets. The list is
69
- generated from the package sources at build time, so it cannot drift from
70
- what the package exports, and an unknown name comes back with the nearest
71
- real one.
72
- - **Cross-package mistakes.** A symbol that lives in `@svgrid/enterprise`, or an
73
- api method that only exists after `installEnterprise(api)`.
74
- - **Svelte 5 rules.** `export let` and `$:` in a runes file (compiler errors),
75
- `on:` / `<slot>` / `createEventDispatcher` (deprecations), and a plain `let`
76
- array that gets mutated and silently never re-renders.
77
- - **The file, compiled.** When a Svelte compiler is reachable - the user's
78
- project copy first, then the one shipped here - real parse errors come back
79
- too. The result says which of the two ran in its `compiler` field, so
80
- "no errors" is never mistaken for "this compiles".
81
-
82
- It is tuned to shut up when the code is right: it reports **nothing** across all
83
- 373 demos in this repo, which is what a CI test asserts. A verifier that cries
84
- wolf is worse than none, because a model will happily "fix" working code.
85
-
86
- ### Studio: drive the app model (agent co-designer)
87
-
88
- The `studio_*` tools let an agent build and edit the **same validated project model the visual designer uses** - add entities, screens, blocks, components, wire data sources, theme, RBAC, auth, the typed data layer, and the deploy target - then generate the full runnable app or export the `studio.config.json` the designer can Load. Every edit runs through the model's own functions + `validateProject`, so the agent can't produce an invalid app.
89
-
90
- | Tool | Purpose |
91
- | --- | --- |
92
- | `studio_new_project` / `studio_load_project` | Start fresh, or load an existing `studio.config.json`. |
93
- | `studio_describe_project` / `studio_get_config` | Inspect the model / export it as `studio.config.json`. |
94
- | `studio_capabilities` | List block kinds, component keys, theme presets, data-source kinds, deploy targets. |
95
- | `studio_add_entity` | Add a table/model (+ default screen), by schema or introspection. |
96
- | `studio_add_screen` / `studio_add_block` / `studio_add_component` | Compose screens from data blocks + UI components. |
97
- | `studio_set_entity_source` | Bind an entity to memory / SQL / Supabase / REST / PGlite. |
98
- | `studio_set_theme` / `studio_set_access` / `studio_set_auth` / `studio_set_data_layer` / `studio_set_deploy_target` | Configure app-wide features. |
99
- | `studio_validate` | Report errors + warnings. |
100
- | `studio_generate_app` | Emit every file of the runnable SvelteKit app. |
101
-
102
- A typical session: `studio_new_project` → `studio_add_entity` (×N) → `studio_set_entity_source` → `studio_set_data_layer` → `studio_set_auth` → `studio_generate_app` → write the files and run `svelte-check`.
103
-
104
- ## Two ways to run it
105
-
106
- | | stdio (this package) | remote HTTP |
107
- | --- | --- | --- |
108
- | Install | `npx @svgrid/mcp` | paste a URL |
109
- | Needs Node | yes | no |
110
- | `check_svgrid_code` compiles | yes | static checks only |
111
- | Studio `studio_*` tools | yes (27) | no |
112
- | Works offline | yes | no |
113
-
114
- The remote server lives in [`workers/svgrid-mcp`](../../workers/svgrid-mcp) and
115
- carries the six docs + verification tools. Use stdio when you want the compiler
116
- pass, the Studio tools, or no third-party endpoint in the loop.
117
-
118
- ## Run
119
-
120
- ```bash
121
- # One-shot via npx (no install)
122
- npx @svgrid/mcp
123
-
124
- # Or install globally, then run the bin
125
- npm install -g @svgrid/mcp
126
- svgrid-mcp
127
- ```
128
-
129
- The server speaks MCP over **stdio**: stdout is reserved for JSON-RPC, logs go to stderr.
130
-
131
- ## Connect Claude Desktop
132
-
133
- Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or
134
- `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
135
-
136
- ```json
137
- {
138
- "mcpServers": {
139
- "svgrid": {
140
- "command": "npx",
141
- "args": ["-y", "@svgrid/mcp"]
142
- }
143
- }
144
- }
145
- ```
146
-
147
- Restart Claude Desktop and open a new chat - the tools above are now available.
148
-
149
- ## Connect Claude Code
150
-
151
- ```bash
152
- claude mcp add svgrid -- npx -y @svgrid/mcp
153
- ```
154
-
155
- Then run `/mcp` in a session to confirm `svgrid` is listed. Ask something like
156
- *"using svgrid, build a grid that groups by department and shows a sparkline per row"*
157
- and the model will pull the relevant demo sources before generating code.
158
-
159
- ## Connect Cursor / Zed
160
-
161
- Add the same `mcpServers` block to the editor's MCP configuration:
162
-
163
- ```json
164
- {
165
- "mcpServers": {
166
- "svgrid": { "command": "npx", "args": ["-y", "@svgrid/mcp"] }
167
- }
168
- }
169
- ```
170
-
171
- ## Build from source
172
-
173
- ```bash
174
- cd packages/mcp
175
- pnpm build
176
- node dist/index.js
177
- ```
178
-
179
- `pnpm build` first runs `scripts/build-manifests.mjs`, which reads
180
- `examples/src/demos/*.svelte` and `docs/**/*.md` from the workspace and inlines
181
- them into `src/data.ts`, so the published package is fully self-contained.
182
-
183
- ## Licensing
184
-
185
- MIT - free to run, no license key. Some tools generate SvGrid Studio projects, and Studio itself is
186
- commercial; see [svgrid.com/pricing](https://svgrid.com/pricing/).
187
- The MIT [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid) core is free for any use.
188
-
189
- SvGrid&trade; and sv-grid&trade; are trademarks of jQWidgets Ltd.
1
+ <p align="center">
2
+ <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
+ </p>
4
+
5
+ <h1 align="center">@svgrid/mcp</h1>
6
+
7
+ <p align="center"><strong>The official Model Context Protocol server for SvGrid.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@svgrid/mcp"><img src="https://img.shields.io/npm/v/%40svgrid%2Fmcp.svg?label=%40svgrid%2Fmcp" alt="npm version" /></a>
11
+ <a href="https://www.npmjs.com/package/@svgrid/mcp"><img src="https://img.shields.io/npm/dm/%40svgrid%2Fmcp.svg" alt="npm downloads" /></a>
12
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" /></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://svgrid.com">Website</a> ·
17
+ <a href="https://svgrid.com/docs/help/mcp-server/">Docs</a> ·
18
+ <a href="https://svgrid.com/pricing/">Pricing</a>
19
+ </p>
20
+
21
+ ---
22
+
23
+ Point any MCP-capable client - Claude Desktop, Claude Code, Cursor, Zed - at this server and the model answers with **accurate, version-pinned** facts about SvGrid: real prop, method, and event names, plus every demo's source as grounding. No hallucinated APIs, no stale blog posts.
24
+
25
+ **Why this beats pasting docs into the chat.** A model working from memory invents plausible SvGrid APIs, because it learned from a mix of other grids and older versions. Pasting docs helps for one question and then falls out of the context window. This server puts the current API surface and 370+ working demo sources one tool call away, for every question, pinned to the version you installed.
26
+
27
+ ## Tools exposed
28
+
29
+ | Tool | Purpose |
30
+ | --- | --- |
31
+ | `check_svgrid_code` | **Verify** a file against the real API surface + the Svelte compiler. |
32
+ | `list_examples` | Every demo: id, title, and one-line blurb. |
33
+ | `get_example_source` | Full `.svelte` source for a demo by id. |
34
+ | `list_docs` | Every documentation page (slug + title). |
35
+ | `get_doc` | Markdown for a single doc by slug. |
36
+ | `search_docs` | Ranked full-text search across the docs. |
37
+ | `get_api_reference` | The curated public-API surface, grouped by category. |
38
+ | `introspect_source` | Studio: infer an `EntitySchema` from a Drizzle file or sample rows. |
39
+ | `scaffold_entity` | Studio: generate SvelteKit files for a single entity. |
40
+
41
+ ### `check_svgrid_code` - the one a retrieval server cannot do
42
+
43
+ Reading the docs makes a model *likelier* to be right. This makes it *checkable*.
44
+ Hand it a file and it answers with line-numbered diagnostics and the exact
45
+ replacement for each:
46
+
47
+ ```jsonc
48
+ {
49
+ "ok": false,
50
+ "checkedAgainst": "@svgrid/grid@2.6.20",
51
+ "compiler": "svelte",
52
+ "counts": { "errors": 3, "warnings": 0, "info": 0 },
53
+ "diagnostics": [
54
+ { "rule": "svgrid/renamed-prop", "severity": "error", "line": 24,
55
+ "message": "`rowData` is not a SvGrid prop.", "fix": "Use `data`." },
56
+ { "rule": "svgrid/renamed-column-key", "severity": "error", "line": 10,
57
+ "message": "`accessorKey` is not a SvGrid column key.", "fix": "Use `field`." },
58
+ { "rule": "svelte/legacy-event-directive", "severity": "error", "line": 30,
59
+ "message": "`on:rowClick` never fires: SvGrid dispatches no component events, it takes callback props.",
60
+ "fix": "Use `onRowClick={...}`." }
61
+ ]
62
+ }
63
+ ```
64
+
65
+ What it checks:
66
+
67
+ - **Every name, against the installed version.** Importable symbols, `<SvGrid>`
68
+ props, `ColumnDef` keys, grid API methods, theme stylesheets. The list is
69
+ generated from the package sources at build time, so it cannot drift from
70
+ what the package exports, and an unknown name comes back with the nearest
71
+ real one.
72
+ - **Cross-package mistakes.** A symbol that lives in `@svgrid/enterprise`, or an
73
+ api method that only exists after `installEnterprise(api)`.
74
+ - **Svelte 5 rules.** `export let` and `$:` in a runes file (compiler errors),
75
+ `on:` / `<slot>` / `createEventDispatcher` (deprecations), and a plain `let`
76
+ array that gets mutated and silently never re-renders.
77
+ - **The file, compiled.** When a Svelte compiler is reachable - the user's
78
+ project copy first, then the one shipped here - real parse errors come back
79
+ too. The result says which of the two ran in its `compiler` field, so
80
+ "no errors" is never mistaken for "this compiles".
81
+
82
+ It is tuned to shut up when the code is right: it reports **nothing** across all
83
+ 375 demos in this repo, which is what a CI test asserts. A verifier that cries
84
+ wolf is worse than none, because a model will happily "fix" working code.
85
+
86
+ ### Studio: drive the app model (agent co-designer)
87
+
88
+ The `studio_*` tools let an agent build and edit the **same validated project model the visual designer uses** - add entities, screens, blocks, components, wire data sources, theme, RBAC, auth, the typed data layer, and the deploy target - then generate the full runnable app or export the `studio.config.json` the designer can Load. Every edit runs through the model's own functions + `validateProject`, so the agent can't produce an invalid app.
89
+
90
+ | Tool | Purpose |
91
+ | --- | --- |
92
+ | `studio_new_project` / `studio_load_project` | Start fresh, or load an existing `studio.config.json`. |
93
+ | `studio_describe_project` / `studio_get_config` | Inspect the model / export it as `studio.config.json`. |
94
+ | `studio_capabilities` | List block kinds, component keys, theme presets, data-source kinds, deploy targets. |
95
+ | `studio_add_entity` | Add a table/model (+ default screen), by schema or introspection. |
96
+ | `studio_add_screen` / `studio_add_block` / `studio_add_component` | Compose screens from data blocks + UI components. |
97
+ | `studio_set_entity_source` | Bind an entity to memory / SQL / Supabase / REST / PGlite. |
98
+ | `studio_set_theme` / `studio_set_access` / `studio_set_auth` / `studio_set_data_layer` / `studio_set_deploy_target` | Configure app-wide features. |
99
+ | `studio_validate` | Report errors + warnings. |
100
+ | `studio_generate_app` | Emit every file of the runnable SvelteKit app. |
101
+
102
+ A typical session: `studio_new_project` → `studio_add_entity` (×N) → `studio_set_entity_source` → `studio_set_data_layer` → `studio_set_auth` → `studio_generate_app` → write the files and run `svelte-check`.
103
+
104
+ ## Two ways to run it
105
+
106
+ | | stdio (this package) | remote HTTP |
107
+ | --- | --- | --- |
108
+ | Install | `npx @svgrid/mcp` | `https://mcp.svgrid.com/mcp` |
109
+ | Needs Node | yes | no |
110
+ | `check_svgrid_code` compiles | yes | static checks only |
111
+ | Studio `studio_*` tools | yes (27) | no |
112
+ | Works offline | yes | no |
113
+
114
+ ```bash
115
+ # No install: point any MCP client at the hosted server
116
+ claude mcp add --transport http svgrid https://mcp.svgrid.com/mcp
117
+ ```
118
+
119
+ <p align="center">
120
+ <a href="https://cursor.com/en/install-mcp?name=svgrid&config=eyJ1cmwiOiJodHRwczovL21jcC5zdmdyaWQuY29tL21jcCJ9"><img src="https://img.shields.io/badge/Add%20to-Cursor-000000?logo=cursor&logoColor=white" alt="Add to Cursor" /></a>
121
+ <a href="https://insiders.vscode.dev/redirect/mcp/install?name=svgrid&config=%7B%22name%22%3A%22svgrid%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.svgrid.com%2Fmcp%22%7D"><img src="https://img.shields.io/badge/Add%20to-VS%20Code-0098FF?logo=visualstudiocode&logoColor=white" alt="Add to VS Code" /></a>
122
+ </p>
123
+
124
+ The remote server is live at **https://mcp.svgrid.com/mcp** and carries the six
125
+ docs + verification tools ([source](../../workers/svgrid-mcp)). Use stdio when
126
+ you want the compiler pass, the Studio tools, or no third-party endpoint in the
127
+ loop.
128
+
129
+ ## Run
130
+
131
+ ```bash
132
+ # One-shot via npx (no install)
133
+ npx @svgrid/mcp
134
+
135
+ # Or install globally, then run the bin
136
+ npm install -g @svgrid/mcp
137
+ svgrid-mcp
138
+ ```
139
+
140
+ The server speaks MCP over **stdio**: stdout is reserved for JSON-RPC, logs go to stderr.
141
+
142
+ ## Connect Claude Desktop
143
+
144
+ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or
145
+ `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
146
+
147
+ ```json
148
+ {
149
+ "mcpServers": {
150
+ "svgrid": {
151
+ "command": "npx",
152
+ "args": ["-y", "@svgrid/mcp"]
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ Restart Claude Desktop and open a new chat - the tools above are now available.
159
+
160
+ ## Connect Claude Code
161
+
162
+ ```bash
163
+ claude mcp add svgrid -- npx -y @svgrid/mcp
164
+ ```
165
+
166
+ Then run `/mcp` in a session to confirm `svgrid` is listed. Ask something like
167
+ *"using svgrid, build a grid that groups by department and shows a sparkline per row"*
168
+ and the model will pull the relevant demo sources before generating code.
169
+
170
+ ## Connect Cursor / Zed
171
+
172
+ Add the same `mcpServers` block to the editor's MCP configuration:
173
+
174
+ ```json
175
+ {
176
+ "mcpServers": {
177
+ "svgrid": { "command": "npx", "args": ["-y", "@svgrid/mcp"] }
178
+ }
179
+ }
180
+ ```
181
+
182
+ ## Build from source
183
+
184
+ ```bash
185
+ cd packages/mcp
186
+ pnpm build
187
+ node dist/index.js
188
+ ```
189
+
190
+ `pnpm build` first runs `scripts/build-manifests.mjs`, which reads
191
+ `examples/src/demos/*.svelte` and `docs/**/*.md` from the workspace and inlines
192
+ them into `src/data.ts`, so the published package is fully self-contained.
193
+
194
+ ## Licensing
195
+
196
+ MIT - free to run, no license key. Some tools generate SvGrid Studio projects, and Studio itself is
197
+ commercial; see [svgrid.com/pricing](https://svgrid.com/pricing/).
198
+ The MIT [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid) core is free for any use.
199
+
200
+ SvGrid&trade; and sv-grid&trade; are trademarks of jQWidgets Ltd.