@soroush.design/mcp 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,78 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ interface ComponentRecord {
3
+ /** PascalCase component name, as exported. */
4
+ name: string;
5
+ /** URL segment on docs.soroush.tech. */
6
+ slug: string;
7
+ /** Workspace package the component ships from. */
8
+ pkg: string;
9
+ /** The npm package a consumer installs. */
10
+ packageName: string;
11
+ /** Category in the component taxonomy; markdown components are uncategorized. */
12
+ category?: string;
13
+ /** For a member of a family (`MenuList` of `Menu`), the family - its subpath is the family's. */
14
+ family?: string;
15
+ /** The exact import statement for this component. */
16
+ importPath: string;
17
+ /** First prose sentence of the README - a one-line summary. */
18
+ summary: string;
19
+ /** README prose before the props reference: what it is and how it composes. */
20
+ intro: string;
21
+ /** The props reference: props, token values, defaults. */
22
+ api: string;
23
+ /** The README's `## Examples` section. Empty when absent. */
24
+ examples: string;
25
+ /** Canonical documentation URL. */
26
+ url: string;
27
+ }
28
+ interface DocRecord {
29
+ /** Stable identifier used by the `get_doc` tool. */
30
+ id: string;
31
+ title: string;
32
+ /** One-line description for the doc index. */
33
+ summary: string;
34
+ /** Full markdown (or source code, for the copy-verbatim references). */
35
+ body: string;
36
+ /** Canonical documentation URL, when the doc has a page on the site. */
37
+ url?: string;
38
+ }
39
+ /** One theme scale, flattened to leaf paths so it reads as a token contract. */
40
+ interface TokenScale {
41
+ name: string;
42
+ /** Dotted path within the scale to its value, e.g. `primary.main`. */
43
+ tokens: Array<{
44
+ path: string;
45
+ value: string | number;
46
+ }>;
47
+ }
48
+ interface ContentBundle {
49
+ /** The design-system version the bundle was generated from. */
50
+ version: string;
51
+ components: ComponentRecord[];
52
+ docs: DocRecord[];
53
+ tokens: TokenScale[];
54
+ }
55
+ declare const SERVER_NAME = "soroush-design-system";
56
+ /** Builds the MCP server. Transport-agnostic: stdio and the Worker both use this. */
57
+ declare const createMcpServer: (bundle?: ContentBundle) => McpServer;
58
+ declare const content: ContentBundle;
59
+ /** Case-insensitive component lookup by name or slug. */
60
+ declare const findComponent: (query: string, source?: ContentBundle) => ContentBundle['components'][number] | undefined;
61
+ /** Doc lookup by exact id, case-insensitive. */
62
+ declare const findDoc: (id: string, source?: ContentBundle) => ContentBundle['docs'][number] | undefined;
63
+ interface SearchHit {
64
+ kind: 'component' | 'doc';
65
+ /** Component name or doc id - what to pass to get_component / get_doc. */
66
+ ref: string;
67
+ title: string;
68
+ /** A short excerpt around the first match. */
69
+ snippet: string;
70
+ score: number;
71
+ }
72
+ /**
73
+ * Ranks components and docs against a query. Deliberately simple term scoring - the
74
+ * corpus is a few hundred documents, and hits are meant to be followed by a
75
+ * get_component / get_doc call rather than read in place.
76
+ */
77
+ declare const search: (bundle: ContentBundle, query: string, limit?: number) => SearchHit[];
78
+ export { type ComponentRecord, type ContentBundle, type DocRecord, SERVER_NAME, type SearchHit, type TokenScale, content, createMcpServer, findComponent, findDoc, search };
@@ -0,0 +1,78 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ interface ComponentRecord {
3
+ /** PascalCase component name, as exported. */
4
+ name: string;
5
+ /** URL segment on docs.soroush.tech. */
6
+ slug: string;
7
+ /** Workspace package the component ships from. */
8
+ pkg: string;
9
+ /** The npm package a consumer installs. */
10
+ packageName: string;
11
+ /** Category in the component taxonomy; markdown components are uncategorized. */
12
+ category?: string;
13
+ /** For a member of a family (`MenuList` of `Menu`), the family - its subpath is the family's. */
14
+ family?: string;
15
+ /** The exact import statement for this component. */
16
+ importPath: string;
17
+ /** First prose sentence of the README - a one-line summary. */
18
+ summary: string;
19
+ /** README prose before the props reference: what it is and how it composes. */
20
+ intro: string;
21
+ /** The props reference: props, token values, defaults. */
22
+ api: string;
23
+ /** The README's `## Examples` section. Empty when absent. */
24
+ examples: string;
25
+ /** Canonical documentation URL. */
26
+ url: string;
27
+ }
28
+ interface DocRecord {
29
+ /** Stable identifier used by the `get_doc` tool. */
30
+ id: string;
31
+ title: string;
32
+ /** One-line description for the doc index. */
33
+ summary: string;
34
+ /** Full markdown (or source code, for the copy-verbatim references). */
35
+ body: string;
36
+ /** Canonical documentation URL, when the doc has a page on the site. */
37
+ url?: string;
38
+ }
39
+ /** One theme scale, flattened to leaf paths so it reads as a token contract. */
40
+ interface TokenScale {
41
+ name: string;
42
+ /** Dotted path within the scale to its value, e.g. `primary.main`. */
43
+ tokens: Array<{
44
+ path: string;
45
+ value: string | number;
46
+ }>;
47
+ }
48
+ interface ContentBundle {
49
+ /** The design-system version the bundle was generated from. */
50
+ version: string;
51
+ components: ComponentRecord[];
52
+ docs: DocRecord[];
53
+ tokens: TokenScale[];
54
+ }
55
+ declare const SERVER_NAME = "soroush-design-system";
56
+ /** Builds the MCP server. Transport-agnostic: stdio and the Worker both use this. */
57
+ declare const createMcpServer: (bundle?: ContentBundle) => McpServer;
58
+ declare const content: ContentBundle;
59
+ /** Case-insensitive component lookup by name or slug. */
60
+ declare const findComponent: (query: string, source?: ContentBundle) => ContentBundle['components'][number] | undefined;
61
+ /** Doc lookup by exact id, case-insensitive. */
62
+ declare const findDoc: (id: string, source?: ContentBundle) => ContentBundle['docs'][number] | undefined;
63
+ interface SearchHit {
64
+ kind: 'component' | 'doc';
65
+ /** Component name or doc id - what to pass to get_component / get_doc. */
66
+ ref: string;
67
+ title: string;
68
+ /** A short excerpt around the first match. */
69
+ snippet: string;
70
+ score: number;
71
+ }
72
+ /**
73
+ * Ranks components and docs against a query. Deliberately simple term scoring - the
74
+ * corpus is a few hundred documents, and hits are meant to be followed by a
75
+ * get_component / get_doc call rather than read in place.
76
+ */
77
+ declare const search: (bundle: ContentBundle, query: string, limit?: number) => SearchHit[];
78
+ export { type ComponentRecord, type ContentBundle, type DocRecord, SERVER_NAME, type SearchHit, type TokenScale, content, createMcpServer, findComponent, findDoc, search };