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,545 @@
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-gists';
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": "gists_list",
55
+ "description": "List gists for the authenticated user",
56
+ "method": "GET",
57
+ "path": "/gists",
58
+ "deleteSendsJsonBody": false,
59
+ "inputSchema": {
60
+ "type": "object",
61
+ "properties": {
62
+ "since": {
63
+ "type": "string",
64
+ "description": "Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
65
+ },
66
+ "per_page": {
67
+ "type": "number",
68
+ "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).\""
69
+ },
70
+ "page": {
71
+ "type": "number",
72
+ "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).\""
73
+ }
74
+ },
75
+ "required": []
76
+ }
77
+ },
78
+ {
79
+ "name": "gists_create",
80
+ "description": "Create a gist",
81
+ "method": "POST",
82
+ "path": "/gists",
83
+ "deleteSendsJsonBody": false,
84
+ "inputSchema": {
85
+ "type": "object",
86
+ "properties": {
87
+ "description": {
88
+ "type": "string",
89
+ "description": "Description of the gist"
90
+ },
91
+ "files": {
92
+ "type": "object",
93
+ "description": "Names and content for the files that make up the gist"
94
+ },
95
+ "public": {
96
+ "type": "string",
97
+ "description": "The public field"
98
+ }
99
+ },
100
+ "required": [
101
+ "files"
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "name": "gists_list_public",
107
+ "description": "List public gists",
108
+ "method": "GET",
109
+ "path": "/gists/public",
110
+ "deleteSendsJsonBody": false,
111
+ "inputSchema": {
112
+ "type": "object",
113
+ "properties": {
114
+ "since": {
115
+ "type": "string",
116
+ "description": "Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
117
+ },
118
+ "per_page": {
119
+ "type": "number",
120
+ "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).\""
121
+ },
122
+ "page": {
123
+ "type": "number",
124
+ "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).\""
125
+ }
126
+ },
127
+ "required": []
128
+ }
129
+ },
130
+ {
131
+ "name": "gists_list_starred",
132
+ "description": "List starred gists",
133
+ "method": "GET",
134
+ "path": "/gists/starred",
135
+ "deleteSendsJsonBody": false,
136
+ "inputSchema": {
137
+ "type": "object",
138
+ "properties": {
139
+ "since": {
140
+ "type": "string",
141
+ "description": "Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
142
+ },
143
+ "per_page": {
144
+ "type": "number",
145
+ "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).\""
146
+ },
147
+ "page": {
148
+ "type": "number",
149
+ "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).\""
150
+ }
151
+ },
152
+ "required": []
153
+ }
154
+ },
155
+ {
156
+ "name": "gists_get",
157
+ "description": "Get a gist",
158
+ "method": "GET",
159
+ "path": "/gists/{gist_id}",
160
+ "deleteSendsJsonBody": false,
161
+ "inputSchema": {
162
+ "type": "object",
163
+ "properties": {
164
+ "gist_id": {
165
+ "type": "string",
166
+ "description": "The unique identifier of the gist."
167
+ }
168
+ },
169
+ "required": [
170
+ "gist_id"
171
+ ]
172
+ }
173
+ },
174
+ {
175
+ "name": "gists_update",
176
+ "description": "Update a gist",
177
+ "method": "PATCH",
178
+ "path": "/gists/{gist_id}",
179
+ "deleteSendsJsonBody": false,
180
+ "inputSchema": {
181
+ "type": "object",
182
+ "properties": {
183
+ "gist_id": {
184
+ "type": "string",
185
+ "description": "The unique identifier of the gist."
186
+ },
187
+ "description": {
188
+ "type": "string",
189
+ "description": "The description of the gist."
190
+ },
191
+ "files": {
192
+ "type": "object",
193
+ "description": "The gist files to be updated, renamed, or deleted. Each `key` must match the current filename\n(including extension) of the targeted gist file. For example: `hello.py`.\n\nTo delete a file, set the whole file to null. For example: `hello.py : null`. The file will also be\ndeleted if the specified object does not contain at least one of `content` or `filename`."
194
+ }
195
+ },
196
+ "required": [
197
+ "gist_id"
198
+ ]
199
+ }
200
+ },
201
+ {
202
+ "name": "gists_delete",
203
+ "description": "Delete a gist",
204
+ "method": "DELETE",
205
+ "path": "/gists/{gist_id}",
206
+ "deleteSendsJsonBody": false,
207
+ "inputSchema": {
208
+ "type": "object",
209
+ "properties": {
210
+ "gist_id": {
211
+ "type": "string",
212
+ "description": "The unique identifier of the gist."
213
+ }
214
+ },
215
+ "required": [
216
+ "gist_id"
217
+ ]
218
+ }
219
+ },
220
+ {
221
+ "name": "gists_list_comments",
222
+ "description": "List gist comments",
223
+ "method": "GET",
224
+ "path": "/gists/{gist_id}/comments",
225
+ "deleteSendsJsonBody": false,
226
+ "inputSchema": {
227
+ "type": "object",
228
+ "properties": {
229
+ "gist_id": {
230
+ "type": "string",
231
+ "description": "The unique identifier of the gist."
232
+ },
233
+ "per_page": {
234
+ "type": "number",
235
+ "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).\""
236
+ },
237
+ "page": {
238
+ "type": "number",
239
+ "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).\""
240
+ }
241
+ },
242
+ "required": [
243
+ "gist_id"
244
+ ]
245
+ }
246
+ },
247
+ {
248
+ "name": "gists_create_comment",
249
+ "description": "Create a gist comment",
250
+ "method": "POST",
251
+ "path": "/gists/{gist_id}/comments",
252
+ "deleteSendsJsonBody": false,
253
+ "inputSchema": {
254
+ "type": "object",
255
+ "properties": {
256
+ "gist_id": {
257
+ "type": "string",
258
+ "description": "The unique identifier of the gist."
259
+ },
260
+ "body": {
261
+ "type": "string",
262
+ "description": "The comment text."
263
+ }
264
+ },
265
+ "required": [
266
+ "gist_id",
267
+ "body"
268
+ ]
269
+ }
270
+ },
271
+ {
272
+ "name": "gists_get_comment",
273
+ "description": "Get a gist comment",
274
+ "method": "GET",
275
+ "path": "/gists/{gist_id}/comments/{comment_id}",
276
+ "deleteSendsJsonBody": false,
277
+ "inputSchema": {
278
+ "type": "object",
279
+ "properties": {
280
+ "gist_id": {
281
+ "type": "string",
282
+ "description": "The unique identifier of the gist."
283
+ },
284
+ "comment_id": {
285
+ "type": "number",
286
+ "description": "The unique identifier of the comment."
287
+ }
288
+ },
289
+ "required": [
290
+ "gist_id",
291
+ "comment_id"
292
+ ]
293
+ }
294
+ },
295
+ {
296
+ "name": "gists_update_comment",
297
+ "description": "Update a gist comment",
298
+ "method": "PATCH",
299
+ "path": "/gists/{gist_id}/comments/{comment_id}",
300
+ "deleteSendsJsonBody": false,
301
+ "inputSchema": {
302
+ "type": "object",
303
+ "properties": {
304
+ "gist_id": {
305
+ "type": "string",
306
+ "description": "The unique identifier of the gist."
307
+ },
308
+ "comment_id": {
309
+ "type": "number",
310
+ "description": "The unique identifier of the comment."
311
+ },
312
+ "body": {
313
+ "type": "string",
314
+ "description": "The comment text."
315
+ }
316
+ },
317
+ "required": [
318
+ "gist_id",
319
+ "comment_id",
320
+ "body"
321
+ ]
322
+ }
323
+ },
324
+ {
325
+ "name": "gists_delete_comment",
326
+ "description": "Delete a gist comment",
327
+ "method": "DELETE",
328
+ "path": "/gists/{gist_id}/comments/{comment_id}",
329
+ "deleteSendsJsonBody": false,
330
+ "inputSchema": {
331
+ "type": "object",
332
+ "properties": {
333
+ "gist_id": {
334
+ "type": "string",
335
+ "description": "The unique identifier of the gist."
336
+ },
337
+ "comment_id": {
338
+ "type": "number",
339
+ "description": "The unique identifier of the comment."
340
+ }
341
+ },
342
+ "required": [
343
+ "gist_id",
344
+ "comment_id"
345
+ ]
346
+ }
347
+ },
348
+ {
349
+ "name": "gists_list_commits",
350
+ "description": "List gist commits",
351
+ "method": "GET",
352
+ "path": "/gists/{gist_id}/commits",
353
+ "deleteSendsJsonBody": false,
354
+ "inputSchema": {
355
+ "type": "object",
356
+ "properties": {
357
+ "gist_id": {
358
+ "type": "string",
359
+ "description": "The unique identifier of the gist."
360
+ },
361
+ "per_page": {
362
+ "type": "number",
363
+ "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).\""
364
+ },
365
+ "page": {
366
+ "type": "number",
367
+ "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).\""
368
+ }
369
+ },
370
+ "required": [
371
+ "gist_id"
372
+ ]
373
+ }
374
+ },
375
+ {
376
+ "name": "gists_list_forks",
377
+ "description": "List gist forks",
378
+ "method": "GET",
379
+ "path": "/gists/{gist_id}/forks",
380
+ "deleteSendsJsonBody": false,
381
+ "inputSchema": {
382
+ "type": "object",
383
+ "properties": {
384
+ "gist_id": {
385
+ "type": "string",
386
+ "description": "The unique identifier of the gist."
387
+ },
388
+ "per_page": {
389
+ "type": "number",
390
+ "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).\""
391
+ },
392
+ "page": {
393
+ "type": "number",
394
+ "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).\""
395
+ }
396
+ },
397
+ "required": [
398
+ "gist_id"
399
+ ]
400
+ }
401
+ },
402
+ {
403
+ "name": "gists_fork",
404
+ "description": "Fork a gist",
405
+ "method": "POST",
406
+ "path": "/gists/{gist_id}/forks",
407
+ "deleteSendsJsonBody": false,
408
+ "inputSchema": {
409
+ "type": "object",
410
+ "properties": {
411
+ "gist_id": {
412
+ "type": "string",
413
+ "description": "The unique identifier of the gist."
414
+ }
415
+ },
416
+ "required": [
417
+ "gist_id"
418
+ ]
419
+ }
420
+ },
421
+ {
422
+ "name": "gists_check_is_starred",
423
+ "description": "Check if a gist is starred",
424
+ "method": "GET",
425
+ "path": "/gists/{gist_id}/star",
426
+ "deleteSendsJsonBody": false,
427
+ "inputSchema": {
428
+ "type": "object",
429
+ "properties": {
430
+ "gist_id": {
431
+ "type": "string",
432
+ "description": "The unique identifier of the gist."
433
+ }
434
+ },
435
+ "required": [
436
+ "gist_id"
437
+ ]
438
+ }
439
+ },
440
+ {
441
+ "name": "gists_star",
442
+ "description": "Star a gist",
443
+ "method": "PUT",
444
+ "path": "/gists/{gist_id}/star",
445
+ "deleteSendsJsonBody": false,
446
+ "inputSchema": {
447
+ "type": "object",
448
+ "properties": {
449
+ "gist_id": {
450
+ "type": "string",
451
+ "description": "The unique identifier of the gist."
452
+ }
453
+ },
454
+ "required": [
455
+ "gist_id"
456
+ ]
457
+ }
458
+ },
459
+ {
460
+ "name": "gists_unstar",
461
+ "description": "Unstar a gist",
462
+ "method": "DELETE",
463
+ "path": "/gists/{gist_id}/star",
464
+ "deleteSendsJsonBody": false,
465
+ "inputSchema": {
466
+ "type": "object",
467
+ "properties": {
468
+ "gist_id": {
469
+ "type": "string",
470
+ "description": "The unique identifier of the gist."
471
+ }
472
+ },
473
+ "required": [
474
+ "gist_id"
475
+ ]
476
+ }
477
+ },
478
+ {
479
+ "name": "gists_get_revision",
480
+ "description": "Get a gist revision",
481
+ "method": "GET",
482
+ "path": "/gists/{gist_id}/{sha}",
483
+ "deleteSendsJsonBody": false,
484
+ "inputSchema": {
485
+ "type": "object",
486
+ "properties": {
487
+ "gist_id": {
488
+ "type": "string",
489
+ "description": "The unique identifier of the gist."
490
+ },
491
+ "sha": {
492
+ "type": "string",
493
+ "description": "The sha parameter"
494
+ }
495
+ },
496
+ "required": [
497
+ "gist_id",
498
+ "sha"
499
+ ]
500
+ }
501
+ },
502
+ {
503
+ "name": "gists_list_for_user",
504
+ "description": "List gists for a user",
505
+ "method": "GET",
506
+ "path": "/users/{username}/gists",
507
+ "deleteSendsJsonBody": false,
508
+ "inputSchema": {
509
+ "type": "object",
510
+ "properties": {
511
+ "username": {
512
+ "type": "string",
513
+ "description": "The handle for the GitHub user account."
514
+ },
515
+ "since": {
516
+ "type": "string",
517
+ "description": "Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
518
+ },
519
+ "per_page": {
520
+ "type": "number",
521
+ "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).\""
522
+ },
523
+ "page": {
524
+ "type": "number",
525
+ "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).\""
526
+ }
527
+ },
528
+ "required": [
529
+ "username"
530
+ ]
531
+ }
532
+ }
533
+ ];
534
+
535
+ export const tools = ENDPOINTS.map((e) => ({
536
+ name: e.name,
537
+ description: e.description,
538
+ method: e.method,
539
+ path: e.path,
540
+ deleteSendsJsonBody: Boolean(e.deleteSendsJsonBody),
541
+ inputSchema: e.inputSchema,
542
+ handler: async (params) => ({
543
+ content: [{ type: 'text', text: JSON.stringify(await apiRequest(e.method, e.path, params, { deleteSendsJsonBody: e.deleteSendsJsonBody }), null, 2) }],
544
+ }),
545
+ }));
@@ -0,0 +1,53 @@
1
+ import { saveCredentials, getCredentials } from '../../core/auth-manager.js';
2
+ import readline from 'readline';
3
+
4
+ const APP_ID = 'github-git';
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 Git 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 Git');
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-git-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-git-adoptai',
7
+ version: '1.0.0',
8
+ tools,
9
+ });
10
+
11
+ start();
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "adoptai-github-git-mcp",
3
+ "version": "1.0.0",
4
+ "description": "GitHub's v3 REST API — git database objects, refs, tags, trees, commits, blobs, and related endpoints (OpenAPI-derived).",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "adoptai-github-git-mcp": "./setup.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node index.js",
12
+ "setup": "node setup.js"
13
+ },
14
+ "keywords": ["mcp", "github", "github-git", "git", "ai", "cursor", "claude", "adopt.ai"],
15
+ "license": "MIT",
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.0.0",
18
+ "axios": "^1.6.0"
19
+ },
20
+ "adoptai": {
21
+ "appId": "github-git",
22
+ "toolCount": 13,
23
+ "sourceFormat": "openapi_3.1",
24
+ "authType": "bearer",
25
+ "generatedAt": "2026-03-26T12:00:00.000Z"
26
+ }
27
+ }