@primer/mcp 0.0.3 → 0.0.5
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/dist/index.js +10 -1
- package/dist/primer.d.ts.map +1 -1
- package/dist/primitives.d.ts +65 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/{server-BdIvJFTO.js → server-BzATDQ5A.js} +190 -117
- package/dist/server-Ccnupv1s.js +718 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/stdio.js +10 -1
- package/package.json +9 -9
- package/src/primer.ts +21 -1
- package/src/primitives.ts +103 -0
- package/src/server.ts +103 -422
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,yCAAyC,CAAA;AASjE,QAAA,MAAM,MAAM,WAGV,CAAA;AAoqBF,OAAO,EAAC,MAAM,EAAC,CAAA"}
|
package/dist/stdio.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
-
import { s as server } from './server-
|
|
2
|
+
import { s as server } from './server-Ccnupv1s.js';
|
|
3
3
|
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import 'cheerio';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'turndown';
|
|
7
7
|
import '@primer/react/generated/components.json' with { type: 'json' };
|
|
8
8
|
import '@primer/octicons/build/data.json' with { type: 'json' };
|
|
9
|
+
import '@primer/primitives/dist/docs/base/motion/motion.json' with { type: 'json' };
|
|
10
|
+
import '@primer/primitives/dist/docs/base/size/size.json' with { type: 'json' };
|
|
11
|
+
import '@primer/primitives/dist/docs/base/typography/typography.json' with { type: 'json' };
|
|
12
|
+
import '@primer/primitives/dist/docs/functional/size/border.json' with { type: 'json' };
|
|
13
|
+
import '@primer/primitives/dist/docs/functional/size/size-coarse.json' with { type: 'json' };
|
|
14
|
+
import '@primer/primitives/dist/docs/functional/size/size-fine.json' with { type: 'json' };
|
|
15
|
+
import '@primer/primitives/dist/docs/functional/size/size.json' with { type: 'json' };
|
|
16
|
+
import '@primer/primitives/dist/docs/functional/themes/light.json' with { type: 'json' };
|
|
17
|
+
import '@primer/primitives/dist/docs/functional/typography/typography.json' with { type: 'json' };
|
|
9
18
|
|
|
10
19
|
const transport = new StdioServerTransport();
|
|
11
20
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/mcp",
|
|
3
3
|
"description": "An MCP server that connects AI tools to the Primer Design System",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mcp": "./bin/mcp.js"
|
|
@@ -29,29 +29,29 @@
|
|
|
29
29
|
"watch": "rollup -c -w"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/runtime": "^7.28.
|
|
32
|
+
"@babel/runtime": "^7.28.4",
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
34
34
|
"@primer/octicons": "^19.15.5",
|
|
35
35
|
"@primer/primitives": "10.x || 11.x",
|
|
36
|
-
"@primer/react": "^
|
|
36
|
+
"@primer/react": "^38.0.0-rc.3",
|
|
37
37
|
"cheerio": "^1.0.0",
|
|
38
38
|
"turndown": "^7.2.0",
|
|
39
39
|
"zod": "^3.23.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@babel/core": "^7.
|
|
43
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
44
|
-
"@babel/preset-env": "^7.
|
|
42
|
+
"@babel/core": "^7.28.4",
|
|
43
|
+
"@babel/plugin-transform-runtime": "^7.28.3",
|
|
44
|
+
"@babel/preset-env": "^7.28.3",
|
|
45
45
|
"@babel/preset-typescript": "^7.27.1",
|
|
46
|
-
"@modelcontextprotocol/inspector": "^0.
|
|
46
|
+
"@modelcontextprotocol/inspector": "^0.16.6",
|
|
47
47
|
"@rollup/plugin-babel": "^6.0.4",
|
|
48
48
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
49
49
|
"@rollup/plugin-json": "^6.1.0",
|
|
50
50
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
51
51
|
"@types/turndown": "^5.0.5",
|
|
52
52
|
"rimraf": "^6.0.1",
|
|
53
|
-
"rollup": "^4.
|
|
53
|
+
"rollup": "^4.50.1",
|
|
54
54
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
55
|
-
"typescript": "^5.
|
|
55
|
+
"typescript": "^5.9.2"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/src/primer.ts
CHANGED
|
@@ -8,12 +8,32 @@ type Component = {
|
|
|
8
8
|
slug: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
function idToSlug(id: string): string {
|
|
12
|
+
if (id === 'actionbar') {
|
|
13
|
+
return 'action-bar'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (id === 'tooltip-v2') {
|
|
17
|
+
return 'tooltip'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (id === 'dialog_v2') {
|
|
21
|
+
return 'dialog'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (id.startsWith('skeleton')) {
|
|
25
|
+
return 'skeleton-loaders'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return id.replaceAll('_', '-')
|
|
29
|
+
}
|
|
30
|
+
|
|
11
31
|
const components: Array<Component> = Object.entries(componentsMetadata.components).map(([id, component]) => {
|
|
12
32
|
return {
|
|
13
33
|
id,
|
|
14
34
|
name: component.name,
|
|
15
35
|
importPath: component.importPath,
|
|
16
|
-
slug: id
|
|
36
|
+
slug: idToSlug(id),
|
|
17
37
|
}
|
|
18
38
|
})
|
|
19
39
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import baseMotion from '@primer/primitives/dist/docs/base/motion/motion.json' with {type: 'json'}
|
|
2
|
+
import baseSize from '@primer/primitives/dist/docs/base/size/size.json' with {type: 'json'}
|
|
3
|
+
import baseTypography from '@primer/primitives/dist/docs/base/typography/typography.json' with {type: 'json'}
|
|
4
|
+
import functionalSizeBorder from '@primer/primitives/dist/docs/functional/size/border.json' with {type: 'json'}
|
|
5
|
+
import functionalSizeCoarse from '@primer/primitives/dist/docs/functional/size/size-coarse.json' with {type: 'json'}
|
|
6
|
+
import functionalSizeFine from '@primer/primitives/dist/docs/functional/size/size-fine.json' with {type: 'json'}
|
|
7
|
+
import functionalSize from '@primer/primitives/dist/docs/functional/size/size.json' with {type: 'json'}
|
|
8
|
+
import light from '@primer/primitives/dist/docs/functional/themes/light.json' with {type: 'json'}
|
|
9
|
+
import functionalTypography from '@primer/primitives/dist/docs/functional/typography/typography.json' with {type: 'json'}
|
|
10
|
+
|
|
11
|
+
const categories = {
|
|
12
|
+
base: {
|
|
13
|
+
motion: Object.values(baseMotion).map(token => {
|
|
14
|
+
return {
|
|
15
|
+
name: token.name,
|
|
16
|
+
type: token.type,
|
|
17
|
+
value: token.value,
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
size: Object.values(baseSize).map(token => {
|
|
21
|
+
return {
|
|
22
|
+
name: token.name,
|
|
23
|
+
type: token.type,
|
|
24
|
+
value: token.value,
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
typography: Object.values(baseTypography).map(token => {
|
|
28
|
+
return {
|
|
29
|
+
name: token.name,
|
|
30
|
+
type: token.type,
|
|
31
|
+
value: token.value,
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
functional: {
|
|
36
|
+
border: Object.values(functionalSizeBorder).map(token => {
|
|
37
|
+
return {
|
|
38
|
+
name: token.name,
|
|
39
|
+
type: token.type,
|
|
40
|
+
value: token.value,
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
sizeCoarse: Object.values(functionalSizeCoarse).map(token => {
|
|
44
|
+
return {
|
|
45
|
+
name: token.name,
|
|
46
|
+
type: token.type,
|
|
47
|
+
value: token.value,
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
sizeFine: Object.values(functionalSizeFine).map(token => {
|
|
51
|
+
return {
|
|
52
|
+
name: token.name,
|
|
53
|
+
type: token.type,
|
|
54
|
+
value: token.value,
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
size: Object.values(functionalSize).map(token => {
|
|
58
|
+
return {
|
|
59
|
+
name: token.name,
|
|
60
|
+
type: token.type,
|
|
61
|
+
value: token.value,
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
themes: {
|
|
65
|
+
light: Object.values(light).map(token => {
|
|
66
|
+
return {
|
|
67
|
+
name: token.name,
|
|
68
|
+
type: token.type,
|
|
69
|
+
value: token.value,
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
typography: Object.values(functionalTypography).map(token => {
|
|
74
|
+
return {
|
|
75
|
+
name: token.name,
|
|
76
|
+
type: token.type,
|
|
77
|
+
value: token.value,
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
} as const
|
|
82
|
+
|
|
83
|
+
const tokens = [
|
|
84
|
+
...categories.base.motion,
|
|
85
|
+
...categories.base.size,
|
|
86
|
+
...categories.base.typography,
|
|
87
|
+
...categories.functional.border,
|
|
88
|
+
...categories.functional.sizeCoarse,
|
|
89
|
+
...categories.functional.sizeFine,
|
|
90
|
+
...categories.functional.size,
|
|
91
|
+
...categories.functional.themes.light,
|
|
92
|
+
...categories.functional.typography,
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
function serialize(value: typeof tokens): string {
|
|
96
|
+
return value
|
|
97
|
+
.map(token => {
|
|
98
|
+
return `<token name="${token.name}" value="${token.value}" type="${token.type}"></token>`
|
|
99
|
+
})
|
|
100
|
+
.join('\n')
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export {categories, tokens, serialize}
|