@ldraney/github-mcp 0.1.0 → 0.2.0-beta.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.
Files changed (78) hide show
  1. package/dist/index.js +8 -2
  2. package/dist/prompts/activity-summary.d.ts +10 -0
  3. package/dist/prompts/activity-summary.js +154 -0
  4. package/dist/server.d.ts +8 -1
  5. package/dist/server.js +20 -210
  6. package/dist/tools/categories/actions.d.ts +2 -5
  7. package/dist/tools/categories/actions.js +640 -369
  8. package/dist/tools/categories/activity.d.ts +2 -0
  9. package/dist/tools/categories/activity.js +534 -0
  10. package/dist/tools/categories/apps.d.ts +2 -0
  11. package/dist/tools/categories/apps.js +224 -0
  12. package/dist/tools/categories/billing.d.ts +2 -0
  13. package/dist/tools/categories/billing.js +145 -0
  14. package/dist/tools/categories/checks.d.ts +2 -0
  15. package/dist/tools/categories/checks.js +554 -0
  16. package/dist/tools/categories/codeScanning.d.ts +2 -0
  17. package/dist/tools/categories/codeScanning.js +375 -0
  18. package/dist/tools/categories/codeSecurity.d.ts +2 -0
  19. package/dist/tools/categories/codeSecurity.js +463 -0
  20. package/dist/tools/categories/codesOfConduct.d.ts +2 -0
  21. package/dist/tools/categories/codesOfConduct.js +45 -0
  22. package/dist/tools/categories/codespaces.d.ts +2 -0
  23. package/dist/tools/categories/codespaces.js +259 -0
  24. package/dist/tools/categories/copilot.d.ts +2 -0
  25. package/dist/tools/categories/copilot.js +187 -0
  26. package/dist/tools/categories/dependabot.d.ts +2 -0
  27. package/dist/tools/categories/dependabot.js +454 -0
  28. package/dist/tools/categories/emojis.d.ts +2 -0
  29. package/dist/tools/categories/emojis.js +22 -0
  30. package/dist/tools/categories/gists.d.ts +2 -5
  31. package/dist/tools/categories/gists.js +474 -285
  32. package/dist/tools/categories/git.d.ts +2 -0
  33. package/dist/tools/categories/git.js +520 -0
  34. package/dist/tools/categories/gitignore.d.ts +2 -0
  35. package/dist/tools/categories/gitignore.js +45 -0
  36. package/dist/tools/categories/index.d.ts +33 -0
  37. package/dist/tools/categories/index.js +33 -0
  38. package/dist/tools/categories/interactions.d.ts +2 -0
  39. package/dist/tools/categories/interactions.js +184 -0
  40. package/dist/tools/categories/issues.d.ts +2 -5
  41. package/dist/tools/categories/issues.js +692 -390
  42. package/dist/tools/categories/licenses.d.ts +2 -0
  43. package/dist/tools/categories/licenses.js +95 -0
  44. package/dist/tools/categories/markdown.d.ts +2 -0
  45. package/dist/tools/categories/markdown.js +64 -0
  46. package/dist/tools/categories/meta.d.ts +2 -0
  47. package/dist/tools/categories/meta.js +74 -0
  48. package/dist/tools/categories/migrations.d.ts +2 -0
  49. package/dist/tools/categories/migrations.js +290 -0
  50. package/dist/tools/categories/orgs.d.ts +2 -5
  51. package/dist/tools/categories/orgs.js +585 -417
  52. package/dist/tools/categories/packages.d.ts +2 -0
  53. package/dist/tools/categories/packages.js +918 -0
  54. package/dist/tools/categories/projects.d.ts +2 -0
  55. package/dist/tools/categories/projects.js +692 -0
  56. package/dist/tools/categories/pulls.d.ts +2 -5
  57. package/dist/tools/categories/pulls.js +715 -332
  58. package/dist/tools/categories/rateLimit.d.ts +2 -0
  59. package/dist/tools/categories/rateLimit.js +22 -0
  60. package/dist/tools/categories/reactions.d.ts +2 -0
  61. package/dist/tools/categories/reactions.js +385 -0
  62. package/dist/tools/categories/repos.d.ts +2 -5
  63. package/dist/tools/categories/repos.js +844 -366
  64. package/dist/tools/categories/search.d.ts +2 -5
  65. package/dist/tools/categories/search.js +294 -196
  66. package/dist/tools/categories/secretScanning.d.ts +2 -0
  67. package/dist/tools/categories/secretScanning.js +324 -0
  68. package/dist/tools/categories/securityAdvisories.d.ts +2 -0
  69. package/dist/tools/categories/securityAdvisories.js +407 -0
  70. package/dist/tools/categories/teams.d.ts +2 -0
  71. package/dist/tools/categories/teams.js +614 -0
  72. package/dist/tools/categories/users.d.ts +2 -5
  73. package/dist/tools/categories/users.js +474 -247
  74. package/dist/tools/generator.d.ts +35 -15
  75. package/dist/tools/generator.js +113 -57
  76. package/dist/tools/types.d.ts +63 -0
  77. package/dist/tools/types.js +17 -0
  78. package/package.json +1 -1
@@ -0,0 +1,463 @@
1
+ import { successResult } from '../types.js';
2
+ export const codeSecurityCategory = {
3
+ name: 'codeSecurity',
4
+ description: 'Code security configuration tools',
5
+ tools: [
6
+ // get_configurations_for_org - Get all code security configurations for an organization
7
+ {
8
+ definition: {
9
+ name: 'github_code_security_get_configurations_for_org',
10
+ description: 'Get all code security configurations for an organization',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ org: {
15
+ type: 'string',
16
+ description: 'Organization name',
17
+ },
18
+ target_type: {
19
+ type: 'string',
20
+ enum: ['global', 'all'],
21
+ description: 'Filter configurations by target type',
22
+ },
23
+ per_page: {
24
+ type: 'number',
25
+ description: 'Results per page (max 100)',
26
+ },
27
+ before: {
28
+ type: 'string',
29
+ description: 'Cursor for pagination (before)',
30
+ },
31
+ after: {
32
+ type: 'string',
33
+ description: 'Cursor for pagination (after)',
34
+ },
35
+ },
36
+ required: ['org'],
37
+ },
38
+ },
39
+ handler: async (octokit, args) => {
40
+ const { data } = await octokit.codeSecurity.getConfigurationsForOrg({
41
+ org: args.org,
42
+ target_type: args.target_type,
43
+ per_page: args.per_page,
44
+ before: args.before,
45
+ after: args.after,
46
+ });
47
+ return successResult(data);
48
+ },
49
+ },
50
+ // get_configuration - Get a code security configuration
51
+ {
52
+ definition: {
53
+ name: 'github_code_security_get_configuration',
54
+ description: 'Get a code security configuration for an organization',
55
+ inputSchema: {
56
+ type: 'object',
57
+ properties: {
58
+ org: {
59
+ type: 'string',
60
+ description: 'Organization name',
61
+ },
62
+ configuration_id: {
63
+ type: 'number',
64
+ description: 'The unique identifier of the code security configuration',
65
+ },
66
+ },
67
+ required: ['org', 'configuration_id'],
68
+ },
69
+ },
70
+ handler: async (octokit, args) => {
71
+ const { data } = await octokit.codeSecurity.getConfiguration({
72
+ org: args.org,
73
+ configuration_id: args.configuration_id,
74
+ });
75
+ return successResult(data);
76
+ },
77
+ },
78
+ // create_configuration - Create a code security configuration
79
+ {
80
+ definition: {
81
+ name: 'github_code_security_create_configuration',
82
+ description: 'Create a code security configuration for an organization',
83
+ inputSchema: {
84
+ type: 'object',
85
+ properties: {
86
+ org: {
87
+ type: 'string',
88
+ description: 'Organization name',
89
+ },
90
+ name: {
91
+ type: 'string',
92
+ description: 'Name of the code security configuration',
93
+ },
94
+ description: {
95
+ type: 'string',
96
+ description: 'Description of the code security configuration',
97
+ },
98
+ advanced_security: {
99
+ type: 'string',
100
+ enum: ['enabled', 'disabled'],
101
+ description: 'Enable or disable GitHub Advanced Security',
102
+ },
103
+ dependency_graph: {
104
+ type: 'string',
105
+ enum: ['enabled', 'disabled', 'not_set'],
106
+ description: 'Enable or disable dependency graph',
107
+ },
108
+ dependency_graph_autosubmit_action: {
109
+ type: 'string',
110
+ enum: ['enabled', 'disabled', 'not_set'],
111
+ description: 'Enable or disable dependency graph auto-submit action',
112
+ },
113
+ dependency_graph_autosubmit_action_options: {
114
+ type: 'string',
115
+ description: 'JSON object with labeled_runners option (boolean)',
116
+ },
117
+ dependabot_alerts: {
118
+ type: 'string',
119
+ enum: ['enabled', 'disabled', 'not_set'],
120
+ description: 'Enable or disable Dependabot alerts',
121
+ },
122
+ dependabot_security_updates: {
123
+ type: 'string',
124
+ enum: ['enabled', 'disabled', 'not_set'],
125
+ description: 'Enable or disable Dependabot security updates',
126
+ },
127
+ code_scanning_default_setup: {
128
+ type: 'string',
129
+ enum: ['enabled', 'disabled', 'not_set'],
130
+ description: 'Enable or disable code scanning default setup',
131
+ },
132
+ secret_scanning: {
133
+ type: 'string',
134
+ enum: ['enabled', 'disabled', 'not_set'],
135
+ description: 'Enable or disable secret scanning',
136
+ },
137
+ secret_scanning_push_protection: {
138
+ type: 'string',
139
+ enum: ['enabled', 'disabled', 'not_set'],
140
+ description: 'Enable or disable secret scanning push protection',
141
+ },
142
+ secret_scanning_validity_checks: {
143
+ type: 'string',
144
+ enum: ['enabled', 'disabled', 'not_set'],
145
+ description: 'Enable or disable secret scanning validity checks',
146
+ },
147
+ secret_scanning_non_provider_patterns: {
148
+ type: 'string',
149
+ enum: ['enabled', 'disabled', 'not_set'],
150
+ description: 'Enable or disable secret scanning non-provider patterns',
151
+ },
152
+ private_vulnerability_reporting: {
153
+ type: 'string',
154
+ enum: ['enabled', 'disabled', 'not_set'],
155
+ description: 'Enable or disable private vulnerability reporting',
156
+ },
157
+ enforcement: {
158
+ type: 'string',
159
+ enum: ['enforced', 'unenforced'],
160
+ description: 'Enforcement status of the configuration',
161
+ },
162
+ },
163
+ required: ['org', 'name', 'description'],
164
+ },
165
+ },
166
+ handler: async (octokit, args) => {
167
+ const options = {
168
+ org: args.org,
169
+ name: args.name,
170
+ description: args.description,
171
+ };
172
+ if (args.advanced_security) {
173
+ options.advanced_security = args.advanced_security;
174
+ }
175
+ if (args.dependency_graph) {
176
+ options.dependency_graph = args.dependency_graph;
177
+ }
178
+ if (args.dependency_graph_autosubmit_action) {
179
+ options.dependency_graph_autosubmit_action = args.dependency_graph_autosubmit_action;
180
+ }
181
+ if (args.dependency_graph_autosubmit_action_options) {
182
+ options.dependency_graph_autosubmit_action_options = JSON.parse(args.dependency_graph_autosubmit_action_options);
183
+ }
184
+ if (args.dependabot_alerts) {
185
+ options.dependabot_alerts = args.dependabot_alerts;
186
+ }
187
+ if (args.dependabot_security_updates) {
188
+ options.dependabot_security_updates = args.dependabot_security_updates;
189
+ }
190
+ if (args.code_scanning_default_setup) {
191
+ options.code_scanning_default_setup = args.code_scanning_default_setup;
192
+ }
193
+ if (args.secret_scanning) {
194
+ options.secret_scanning = args.secret_scanning;
195
+ }
196
+ if (args.secret_scanning_push_protection) {
197
+ options.secret_scanning_push_protection = args.secret_scanning_push_protection;
198
+ }
199
+ if (args.secret_scanning_validity_checks) {
200
+ options.secret_scanning_validity_checks = args.secret_scanning_validity_checks;
201
+ }
202
+ if (args.secret_scanning_non_provider_patterns) {
203
+ options.secret_scanning_non_provider_patterns = args.secret_scanning_non_provider_patterns;
204
+ }
205
+ if (args.private_vulnerability_reporting) {
206
+ options.private_vulnerability_reporting = args.private_vulnerability_reporting;
207
+ }
208
+ if (args.enforcement) {
209
+ options.enforcement = args.enforcement;
210
+ }
211
+ const { data } = await octokit.codeSecurity.createConfiguration(options);
212
+ return successResult(data);
213
+ },
214
+ },
215
+ // update_configuration - Update a code security configuration
216
+ {
217
+ definition: {
218
+ name: 'github_code_security_update_configuration',
219
+ description: 'Update a code security configuration for an organization',
220
+ inputSchema: {
221
+ type: 'object',
222
+ properties: {
223
+ org: {
224
+ type: 'string',
225
+ description: 'Organization name',
226
+ },
227
+ configuration_id: {
228
+ type: 'number',
229
+ description: 'The unique identifier of the code security configuration',
230
+ },
231
+ name: {
232
+ type: 'string',
233
+ description: 'Name of the code security configuration',
234
+ },
235
+ description: {
236
+ type: 'string',
237
+ description: 'Description of the code security configuration',
238
+ },
239
+ advanced_security: {
240
+ type: 'string',
241
+ enum: ['enabled', 'disabled'],
242
+ description: 'Enable or disable GitHub Advanced Security',
243
+ },
244
+ dependency_graph: {
245
+ type: 'string',
246
+ enum: ['enabled', 'disabled', 'not_set'],
247
+ description: 'Enable or disable dependency graph',
248
+ },
249
+ dependency_graph_autosubmit_action: {
250
+ type: 'string',
251
+ enum: ['enabled', 'disabled', 'not_set'],
252
+ description: 'Enable or disable dependency graph auto-submit action',
253
+ },
254
+ dependency_graph_autosubmit_action_options: {
255
+ type: 'string',
256
+ description: 'JSON object with labeled_runners option (boolean)',
257
+ },
258
+ dependabot_alerts: {
259
+ type: 'string',
260
+ enum: ['enabled', 'disabled', 'not_set'],
261
+ description: 'Enable or disable Dependabot alerts',
262
+ },
263
+ dependabot_security_updates: {
264
+ type: 'string',
265
+ enum: ['enabled', 'disabled', 'not_set'],
266
+ description: 'Enable or disable Dependabot security updates',
267
+ },
268
+ code_scanning_default_setup: {
269
+ type: 'string',
270
+ enum: ['enabled', 'disabled', 'not_set'],
271
+ description: 'Enable or disable code scanning default setup',
272
+ },
273
+ secret_scanning: {
274
+ type: 'string',
275
+ enum: ['enabled', 'disabled', 'not_set'],
276
+ description: 'Enable or disable secret scanning',
277
+ },
278
+ secret_scanning_push_protection: {
279
+ type: 'string',
280
+ enum: ['enabled', 'disabled', 'not_set'],
281
+ description: 'Enable or disable secret scanning push protection',
282
+ },
283
+ secret_scanning_validity_checks: {
284
+ type: 'string',
285
+ enum: ['enabled', 'disabled', 'not_set'],
286
+ description: 'Enable or disable secret scanning validity checks',
287
+ },
288
+ secret_scanning_non_provider_patterns: {
289
+ type: 'string',
290
+ enum: ['enabled', 'disabled', 'not_set'],
291
+ description: 'Enable or disable secret scanning non-provider patterns',
292
+ },
293
+ private_vulnerability_reporting: {
294
+ type: 'string',
295
+ enum: ['enabled', 'disabled', 'not_set'],
296
+ description: 'Enable or disable private vulnerability reporting',
297
+ },
298
+ enforcement: {
299
+ type: 'string',
300
+ enum: ['enforced', 'unenforced'],
301
+ description: 'Enforcement status of the configuration',
302
+ },
303
+ },
304
+ required: ['org', 'configuration_id'],
305
+ },
306
+ },
307
+ handler: async (octokit, args) => {
308
+ const options = {
309
+ org: args.org,
310
+ configuration_id: args.configuration_id,
311
+ };
312
+ if (args.name) {
313
+ options.name = args.name;
314
+ }
315
+ if (args.description) {
316
+ options.description = args.description;
317
+ }
318
+ if (args.advanced_security) {
319
+ options.advanced_security = args.advanced_security;
320
+ }
321
+ if (args.dependency_graph) {
322
+ options.dependency_graph = args.dependency_graph;
323
+ }
324
+ if (args.dependency_graph_autosubmit_action) {
325
+ options.dependency_graph_autosubmit_action = args.dependency_graph_autosubmit_action;
326
+ }
327
+ if (args.dependency_graph_autosubmit_action_options) {
328
+ options.dependency_graph_autosubmit_action_options = JSON.parse(args.dependency_graph_autosubmit_action_options);
329
+ }
330
+ if (args.dependabot_alerts) {
331
+ options.dependabot_alerts = args.dependabot_alerts;
332
+ }
333
+ if (args.dependabot_security_updates) {
334
+ options.dependabot_security_updates = args.dependabot_security_updates;
335
+ }
336
+ if (args.code_scanning_default_setup) {
337
+ options.code_scanning_default_setup = args.code_scanning_default_setup;
338
+ }
339
+ if (args.secret_scanning) {
340
+ options.secret_scanning = args.secret_scanning;
341
+ }
342
+ if (args.secret_scanning_push_protection) {
343
+ options.secret_scanning_push_protection = args.secret_scanning_push_protection;
344
+ }
345
+ if (args.secret_scanning_validity_checks) {
346
+ options.secret_scanning_validity_checks = args.secret_scanning_validity_checks;
347
+ }
348
+ if (args.secret_scanning_non_provider_patterns) {
349
+ options.secret_scanning_non_provider_patterns = args.secret_scanning_non_provider_patterns;
350
+ }
351
+ if (args.private_vulnerability_reporting) {
352
+ options.private_vulnerability_reporting = args.private_vulnerability_reporting;
353
+ }
354
+ if (args.enforcement) {
355
+ options.enforcement = args.enforcement;
356
+ }
357
+ const { data } = await octokit.codeSecurity.updateConfiguration(options);
358
+ return successResult(data);
359
+ },
360
+ },
361
+ // attach_configuration - Attach repositories to a code security configuration
362
+ {
363
+ definition: {
364
+ name: 'github_code_security_attach_configuration',
365
+ description: 'Attach repositories to a code security configuration',
366
+ inputSchema: {
367
+ type: 'object',
368
+ properties: {
369
+ org: {
370
+ type: 'string',
371
+ description: 'Organization name',
372
+ },
373
+ configuration_id: {
374
+ type: 'number',
375
+ description: 'The unique identifier of the code security configuration',
376
+ },
377
+ scope: {
378
+ type: 'string',
379
+ enum: ['all', 'public', 'private_or_internal', 'selected'],
380
+ description: 'Scope of repositories to attach (all, public, private_or_internal, or selected)',
381
+ },
382
+ selected_repository_ids: {
383
+ type: 'string',
384
+ description: 'Comma-separated list of repository IDs (required when scope is "selected")',
385
+ },
386
+ },
387
+ required: ['org', 'configuration_id', 'scope'],
388
+ },
389
+ },
390
+ handler: async (octokit, args) => {
391
+ const selectedRepoIds = args.selected_repository_ids
392
+ ? args.selected_repository_ids.split(',').map((id) => parseInt(id.trim(), 10))
393
+ : undefined;
394
+ const { data } = await octokit.codeSecurity.attachConfiguration({
395
+ org: args.org,
396
+ configuration_id: args.configuration_id,
397
+ scope: args.scope,
398
+ selected_repository_ids: selectedRepoIds,
399
+ });
400
+ return successResult(data);
401
+ },
402
+ },
403
+ // detach_configuration - Detach repositories from a code security configuration
404
+ {
405
+ definition: {
406
+ name: 'github_code_security_detach_configuration',
407
+ description: 'Detach repositories from a code security configuration',
408
+ inputSchema: {
409
+ type: 'object',
410
+ properties: {
411
+ org: {
412
+ type: 'string',
413
+ description: 'Organization name',
414
+ },
415
+ configuration_id: {
416
+ type: 'number',
417
+ description: 'The unique identifier of the code security configuration',
418
+ },
419
+ selected_repository_ids: {
420
+ type: 'string',
421
+ description: 'Comma-separated list of repository IDs to detach',
422
+ },
423
+ },
424
+ required: ['org', 'configuration_id'],
425
+ },
426
+ },
427
+ handler: async (octokit, args) => {
428
+ const selectedRepoIds = args.selected_repository_ids
429
+ ? args.selected_repository_ids.split(',').map((id) => parseInt(id.trim(), 10))
430
+ : undefined;
431
+ await octokit.codeSecurity.detachConfiguration({
432
+ org: args.org,
433
+ configuration_id: args.configuration_id,
434
+ selected_repository_ids: selectedRepoIds,
435
+ });
436
+ return successResult({ success: true, message: 'Repositories detached from configuration' });
437
+ },
438
+ },
439
+ // get_default_configurations - Get default code security configurations for an organization
440
+ {
441
+ definition: {
442
+ name: 'github_code_security_get_default_configurations',
443
+ description: 'Get default code security configurations for an organization',
444
+ inputSchema: {
445
+ type: 'object',
446
+ properties: {
447
+ org: {
448
+ type: 'string',
449
+ description: 'Organization name',
450
+ },
451
+ },
452
+ required: ['org'],
453
+ },
454
+ },
455
+ handler: async (octokit, args) => {
456
+ const { data } = await octokit.codeSecurity.getDefaultConfigurations({
457
+ org: args.org,
458
+ });
459
+ return successResult(data);
460
+ },
461
+ },
462
+ ],
463
+ };
@@ -0,0 +1,2 @@
1
+ import type { ToolCategory } from '../types.js';
2
+ export declare const codesOfConductCategory: ToolCategory;
@@ -0,0 +1,45 @@
1
+ import { successResult } from '../types.js';
2
+ export const codesOfConductCategory = {
3
+ name: 'codesOfConduct',
4
+ description: 'GitHub codes of conduct tools',
5
+ tools: [
6
+ // getAllCodesOfConduct - List all codes of conduct
7
+ {
8
+ definition: {
9
+ name: 'github_codesOfConduct_get_all_codes_of_conduct',
10
+ description: 'List all codes of conduct available on GitHub',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {},
14
+ },
15
+ },
16
+ handler: async (octokit) => {
17
+ const { data } = await octokit.codesOfConduct.getAllCodesOfConduct();
18
+ return successResult(data);
19
+ },
20
+ },
21
+ // getConductCode - Get a specific code of conduct
22
+ {
23
+ definition: {
24
+ name: 'github_codesOfConduct_get_conduct_code',
25
+ description: 'Get a specific code of conduct by its key',
26
+ inputSchema: {
27
+ type: 'object',
28
+ properties: {
29
+ key: {
30
+ type: 'string',
31
+ description: 'The key of the code of conduct (e.g., "contributor_covenant", "citizen_code_of_conduct")',
32
+ },
33
+ },
34
+ required: ['key'],
35
+ },
36
+ },
37
+ handler: async (octokit, args) => {
38
+ const { data } = await octokit.codesOfConduct.getConductCode({
39
+ key: args.key,
40
+ });
41
+ return successResult(data);
42
+ },
43
+ },
44
+ ],
45
+ };
@@ -0,0 +1,2 @@
1
+ import type { ToolCategory } from '../types.js';
2
+ export declare const codespacesCategory: ToolCategory;