You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/mcp/README.md
+42-75Lines changed: 42 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,55 +2,30 @@
2
2
3
3
`@salt-ds/mcp` is a publishable MCP server package for Salt Design System runtime use cases.
4
4
5
-
It builds a machine-readable registry from Salt source material and is presented as a single MCP server with a consumer-first default experience.
5
+
It builds a machine-readable registry from Salt source material and serves it through a single MCP server with a compact, workflow-oriented public interface.
6
6
7
-
## Default Consumer Workflows
7
+
## Public Tool Surface
8
8
9
-
These are the primary tools to surface in docs, prompts, and demos:
9
+
The server now exposes six workflow tools:
10
10
11
11
-`discover_salt`
12
-
- Route a broad Salt question to the best starting point, with clarifying questions when the intent is still ambiguous.
13
-
-`recommend_component`
14
-
- Choose the right Salt primitive from a user need, with opt-in starter code and shipping/a11y filters.
15
-
-`get_composition_recipe`
16
-
- Assemble a common Salt flow or pattern correctly, with opt-in starter code and shipping/a11y filters.
17
-
-`get_component`
18
-
- Look up a specific component once the name is known.
19
-
-`get_examples`
20
-
- Find implementation examples with a best example, nearby variants, and scenario hints.
21
-
-`get_foundation`
22
-
- Look up typography, spacing, density, size, and responsiveness guidance, with opt-in starter scaffolds.
23
-
-`recommend_tokens`
24
-
- Find the right design tokens from styling intent.
25
-
-`recommend_fix_recipes`
26
-
- Turn code issues into actionable Salt remediation steps.
27
-
-`compare_versions`
28
-
- Understand upgrade impact between versions.
29
-
-`search_salt_docs`
30
-
- General escape hatch when the caller is not sure where to start.
31
-
32
-
## Additional Tools
33
-
34
-
These stay available in the same server but are not the primary consumer starting points:
35
-
36
-
-`list_salt_catalog`
37
-
-`get_package`
38
-
-`get_guide`
39
-
-`list_foundations`
40
-
-`get_page`
41
-
-`get_changes`
42
-
-`get_icon`
43
-
-`get_icons`
44
-
-`get_country_symbol`
45
-
-`get_country_symbols`
46
-
-`get_pattern`
47
-
-`get_token`
48
-
-`search_api_surface`
49
-
-`search_component_capabilities`
50
-
-`get_related_entities`
51
-
-`compare_options`
52
-
-`suggest_migration`
53
-
-`validate_salt_usage`
12
+
- Use this for broad, ambiguous, or exploratory Salt requests.
13
+
- It searches, clarifies intent, and routes to the next best Salt workflow.
14
+
- Do not use it when the caller already wants a direct recommendation or a known-entity lookup.
15
+
-`choose_salt_solution`
16
+
- Use this for recommendation or side-by-side comparison.
17
+
- If `names` is present, comparison mode wins. Otherwise `query` drives recommendation mode.
18
+
-`get_salt_entity`
19
+
- Use this for known or near-known Salt entity lookup.
20
+
- It resolves specific or almost-specific components, patterns, foundations, tokens, guides, pages, packages, icons, and country symbols.
21
+
- Do not use it for broad discovery or recommendation/comparison.
22
+
-`get_salt_examples`
23
+
- Find the best implementation example and nearby variants for a component or pattern.
24
+
- Can return lightweight starter snippets when Salt already has a corresponding starter path.
25
+
-`analyze_salt_code`
26
+
- Analyze existing React and Salt code with AST-based validation, version-aware deprecation checks, fix guidance, and migration suggestions.
27
+
-`compare_salt_versions`
28
+
- Explain upgrade impact between versions, highlight breaking changes, and suggest the next actions.
54
29
55
30
## Usage
56
31
@@ -73,13 +48,13 @@ Build the package from the repo:
73
48
yarn workspace @salt-ds/mcp build
74
49
```
75
50
76
-
Generate registry artifacts from repo sources with the repo-only maintainer script:
51
+
Generate registry artifacts from repo sources with the maintainer script:
- Salt MCP is intentionally a single-server setup. The simplification is in the recommended workflow and documentation, not in separate profiles or install modes.
94
-
- The main consumer tools are compact by default and optimized for decision-making. Use `view: "full"` on tools like `discover_salt`, `get_component`, `get_examples`, `get_foundation`, `recommend_component`, `get_composition_recipe`, `compare_versions`, `recommend_tokens`, and `recommend_fix_recipes` when you want the richer evidence.
95
-
-`discover_salt` can return structured `clarifying_questions` when a broad query still needs consumer decisions such as single vs multi-select or design guidance vs implementation help.
96
-
-`recommend_component`, `get_composition_recipe`, and `get_foundation` can return opt-in `starter_code` scaffolds that stay lightweight enough for MCP and avoid turning the server into a workflow skill. Where registry examples exist, the starter payload also includes an example-derived snippet.
97
-
- Consumer recommendation tools support filters like `production_ready`, `prefer_stable`, `a11y_required`, and `form_field_support` to bias toward ship-ready guidance.
98
-
- Consumer-facing tools now bias toward a decision-first shape with `best_example`, `caveats`, `ship_check`, and `suggested_follow_ups` fields before exposing raw scoring details.
99
-
- Tool responses are compact by default to reduce token usage.
68
+
- Salt MCP stays intentionally single-server. The simplification is in the public tool contract, not in server splitting.
69
+
- Public tool responses are compact by default and decision-first. Use `view: "full"` when you need richer evidence.
-`choose_salt_solution`: recommendation or comparison.
76
+
-`get_salt_entity`: known or near-known lookup.
77
+
-`analyze_salt_code` absorbs validation, fix recipes, and migration guidance while preserving AST-based analysis and version-aware checks.
78
+
-`compare_salt_versions` supports both explicit version-to-version comparison and open-ended history mode when `to_version` is omitted.
79
+
- Starter scaffolds stay intentionally lightweight to keep the MCP focused on guidance instead of turning into a workflow engine.
100
80
- Tool responses include a top-level `sources` array that normalizes site routes to absolute URLs while preserving local repo paths for debugging.
101
-
-`get_changes` exposes changelog-derived package and component history for AI-friendly "what changed?" lookups.
102
-
-`list_salt_catalog` provides a browse-first catalog view when the consumer does not know the exact Salt name yet, including country symbols alongside icons and docs-backed entities.
103
-
-`get_guide` exposes structured setup and theming guidance sourced from the Salt docs.
104
-
-`list_foundations` and `get_foundation` expose foundations as a first-class consumer entry point instead of requiring generic page lookup.
105
-
- Icon search metadata is sourced from the same synonym dataset used by the site icon preview.
106
-
- Country symbol search metadata is sourced from `@salt-ds/countries` generated country metadata and includes both circle and sharp exports.
107
81
- The published package serves the bundled registry by default. `--registry-dir` is only needed for local development or testing against a custom registry build.
108
82
- Registry generation is a repo-only build step. The published CLI only supports serving the bundled registry.
109
-
- Use the package bin entrypoint (`bin/salt-mcp.js` or installed `salt-mcp`) when launching the CLI. `dist-cjs/cli.js` exports `runCli` but is not a direct executable.
110
-
- Use `view: "full"` or `include` fields on relevant tools to request expanded payloads.
111
-
- The default consumer workflow is centered on ten tools: `discover_salt`, `recommend_component`, `get_composition_recipe`, `get_component`, `get_examples`, `get_foundation`, `recommend_tokens`, `recommend_fix_recipes`, `compare_versions`, and `search_salt_docs`.
112
-
-`search_api_surface` is intended for more technical questions such as “which components support validationStatus?” or “what props are deprecated?”
113
-
-`recommend_tokens` and `get_related_entities` support discovery flows that start from styling intent or a nearby Salt entity instead of an exact API name.
114
-
-`compare_options` supports structured side-by-side comparison for close Salt choices such as `Button` vs `Link` or one pattern versus another.
115
-
-`recommend_fix_recipes` exposes consumer-facing remediation on top of the raw registry and code-analysis tools.
116
-
-`validate_salt_usage` uses AST-based React analysis and supports version-aware deprecation checks via `package_version`.
83
+
- The MCP handshake advertises the `@salt-ds/mcp` runtime version. Treat that separately from the Salt registry version and `generated_at` timestamp used for content metadata.
117
84
118
85
## Maintainer Notes
119
86
120
-
- Registry artifact filenames and payload keys are centralized in [`src/registry/artifacts.ts`](./src/registry/artifacts.ts). Update that file first when adding or renaming a generated artifact.
87
+
- Registry artifact filenames and payload keys are centralized in [`src/registry/artifacts.ts`](./src/registry/artifacts.ts).
121
88
- Runtime loading lives in [`src/registry/loadRegistry.ts`](./src/registry/loadRegistry.ts). Registry build output is assembled in [`src/build/buildRegistry.ts`](./src/build/buildRegistry.ts).
122
-
- MCP tool metadata is defined in [`src/tools/toolDefinitions.ts`](./src/tools/toolDefinitions.ts). The server registration layer in [`src/server/createServer.ts`](./src/server/createServer.ts)is intentionally thin.
123
-
-Reusable lookup/ambiguity behavior for `get_*` tools lives in [`src/tools/lookupResolver.ts`](./src/tools/lookupResolver.ts).
89
+
- MCP tool metadata is defined in [`src/tools/toolDefinitions.ts`](./src/tools/toolDefinitions.ts). The server registration layer in [`src/server/createServer.ts`](./src/server/createServer.ts)stays intentionally thin, with runtime-vs-registry version metadata centralized in [`src/server/serverMetadata.ts`](./src/server/serverMetadata.ts).
90
+
-Lookup, recommendation, search, and code-analysis helpers still live in `src/tools/` as internal building blocks. The public surface is the curated six-tool set above.
124
91
- The main test entry points are:
125
-
-[`src/__tests__/tools.spec.ts`](./src/__tests__/tools.spec.ts) for catalog/query tools
126
-
-[`src/__tests__/codeAnalysisTools.spec.ts`](./src/__tests__/codeAnalysisTools.spec.ts) for AST-based code analysis tools
127
-
-[`src/__tests__/registry.integration.spec.ts`](./src/__tests__/registry.integration.spec.ts) for generated-registry integration
0 commit comments