adoptai-mcp 1.0.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 (174) hide show
  1. package/README.md +70 -0
  2. package/bin/adoptai-mcp.js +2 -0
  3. package/dist/apps/canva.js +1 -0
  4. package/dist/apps/figma.js +1 -0
  5. package/dist/apps/github.js +2 -0
  6. package/dist/apps/notion.js +1 -0
  7. package/dist/apps/registry.js +20 -0
  8. package/dist/apps/salesforce.js +1 -0
  9. package/dist/cli/add.js +532 -0
  10. package/dist/cli/index.js +39 -0
  11. package/dist/cli/list.js +19 -0
  12. package/dist/cli/remove.js +37 -0
  13. package/dist/cli/serve.js +27 -0
  14. package/dist/cli/status.js +24 -0
  15. package/dist/config/clients.js +118 -0
  16. package/dist/config/credentials.js +34 -0
  17. package/dist/core/auth-manager.js +237 -0
  18. package/dist/core/config-writer.js +161 -0
  19. package/dist/core/doctor.js +199 -0
  20. package/dist/core/package.json +3 -0
  21. package/dist/core/server-base.js +81 -0
  22. package/dist/integrations/canva/.env +3 -0
  23. package/dist/integrations/canva/auth.js +287 -0
  24. package/dist/integrations/canva/env.js +9 -0
  25. package/dist/integrations/canva/index.js +12 -0
  26. package/dist/integrations/canva/package.json +31 -0
  27. package/dist/integrations/canva/publish-to-adoptai.js +365 -0
  28. package/dist/integrations/canva/setup.js +90 -0
  29. package/dist/integrations/canva/tools.js +1315 -0
  30. package/dist/integrations/canva/tools.original.js +1315 -0
  31. package/dist/integrations/figma/auth.js +48 -0
  32. package/dist/integrations/figma/index.js +11 -0
  33. package/dist/integrations/figma/package.json +27 -0
  34. package/dist/integrations/figma/publish-to-adoptai.js +384 -0
  35. package/dist/integrations/figma/setup.js +90 -0
  36. package/dist/integrations/figma/tools.js +1137 -0
  37. package/dist/integrations/github/auth.js +53 -0
  38. package/dist/integrations/github/index.js +11 -0
  39. package/dist/integrations/github/package.json +28 -0
  40. package/dist/integrations/github/publish-to-adoptai.js +240 -0
  41. package/dist/integrations/github/setup.js +103 -0
  42. package/dist/integrations/github/tools.js +78 -0
  43. package/dist/integrations/github-actions/auth.js +53 -0
  44. package/dist/integrations/github-actions/index.js +11 -0
  45. package/dist/integrations/github-actions/package.json +27 -0
  46. package/dist/integrations/github-actions/setup.js +103 -0
  47. package/dist/integrations/github-actions/tools.js +5642 -0
  48. package/dist/integrations/github-activity/auth.js +53 -0
  49. package/dist/integrations/github-activity/index.js +11 -0
  50. package/dist/integrations/github-activity/package.json +27 -0
  51. package/dist/integrations/github-activity/setup.js +103 -0
  52. package/dist/integrations/github-activity/tools.js +925 -0
  53. package/dist/integrations/github-apps/auth.js +53 -0
  54. package/dist/integrations/github-apps/index.js +11 -0
  55. package/dist/integrations/github-apps/package.json +27 -0
  56. package/dist/integrations/github-apps/setup.js +103 -0
  57. package/dist/integrations/github-apps/tools.js +791 -0
  58. package/dist/integrations/github-billing/auth.js +53 -0
  59. package/dist/integrations/github-billing/index.js +11 -0
  60. package/dist/integrations/github-billing/package.json +27 -0
  61. package/dist/integrations/github-billing/setup.js +103 -0
  62. package/dist/integrations/github-billing/tools.js +438 -0
  63. package/dist/integrations/github-checks/auth.js +53 -0
  64. package/dist/integrations/github-checks/index.js +11 -0
  65. package/dist/integrations/github-checks/package.json +27 -0
  66. package/dist/integrations/github-checks/setup.js +103 -0
  67. package/dist/integrations/github-checks/tools.js +607 -0
  68. package/dist/integrations/github-code-scanning/auth.js +53 -0
  69. package/dist/integrations/github-code-scanning/index.js +11 -0
  70. package/dist/integrations/github-code-scanning/package.json +27 -0
  71. package/dist/integrations/github-code-scanning/setup.js +103 -0
  72. package/dist/integrations/github-code-scanning/tools.js +987 -0
  73. package/dist/integrations/github-dependabot/auth.js +53 -0
  74. package/dist/integrations/github-dependabot/index.js +11 -0
  75. package/dist/integrations/github-dependabot/package.json +27 -0
  76. package/dist/integrations/github-dependabot/setup.js +103 -0
  77. package/dist/integrations/github-dependabot/tools.js +915 -0
  78. package/dist/integrations/github-gists/auth.js +53 -0
  79. package/dist/integrations/github-gists/index.js +11 -0
  80. package/dist/integrations/github-gists/package.json +27 -0
  81. package/dist/integrations/github-gists/setup.js +103 -0
  82. package/dist/integrations/github-gists/tools.js +545 -0
  83. package/dist/integrations/github-git/auth.js +53 -0
  84. package/dist/integrations/github-git/index.js +11 -0
  85. package/dist/integrations/github-git/package.json +27 -0
  86. package/dist/integrations/github-git/setup.js +103 -0
  87. package/dist/integrations/github-git/tools.js +513 -0
  88. package/dist/integrations/github-issues/auth.js +53 -0
  89. package/dist/integrations/github-issues/index.js +11 -0
  90. package/dist/integrations/github-issues/package.json +27 -0
  91. package/dist/integrations/github-issues/setup.js +103 -0
  92. package/dist/integrations/github-issues/tools.js +2232 -0
  93. package/dist/integrations/github-orgs/auth.js +53 -0
  94. package/dist/integrations/github-orgs/index.js +11 -0
  95. package/dist/integrations/github-orgs/package.json +27 -0
  96. package/dist/integrations/github-orgs/setup.js +103 -0
  97. package/dist/integrations/github-orgs/tools.js +3512 -0
  98. package/dist/integrations/github-packages/auth.js +53 -0
  99. package/dist/integrations/github-packages/index.js +11 -0
  100. package/dist/integrations/github-packages/package.json +27 -0
  101. package/dist/integrations/github-packages/setup.js +103 -0
  102. package/dist/integrations/github-packages/tools.js +1088 -0
  103. package/dist/integrations/github-pulls/auth.js +53 -0
  104. package/dist/integrations/github-pulls/index.js +11 -0
  105. package/dist/integrations/github-pulls/package.json +27 -0
  106. package/dist/integrations/github-pulls/setup.js +103 -0
  107. package/dist/integrations/github-pulls/tools.js +1252 -0
  108. package/dist/integrations/github-reactions/auth.js +53 -0
  109. package/dist/integrations/github-reactions/index.js +11 -0
  110. package/dist/integrations/github-reactions/package.json +27 -0
  111. package/dist/integrations/github-reactions/setup.js +103 -0
  112. package/dist/integrations/github-reactions/tools.js +706 -0
  113. package/dist/integrations/github-repos/auth.js +53 -0
  114. package/dist/integrations/github-repos/index.js +11 -0
  115. package/dist/integrations/github-repos/package.json +27 -0
  116. package/dist/integrations/github-repos/setup.js +103 -0
  117. package/dist/integrations/github-repos/tools.js +7286 -0
  118. package/dist/integrations/github-search/auth.js +53 -0
  119. package/dist/integrations/github-search/index.js +11 -0
  120. package/dist/integrations/github-search/package.json +27 -0
  121. package/dist/integrations/github-search/setup.js +103 -0
  122. package/dist/integrations/github-search/tools.js +370 -0
  123. package/dist/integrations/github-teams/auth.js +53 -0
  124. package/dist/integrations/github-teams/index.js +11 -0
  125. package/dist/integrations/github-teams/package.json +27 -0
  126. package/dist/integrations/github-teams/setup.js +103 -0
  127. package/dist/integrations/github-teams/tools.js +633 -0
  128. package/dist/integrations/github-users/auth.js +53 -0
  129. package/dist/integrations/github-users/index.js +11 -0
  130. package/dist/integrations/github-users/package.json +27 -0
  131. package/dist/integrations/github-users/setup.js +103 -0
  132. package/dist/integrations/github-users/tools.js +1118 -0
  133. package/dist/integrations/notion/api.js +108 -0
  134. package/dist/integrations/notion/auth.js +59 -0
  135. package/dist/integrations/notion/endpoints.json +630 -0
  136. package/dist/integrations/notion/index.js +11 -0
  137. package/dist/integrations/notion/package.json +33 -0
  138. package/dist/integrations/notion/publish-to-adoptai.js +271 -0
  139. package/dist/integrations/notion/scripts/generate-endpoints.mjs +306 -0
  140. package/dist/integrations/notion/setup.js +89 -0
  141. package/dist/integrations/notion/tools.js +586 -0
  142. package/dist/integrations/notion/tools.original.js +568 -0
  143. package/dist/integrations/salesforce/.env +8 -0
  144. package/dist/integrations/salesforce/.env.example +15 -0
  145. package/dist/integrations/salesforce/auth.js +311 -0
  146. package/dist/integrations/salesforce/endpoints.json +1359 -0
  147. package/dist/integrations/salesforce/env.js +9 -0
  148. package/dist/integrations/salesforce/index.js +12 -0
  149. package/dist/integrations/salesforce/package.json +42 -0
  150. package/dist/integrations/salesforce/publish-smart-specs.js +890 -0
  151. package/dist/integrations/salesforce/publish-to-adoptai.js +386 -0
  152. package/dist/integrations/salesforce/scripts/extract-postman.mjs +222 -0
  153. package/dist/integrations/salesforce/setup.js +112 -0
  154. package/dist/integrations/salesforce/tools.js +4544 -0
  155. package/dist/integrations/salesforce/tools.original.js +4487 -0
  156. package/dist/server/mcp-server.js +50 -0
  157. package/dist/server/tool-loader.js +47 -0
  158. package/dist/specs/figma-api.json +13621 -0
  159. package/dist/specs/split/salesforce-auth.json +3931 -0
  160. package/dist/specs/split/salesforce-bulk-v1.json +1489 -0
  161. package/dist/specs/split/salesforce-bulk-v2.json +1951 -0
  162. package/dist/specs/split/salesforce-composite.json +1246 -0
  163. package/dist/specs/split/salesforce-connect.json +11639 -0
  164. package/dist/specs/split/salesforce-einstein-prediction-service.json +576 -0
  165. package/dist/specs/split/salesforce-event-platform.json +2682 -0
  166. package/dist/specs/split/salesforce-graphql.json +1754 -0
  167. package/dist/specs/split/salesforce-industries.json +4115 -0
  168. package/dist/specs/split/salesforce-metadata.json +555 -0
  169. package/dist/specs/split/salesforce-rest.json +4798 -0
  170. package/dist/specs/split/salesforce-soap.json +210 -0
  171. package/dist/specs/split/salesforce-subscription-management.json +1299 -0
  172. package/dist/specs/split/salesforce-tooling.json +2026 -0
  173. package/dist/specs/split/salesforce-ui.json +7426 -0
  174. package/package.json +47 -0
@@ -0,0 +1,607 @@
1
+ import axios from 'axios';
2
+ import { buildAuthHeaders } from './auth.js';
3
+
4
+ const BASE_URL = 'https://api.github.com';
5
+ const APP_ID = 'github-checks';
6
+
7
+ function handleError(err) {
8
+ const status = err.response?.status;
9
+ const msg = err.response?.data?.message || err.response?.data?.error || err.message;
10
+ if (status === 401) throw new Error(`Token invalid.\nRun: npx adoptai-${APP_ID}-mcp --client cursor`);
11
+ if (status === 403) throw new Error('Insufficient permissions. Check your API key scopes.');
12
+ if (status === 404) throw new Error('Resource not found. Check your parameters.');
13
+ if (status === 429) throw new Error('Rate limit exceeded. Please wait and try again.');
14
+ throw new Error(msg || 'API request failed');
15
+ }
16
+
17
+ async function apiRequest(method, pathTemplate, params = {}, opts = {}) {
18
+ const { deleteSendsJsonBody = false } = opts;
19
+ const headers = buildAuthHeaders();
20
+ let url = BASE_URL + pathTemplate;
21
+ const pathKeys = [...pathTemplate.matchAll(/\{([^}]+)\}/g)].map((m) => m[1]);
22
+ for (const key of pathKeys) {
23
+ const value = params[key];
24
+ if (value !== undefined && value !== null) url = url.replace(`{${key}}`, encodeURIComponent(String(value)));
25
+ }
26
+ const rest = { ...params };
27
+ for (const key of pathKeys) delete rest[key];
28
+ const m = method.toUpperCase();
29
+ const useQuery = m === 'GET' || (m === 'DELETE' && !deleteSendsJsonBody);
30
+ const queryParams = {};
31
+ const bodyParams = {};
32
+ for (const [key, value] of Object.entries(rest)) {
33
+ if (value === undefined) continue;
34
+ if (useQuery) queryParams[key] = value; else bodyParams[key] = value;
35
+ }
36
+ try {
37
+ const res = await axios({
38
+ method: m,
39
+ url,
40
+ headers: { 'Content-Type': 'application/json', ...headers },
41
+ params: Object.keys(queryParams).length ? queryParams : undefined,
42
+ data: Object.keys(bodyParams).length ? bodyParams : undefined,
43
+ timeout: 30000,
44
+ });
45
+ if (res.status === 204 || res.data === '' || res.data === undefined) return { ok: true, status: res.status };
46
+ return res.data;
47
+ } catch (err) {
48
+ handleError(err);
49
+ }
50
+ }
51
+
52
+ const ENDPOINTS = [
53
+ {
54
+ "name": "checks_create",
55
+ "description": "Create a check run",
56
+ "method": "POST",
57
+ "path": "/repos/{owner}/{repo}/check-runs",
58
+ "deleteSendsJsonBody": false,
59
+ "inputSchema": {
60
+ "type": "object",
61
+ "properties": {
62
+ "owner": {
63
+ "type": "string",
64
+ "description": "The account owner of the repository. The name is not case sensitive."
65
+ },
66
+ "repo": {
67
+ "type": "string",
68
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
69
+ },
70
+ "name": {
71
+ "type": "string",
72
+ "description": "The name of the check. For example, \"code-coverage\"."
73
+ },
74
+ "head_sha": {
75
+ "type": "string",
76
+ "description": "The SHA of the commit."
77
+ },
78
+ "details_url": {
79
+ "type": "string",
80
+ "description": "The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used."
81
+ },
82
+ "external_id": {
83
+ "type": "string",
84
+ "description": "A reference for the run on the integrator's system."
85
+ },
86
+ "status": {
87
+ "type": "string",
88
+ "description": "The current status of the check run. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`.",
89
+ "enum": [
90
+ "queued",
91
+ "in_progress",
92
+ "completed",
93
+ "waiting",
94
+ "requested",
95
+ "pending"
96
+ ]
97
+ },
98
+ "started_at": {
99
+ "type": "string",
100
+ "description": "The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
101
+ },
102
+ "conclusion": {
103
+ "type": "string",
104
+ "description": "**Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. \n**Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.",
105
+ "enum": [
106
+ "action_required",
107
+ "cancelled",
108
+ "failure",
109
+ "neutral",
110
+ "success",
111
+ "skipped",
112
+ "stale",
113
+ "timed_out"
114
+ ]
115
+ },
116
+ "completed_at": {
117
+ "type": "string",
118
+ "description": "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
119
+ },
120
+ "output": {
121
+ "type": "object",
122
+ "description": "Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run."
123
+ },
124
+ "actions": {
125
+ "type": "array",
126
+ "description": "Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [`check_run.requested_action` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. To learn more about check runs and requested actions, see \"[Check runs and requested actions](https://docs.github.com/rest/guides/using-the-rest-api-to-interact-with-checks#check-runs-and-requested-actions).\""
127
+ }
128
+ },
129
+ "required": [
130
+ "owner",
131
+ "repo",
132
+ "name",
133
+ "head_sha"
134
+ ]
135
+ }
136
+ },
137
+ {
138
+ "name": "checks_get",
139
+ "description": "Get a check run",
140
+ "method": "GET",
141
+ "path": "/repos/{owner}/{repo}/check-runs/{check_run_id}",
142
+ "deleteSendsJsonBody": false,
143
+ "inputSchema": {
144
+ "type": "object",
145
+ "properties": {
146
+ "owner": {
147
+ "type": "string",
148
+ "description": "The account owner of the repository. The name is not case sensitive."
149
+ },
150
+ "repo": {
151
+ "type": "string",
152
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
153
+ },
154
+ "check_run_id": {
155
+ "type": "number",
156
+ "description": "The unique identifier of the check run."
157
+ }
158
+ },
159
+ "required": [
160
+ "owner",
161
+ "repo",
162
+ "check_run_id"
163
+ ]
164
+ }
165
+ },
166
+ {
167
+ "name": "checks_update",
168
+ "description": "Update a check run",
169
+ "method": "PATCH",
170
+ "path": "/repos/{owner}/{repo}/check-runs/{check_run_id}",
171
+ "deleteSendsJsonBody": false,
172
+ "inputSchema": {
173
+ "type": "object",
174
+ "properties": {
175
+ "owner": {
176
+ "type": "string",
177
+ "description": "The account owner of the repository. The name is not case sensitive."
178
+ },
179
+ "repo": {
180
+ "type": "string",
181
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
182
+ },
183
+ "check_run_id": {
184
+ "type": "number",
185
+ "description": "The unique identifier of the check run."
186
+ },
187
+ "name": {
188
+ "type": "string",
189
+ "description": "The name of the check. For example, \"code-coverage\"."
190
+ },
191
+ "details_url": {
192
+ "type": "string",
193
+ "description": "The URL of the integrator's site that has the full details of the check."
194
+ },
195
+ "external_id": {
196
+ "type": "string",
197
+ "description": "A reference for the run on the integrator's system."
198
+ },
199
+ "started_at": {
200
+ "type": "string",
201
+ "description": "This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
202
+ },
203
+ "status": {
204
+ "type": "string",
205
+ "description": "The current status of the check run. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`.",
206
+ "enum": [
207
+ "queued",
208
+ "in_progress",
209
+ "completed",
210
+ "waiting",
211
+ "requested",
212
+ "pending"
213
+ ]
214
+ },
215
+ "conclusion": {
216
+ "type": "string",
217
+ "description": "**Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. \n**Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.",
218
+ "enum": [
219
+ "action_required",
220
+ "cancelled",
221
+ "failure",
222
+ "neutral",
223
+ "success",
224
+ "skipped",
225
+ "stale",
226
+ "timed_out"
227
+ ]
228
+ },
229
+ "completed_at": {
230
+ "type": "string",
231
+ "description": "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
232
+ },
233
+ "output": {
234
+ "type": "object",
235
+ "description": "Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run."
236
+ },
237
+ "actions": {
238
+ "type": "array",
239
+ "description": "Possible further actions the integrator can perform, which a user may trigger. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. To learn more about check runs and requested actions, see \"[Check runs and requested actions](https://docs.github.com/rest/guides/using-the-rest-api-to-interact-with-checks#check-runs-and-requested-actions).\""
240
+ }
241
+ },
242
+ "required": [
243
+ "owner",
244
+ "repo",
245
+ "check_run_id"
246
+ ]
247
+ }
248
+ },
249
+ {
250
+ "name": "checks_list_annotations",
251
+ "description": "List check run annotations",
252
+ "method": "GET",
253
+ "path": "/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
254
+ "deleteSendsJsonBody": false,
255
+ "inputSchema": {
256
+ "type": "object",
257
+ "properties": {
258
+ "owner": {
259
+ "type": "string",
260
+ "description": "The account owner of the repository. The name is not case sensitive."
261
+ },
262
+ "repo": {
263
+ "type": "string",
264
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
265
+ },
266
+ "check_run_id": {
267
+ "type": "number",
268
+ "description": "The unique identifier of the check run."
269
+ },
270
+ "per_page": {
271
+ "type": "number",
272
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
273
+ },
274
+ "page": {
275
+ "type": "number",
276
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
277
+ }
278
+ },
279
+ "required": [
280
+ "owner",
281
+ "repo",
282
+ "check_run_id"
283
+ ]
284
+ }
285
+ },
286
+ {
287
+ "name": "checks_rerequest_run",
288
+ "description": "Rerequest a check run",
289
+ "method": "POST",
290
+ "path": "/repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest",
291
+ "deleteSendsJsonBody": false,
292
+ "inputSchema": {
293
+ "type": "object",
294
+ "properties": {
295
+ "owner": {
296
+ "type": "string",
297
+ "description": "The account owner of the repository. The name is not case sensitive."
298
+ },
299
+ "repo": {
300
+ "type": "string",
301
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
302
+ },
303
+ "check_run_id": {
304
+ "type": "number",
305
+ "description": "The unique identifier of the check run."
306
+ }
307
+ },
308
+ "required": [
309
+ "owner",
310
+ "repo",
311
+ "check_run_id"
312
+ ]
313
+ }
314
+ },
315
+ {
316
+ "name": "checks_create_suite",
317
+ "description": "Create a check suite",
318
+ "method": "POST",
319
+ "path": "/repos/{owner}/{repo}/check-suites",
320
+ "deleteSendsJsonBody": false,
321
+ "inputSchema": {
322
+ "type": "object",
323
+ "properties": {
324
+ "owner": {
325
+ "type": "string",
326
+ "description": "The account owner of the repository. The name is not case sensitive."
327
+ },
328
+ "repo": {
329
+ "type": "string",
330
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
331
+ },
332
+ "head_sha": {
333
+ "type": "string",
334
+ "description": "The sha of the head commit."
335
+ }
336
+ },
337
+ "required": [
338
+ "owner",
339
+ "repo",
340
+ "head_sha"
341
+ ]
342
+ }
343
+ },
344
+ {
345
+ "name": "checks_set_suites_preferences",
346
+ "description": "Update repository preferences for check suites",
347
+ "method": "PATCH",
348
+ "path": "/repos/{owner}/{repo}/check-suites/preferences",
349
+ "deleteSendsJsonBody": false,
350
+ "inputSchema": {
351
+ "type": "object",
352
+ "properties": {
353
+ "owner": {
354
+ "type": "string",
355
+ "description": "The account owner of the repository. The name is not case sensitive."
356
+ },
357
+ "repo": {
358
+ "type": "string",
359
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
360
+ },
361
+ "auto_trigger_checks": {
362
+ "type": "array",
363
+ "description": "Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default."
364
+ }
365
+ },
366
+ "required": [
367
+ "owner",
368
+ "repo"
369
+ ]
370
+ }
371
+ },
372
+ {
373
+ "name": "checks_get_suite",
374
+ "description": "Get a check suite",
375
+ "method": "GET",
376
+ "path": "/repos/{owner}/{repo}/check-suites/{check_suite_id}",
377
+ "deleteSendsJsonBody": false,
378
+ "inputSchema": {
379
+ "type": "object",
380
+ "properties": {
381
+ "owner": {
382
+ "type": "string",
383
+ "description": "The account owner of the repository. The name is not case sensitive."
384
+ },
385
+ "repo": {
386
+ "type": "string",
387
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
388
+ },
389
+ "check_suite_id": {
390
+ "type": "number",
391
+ "description": "The unique identifier of the check suite."
392
+ }
393
+ },
394
+ "required": [
395
+ "owner",
396
+ "repo",
397
+ "check_suite_id"
398
+ ]
399
+ }
400
+ },
401
+ {
402
+ "name": "checks_list_for_suite",
403
+ "description": "List check runs in a check suite",
404
+ "method": "GET",
405
+ "path": "/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
406
+ "deleteSendsJsonBody": false,
407
+ "inputSchema": {
408
+ "type": "object",
409
+ "properties": {
410
+ "owner": {
411
+ "type": "string",
412
+ "description": "The account owner of the repository. The name is not case sensitive."
413
+ },
414
+ "repo": {
415
+ "type": "string",
416
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
417
+ },
418
+ "check_suite_id": {
419
+ "type": "number",
420
+ "description": "The unique identifier of the check suite."
421
+ },
422
+ "check_name": {
423
+ "type": "string",
424
+ "description": "Returns check runs with the specified `name`."
425
+ },
426
+ "status": {
427
+ "type": "string",
428
+ "description": "Returns check runs with the specified `status`.",
429
+ "enum": [
430
+ "queued",
431
+ "in_progress",
432
+ "completed"
433
+ ]
434
+ },
435
+ "filter": {
436
+ "type": "string",
437
+ "description": "Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs.",
438
+ "enum": [
439
+ "latest",
440
+ "all"
441
+ ]
442
+ },
443
+ "per_page": {
444
+ "type": "number",
445
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
446
+ },
447
+ "page": {
448
+ "type": "number",
449
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
450
+ }
451
+ },
452
+ "required": [
453
+ "owner",
454
+ "repo",
455
+ "check_suite_id"
456
+ ]
457
+ }
458
+ },
459
+ {
460
+ "name": "checks_rerequest_suite",
461
+ "description": "Rerequest a check suite",
462
+ "method": "POST",
463
+ "path": "/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest",
464
+ "deleteSendsJsonBody": false,
465
+ "inputSchema": {
466
+ "type": "object",
467
+ "properties": {
468
+ "owner": {
469
+ "type": "string",
470
+ "description": "The account owner of the repository. The name is not case sensitive."
471
+ },
472
+ "repo": {
473
+ "type": "string",
474
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
475
+ },
476
+ "check_suite_id": {
477
+ "type": "number",
478
+ "description": "The unique identifier of the check suite."
479
+ }
480
+ },
481
+ "required": [
482
+ "owner",
483
+ "repo",
484
+ "check_suite_id"
485
+ ]
486
+ }
487
+ },
488
+ {
489
+ "name": "checks_list_for_ref",
490
+ "description": "List check runs for a Git reference",
491
+ "method": "GET",
492
+ "path": "/repos/{owner}/{repo}/commits/{ref}/check-runs",
493
+ "deleteSendsJsonBody": false,
494
+ "inputSchema": {
495
+ "type": "object",
496
+ "properties": {
497
+ "owner": {
498
+ "type": "string",
499
+ "description": "The account owner of the repository. The name is not case sensitive."
500
+ },
501
+ "repo": {
502
+ "type": "string",
503
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
504
+ },
505
+ "ref": {
506
+ "type": "string",
507
+ "description": "The commit reference. Can be a commit SHA, branch name (`heads/BRANCH_NAME`), or tag name (`tags/TAG_NAME`). For more information, see \"[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)\" in the Git documentation."
508
+ },
509
+ "check_name": {
510
+ "type": "string",
511
+ "description": "Returns check runs with the specified `name`."
512
+ },
513
+ "status": {
514
+ "type": "string",
515
+ "description": "Returns check runs with the specified `status`.",
516
+ "enum": [
517
+ "queued",
518
+ "in_progress",
519
+ "completed"
520
+ ]
521
+ },
522
+ "filter": {
523
+ "type": "string",
524
+ "description": "Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs.",
525
+ "enum": [
526
+ "latest",
527
+ "all"
528
+ ]
529
+ },
530
+ "per_page": {
531
+ "type": "number",
532
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
533
+ },
534
+ "page": {
535
+ "type": "number",
536
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
537
+ },
538
+ "app_id": {
539
+ "type": "number",
540
+ "description": "The app_id parameter"
541
+ }
542
+ },
543
+ "required": [
544
+ "owner",
545
+ "repo",
546
+ "ref"
547
+ ]
548
+ }
549
+ },
550
+ {
551
+ "name": "checks_list_suites_for_ref",
552
+ "description": "List check suites for a Git reference",
553
+ "method": "GET",
554
+ "path": "/repos/{owner}/{repo}/commits/{ref}/check-suites",
555
+ "deleteSendsJsonBody": false,
556
+ "inputSchema": {
557
+ "type": "object",
558
+ "properties": {
559
+ "owner": {
560
+ "type": "string",
561
+ "description": "The account owner of the repository. The name is not case sensitive."
562
+ },
563
+ "repo": {
564
+ "type": "string",
565
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
566
+ },
567
+ "ref": {
568
+ "type": "string",
569
+ "description": "The commit reference. Can be a commit SHA, branch name (`heads/BRANCH_NAME`), or tag name (`tags/TAG_NAME`). For more information, see \"[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)\" in the Git documentation."
570
+ },
571
+ "app_id": {
572
+ "type": "number",
573
+ "description": "Filters check suites by GitHub App `id`."
574
+ },
575
+ "check_name": {
576
+ "type": "string",
577
+ "description": "Returns check runs with the specified `name`."
578
+ },
579
+ "per_page": {
580
+ "type": "number",
581
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
582
+ },
583
+ "page": {
584
+ "type": "number",
585
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
586
+ }
587
+ },
588
+ "required": [
589
+ "owner",
590
+ "repo",
591
+ "ref"
592
+ ]
593
+ }
594
+ }
595
+ ];
596
+
597
+ export const tools = ENDPOINTS.map((e) => ({
598
+ name: e.name,
599
+ description: e.description,
600
+ method: e.method,
601
+ path: e.path,
602
+ deleteSendsJsonBody: Boolean(e.deleteSendsJsonBody),
603
+ inputSchema: e.inputSchema,
604
+ handler: async (params) => ({
605
+ content: [{ type: 'text', text: JSON.stringify(await apiRequest(e.method, e.path, params, { deleteSendsJsonBody: e.deleteSendsJsonBody }), null, 2) }],
606
+ }),
607
+ }));
@@ -0,0 +1,53 @@
1
+ import { saveCredentials, getCredentials } from '../../core/auth-manager.js';
2
+ import readline from 'readline';
3
+
4
+ const APP_ID = 'github-code-scanning';
5
+
6
+ export async function runAuth() {
7
+ const rl = readline.createInterface({
8
+ input: process.stdin,
9
+ output: process.stdout,
10
+ });
11
+
12
+ console.log(`
13
+ ┌─────────────────────────────────────────────┐
14
+ │ GitHub Code Scanning Authentication │
15
+ │ │
16
+ │ Use a GitHub Personal Access Token (PAT). │
17
+ │ Create one in Settings → Developer │
18
+ │ settings → Personal access tokens. │
19
+ └─────────────────────────────────────────────┘
20
+ `);
21
+
22
+ const token = await new Promise((resolve) => {
23
+ rl.question('Paste your GitHub PAT: ', (answer) => {
24
+ rl.close();
25
+ resolve(answer.trim());
26
+ });
27
+ });
28
+
29
+ if (!token || token.length < 10) {
30
+ throw new Error('Invalid token');
31
+ }
32
+
33
+ saveCredentials(APP_ID, {
34
+ token,
35
+ tokenType: 'bearer',
36
+ expiresAt: null,
37
+ savedAt: new Date().toISOString(),
38
+ });
39
+
40
+ console.log('✅ Token saved for GitHub Code Scanning');
41
+ }
42
+
43
+ export function getToken() {
44
+ return getCredentials(APP_ID)?.token || null;
45
+ }
46
+
47
+ export function buildAuthHeaders() {
48
+ const token = getToken();
49
+ if (!token) {
50
+ throw new Error('Not authenticated. Run: npx adoptai-github-code-scanning-mcp --client cursor');
51
+ }
52
+ return { Authorization: 'Bearer ' + token };
53
+ }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { createMCPServer } from '../../core/server-base.js';
3
+ import { tools } from './tools.js';
4
+
5
+ const { start } = createMCPServer({
6
+ name: 'github-code-scanning-adoptai',
7
+ version: '1.0.0',
8
+ tools,
9
+ });
10
+
11
+ start();