@aitrien/motifspec 1.13.3 → 1.14.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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  Every release of MotifSpec (named brand-codex until 1.10.0), newest first. Entries before 1.10.0 keep the names they were released under. Versions follow the rules in `CONVENTIONS.md`: renaming or removing a semantic token is major, adding tokens, components or icons is minor, and changing a value or fixing a description is a patch. `npm run build` fails if the version in `package.json` has no entry here.
4
4
 
5
+ ## [1.14.0] - 2026-10-28
6
+
7
+ ### Added
8
+ - The MotifSpec MCP server, at `https://mcp.motifspec.com/mcp`, for any AI assistant that supports remote MCP servers. Read-only, no sign-in. Five tools:
9
+ - `get_rules`: the README's rules and what the checker enforces.
10
+ - `find_tokens`: semantic tokens matching a query, with usage rule, CSS property, light and dark values, and the surfaces a colour may sit on.
11
+ - `get_component`: a component's doc with its Hugo partial and Markdown form, or the list.
12
+ - `get_doc`: `docs/hugo.md` or `docs/templates.md`.
13
+ - `check`: the rule checker on a piece of markup, Markdown or CSS.
14
+
15
+ It answers from this release's own files and tells assistants which version it serves. Built with the official MCP SDK (stateless Streamable HTTP, JSON responses).
16
+ - Hosting: AWS Lambda behind an API Gateway HTTP API on the custom domain, rate-limited, defined in `infra/mcp.yml`. The release workflow bundles the server (`npm run mcp:bundle`, about 260 KB), tests the bundle, deploys it with a role GitHub assumes through OIDC (no stored AWS key; only main can use it, and it can only replace the function's code), and checks the live server reports the new version.
17
+ - `npm run test:mcp`, run in CI on the source and on the bundle: calls every tool through the Lambda handler.
18
+ - README: "Using it from an AI assistant", with how to connect Claude, Claude Code, VS Code and others.
19
+
20
+ The npm package is unchanged apart from the version: the server's SDK, zod and esbuild are dev dependencies, and `mcp/` and `infra/` aren't in the package.
21
+
5
22
  ## [1.13.3] - 2026-10-27
6
23
 
7
24
  ### Changed
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MotifSpec
2
2
 
3
- Liam Marshall's design system: the single source of truth for aitrien.com and every project after it. Tokens are [DTCG](https://www.designtokens.org/) JSON, components are documented rules with markup to copy, and one checker holds every project that uses it to those rules.
3
+ Liam Marshall's design system: the single source of truth for aitrien.com and every project after it. Tokens are [DTCG](https://www.designtokens.org/) JSON, components are documented rules with markup to copy, one checker holds every project that uses it to those rules, and an MCP server gives AI assistants all three.
4
4
 
5
5
  ## Principles
6
6
 
@@ -50,6 +50,8 @@ js/codex.js Theme toggle, copy buttons, tooltip dismissal, TOC docking a
50
50
  js/theme-init.js One-line <head> snippet that applies a stored theme before first paint
51
51
  js/plate.js Contour survey generator for the backdrop and the specimen plate: draws the static contours at build time and animates them in the browser
52
52
  showcase/ Source of the system's showcase page
53
+ mcp/ The MCP server (server.mjs), its Lambda handler, bundle step and tests
54
+ infra/mcp.yml The server's AWS stack and deploy role (CloudFormation, applied by hand)
53
55
  hugo.toml, go.mod Hugo module definition and its mounts
54
56
  dist/ Generated: tokens.css, components in codex.css, chroma.css, fonts.css, icons.svg (sprite), tokens.json, tokens.js (ES module export), codex.js and theme-init.js (behaviour), backdrop.html, plate.html and plate.js (backdrop and specimen plate), contrast.md, showcase.html (fragment for publishing), showcase.standalone.html (open locally)
55
57
  ```
@@ -63,6 +65,8 @@ npm run audit # prove dist/showcase.html and the shipped scripts have no raw
63
65
  npm run release:check # what merging this would release, and whether that release is valid
64
66
  npm run pack:check # the npm package has every file the README and package.json promise
65
67
  npm run check -- <dir> # check a project that uses MotifSpec (see below)
68
+ npm run test:mcp # call every MCP tool through the Lambda handler
69
+ npm run mcp:bundle # build/mcp.zip, the server's Lambda package
66
70
  ```
67
71
 
68
72
  `scripts/check.mjs` is the one rule checker: this repo's audit runs it on `layouts/` and the component docs' markup, and projects run it from the version they pin. It checks a project's `layouts/` and `content/` against the release it comes from, and fails on:
@@ -75,7 +79,7 @@ npm run check -- <dir> # check a project that uses MotifSpec (see below)
75
79
 
76
80
  Releases are automatic; `CONVENTIONS.md` (Versioning) says how.
77
81
 
78
- Node 20 or later, no dependencies.
82
+ Node 20 or later. The package has no dependencies; the MCP server's are dev dependencies, bundled into its deployment.
79
83
 
80
84
  ## Using it in Hugo
81
85
 
@@ -109,6 +113,27 @@ npx motifspec-check . --dirs src
109
113
 
110
114
  It reads `.html`, `.jsx`, `.tsx`, `.vue`, `.svelte`, `.astro`, `.md` and `.mdx` (both `class` and `className`), and skips `node_modules`, `dist` and `build`. Its stylesheet rule applies here too: a project using MotifSpec has no CSS of its own.
111
115
 
116
+ ## Using it from an AI assistant
117
+
118
+ The MCP server at `https://mcp.motifspec.com/mcp` serves the latest release to any assistant that supports remote MCP servers. It needs no sign-in and only reads.
119
+
120
+ | Tool | What it returns |
121
+ |---|---|
122
+ | `get_rules` | The rules above, and what the checker enforces |
123
+ | `find_tokens` | Semantic tokens matching a query: CSS property, usage rule, light and dark values, the surfaces a colour may sit on |
124
+ | `get_component` | A component's doc (markup, do and don't, accessibility), with its Hugo partial and Markdown form; without a name, the list |
125
+ | `get_doc` | `docs/hugo.md` or `docs/templates.md` |
126
+ | `check` | The checker's problems in a piece of markup, Markdown or CSS |
127
+
128
+ To connect it:
129
+
130
+ - **Claude (web, desktop):** Customize → Connectors → Add custom connector, with the URL above and "No sign in".
131
+ - **Claude Code:** `claude mcp add --transport http motifspec https://mcp.motifspec.com/mcp`, or a project `.mcp.json`.
132
+ - **VS Code:** add it to `.vscode/mcp.json` with `"type": "http"` and the URL.
133
+ - **Others:** add a remote MCP server by URL.
134
+
135
+ It serves the latest release. A project pinned to an older version can be offered something its version doesn't have yet; its own checker, at its pinned version, catches that.
136
+
112
137
  ## The identity in brief
113
138
 
114
139
  | | |
package/dist/codex.css CHANGED
@@ -2,7 +2,7 @@
2
2
  @font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
3
3
  @font-face { font-family: "Yarndings 12"; src: url("../fonts/yarndings-12-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
4
4
 
5
- /* MotifSpec 1.13.3 — generated from tokens/*.json. Do not edit.
5
+ /* MotifSpec 1.14.0 — generated from tokens/*.json. Do not edit.
6
6
  Themes: semantic colours use light-dark(); color-scheme follows the system unless
7
7
  <html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
8
8
  :root {
package/dist/tokens.css CHANGED
@@ -1,4 +1,4 @@
1
- /* MotifSpec 1.13.3 — generated from tokens/*.json. Do not edit.
1
+ /* MotifSpec 1.14.0 — generated from tokens/*.json. Do not edit.
2
2
  Themes: semantic colours use light-dark(); color-scheme follows the system unless
3
3
  <html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
4
4
  :root {
package/dist/tokens.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated by npm run build. Do not edit.
2
- export const version = "1.13.3";
2
+ export const version = "1.14.0";
3
3
  export const changelog = "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md";
4
4
  export const tokens = [
5
5
  {
package/dist/tokens.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.13.3",
2
+ "version": "1.14.0",
3
3
  "changelog": "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md",
4
4
  "tokens": [
5
5
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aitrien/motifspec",
3
- "version": "1.13.3",
3
+ "version": "1.14.0",
4
4
  "description": "Liam Marshall's design system: DTCG tokens, component rules, generated CSS, Hugo templates and a rule checker.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -60,9 +60,16 @@
60
60
  "audit": "node scripts/audit.mjs",
61
61
  "check": "node scripts/check.mjs",
62
62
  "release:check": "node scripts/release.mjs",
63
- "pack:check": "node scripts/pack-check.mjs"
63
+ "pack:check": "node scripts/pack-check.mjs",
64
+ "test:mcp": "node --test mcp/test.mjs",
65
+ "mcp:bundle": "node mcp/build.mjs"
64
66
  },
65
67
  "engines": {
66
68
  "node": ">=20"
69
+ },
70
+ "devDependencies": {
71
+ "@modelcontextprotocol/sdk": "1.32.2",
72
+ "esbuild": "0.28.2",
73
+ "zod": "4.6.7"
67
74
  }
68
75
  }