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.
- package/README.md +70 -0
- package/bin/adoptai-mcp.js +2 -0
- package/dist/apps/canva.js +1 -0
- package/dist/apps/figma.js +1 -0
- package/dist/apps/github.js +2 -0
- package/dist/apps/notion.js +1 -0
- package/dist/apps/registry.js +20 -0
- package/dist/apps/salesforce.js +1 -0
- package/dist/cli/add.js +532 -0
- package/dist/cli/index.js +39 -0
- package/dist/cli/list.js +19 -0
- package/dist/cli/remove.js +37 -0
- package/dist/cli/serve.js +27 -0
- package/dist/cli/status.js +24 -0
- package/dist/config/clients.js +118 -0
- package/dist/config/credentials.js +34 -0
- package/dist/core/auth-manager.js +237 -0
- package/dist/core/config-writer.js +161 -0
- package/dist/core/doctor.js +199 -0
- package/dist/core/package.json +3 -0
- package/dist/core/server-base.js +81 -0
- package/dist/integrations/canva/.env +3 -0
- package/dist/integrations/canva/auth.js +287 -0
- package/dist/integrations/canva/env.js +9 -0
- package/dist/integrations/canva/index.js +12 -0
- package/dist/integrations/canva/package.json +31 -0
- package/dist/integrations/canva/publish-to-adoptai.js +365 -0
- package/dist/integrations/canva/setup.js +90 -0
- package/dist/integrations/canva/tools.js +1315 -0
- package/dist/integrations/canva/tools.original.js +1315 -0
- package/dist/integrations/figma/auth.js +48 -0
- package/dist/integrations/figma/index.js +11 -0
- package/dist/integrations/figma/package.json +27 -0
- package/dist/integrations/figma/publish-to-adoptai.js +384 -0
- package/dist/integrations/figma/setup.js +90 -0
- package/dist/integrations/figma/tools.js +1137 -0
- package/dist/integrations/github/auth.js +53 -0
- package/dist/integrations/github/index.js +11 -0
- package/dist/integrations/github/package.json +28 -0
- package/dist/integrations/github/publish-to-adoptai.js +240 -0
- package/dist/integrations/github/setup.js +103 -0
- package/dist/integrations/github/tools.js +78 -0
- package/dist/integrations/github-actions/auth.js +53 -0
- package/dist/integrations/github-actions/index.js +11 -0
- package/dist/integrations/github-actions/package.json +27 -0
- package/dist/integrations/github-actions/setup.js +103 -0
- package/dist/integrations/github-actions/tools.js +5642 -0
- package/dist/integrations/github-activity/auth.js +53 -0
- package/dist/integrations/github-activity/index.js +11 -0
- package/dist/integrations/github-activity/package.json +27 -0
- package/dist/integrations/github-activity/setup.js +103 -0
- package/dist/integrations/github-activity/tools.js +925 -0
- package/dist/integrations/github-apps/auth.js +53 -0
- package/dist/integrations/github-apps/index.js +11 -0
- package/dist/integrations/github-apps/package.json +27 -0
- package/dist/integrations/github-apps/setup.js +103 -0
- package/dist/integrations/github-apps/tools.js +791 -0
- package/dist/integrations/github-billing/auth.js +53 -0
- package/dist/integrations/github-billing/index.js +11 -0
- package/dist/integrations/github-billing/package.json +27 -0
- package/dist/integrations/github-billing/setup.js +103 -0
- package/dist/integrations/github-billing/tools.js +438 -0
- package/dist/integrations/github-checks/auth.js +53 -0
- package/dist/integrations/github-checks/index.js +11 -0
- package/dist/integrations/github-checks/package.json +27 -0
- package/dist/integrations/github-checks/setup.js +103 -0
- package/dist/integrations/github-checks/tools.js +607 -0
- package/dist/integrations/github-code-scanning/auth.js +53 -0
- package/dist/integrations/github-code-scanning/index.js +11 -0
- package/dist/integrations/github-code-scanning/package.json +27 -0
- package/dist/integrations/github-code-scanning/setup.js +103 -0
- package/dist/integrations/github-code-scanning/tools.js +987 -0
- package/dist/integrations/github-dependabot/auth.js +53 -0
- package/dist/integrations/github-dependabot/index.js +11 -0
- package/dist/integrations/github-dependabot/package.json +27 -0
- package/dist/integrations/github-dependabot/setup.js +103 -0
- package/dist/integrations/github-dependabot/tools.js +915 -0
- package/dist/integrations/github-gists/auth.js +53 -0
- package/dist/integrations/github-gists/index.js +11 -0
- package/dist/integrations/github-gists/package.json +27 -0
- package/dist/integrations/github-gists/setup.js +103 -0
- package/dist/integrations/github-gists/tools.js +545 -0
- package/dist/integrations/github-git/auth.js +53 -0
- package/dist/integrations/github-git/index.js +11 -0
- package/dist/integrations/github-git/package.json +27 -0
- package/dist/integrations/github-git/setup.js +103 -0
- package/dist/integrations/github-git/tools.js +513 -0
- package/dist/integrations/github-issues/auth.js +53 -0
- package/dist/integrations/github-issues/index.js +11 -0
- package/dist/integrations/github-issues/package.json +27 -0
- package/dist/integrations/github-issues/setup.js +103 -0
- package/dist/integrations/github-issues/tools.js +2232 -0
- package/dist/integrations/github-orgs/auth.js +53 -0
- package/dist/integrations/github-orgs/index.js +11 -0
- package/dist/integrations/github-orgs/package.json +27 -0
- package/dist/integrations/github-orgs/setup.js +103 -0
- package/dist/integrations/github-orgs/tools.js +3512 -0
- package/dist/integrations/github-packages/auth.js +53 -0
- package/dist/integrations/github-packages/index.js +11 -0
- package/dist/integrations/github-packages/package.json +27 -0
- package/dist/integrations/github-packages/setup.js +103 -0
- package/dist/integrations/github-packages/tools.js +1088 -0
- package/dist/integrations/github-pulls/auth.js +53 -0
- package/dist/integrations/github-pulls/index.js +11 -0
- package/dist/integrations/github-pulls/package.json +27 -0
- package/dist/integrations/github-pulls/setup.js +103 -0
- package/dist/integrations/github-pulls/tools.js +1252 -0
- package/dist/integrations/github-reactions/auth.js +53 -0
- package/dist/integrations/github-reactions/index.js +11 -0
- package/dist/integrations/github-reactions/package.json +27 -0
- package/dist/integrations/github-reactions/setup.js +103 -0
- package/dist/integrations/github-reactions/tools.js +706 -0
- package/dist/integrations/github-repos/auth.js +53 -0
- package/dist/integrations/github-repos/index.js +11 -0
- package/dist/integrations/github-repos/package.json +27 -0
- package/dist/integrations/github-repos/setup.js +103 -0
- package/dist/integrations/github-repos/tools.js +7286 -0
- package/dist/integrations/github-search/auth.js +53 -0
- package/dist/integrations/github-search/index.js +11 -0
- package/dist/integrations/github-search/package.json +27 -0
- package/dist/integrations/github-search/setup.js +103 -0
- package/dist/integrations/github-search/tools.js +370 -0
- package/dist/integrations/github-teams/auth.js +53 -0
- package/dist/integrations/github-teams/index.js +11 -0
- package/dist/integrations/github-teams/package.json +27 -0
- package/dist/integrations/github-teams/setup.js +103 -0
- package/dist/integrations/github-teams/tools.js +633 -0
- package/dist/integrations/github-users/auth.js +53 -0
- package/dist/integrations/github-users/index.js +11 -0
- package/dist/integrations/github-users/package.json +27 -0
- package/dist/integrations/github-users/setup.js +103 -0
- package/dist/integrations/github-users/tools.js +1118 -0
- package/dist/integrations/notion/api.js +108 -0
- package/dist/integrations/notion/auth.js +59 -0
- package/dist/integrations/notion/endpoints.json +630 -0
- package/dist/integrations/notion/index.js +11 -0
- package/dist/integrations/notion/package.json +33 -0
- package/dist/integrations/notion/publish-to-adoptai.js +271 -0
- package/dist/integrations/notion/scripts/generate-endpoints.mjs +306 -0
- package/dist/integrations/notion/setup.js +89 -0
- package/dist/integrations/notion/tools.js +586 -0
- package/dist/integrations/notion/tools.original.js +568 -0
- package/dist/integrations/salesforce/.env +8 -0
- package/dist/integrations/salesforce/.env.example +15 -0
- package/dist/integrations/salesforce/auth.js +311 -0
- package/dist/integrations/salesforce/endpoints.json +1359 -0
- package/dist/integrations/salesforce/env.js +9 -0
- package/dist/integrations/salesforce/index.js +12 -0
- package/dist/integrations/salesforce/package.json +42 -0
- package/dist/integrations/salesforce/publish-smart-specs.js +890 -0
- package/dist/integrations/salesforce/publish-to-adoptai.js +386 -0
- package/dist/integrations/salesforce/scripts/extract-postman.mjs +222 -0
- package/dist/integrations/salesforce/setup.js +112 -0
- package/dist/integrations/salesforce/tools.js +4544 -0
- package/dist/integrations/salesforce/tools.original.js +4487 -0
- package/dist/server/mcp-server.js +50 -0
- package/dist/server/tool-loader.js +47 -0
- package/dist/specs/figma-api.json +13621 -0
- package/dist/specs/split/salesforce-auth.json +3931 -0
- package/dist/specs/split/salesforce-bulk-v1.json +1489 -0
- package/dist/specs/split/salesforce-bulk-v2.json +1951 -0
- package/dist/specs/split/salesforce-composite.json +1246 -0
- package/dist/specs/split/salesforce-connect.json +11639 -0
- package/dist/specs/split/salesforce-einstein-prediction-service.json +576 -0
- package/dist/specs/split/salesforce-event-platform.json +2682 -0
- package/dist/specs/split/salesforce-graphql.json +1754 -0
- package/dist/specs/split/salesforce-industries.json +4115 -0
- package/dist/specs/split/salesforce-metadata.json +555 -0
- package/dist/specs/split/salesforce-rest.json +4798 -0
- package/dist/specs/split/salesforce-soap.json +210 -0
- package/dist/specs/split/salesforce-subscription-management.json +1299 -0
- package/dist/specs/split/salesforce-tooling.json +2026 -0
- package/dist/specs/split/salesforce-ui.json +7426 -0
- package/package.json +47 -0
|
@@ -0,0 +1,633 @@
|
|
|
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-teams';
|
|
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": "teams_list",
|
|
55
|
+
"description": "List teams",
|
|
56
|
+
"method": "GET",
|
|
57
|
+
"path": "/orgs/{org}/teams",
|
|
58
|
+
"deleteSendsJsonBody": false,
|
|
59
|
+
"inputSchema": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"org": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "The organization name. The name is not case sensitive."
|
|
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
|
+
"team_type": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Filter team results by their type. For more information, see \"[What kind of team should I use?](https://docs.github.com/enterprise-cloud@latest/admin/concepts/enterprise-fundamentals/teams-in-an-enterprise#what-kind-of-team-should-i-use)\"",
|
|
77
|
+
"enum": [
|
|
78
|
+
"all",
|
|
79
|
+
"enterprise",
|
|
80
|
+
"organization"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"org"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "teams_create",
|
|
91
|
+
"description": "Create a team",
|
|
92
|
+
"method": "POST",
|
|
93
|
+
"path": "/orgs/{org}/teams",
|
|
94
|
+
"deleteSendsJsonBody": false,
|
|
95
|
+
"inputSchema": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"org": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "The organization name. The name is not case sensitive."
|
|
101
|
+
},
|
|
102
|
+
"name": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "The name of the team."
|
|
105
|
+
},
|
|
106
|
+
"description": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "The description of the team."
|
|
109
|
+
},
|
|
110
|
+
"maintainers": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"description": "List GitHub usernames for organization members who will become team maintainers."
|
|
113
|
+
},
|
|
114
|
+
"repo_names": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"description": "The full name (e.g., \"organization-name/repository-name\") of repositories to add the team to."
|
|
117
|
+
},
|
|
118
|
+
"privacy": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"description": "The level of privacy this team should have. The options are: \n**For a non-nested team:** \n * `secret` - only visible to organization owners and members of this team. \n * `closed` - visible to all members of this organization. \nDefault: `secret` \n**For a parent or child team:** \n * `closed` - visible to all members of this organization. \nDefault for child team: `closed`",
|
|
121
|
+
"enum": [
|
|
122
|
+
"secret",
|
|
123
|
+
"closed"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"notification_setting": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"description": "The notification setting the team has chosen. The options are: \n * `notifications_enabled` - team members receive notifications when the team is @mentioned. \n * `notifications_disabled` - no one receives notifications. \nDefault: `notifications_enabled`",
|
|
129
|
+
"enum": [
|
|
130
|
+
"notifications_enabled",
|
|
131
|
+
"notifications_disabled"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"permission": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"description": "**Closing down notice**. The permission that new repositories will be added to the team with when none is specified.",
|
|
137
|
+
"enum": [
|
|
138
|
+
"pull",
|
|
139
|
+
"push"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"parent_team_id": {
|
|
143
|
+
"type": "number",
|
|
144
|
+
"description": "The ID of a team to set as the parent team."
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"required": [
|
|
148
|
+
"org",
|
|
149
|
+
"name"
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "teams_get_by_name",
|
|
155
|
+
"description": "Get a team by name",
|
|
156
|
+
"method": "GET",
|
|
157
|
+
"path": "/orgs/{org}/teams/{team_slug}",
|
|
158
|
+
"deleteSendsJsonBody": false,
|
|
159
|
+
"inputSchema": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"properties": {
|
|
162
|
+
"org": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"description": "The organization name. The name is not case sensitive."
|
|
165
|
+
},
|
|
166
|
+
"team_slug": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"description": "The slug of the team name."
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"required": [
|
|
172
|
+
"org",
|
|
173
|
+
"team_slug"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "teams_update_in_org",
|
|
179
|
+
"description": "Update a team",
|
|
180
|
+
"method": "PATCH",
|
|
181
|
+
"path": "/orgs/{org}/teams/{team_slug}",
|
|
182
|
+
"deleteSendsJsonBody": false,
|
|
183
|
+
"inputSchema": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"properties": {
|
|
186
|
+
"org": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"description": "The organization name. The name is not case sensitive."
|
|
189
|
+
},
|
|
190
|
+
"team_slug": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"description": "The slug of the team name."
|
|
193
|
+
},
|
|
194
|
+
"name": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"description": "The name of the team."
|
|
197
|
+
},
|
|
198
|
+
"description": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"description": "The description of the team."
|
|
201
|
+
},
|
|
202
|
+
"privacy": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"description": "The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are: \n**For a non-nested team:** \n * `secret` - only visible to organization owners and members of this team. \n * `closed` - visible to all members of this organization. \n**For a parent or child team:** \n * `closed` - visible to all members of this organization.",
|
|
205
|
+
"enum": [
|
|
206
|
+
"secret",
|
|
207
|
+
"closed"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"notification_setting": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"description": "The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: \n * `notifications_enabled` - team members receive notifications when the team is @mentioned. \n * `notifications_disabled` - no one receives notifications.",
|
|
213
|
+
"enum": [
|
|
214
|
+
"notifications_enabled",
|
|
215
|
+
"notifications_disabled"
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"permission": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"description": "**Closing down notice**. The permission that new repositories will be added to the team with when none is specified.",
|
|
221
|
+
"enum": [
|
|
222
|
+
"pull",
|
|
223
|
+
"push",
|
|
224
|
+
"admin"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"parent_team_id": {
|
|
228
|
+
"type": "number",
|
|
229
|
+
"description": "The ID of a team to set as the parent team."
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"required": [
|
|
233
|
+
"org",
|
|
234
|
+
"team_slug"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "teams_delete_in_org",
|
|
240
|
+
"description": "Delete a team",
|
|
241
|
+
"method": "DELETE",
|
|
242
|
+
"path": "/orgs/{org}/teams/{team_slug}",
|
|
243
|
+
"deleteSendsJsonBody": false,
|
|
244
|
+
"inputSchema": {
|
|
245
|
+
"type": "object",
|
|
246
|
+
"properties": {
|
|
247
|
+
"org": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"description": "The organization name. The name is not case sensitive."
|
|
250
|
+
},
|
|
251
|
+
"team_slug": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"description": "The slug of the team name."
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"required": [
|
|
257
|
+
"org",
|
|
258
|
+
"team_slug"
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "teams_list_pending_invitations_in_org",
|
|
264
|
+
"description": "List pending team invitations",
|
|
265
|
+
"method": "GET",
|
|
266
|
+
"path": "/orgs/{org}/teams/{team_slug}/invitations",
|
|
267
|
+
"deleteSendsJsonBody": false,
|
|
268
|
+
"inputSchema": {
|
|
269
|
+
"type": "object",
|
|
270
|
+
"properties": {
|
|
271
|
+
"org": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"description": "The organization name. The name is not case sensitive."
|
|
274
|
+
},
|
|
275
|
+
"team_slug": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"description": "The slug of the team name."
|
|
278
|
+
},
|
|
279
|
+
"per_page": {
|
|
280
|
+
"type": "number",
|
|
281
|
+
"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).\""
|
|
282
|
+
},
|
|
283
|
+
"page": {
|
|
284
|
+
"type": "number",
|
|
285
|
+
"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).\""
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"required": [
|
|
289
|
+
"org",
|
|
290
|
+
"team_slug"
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "teams_list_members_in_org",
|
|
296
|
+
"description": "List team members",
|
|
297
|
+
"method": "GET",
|
|
298
|
+
"path": "/orgs/{org}/teams/{team_slug}/members",
|
|
299
|
+
"deleteSendsJsonBody": false,
|
|
300
|
+
"inputSchema": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"properties": {
|
|
303
|
+
"org": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"description": "The organization name. The name is not case sensitive."
|
|
306
|
+
},
|
|
307
|
+
"team_slug": {
|
|
308
|
+
"type": "string",
|
|
309
|
+
"description": "The slug of the team name."
|
|
310
|
+
},
|
|
311
|
+
"role": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"description": "Filters members returned by their role in the team.",
|
|
314
|
+
"enum": [
|
|
315
|
+
"member",
|
|
316
|
+
"maintainer",
|
|
317
|
+
"all"
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
"per_page": {
|
|
321
|
+
"type": "number",
|
|
322
|
+
"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).\""
|
|
323
|
+
},
|
|
324
|
+
"page": {
|
|
325
|
+
"type": "number",
|
|
326
|
+
"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).\""
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"required": [
|
|
330
|
+
"org",
|
|
331
|
+
"team_slug"
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "teams_get_membership_for_user_in_org",
|
|
337
|
+
"description": "Get team membership for a user",
|
|
338
|
+
"method": "GET",
|
|
339
|
+
"path": "/orgs/{org}/teams/{team_slug}/memberships/{username}",
|
|
340
|
+
"deleteSendsJsonBody": false,
|
|
341
|
+
"inputSchema": {
|
|
342
|
+
"type": "object",
|
|
343
|
+
"properties": {
|
|
344
|
+
"org": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"description": "The organization name. The name is not case sensitive."
|
|
347
|
+
},
|
|
348
|
+
"team_slug": {
|
|
349
|
+
"type": "string",
|
|
350
|
+
"description": "The slug of the team name."
|
|
351
|
+
},
|
|
352
|
+
"username": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"description": "The handle for the GitHub user account."
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
"required": [
|
|
358
|
+
"org",
|
|
359
|
+
"team_slug",
|
|
360
|
+
"username"
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "teams_add_or_update_membership_for_user_in_org",
|
|
366
|
+
"description": "Add or update team membership for a user",
|
|
367
|
+
"method": "PUT",
|
|
368
|
+
"path": "/orgs/{org}/teams/{team_slug}/memberships/{username}",
|
|
369
|
+
"deleteSendsJsonBody": false,
|
|
370
|
+
"inputSchema": {
|
|
371
|
+
"type": "object",
|
|
372
|
+
"properties": {
|
|
373
|
+
"org": {
|
|
374
|
+
"type": "string",
|
|
375
|
+
"description": "The organization name. The name is not case sensitive."
|
|
376
|
+
},
|
|
377
|
+
"team_slug": {
|
|
378
|
+
"type": "string",
|
|
379
|
+
"description": "The slug of the team name."
|
|
380
|
+
},
|
|
381
|
+
"username": {
|
|
382
|
+
"type": "string",
|
|
383
|
+
"description": "The handle for the GitHub user account."
|
|
384
|
+
},
|
|
385
|
+
"role": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"description": "The role that this user should have in the team.",
|
|
388
|
+
"enum": [
|
|
389
|
+
"member",
|
|
390
|
+
"maintainer"
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"required": [
|
|
395
|
+
"org",
|
|
396
|
+
"team_slug",
|
|
397
|
+
"username"
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "teams_remove_membership_for_user_in_org",
|
|
403
|
+
"description": "Remove team membership for a user",
|
|
404
|
+
"method": "DELETE",
|
|
405
|
+
"path": "/orgs/{org}/teams/{team_slug}/memberships/{username}",
|
|
406
|
+
"deleteSendsJsonBody": false,
|
|
407
|
+
"inputSchema": {
|
|
408
|
+
"type": "object",
|
|
409
|
+
"properties": {
|
|
410
|
+
"org": {
|
|
411
|
+
"type": "string",
|
|
412
|
+
"description": "The organization name. The name is not case sensitive."
|
|
413
|
+
},
|
|
414
|
+
"team_slug": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"description": "The slug of the team name."
|
|
417
|
+
},
|
|
418
|
+
"username": {
|
|
419
|
+
"type": "string",
|
|
420
|
+
"description": "The handle for the GitHub user account."
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
"required": [
|
|
424
|
+
"org",
|
|
425
|
+
"team_slug",
|
|
426
|
+
"username"
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"name": "teams_list_repos_in_org",
|
|
432
|
+
"description": "List team repositories",
|
|
433
|
+
"method": "GET",
|
|
434
|
+
"path": "/orgs/{org}/teams/{team_slug}/repos",
|
|
435
|
+
"deleteSendsJsonBody": false,
|
|
436
|
+
"inputSchema": {
|
|
437
|
+
"type": "object",
|
|
438
|
+
"properties": {
|
|
439
|
+
"org": {
|
|
440
|
+
"type": "string",
|
|
441
|
+
"description": "The organization name. The name is not case sensitive."
|
|
442
|
+
},
|
|
443
|
+
"team_slug": {
|
|
444
|
+
"type": "string",
|
|
445
|
+
"description": "The slug of the team name."
|
|
446
|
+
},
|
|
447
|
+
"per_page": {
|
|
448
|
+
"type": "number",
|
|
449
|
+
"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).\""
|
|
450
|
+
},
|
|
451
|
+
"page": {
|
|
452
|
+
"type": "number",
|
|
453
|
+
"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).\""
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"required": [
|
|
457
|
+
"org",
|
|
458
|
+
"team_slug"
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"name": "teams_check_permissions_for_repo_in_org",
|
|
464
|
+
"description": "Check team permissions for a repository",
|
|
465
|
+
"method": "GET",
|
|
466
|
+
"path": "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}",
|
|
467
|
+
"deleteSendsJsonBody": false,
|
|
468
|
+
"inputSchema": {
|
|
469
|
+
"type": "object",
|
|
470
|
+
"properties": {
|
|
471
|
+
"org": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"description": "The organization name. The name is not case sensitive."
|
|
474
|
+
},
|
|
475
|
+
"team_slug": {
|
|
476
|
+
"type": "string",
|
|
477
|
+
"description": "The slug of the team name."
|
|
478
|
+
},
|
|
479
|
+
"owner": {
|
|
480
|
+
"type": "string",
|
|
481
|
+
"description": "The account owner of the repository. The name is not case sensitive."
|
|
482
|
+
},
|
|
483
|
+
"repo": {
|
|
484
|
+
"type": "string",
|
|
485
|
+
"description": "The name of the repository without the `.git` extension. The name is not case sensitive."
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
"required": [
|
|
489
|
+
"org",
|
|
490
|
+
"team_slug",
|
|
491
|
+
"owner",
|
|
492
|
+
"repo"
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"name": "teams_add_or_update_repo_permissions_in_org",
|
|
498
|
+
"description": "Add or update team repository permissions",
|
|
499
|
+
"method": "PUT",
|
|
500
|
+
"path": "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}",
|
|
501
|
+
"deleteSendsJsonBody": false,
|
|
502
|
+
"inputSchema": {
|
|
503
|
+
"type": "object",
|
|
504
|
+
"properties": {
|
|
505
|
+
"org": {
|
|
506
|
+
"type": "string",
|
|
507
|
+
"description": "The organization name. The name is not case sensitive."
|
|
508
|
+
},
|
|
509
|
+
"team_slug": {
|
|
510
|
+
"type": "string",
|
|
511
|
+
"description": "The slug of the team name."
|
|
512
|
+
},
|
|
513
|
+
"owner": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"description": "The account owner of the repository. The name is not case sensitive."
|
|
516
|
+
},
|
|
517
|
+
"repo": {
|
|
518
|
+
"type": "string",
|
|
519
|
+
"description": "The name of the repository without the `.git` extension. The name is not case sensitive."
|
|
520
|
+
},
|
|
521
|
+
"permission": {
|
|
522
|
+
"type": "string",
|
|
523
|
+
"description": "The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository."
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
"required": [
|
|
527
|
+
"org",
|
|
528
|
+
"team_slug",
|
|
529
|
+
"owner",
|
|
530
|
+
"repo"
|
|
531
|
+
]
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"name": "teams_remove_repo_in_org",
|
|
536
|
+
"description": "Remove a repository from a team",
|
|
537
|
+
"method": "DELETE",
|
|
538
|
+
"path": "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}",
|
|
539
|
+
"deleteSendsJsonBody": false,
|
|
540
|
+
"inputSchema": {
|
|
541
|
+
"type": "object",
|
|
542
|
+
"properties": {
|
|
543
|
+
"org": {
|
|
544
|
+
"type": "string",
|
|
545
|
+
"description": "The organization name. The name is not case sensitive."
|
|
546
|
+
},
|
|
547
|
+
"team_slug": {
|
|
548
|
+
"type": "string",
|
|
549
|
+
"description": "The slug of the team name."
|
|
550
|
+
},
|
|
551
|
+
"owner": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"description": "The account owner of the repository. The name is not case sensitive."
|
|
554
|
+
},
|
|
555
|
+
"repo": {
|
|
556
|
+
"type": "string",
|
|
557
|
+
"description": "The name of the repository without the `.git` extension. The name is not case sensitive."
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
"required": [
|
|
561
|
+
"org",
|
|
562
|
+
"team_slug",
|
|
563
|
+
"owner",
|
|
564
|
+
"repo"
|
|
565
|
+
]
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"name": "teams_list_child_in_org",
|
|
570
|
+
"description": "List child teams",
|
|
571
|
+
"method": "GET",
|
|
572
|
+
"path": "/orgs/{org}/teams/{team_slug}/teams",
|
|
573
|
+
"deleteSendsJsonBody": false,
|
|
574
|
+
"inputSchema": {
|
|
575
|
+
"type": "object",
|
|
576
|
+
"properties": {
|
|
577
|
+
"org": {
|
|
578
|
+
"type": "string",
|
|
579
|
+
"description": "The organization name. The name is not case sensitive."
|
|
580
|
+
},
|
|
581
|
+
"team_slug": {
|
|
582
|
+
"type": "string",
|
|
583
|
+
"description": "The slug of the team name."
|
|
584
|
+
},
|
|
585
|
+
"per_page": {
|
|
586
|
+
"type": "number",
|
|
587
|
+
"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).\""
|
|
588
|
+
},
|
|
589
|
+
"page": {
|
|
590
|
+
"type": "number",
|
|
591
|
+
"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).\""
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
"required": [
|
|
595
|
+
"org",
|
|
596
|
+
"team_slug"
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"name": "teams_list_for_authenticated_user",
|
|
602
|
+
"description": "List teams for the authenticated user",
|
|
603
|
+
"method": "GET",
|
|
604
|
+
"path": "/user/teams",
|
|
605
|
+
"deleteSendsJsonBody": false,
|
|
606
|
+
"inputSchema": {
|
|
607
|
+
"type": "object",
|
|
608
|
+
"properties": {
|
|
609
|
+
"per_page": {
|
|
610
|
+
"type": "number",
|
|
611
|
+
"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).\""
|
|
612
|
+
},
|
|
613
|
+
"page": {
|
|
614
|
+
"type": "number",
|
|
615
|
+
"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).\""
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
"required": []
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
];
|
|
622
|
+
|
|
623
|
+
export const tools = ENDPOINTS.map((e) => ({
|
|
624
|
+
name: e.name,
|
|
625
|
+
description: e.description,
|
|
626
|
+
method: e.method,
|
|
627
|
+
path: e.path,
|
|
628
|
+
deleteSendsJsonBody: Boolean(e.deleteSendsJsonBody),
|
|
629
|
+
inputSchema: e.inputSchema,
|
|
630
|
+
handler: async (params) => ({
|
|
631
|
+
content: [{ type: 'text', text: JSON.stringify(await apiRequest(e.method, e.path, params, { deleteSendsJsonBody: e.deleteSendsJsonBody }), null, 2) }],
|
|
632
|
+
}),
|
|
633
|
+
}));
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { saveCredentials, getCredentials } from '../../core/auth-manager.js';
|
|
2
|
+
import readline from 'readline';
|
|
3
|
+
|
|
4
|
+
const APP_ID = 'github-users';
|
|
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 Users 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 Users');
|
|
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-users-mcp --client cursor');
|
|
51
|
+
}
|
|
52
|
+
return { Authorization: 'Bearer ' + token };
|
|
53
|
+
}
|