@primer/mcp 0.3.3-rc.da8b5648e → 0.3.3

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 CHANGED
@@ -1,4 +1,4 @@
1
- export { s as server } from './server-B7Ip8Z4Y.js';
1
+ export { s as server } from './server-C2QaEv-c.js';
2
2
  import '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import 'cheerio';
4
4
  import 'zod';
@@ -753,10 +753,7 @@ const allTokensWithGuidelines = loadAllTokensWithGuidelines();
753
753
  // Project setup
754
754
  // -----------------------------------------------------------------------------
755
755
  server.registerTool('init', {
756
- description: 'Setup or create a project that includes Primer React',
757
- annotations: {
758
- readOnlyHint: true
759
- }
756
+ description: 'Setup or create a project that includes Primer React'
760
757
  }, async () => {
761
758
  const url = new URL(`/product/getting-started/react`, 'https://primer.style');
762
759
  const response = await fetch(url);
@@ -801,10 +798,7 @@ ${text}
801
798
  // Components
802
799
  // -----------------------------------------------------------------------------
803
800
  server.registerTool('list_components', {
804
- description: 'List all of the components available from Primer React',
805
- annotations: {
806
- readOnlyHint: true
807
- }
801
+ description: 'List all of the components available from Primer React'
808
802
  }, async () => {
809
803
  const components = listComponents().map(component => {
810
804
  return `- ${component.name}`;
@@ -824,9 +818,6 @@ server.registerTool('get_component', {
824
818
  description: 'Retrieve documentation and usage details for a specific React component from the @primer/react package by its name. This tool provides the official Primer documentation for any listed component, making it easy to inspect, reuse, or integrate components in your project.',
825
819
  inputSchema: {
826
820
  name: z.string().describe('The name of the component to retrieve')
827
- },
828
- annotations: {
829
- readOnlyHint: true
830
821
  }
831
822
  }, async ({
832
823
  name
@@ -867,9 +858,6 @@ server.registerTool('get_component_examples', {
867
858
  description: 'Get examples for how to use a component from Primer React',
868
859
  inputSchema: {
869
860
  name: z.string().describe('The name of the component to retrieve')
870
- },
871
- annotations: {
872
- readOnlyHint: true
873
861
  }
874
862
  }, async ({
875
863
  name
@@ -918,9 +906,6 @@ server.registerTool('get_component_usage_guidelines', {
918
906
  description: 'Get usage information for how to use a component from Primer',
919
907
  inputSchema: {
920
908
  name: z.string().describe('The name of the component to retrieve')
921
- },
922
- annotations: {
923
- readOnlyHint: true
924
909
  }
925
910
  }, async ({
926
911
  name
@@ -977,9 +962,6 @@ server.registerTool('get_component_accessibility_guidelines', {
977
962
  description: 'Retrieve accessibility guidelines and best practices for a specific component from the @primer/react package by its name. Use this tool to get official accessibility recommendations, usage tips, and requirements to ensure your UI components are inclusive and meet accessibility standards.',
978
963
  inputSchema: {
979
964
  name: z.string().describe('The name of the component to retrieve')
980
- },
981
- annotations: {
982
- readOnlyHint: true
983
965
  }
984
966
  }, async ({
985
967
  name
@@ -1037,10 +1019,7 @@ ${text}`
1037
1019
  // Patterns
1038
1020
  // -----------------------------------------------------------------------------
1039
1021
  server.registerTool('list_patterns', {
1040
- description: 'List all of the patterns available from Primer React',
1041
- annotations: {
1042
- readOnlyHint: true
1043
- }
1022
+ description: 'List all of the patterns available from Primer React'
1044
1023
  }, async () => {
1045
1024
  const patterns = listPatterns().map(pattern => {
1046
1025
  return `- ${pattern.name}`;
@@ -1058,9 +1037,6 @@ server.registerTool('get_pattern', {
1058
1037
  description: 'Get a specific pattern by name',
1059
1038
  inputSchema: {
1060
1039
  name: z.string().describe('The name of the pattern to retrieve')
1061
- },
1062
- annotations: {
1063
- readOnlyHint: true
1064
1040
  }
1065
1041
  }, async ({
1066
1042
  name
@@ -1115,9 +1091,6 @@ server.registerTool('find_tokens', {
1115
1091
  query: z.string().optional().default('').describe('Search keywords (e.g., "danger border", "success background")'),
1116
1092
  group: z.string().optional().describe('Filter by group (e.g., "fgColor", "border")'),
1117
1093
  limit: z.number().int().min(1).max(100).optional().default(15).describe('Maximum results to return to stay within context limits')
1118
- },
1119
- annotations: {
1120
- readOnlyHint: true
1121
1094
  }
1122
1095
  }, async ({
1123
1096
  query,
@@ -1199,9 +1172,6 @@ server.registerTool('get_token_group_bundle', {
1199
1172
  description: "PREFERRED FOR COMPONENTS. Fetch all tokens for complex UI (e.g., Dialogs, Cards) in one call by providing an array of groups like ['overlay', 'shadow']. Use this instead of multiple find_tokens calls to save context.",
1200
1173
  inputSchema: {
1201
1174
  groups: z.array(z.string()).describe('Array of group names (e.g., ["overlay", "shadow", "focus"])')
1202
- },
1203
- annotations: {
1204
- readOnlyHint: true
1205
1175
  }
1206
1176
  }, async ({
1207
1177
  groups
@@ -1236,10 +1206,7 @@ server.registerTool('get_token_group_bundle', {
1236
1206
  };
1237
1207
  });
1238
1208
  server.registerTool('get_design_token_specs', {
1239
- description: 'CRITICAL: CALL THIS FIRST. Provides the logic matrix and the list of valid group names. You cannot search accurately without this map.',
1240
- annotations: {
1241
- readOnlyHint: true
1242
- }
1209
+ description: 'CRITICAL: CALL THIS FIRST. Provides the logic matrix and the list of valid group names. You cannot search accurately without this map.'
1243
1210
  }, async () => {
1244
1211
  const groups = listTokenGroups();
1245
1212
  const customRules = getDesignTokenSpecsText(groups);
@@ -1258,10 +1225,7 @@ server.registerTool('get_design_token_specs', {
1258
1225
  };
1259
1226
  });
1260
1227
  server.registerTool('get_token_usage_patterns', {
1261
- description: 'Provides "Golden Example" CSS for core patterns: Button (Interactions) and Stack (Layout). Use this to understand how to apply the Logic Matrix, Motion, and Spacing scales.',
1262
- annotations: {
1263
- readOnlyHint: true
1264
- }
1228
+ description: 'Provides "Golden Example" CSS for core patterns: Button (Interactions) and Stack (Layout). Use this to understand how to apply the Logic Matrix, Motion, and Spacing scales.'
1265
1229
  }, async () => {
1266
1230
  const customPatterns = getTokenUsagePatternsText();
1267
1231
  let text;
@@ -1287,9 +1251,6 @@ server.registerTool('lint_css', {
1287
1251
  description: 'REQUIRED FINAL STEP. Use this to validate your CSS. You cannot complete a task involving CSS without a successful run of this tool.',
1288
1252
  inputSchema: {
1289
1253
  css: z.string()
1290
- },
1291
- annotations: {
1292
- readOnlyHint: true
1293
1254
  }
1294
1255
  }, async ({
1295
1256
  css
@@ -1321,10 +1282,7 @@ server.registerTool('lint_css', {
1321
1282
  // Foundations
1322
1283
  // -----------------------------------------------------------------------------
1323
1284
  server.registerTool('get_color_usage', {
1324
- description: 'Get the guidelines for how to apply color to a user interface',
1325
- annotations: {
1326
- readOnlyHint: true
1327
- }
1285
+ description: 'Get the guidelines for how to apply color to a user interface'
1328
1286
  }, async () => {
1329
1287
  const url = new URL(`/product/getting-started/foundations/color-usage`, 'https://primer.style');
1330
1288
  const response = await fetch(url);
@@ -1353,10 +1311,7 @@ server.registerTool('get_color_usage', {
1353
1311
  };
1354
1312
  });
1355
1313
  server.registerTool('get_typography_usage', {
1356
- description: 'Get the guidelines for how to apply typography to a user interface',
1357
- annotations: {
1358
- readOnlyHint: true
1359
- }
1314
+ description: 'Get the guidelines for how to apply typography to a user interface'
1360
1315
  }, async () => {
1361
1316
  const url = new URL(`/product/getting-started/foundations/typography`, 'https://primer.style');
1362
1317
  const response = await fetch(url);
@@ -1389,10 +1344,7 @@ server.registerTool('get_typography_usage', {
1389
1344
  // Icons
1390
1345
  // -----------------------------------------------------------------------------
1391
1346
  server.registerTool('list_icons', {
1392
- description: 'List all of the icons (octicons) available from Primer Octicons React',
1393
- annotations: {
1394
- readOnlyHint: true
1395
- }
1347
+ description: 'List all of the icons (octicons) available from Primer Octicons React'
1396
1348
  }, async () => {
1397
1349
  const icons = listIcons().map(icon => {
1398
1350
  const keywords = icon.keywords.map(keyword => {
@@ -1419,9 +1371,6 @@ server.registerTool('get_icon', {
1419
1371
  inputSchema: {
1420
1372
  name: z.string().describe('The name of the icon to retrieve'),
1421
1373
  size: z.string().optional().describe('The size of the icon to retrieve, e.g. "16"').default('16')
1422
- },
1423
- annotations: {
1424
- readOnlyHint: true
1425
1374
  }
1426
1375
  }, async ({
1427
1376
  name,
@@ -1471,10 +1420,7 @@ ${text}`
1471
1420
  // Coding guidelines
1472
1421
  // -----------------------------------------------------------------------------
1473
1422
  server.registerTool('primer_coding_guidelines', {
1474
- description: 'Get the guidelines when writing code that uses Primer or for UI code that you are creating',
1475
- annotations: {
1476
- readOnlyHint: true
1477
- }
1423
+ description: 'Get the guidelines when writing code that uses Primer or for UI code that you are creating'
1478
1424
  }, async () => {
1479
1425
  return {
1480
1426
  content: [{
@@ -1525,9 +1471,6 @@ server.registerTool('review_alt_text', {
1525
1471
  surroundingText: z.string().describe('Text surrounding the image, relevant to the image.'),
1526
1472
  alt: z.string().describe('The alt text of the image being evaluated'),
1527
1473
  image: z.string().describe('The image URL or file path being evaluated')
1528
- },
1529
- annotations: {
1530
- readOnlyHint: true
1531
1474
  }
1532
1475
  }, async ({
1533
1476
  surroundingText,