@wordpress/design-system-mcp 0.5.1 → 0.6.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/README.md +24 -6
- package/build-module/parse-components.mjs +2 -2
- package/build-module/parse-components.mjs.map +2 -2
- package/build-types/parse-components.d.ts +4 -4
- package/build-types/parse-components.d.ts.map +1 -1
- package/build-types/types.d.ts +14 -5
- package/build-types/types.d.ts.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
# WordPress Design System MCP
|
|
1
|
+
# WordPress Design System MCP Server
|
|
2
2
|
|
|
3
|
-
<
|
|
3
|
+
<p class="callout callout-alert">
|
|
4
4
|
This package is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
|
-
</
|
|
5
|
+
</p>
|
|
6
6
|
|
|
7
|
-
An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server for the WordPress Design System. Provides AI
|
|
7
|
+
An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server for the WordPress Design System. Provides AI agents with component documentation, usage examples, and design tokens.
|
|
8
|
+
|
|
9
|
+
By using the MCP server, you can be confident that your AI agents are correctly following the latest design system guidance when asking questions like:
|
|
10
|
+
|
|
11
|
+
- Which components should be used for a given interaction or user interface, like a button or a dropdown
|
|
12
|
+
- How to implement those components in code, following sample code from the design system documentation
|
|
13
|
+
- How to implement new components following the design system styling standards with design tokens
|
|
14
|
+
|
|
15
|
+
Without the MCP server, an AI agent may produce a functional and convincing result, but there's a higher risk that its resources are out-of-date or inaccurate, and it may try to use components which are no longer recommended for use. Since AI agents are unable to read [the WordPress Gutenberg Storybook documentation](https://wordpress.github.io/gutenberg/), the MCP server provides an alternative, machine-readable interface to that same information.
|
|
8
16
|
|
|
9
17
|
## Setup
|
|
10
18
|
|
|
@@ -14,12 +22,16 @@ An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server for t
|
|
|
14
22
|
claude mcp add wordpress-design-system -- npx -y --ignore-scripts --min-release-age=2 @wordpress/design-system-mcp@latest
|
|
15
23
|
```
|
|
16
24
|
|
|
25
|
+
### OpenAI Codex
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
codex mcp add wordpress-design-system -- npx -y --ignore-scripts --min-release-age=2 @wordpress/design-system-mcp@latest
|
|
29
|
+
```
|
|
30
|
+
|
|
17
31
|
### Cursor
|
|
18
32
|
|
|
19
33
|
[](https://cursor.com/en-US/install-mcp?name=wordpress-design-system&config=eyJjb21tYW5kIjoibnB4IC15IC0taWdub3JlLXNjcmlwdHMgLS1taW4tcmVsZWFzZS1hZ2U9MiBAd29yZHByZXNzL2Rlc2lnbi1zeXN0ZW0tbWNwQGxhdGVzdCJ9)
|
|
20
34
|
|
|
21
|
-
Install link: [cursor://anysphere.cursor-deeplink/mcp/install?name=wordpress-design-system&config=eyJjb21tYW5kIjoibnB4IC15IC0taWdub3JlLXNjcmlwdHMgLS1taW4tcmVsZWFzZS1hZ2U9MiBAd29yZHByZXNzL2Rlc2lnbi1zeXN0ZW0tbWNwQGxhdGVzdCJ9](cursor://anysphere.cursor-deeplink/mcp/install?name=wordpress-design-system&config=eyJjb21tYW5kIjoibnB4IC15IC0taWdub3JlLXNjcmlwdHMgLS1taW4tcmVsZWFzZS1hZ2U9MiBAd29yZHByZXNzL2Rlc2lnbi1zeXN0ZW0tbWNwQGxhdGVzdCJ9)
|
|
22
|
-
|
|
23
35
|
### Other (Claude Desktop, VS Code)
|
|
24
36
|
|
|
25
37
|
Add to your MCP client configuration (`mcp.json` or equivalent):
|
|
@@ -40,6 +52,12 @@ Add to your MCP client configuration (`mcp.json` or equivalent):
|
|
|
40
52
|
}
|
|
41
53
|
```
|
|
42
54
|
|
|
55
|
+
Configuration instructions for common clients:
|
|
56
|
+
|
|
57
|
+
- [VSCode](https://code.visualstudio.com/docs/agent-customization/mcp-servers#_configure-the-mcpjson-file)
|
|
58
|
+
- [Claude Desktop](https://modelcontextprotocol.io/docs/develop/connect-local-servers#installing-the-filesystem-server)
|
|
59
|
+
- This guide is for the "filesystem" server, but you can substitute the `mcpServers` entry from the snippet above and the rest of the instructions still apply.
|
|
60
|
+
|
|
43
61
|
## Contributing to this package
|
|
44
62
|
|
|
45
63
|
This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/org/wordpress) and used by [WordPress](https://make.wordpress.org/core/) as well as by the broader JavaScript ecosystem.
|
|
@@ -27,7 +27,7 @@ function parseProps(rawProps) {
|
|
|
27
27
|
// Prefer `raw` when present, as it carries the source-authored type
|
|
28
28
|
// expression a consumer could use directly. Primitives emit only
|
|
29
29
|
// `name`, so fall back if `raw` is not present.
|
|
30
|
-
type: propInfo.
|
|
30
|
+
type: propInfo.type?.raw || propInfo.type?.name || "unknown",
|
|
31
31
|
required: propInfo.required || false,
|
|
32
32
|
description: propInfo.description || "",
|
|
33
33
|
defaultValue: propInfo.defaultValue?.value ?? null
|
|
@@ -66,7 +66,7 @@ function parseComponentDetail(components, name) {
|
|
|
66
66
|
continue;
|
|
67
67
|
}
|
|
68
68
|
const description = component.description || "";
|
|
69
|
-
const props = parseProps(component.
|
|
69
|
+
const props = parseProps(component.reactComponentMeta?.props || {});
|
|
70
70
|
const stories = component.stories || [];
|
|
71
71
|
if (!detail) {
|
|
72
72
|
detail = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/parse-components.ts"],
|
|
4
|
-
"sourcesContent": ["import type {\n\tComponent,\n\tComponentDetail,\n\tComponentProp,\n\tManifestComponent,\n} from './types';\n\n/**\n * Mapping of canonical name to actual exported identifier, keyed by\n * `package:name`. A package's actual exported identifier may be different from\n * the canonical name in the internal implementation that's known to Storybook.\n *\n * Ideally we could derive this from the package's source code, but MCP\n * consumers aren't guaranteed to have these packages installed. Since this\n * is a legacy convention, we expect this list will only ever shrink over time\n * and can eventually be removed.\n */\nconst EXPORT_ALIASES: Record< string, string > = {\n\t'@wordpress/components:ConfirmDialog': '__experimentalConfirmDialog',\n\t'@wordpress/components:InputControl': '__experimentalInputControl',\n\t'@wordpress/components:ItemGroup': '__experimentalItemGroup',\n\t'@wordpress/components:ToggleGroupControl':\n\t\t'__experimentalToggleGroupControl',\n\t'@wordpress/components:TreeGrid': '__experimentalTreeGrid',\n\t'@wordpress/components:Truncate': '__experimentalTruncate',\n};\n\n/**\n * Build the import statement a consumer should use to bring a component into\n * scope under its canonical name. For aliased components, emit an `as` rename\n * so that subsequent code samples (which reference the canonical name) resolve\n * against the actual export.\n *\n * @param name - The canonical component name.\n * @param packageName - The npm package name.\n * @return The import statement as a single-line string.\n */\nfunction buildImportStatement( name: string, packageName: string ): string {\n\tconst exported = EXPORT_ALIASES[ `${ packageName }:${ name }` ];\n\treturn exported\n\t\t? `import { ${ exported } as ${ name } } from '${ packageName }';`\n\t\t: `import { ${ name } } from '${ packageName }';`;\n}\n\n/**\n * Derive the npm package name from the story file path.\n *\n * Manifest paths look like `../packages/<dir>/src/.../index.story.tsx`. We\n * extract `<dir>` and prepend the `@wordpress/` npm namespace. Curation of\n * which components appear in the manifest is handled upstream via Storybook\n * tags, so this only needs to recognize package-shaped paths.\n *\n * @param storyPath - The story file path from the manifest.\n * @return The npm package name, or null for paths outside `packages/*`.\n */\nexport function packageNameFromPath( storyPath: string ): string | null {\n\tconst match = storyPath.match( /\\.\\.\\/packages\\/([^/]+)\\// );\n\treturn match ? `@wordpress/${ match[ 1 ] }` : null;\n}\n\n/**\n * For components exported as a namespace (e.g. `AlertDialog`, with members\n * `AlertDialog.Root`, `AlertDialog.Trigger`, etc.), the manifest lists the\n * primary entry under a dotted name like `AlertDialog.Root`. The canonical\n * name we expose is the top-level identifier a consumer actually imports,\n * which is the portion before the first dot. For simple components (e.g.\n * `Button`), this is a no-op.\n *\n * @param name - The component name from the manifest.\n * @return The top-level importable identifier.\n */\nfunction canonicalComponentName( name: string ): string {\n\treturn name.split( '.', 1 )[ 0 ];\n}\n\n/**\n * Parse props from a component's
|
|
5
|
-
"mappings": ";AAiBA,IAAM,iBAA2C;AAAA,EAChD,uCAAuC;AAAA,EACvC,sCAAsC;AAAA,EACtC,mCAAmC;AAAA,EACnC,4CACC;AAAA,EACD,kCAAkC;AAAA,EAClC,kCAAkC;AACnC;AAYA,SAAS,qBAAsB,MAAc,aAA8B;AAC1E,QAAM,WAAW,eAAgB,GAAI,WAAY,IAAK,IAAK,EAAG;AAC9D,SAAO,WACJ,YAAa,QAAS,OAAQ,IAAK,YAAa,WAAY,OAC5D,YAAa,IAAK,YAAa,WAAY;AAC/C;AAaO,SAAS,oBAAqB,WAAmC;AACvE,QAAM,QAAQ,UAAU,MAAO,2BAA4B;AAC3D,SAAO,QAAQ,cAAe,MAAO,CAAE,CAAE,KAAK;AAC/C;AAaA,SAAS,uBAAwB,MAAuB;AACvD,SAAO,KAAK,MAAO,KAAK,CAAE,EAAG,CAAE;AAChC;AASO,SAAS,WACf,UASkB;AAClB,SAAO,OAAO,QAAS,QAAS,EAC9B,OAAQ,CAAE,CAAE,EAAE,QAAS,MAAO;AAC9B,UAAM,eAAgB,SAAS,eAAe,IAAK,YAAY;AAC/D,WACC,CAAE,YAAY,SAAU,aAAc,KACtC,CAAE,YAAY,SAAU,SAAU;AAAA,EAEpC,CAAE,EACD,IAAK,CAAE,CAAE,UAAU,QAAS,OAAS;AAAA,IACrC,MAAM;AAAA;AAAA;AAAA;AAAA,IAIN,MAAM,SAAS,
|
|
4
|
+
"sourcesContent": ["import type {\n\tComponent,\n\tComponentDetail,\n\tComponentProp,\n\tManifestComponent,\n} from './types';\n\n/**\n * Mapping of canonical name to actual exported identifier, keyed by\n * `package:name`. A package's actual exported identifier may be different from\n * the canonical name in the internal implementation that's known to Storybook.\n *\n * Ideally we could derive this from the package's source code, but MCP\n * consumers aren't guaranteed to have these packages installed. Since this\n * is a legacy convention, we expect this list will only ever shrink over time\n * and can eventually be removed.\n */\nconst EXPORT_ALIASES: Record< string, string > = {\n\t'@wordpress/components:ConfirmDialog': '__experimentalConfirmDialog',\n\t'@wordpress/components:InputControl': '__experimentalInputControl',\n\t'@wordpress/components:ItemGroup': '__experimentalItemGroup',\n\t'@wordpress/components:ToggleGroupControl':\n\t\t'__experimentalToggleGroupControl',\n\t'@wordpress/components:TreeGrid': '__experimentalTreeGrid',\n\t'@wordpress/components:Truncate': '__experimentalTruncate',\n};\n\n/**\n * Build the import statement a consumer should use to bring a component into\n * scope under its canonical name. For aliased components, emit an `as` rename\n * so that subsequent code samples (which reference the canonical name) resolve\n * against the actual export.\n *\n * @param name - The canonical component name.\n * @param packageName - The npm package name.\n * @return The import statement as a single-line string.\n */\nfunction buildImportStatement( name: string, packageName: string ): string {\n\tconst exported = EXPORT_ALIASES[ `${ packageName }:${ name }` ];\n\treturn exported\n\t\t? `import { ${ exported } as ${ name } } from '${ packageName }';`\n\t\t: `import { ${ name } } from '${ packageName }';`;\n}\n\n/**\n * Derive the npm package name from the story file path.\n *\n * Manifest paths look like `../packages/<dir>/src/.../index.story.tsx`. We\n * extract `<dir>` and prepend the `@wordpress/` npm namespace. Curation of\n * which components appear in the manifest is handled upstream via Storybook\n * tags, so this only needs to recognize package-shaped paths.\n *\n * @param storyPath - The story file path from the manifest.\n * @return The npm package name, or null for paths outside `packages/*`.\n */\nexport function packageNameFromPath( storyPath: string ): string | null {\n\tconst match = storyPath.match( /\\.\\.\\/packages\\/([^/]+)\\// );\n\treturn match ? `@wordpress/${ match[ 1 ] }` : null;\n}\n\n/**\n * For components exported as a namespace (e.g. `AlertDialog`, with members\n * `AlertDialog.Root`, `AlertDialog.Trigger`, etc.), the manifest lists the\n * primary entry under a dotted name like `AlertDialog.Root`. The canonical\n * name we expose is the top-level identifier a consumer actually imports,\n * which is the portion before the first dot. For simple components (e.g.\n * `Button`), this is a no-op.\n *\n * @param name - The component name from the manifest.\n * @return The top-level importable identifier.\n */\nfunction canonicalComponentName( name: string ): string {\n\treturn name.split( '.', 1 )[ 0 ];\n}\n\n/**\n * Parse props from a component's `reactComponentMeta` data, filtering out\n * deprecated and ignored props.\n *\n * @param rawProps - The component meta props record.\n * @return Parsed props with deprecated entries removed.\n */\nexport function parseProps(\n\trawProps: Record<\n\t\tstring,\n\t\t{\n\t\t\trequired?: boolean;\n\t\t\ttype?: { name: string; raw?: string };\n\t\t\tdescription?: string;\n\t\t\tdefaultValue?: { value: string } | null;\n\t\t}\n\t>\n): ComponentProp[] {\n\treturn Object.entries( rawProps )\n\t\t.filter( ( [ , propInfo ] ) => {\n\t\t\tconst description = ( propInfo.description || '' ).toLowerCase();\n\t\t\treturn (\n\t\t\t\t! description.includes( '@deprecated' ) &&\n\t\t\t\t! description.includes( '@ignore' )\n\t\t\t);\n\t\t} )\n\t\t.map( ( [ propName, propInfo ] ) => ( {\n\t\t\tname: propName,\n\t\t\t// Prefer `raw` when present, as it carries the source-authored type\n\t\t\t// expression a consumer could use directly. Primitives emit only\n\t\t\t// `name`, so fall back if `raw` is not present.\n\t\t\ttype: propInfo.type?.raw || propInfo.type?.name || 'unknown',\n\t\t\trequired: propInfo.required || false,\n\t\t\tdescription: propInfo.description || '',\n\t\t\tdefaultValue: propInfo.defaultValue?.value ?? null,\n\t\t} ) );\n}\n\n/**\n * Parse manifest components into a flat list sorted alphabetically by name.\n * When a component is defined across multiple story files (e.g. a companion\n * file documenting a specific aspect), it is collapsed to a single entry keyed\n * by its canonical name and package.\n *\n * @param components - The manifest components record.\n * @return Flat list of components derived from the manifest.\n */\nexport function parseComponents(\n\tcomponents: Record< string, ManifestComponent >\n): Component[] {\n\tconst byKey = new Map< string, Component >();\n\n\tfor ( const component of Object.values( components ) ) {\n\t\tconst packageName = packageNameFromPath( component.path );\n\t\tif ( ! packageName ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst name = canonicalComponentName( component.name );\n\t\tconst key = `${ packageName }:${ name }`;\n\t\tconst existing = byKey.get( key );\n\t\tconst description = component.description || '';\n\n\t\tif ( ! existing ) {\n\t\t\tbyKey.set( key, { name, description, packageName } );\n\t\t} else {\n\t\t\t// Prefer a non-empty description from a later entry over an\n\t\t\t// empty one from the first.\n\t\t\texisting.description ||= description;\n\t\t}\n\t}\n\n\treturn Array.from( byKey.values() ).sort( ( a, b ) =>\n\t\ta.name.localeCompare( b.name )\n\t);\n}\n\n/**\n * Find a single component by name (case-insensitive) and return its full\n * detail including props and stories. When a component is spread across\n * multiple story files, stories from every contributing file are collected\n * in manifest order. Descriptions and props are also authored on the component\n * itself, so in principle they should be identical across story files; in\n * practice one file may omit them, so we prefer any non-empty value found.\n *\n * @param components - The manifest components record.\n * @param name - The component name to look up.\n * @return The component detail, or null if not found.\n */\nexport function parseComponentDetail(\n\tcomponents: Record< string, ManifestComponent >,\n\tname: string\n): ComponentDetail | null {\n\tlet detail: ComponentDetail | null = null;\n\n\tfor ( const component of Object.values( components ) ) {\n\t\tconst canonicalName = canonicalComponentName( component.name );\n\t\tif ( canonicalName.toLowerCase() !== name.toLowerCase() ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst pkg = packageNameFromPath( component.path );\n\t\tif ( ! pkg ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst description = component.description || '';\n\t\tconst props = parseProps( component.reactComponentMeta?.props || {} );\n\t\tconst stories = component.stories || [];\n\n\t\tif ( ! detail ) {\n\t\t\tdetail = {\n\t\t\t\tname: canonicalName,\n\t\t\t\tdescription,\n\t\t\t\tpackageName: pkg,\n\t\t\t\timportStatement: buildImportStatement( canonicalName, pkg ),\n\t\t\t\tprops,\n\t\t\t\tstories: [ ...stories ],\n\t\t\t};\n\t\t} else if ( detail.packageName === pkg ) {\n\t\t\tdetail.description ||= description;\n\t\t\tif ( detail.props.length === 0 ) {\n\t\t\t\tdetail.props = props;\n\t\t\t}\n\t\t\tdetail.stories.push( ...stories );\n\t\t}\n\t}\n\n\treturn detail;\n}\n"],
|
|
5
|
+
"mappings": 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{ Component, ComponentDetail, ComponentProp, ManifestComponent } fro
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function packageNameFromPath(storyPath: string): string | null;
|
|
14
14
|
/**
|
|
15
|
-
* Parse props from a component's
|
|
15
|
+
* Parse props from a component's `reactComponentMeta` data, filtering out
|
|
16
16
|
* deprecated and ignored props.
|
|
17
17
|
*
|
|
18
|
-
* @param rawProps - The
|
|
18
|
+
* @param rawProps - The component meta props record.
|
|
19
19
|
* @return Parsed props with deprecated entries removed.
|
|
20
20
|
*/
|
|
21
21
|
export declare function parseProps(rawProps: Record<string, {
|
|
22
22
|
required?: boolean;
|
|
23
|
-
|
|
23
|
+
type?: {
|
|
24
24
|
name: string;
|
|
25
25
|
raw?: string;
|
|
26
26
|
};
|
|
27
27
|
description?: string;
|
|
28
28
|
defaultValue?: {
|
|
29
29
|
value: string;
|
|
30
|
-
};
|
|
30
|
+
} | null;
|
|
31
31
|
}>): ComponentProp[];
|
|
32
32
|
/**
|
|
33
33
|
* Parse manifest components into a flat list sorted alphabetically by name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-components.d.ts","sourceRoot":"","sources":["../src/parse-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,EACT,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,MAAM,SAAS,CAAC;AAuCjB;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAE,SAAS,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAGtE;AAiBD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACzB,QAAQ,EAAE,MAAM,CACf,MAAM,EACN;IACC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"parse-components.d.ts","sourceRoot":"","sources":["../src/parse-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,EACT,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,MAAM,SAAS,CAAC;AAuCjB;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAE,SAAS,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAGtE;AAiBD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACzB,QAAQ,EAAE,MAAM,CACf,MAAM,EACN;IACC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACxC,CACD,GACC,aAAa,EAAE,CAmBjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC9B,UAAU,EAAE,MAAM,CAAE,MAAM,EAAE,iBAAiB,CAAE,GAC7C,SAAS,EAAE,CA0Bb;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CACnC,UAAU,EAAE,MAAM,CAAE,MAAM,EAAE,iBAAiB,CAAE,EAC/C,IAAI,EAAE,MAAM,GACV,eAAe,GAAG,IAAI,CAqCxB"}
|
package/build-types/types.d.ts
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface ManifestComponent {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
stories?: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
snippet?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}>;
|
|
11
|
+
reactComponentMeta?: {
|
|
4
12
|
description?: string;
|
|
5
13
|
displayName?: string;
|
|
14
|
+
exportName?: string;
|
|
6
15
|
props?: Record<string, {
|
|
7
16
|
required?: boolean;
|
|
8
|
-
|
|
17
|
+
type?: {
|
|
9
18
|
name: string;
|
|
10
19
|
raw?: string;
|
|
11
20
|
};
|
|
12
21
|
description?: string;
|
|
13
22
|
defaultValue?: {
|
|
14
23
|
value: string;
|
|
15
|
-
};
|
|
24
|
+
} | null;
|
|
16
25
|
}>;
|
|
17
26
|
};
|
|
18
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,CAAE,CAAC;IACJ,kBAAkB,CAAC,EAAE;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CACb,MAAM,EACN;YACC,QAAQ,CAAC,EAAE,OAAO,CAAC;YACnB,IAAI,CAAC,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,GAAG,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YACtC,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,YAAY,CAAC,EAAE;gBAAE,KAAK,EAAE,MAAM,CAAA;aAAE,GAAG,IAAI,CAAC;SACxC,CACD,CAAC;KACF,CAAC;CACF;AAED,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,OAAO,EAAE,KAAK,CAAE;QACf,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,CAAE,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/design-system-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "MCP server for the WordPress Design System.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -46,11 +46,10 @@
|
|
|
46
46
|
"zod": "^4.3.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/jest": "^29.5.14"
|
|
50
|
-
"storybook": "^10.2.8"
|
|
49
|
+
"@types/jest": "^29.5.14"
|
|
51
50
|
},
|
|
52
51
|
"publishConfig": {
|
|
53
52
|
"access": "public"
|
|
54
53
|
},
|
|
55
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "0e7112a4f4fde4ea15bd9060489b8f6fe11eb6ca"
|
|
56
55
|
}
|