@slexkit/mcp 0.2.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/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/data/llms-authoring.txt +44 -0
- package/dist/data/llms-components.txt +669 -0
- package/dist/data/llms-full.txt +6586 -0
- package/dist/data/llms-runtime.txt +1475 -0
- package/dist/data/llms-toolhost.txt +295 -0
- package/dist/data/llms.txt +69 -0
- package/dist/data/slexkit-ai-manifest.json +2922 -0
- package/dist/index.js +621 -0
- package/dist/index.js.map +11 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SlexKit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @slexkit/mcp
|
|
2
|
+
|
|
3
|
+
Read-only MCP server for SlexKit docs, component APIs, examples, and source validation.
|
|
4
|
+
|
|
5
|
+
## Configure
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"mcpServers": {
|
|
10
|
+
"slexkit": {
|
|
11
|
+
"command": "npx",
|
|
12
|
+
"args": ["-y", "@slexkit/mcp"]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The same command shape works in clients such as Codex, Claude Desktop, and other MCP-compatible agent tools:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npx -y @slexkit/mcp
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Tools
|
|
25
|
+
|
|
26
|
+
The server exposes three read-only tools:
|
|
27
|
+
|
|
28
|
+
| Tool | Purpose |
|
|
29
|
+
|------|---------|
|
|
30
|
+
| `slexkitDocs` | Search or fetch generated Markdown docs, including runtime, security, package, ToolHost, and component pages. |
|
|
31
|
+
| `slexkitExamples` | Return component examples or generated templates such as `status`, `calculator`, `toolhost-form`, and `host-integration`. |
|
|
32
|
+
| `slexkitValidate` | Parse Slex source and return diagnostics plus detected component usage. |
|
|
33
|
+
|
|
34
|
+
Example validation request:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"name": "slexkitValidate",
|
|
39
|
+
"arguments": {
|
|
40
|
+
"source": "{ slex: \"0.1\", namespace: \"demo\", layout: { \"text:message\": { text: \"Hello\" } } }"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Successful validation returns structured content similar to:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"ok": true,
|
|
50
|
+
"componentUsage": ["text"]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Invalid source returns `ok: false` plus a SlexKit diagnostic with message, location, and excerpt.
|
|
55
|
+
|
|
56
|
+
## Safety
|
|
57
|
+
|
|
58
|
+
The MCP server is read-only. It serves bundled docs and generated metadata from the package, validates source text, and writes no project files.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# SlexKit Authoring Rules for LLMs
|
|
2
|
+
|
|
3
|
+
SlexKit's agent-readable source is Markdown with explicit `slex` fences. Do not use `.mdx`; `slex` fences are the interactive layer.
|
|
4
|
+
|
|
5
|
+
## Always Do
|
|
6
|
+
|
|
7
|
+
- Emit explicit `slex` fenced code blocks for display-oriented interactive UI.
|
|
8
|
+
- Use a Slex expression envelope: `slex`, `namespace`, `g`, and `layout`.
|
|
9
|
+
- Put mutable state and helper functions in `g`; put component structure in `layout`.
|
|
10
|
+
- Use component keys in `type:identifier` form, such as `card:summary`.
|
|
11
|
+
- Use `$` read-pipes for dynamic props and `on*` write-pipes for event handlers.
|
|
12
|
+
- Include readable Markdown fallback text after the fence.
|
|
13
|
+
- Use secure runtime integration for untrusted or agent-generated source.
|
|
14
|
+
|
|
15
|
+
## Do Not
|
|
16
|
+
|
|
17
|
+
- Do not emit imports, JSX, Svelte, Vue, or project scaffolding inside `slex` fences.
|
|
18
|
+
- Do not ask hosts to scan plain JavaScript, JSON, or untagged code blocks.
|
|
19
|
+
- Do not wrap ordinary status cards or summaries in ToolHost.
|
|
20
|
+
- Do not bypass the sandbox for untrusted source.
|
|
21
|
+
- Do not invent `.mdx` routes for SlexKit docs.
|
|
22
|
+
|
|
23
|
+
## Display UI Example
|
|
24
|
+
|
|
25
|
+
```slex
|
|
26
|
+
{
|
|
27
|
+
slex: "0.1",
|
|
28
|
+
namespace: "release_status",
|
|
29
|
+
g: { done: 3, total: 4 },
|
|
30
|
+
layout: {
|
|
31
|
+
"card:summary": {
|
|
32
|
+
title: "Release status",
|
|
33
|
+
"text:count": { "$text": "g.done + '/' + g.total + ' complete'" },
|
|
34
|
+
"progress:bar": { "$value": "g.done / g.total * 100" }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Fallback:** Release status: 3/4 complete.
|
|
41
|
+
|
|
42
|
+
## ToolHost Boundary
|
|
43
|
+
|
|
44
|
+
Use ToolHost only when the UI must return structured user input to the host, such as confirmations, option lists, or forms. Display-only dashboards, metrics, and status blocks should stay as `slex` fences.
|