@terreno/admin-backend 57.20.0 → 58.0.0-beta.1
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/AGENTS.md +20 -18
- package/CHANGELOG.md +93 -0
- package/biome.jsonc +1 -0
- package/dist/adminApp.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -1
- package/dist/mcpAdmin.d.ts +42 -0
- package/dist/mcpAdmin.js +213 -0
- package/e2e/smoke.ts +246 -0
- package/package.json +10 -7
- package/src/adminApp.migrations.test.ts +3 -2
- package/src/adminApp.models.test.ts +6 -3
- package/src/adminApp.test.ts +2 -2
- package/src/adminApp.ts +2 -0
- package/src/adminScriptJob.test.ts +10 -3
- package/src/adminSyncMutationAuthMismatch.test.ts +3 -2
- package/src/aggregateAdmin.test.ts +9 -5
- package/src/enrichAdminListFilters.test.ts +1 -1
- package/src/index.ts +8 -0
- package/src/mcpAdmin.test.ts +176 -0
- package/src/mcpAdmin.ts +237 -0
- package/tsconfig.typecheck.json +18 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import {beforeEach, describe, expect, it} from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
addAuthRoutes,
|
|
4
|
+
apiErrorMiddleware,
|
|
5
|
+
apiUnauthorizedMiddleware,
|
|
6
|
+
createScriptArgs,
|
|
7
|
+
McpOAuthRevokedFamily,
|
|
8
|
+
McpOAuthToken,
|
|
9
|
+
McpServiceToken,
|
|
10
|
+
McpToolSetting,
|
|
11
|
+
type ScriptContext,
|
|
12
|
+
setupAuth,
|
|
13
|
+
type UserModel as UserModelType,
|
|
14
|
+
} from "@terreno/api";
|
|
15
|
+
import {authAsUser, getBaseServer, setupDb, UserModel} from "@terreno/api/testing";
|
|
16
|
+
import type express from "express";
|
|
17
|
+
import type mongoose from "mongoose";
|
|
18
|
+
import type TestAgent from "supertest/lib/agent";
|
|
19
|
+
|
|
20
|
+
import {AdminApp} from "./adminApp";
|
|
21
|
+
import {mcpAdminModels, mcpAdminScripts, mcpSignOutEverywhere} from "./mcpAdmin";
|
|
22
|
+
|
|
23
|
+
const buildApp = (): express.Application => {
|
|
24
|
+
const app = getBaseServer();
|
|
25
|
+
setupAuth(app, UserModel as unknown as UserModelType);
|
|
26
|
+
addAuthRoutes(app, UserModel as unknown as UserModelType);
|
|
27
|
+
new AdminApp({
|
|
28
|
+
basePath: "/admin",
|
|
29
|
+
models: mcpAdminModels({requestLog: true, toolSettings: true}),
|
|
30
|
+
scripts: mcpAdminScripts(),
|
|
31
|
+
}).register(app);
|
|
32
|
+
app.use(apiUnauthorizedMiddleware);
|
|
33
|
+
app.use(apiErrorMiddleware);
|
|
34
|
+
return app;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const scriptContext = (user: string): ScriptContext => ({
|
|
38
|
+
addLog: async (): Promise<void> => {},
|
|
39
|
+
args: createScriptArgs({values: {user}}).args,
|
|
40
|
+
checkCancellation: async (): Promise<void> => {},
|
|
41
|
+
updateProgress: async (): Promise<void> => {},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const issueOAuth = (userId: mongoose.Types.ObjectId) =>
|
|
45
|
+
McpOAuthToken.issue({
|
|
46
|
+
accessTokenTtlSeconds: 60,
|
|
47
|
+
clientId: "claude",
|
|
48
|
+
refreshTokenTtlSeconds: 3600,
|
|
49
|
+
userId,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe("mcpAdminModels", () => {
|
|
53
|
+
it("returns every MCP screen in one group, without hash fields in any list", () => {
|
|
54
|
+
const models = mcpAdminModels({requestLog: true, toolSettings: true});
|
|
55
|
+
|
|
56
|
+
expect(models.map((model) => model.routePath)).toEqual([
|
|
57
|
+
"/mcp-service-tokens",
|
|
58
|
+
"/mcp-oauth-clients",
|
|
59
|
+
"/mcp-oauth-connections",
|
|
60
|
+
"/mcp-request-log",
|
|
61
|
+
"/mcp-tools",
|
|
62
|
+
]);
|
|
63
|
+
for (const model of models) {
|
|
64
|
+
expect(model.group).toBe("MCP");
|
|
65
|
+
expect(model.listFields.some((field) => field.toLowerCase().includes("hash"))).toBe(false);
|
|
66
|
+
expect(model.permissions?.create).toBe(false);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("leaves out the request log and tool screens unless their server options are on", () => {
|
|
71
|
+
expect(mcpAdminModels()).toHaveLength(3);
|
|
72
|
+
const models = mcpAdminModels({group: "Platform", requestLog: false, toolSettings: false});
|
|
73
|
+
|
|
74
|
+
expect(models).toHaveLength(3);
|
|
75
|
+
expect(models.every((model) => model.group === "Platform")).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("MCP admin routes", () => {
|
|
80
|
+
let adminAgent: TestAgent;
|
|
81
|
+
let notAdminAgent: TestAgent;
|
|
82
|
+
let notAdminId: mongoose.Types.ObjectId;
|
|
83
|
+
|
|
84
|
+
beforeEach(async () => {
|
|
85
|
+
const users = await setupDb();
|
|
86
|
+
notAdminId = users[1]._id as mongoose.Types.ObjectId;
|
|
87
|
+
await McpOAuthToken.deleteMany({});
|
|
88
|
+
await McpOAuthRevokedFamily.deleteMany({});
|
|
89
|
+
await McpServiceToken.deleteMany({});
|
|
90
|
+
await McpToolSetting.deleteMany({});
|
|
91
|
+
const app = buildApp();
|
|
92
|
+
adminAgent = await authAsUser(app, "admin");
|
|
93
|
+
notAdminAgent = await authAsUser(app, "notAdmin");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("lists OAuth connections without token hashes and refuses non-admins", async () => {
|
|
97
|
+
await issueOAuth(notAdminId);
|
|
98
|
+
|
|
99
|
+
const res = await adminAgent.get("/admin/mcp-oauth-connections");
|
|
100
|
+
const denied = await notAdminAgent.get("/admin/mcp-oauth-connections");
|
|
101
|
+
|
|
102
|
+
expect(res.status).toBe(200);
|
|
103
|
+
expect(res.body.data).toHaveLength(1);
|
|
104
|
+
expect(JSON.stringify(res.body)).not.toContain("TokenHash");
|
|
105
|
+
expect([401, 403, 405]).toContain(denied.status);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("revokes the whole connection when an admin deletes a row", async () => {
|
|
109
|
+
const {mcpOAuthToken} = await issueOAuth(notAdminId);
|
|
110
|
+
|
|
111
|
+
const res = await adminAgent.delete(`/admin/mcp-oauth-connections/${mcpOAuthToken._id}`);
|
|
112
|
+
|
|
113
|
+
expect(res.status).toBeLessThan(300);
|
|
114
|
+
const stored = await McpOAuthToken.findExactlyOne({_id: mcpOAuthToken._id});
|
|
115
|
+
expect(stored.revokedAt).toBeDefined();
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("lets an admin switch a tool off but not rename it", async () => {
|
|
119
|
+
const setting = await McpToolSetting.create({name: "todos_list", source: "model"});
|
|
120
|
+
|
|
121
|
+
const res = await adminAgent
|
|
122
|
+
.patch(`/admin/mcp-tools/${setting._id}`)
|
|
123
|
+
.send({enabled: false, name: "renamed"});
|
|
124
|
+
|
|
125
|
+
expect(res.status).toBe(200);
|
|
126
|
+
const stored = await McpToolSetting.findExactlyOne({_id: setting._id});
|
|
127
|
+
expect(stored.enabled).toBe(false);
|
|
128
|
+
expect(stored.name).toBe("todos_list");
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
describe("mcpSignOutEverywhere", () => {
|
|
133
|
+
let notAdminId: mongoose.Types.ObjectId;
|
|
134
|
+
|
|
135
|
+
beforeEach(async () => {
|
|
136
|
+
const users = await setupDb();
|
|
137
|
+
notAdminId = users[1]._id as mongoose.Types.ObjectId;
|
|
138
|
+
await McpOAuthToken.deleteMany({});
|
|
139
|
+
await McpOAuthRevokedFamily.deleteMany({});
|
|
140
|
+
await McpServiceToken.deleteMany({});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("counts on a dry run and revokes on a wet run, by email", async () => {
|
|
144
|
+
await issueOAuth(notAdminId);
|
|
145
|
+
await McpServiceToken.issueFor({_id: notAdminId}, {name: "Laptop"});
|
|
146
|
+
const user = await UserModel.findById(notAdminId);
|
|
147
|
+
const email = String((user as unknown as {email: string}).email);
|
|
148
|
+
|
|
149
|
+
const dry = await mcpSignOutEverywhere(false, scriptContext(email));
|
|
150
|
+
expect(dry.success).toBe(true);
|
|
151
|
+
expect(dry.results[0]).toContain("Would revoke 1 OAuth connection(s) and 1 service token(s)");
|
|
152
|
+
expect(await McpServiceToken.countDocuments({revokedAt: {$exists: false}})).toBe(1);
|
|
153
|
+
|
|
154
|
+
const wet = await mcpSignOutEverywhere(true, scriptContext(String(notAdminId)));
|
|
155
|
+
expect(wet.success).toBe(true);
|
|
156
|
+
expect(await McpServiceToken.countDocuments({revokedAt: {$exists: false}})).toBe(0);
|
|
157
|
+
expect(await McpOAuthToken.countDocuments({revokedAt: {$exists: false}})).toBe(0);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("looks up a 12-character email by email, not as an id", async () => {
|
|
161
|
+
await UserModel.updateOne({_id: notAdminId}, {$set: {email: "ab@gmail.com"}});
|
|
162
|
+
await McpServiceToken.issueFor({_id: notAdminId}, {name: "Laptop"});
|
|
163
|
+
|
|
164
|
+
const wet = await mcpSignOutEverywhere(true, scriptContext("ab@gmail.com"));
|
|
165
|
+
|
|
166
|
+
expect(wet.success).toBe(true);
|
|
167
|
+
expect(await McpServiceToken.countDocuments({revokedAt: {$exists: false}})).toBe(0);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it("fails without a user or with an unknown email", async () => {
|
|
171
|
+
expect((await mcpSignOutEverywhere(true, scriptContext(""))).success).toBe(false);
|
|
172
|
+
expect((await mcpSignOutEverywhere(true, scriptContext("nobody@example.com"))).success).toBe(
|
|
173
|
+
false
|
|
174
|
+
);
|
|
175
|
+
});
|
|
176
|
+
});
|
package/src/mcpAdmin.ts
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ADMIN_MODEL_ACCESS,
|
|
3
|
+
McpOAuthClient,
|
|
4
|
+
McpOAuthToken,
|
|
5
|
+
McpRequestLog,
|
|
6
|
+
McpServiceToken,
|
|
7
|
+
McpToolSetting,
|
|
8
|
+
type ScriptRunner,
|
|
9
|
+
} from "@terreno/api";
|
|
10
|
+
import mongoose from "mongoose";
|
|
11
|
+
|
|
12
|
+
import type {AdminModelConfig, AdminScriptConfig} from "./adminApp";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* RBAC statements for the MCP admin screens. Spread into `createAccess({statements})` when
|
|
16
|
+
* `AdminApp` has `accessControl`; without it the screens use `IsAdmin`.
|
|
17
|
+
*/
|
|
18
|
+
export const mcpAdminStatements = {
|
|
19
|
+
adminMcpOAuthClient: ADMIN_MODEL_ACCESS,
|
|
20
|
+
adminMcpOAuthConnection: ADMIN_MODEL_ACCESS,
|
|
21
|
+
adminMcpRequestLog: ADMIN_MODEL_ACCESS,
|
|
22
|
+
adminMcpServiceToken: ADMIN_MODEL_ACCESS,
|
|
23
|
+
adminMcpTool: ADMIN_MODEL_ACCESS,
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
/** Sidebar group the MCP screens share. */
|
|
27
|
+
export const MCP_ADMIN_GROUP = "MCP";
|
|
28
|
+
|
|
29
|
+
export interface McpAdminModelsOptions {
|
|
30
|
+
/** Sidebar group. Default `"MCP"`. */
|
|
31
|
+
group?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Include the request log screen. Match `TerrenoApp`'s `mcpRequestLog`: the screen is empty
|
|
34
|
+
* without it. Default false, like the server option.
|
|
35
|
+
*/
|
|
36
|
+
requestLog?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Include the tool registry screen. Match `TerrenoApp`'s `mcpToolSettings`: without it the
|
|
39
|
+
* server ignores the switches. Default false, like the server option.
|
|
40
|
+
*/
|
|
41
|
+
toolSettings?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Admin screens for a Terreno MCP server: service tokens, OAuth clients, OAuth connections
|
|
46
|
+
* (token families), the request log, and the tool registry. Secret hashes are never listed, and
|
|
47
|
+
* "delete" on a token or connection revokes it instead of removing the row.
|
|
48
|
+
*/
|
|
49
|
+
export const mcpAdminModels = (options: McpAdminModelsOptions = {}): AdminModelConfig[] => {
|
|
50
|
+
const group = options.group ?? MCP_ADMIN_GROUP;
|
|
51
|
+
const models: AdminModelConfig[] = [
|
|
52
|
+
{
|
|
53
|
+
adminAccess: {resource: "adminMcpServiceToken"},
|
|
54
|
+
displayName: "MCP service tokens",
|
|
55
|
+
group,
|
|
56
|
+
hiddenFields: ["tokenHash"],
|
|
57
|
+
listFields: [
|
|
58
|
+
"name",
|
|
59
|
+
"tokenPrefix",
|
|
60
|
+
"userId",
|
|
61
|
+
"lastUsedAt",
|
|
62
|
+
"expiresAt",
|
|
63
|
+
"revokedAt",
|
|
64
|
+
"created",
|
|
65
|
+
],
|
|
66
|
+
// The synced token model has a String `_id`, which AdminModelConfig's Model<any> rejects.
|
|
67
|
+
model: McpServiceToken as unknown as mongoose.Model<unknown>,
|
|
68
|
+
permissions: {create: false, delete: true, update: false},
|
|
69
|
+
routePath: "/mcp-service-tokens",
|
|
70
|
+
searchFields: ["name", "tokenPrefix"],
|
|
71
|
+
sortableFields: ["name", "created", "lastUsedAt", "expiresAt", "revokedAt"],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
adminAccess: {resource: "adminMcpOAuthClient"},
|
|
75
|
+
displayName: "MCP OAuth clients",
|
|
76
|
+
group,
|
|
77
|
+
hiddenFields: ["clientSecretHash"],
|
|
78
|
+
listFields: [
|
|
79
|
+
"clientName",
|
|
80
|
+
"clientId",
|
|
81
|
+
"redirectUris",
|
|
82
|
+
"grantTypes",
|
|
83
|
+
"tokenEndpointAuthMethod",
|
|
84
|
+
"userId",
|
|
85
|
+
"revokedAt",
|
|
86
|
+
"created",
|
|
87
|
+
],
|
|
88
|
+
model: McpOAuthClient,
|
|
89
|
+
// Deleting a client removes its registration and revokes every token issued to it.
|
|
90
|
+
permissions: {create: false, delete: true, update: false},
|
|
91
|
+
routePath: "/mcp-oauth-clients",
|
|
92
|
+
searchFields: ["clientName", "clientId"],
|
|
93
|
+
sortableFields: ["clientName", "created", "revokedAt"],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
adminAccess: {resource: "adminMcpOAuthConnection"},
|
|
97
|
+
displayName: "MCP OAuth connections",
|
|
98
|
+
group,
|
|
99
|
+
hiddenFields: ["accessTokenHash", "refreshTokenHash"],
|
|
100
|
+
listFields: [
|
|
101
|
+
"userId",
|
|
102
|
+
"clientId",
|
|
103
|
+
"familyId",
|
|
104
|
+
"scope",
|
|
105
|
+
"accessExpiresAt",
|
|
106
|
+
"refreshExpiresAt",
|
|
107
|
+
"rotatedAt",
|
|
108
|
+
"revokedAt",
|
|
109
|
+
"created",
|
|
110
|
+
],
|
|
111
|
+
model: McpOAuthToken,
|
|
112
|
+
// Each row is one access/refresh pair. Deleting any row revokes its whole connection.
|
|
113
|
+
permissions: {create: false, delete: true, update: false},
|
|
114
|
+
routePath: "/mcp-oauth-connections",
|
|
115
|
+
searchFields: ["clientId", "familyId"],
|
|
116
|
+
sortableFields: ["created", "accessExpiresAt", "refreshExpiresAt", "revokedAt"],
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
if (options.requestLog === true) {
|
|
120
|
+
models.push({
|
|
121
|
+
adminAccess: {resource: "adminMcpRequestLog"},
|
|
122
|
+
defaultSort: "-created",
|
|
123
|
+
displayName: "MCP request log",
|
|
124
|
+
group,
|
|
125
|
+
listFields: [
|
|
126
|
+
"created",
|
|
127
|
+
"toolName",
|
|
128
|
+
"outcome",
|
|
129
|
+
"durationMs",
|
|
130
|
+
"userId",
|
|
131
|
+
"credential",
|
|
132
|
+
"oauthClientId",
|
|
133
|
+
"serviceTokenId",
|
|
134
|
+
"errorName",
|
|
135
|
+
],
|
|
136
|
+
model: McpRequestLog,
|
|
137
|
+
permissions: {create: false, delete: false, update: false},
|
|
138
|
+
routePath: "/mcp-request-log",
|
|
139
|
+
searchFields: ["toolName", "oauthClientId", "errorName"],
|
|
140
|
+
sortableFields: ["created", "toolName", "durationMs", "outcome"],
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (options.toolSettings === true) {
|
|
144
|
+
models.push({
|
|
145
|
+
adminAccess: {resource: "adminMcpTool"},
|
|
146
|
+
defaultSort: "name",
|
|
147
|
+
displayName: "MCP tools",
|
|
148
|
+
group,
|
|
149
|
+
listFields: ["name", "enabled", "source", "registered", "lastRegisteredAt"],
|
|
150
|
+
model: McpToolSetting,
|
|
151
|
+
permissions: {create: false, delete: false, update: true},
|
|
152
|
+
readonlyFields: ["name", "source", "registered", "description", "lastRegisteredAt"],
|
|
153
|
+
routePath: "/mcp-tools",
|
|
154
|
+
searchFields: ["name", "description"],
|
|
155
|
+
sortableFields: ["name", "enabled", "source", "lastRegisteredAt"],
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return models;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const SIGN_OUT_SCRIPT_NAME = "mcp-sign-out-everywhere";
|
|
162
|
+
const OBJECT_ID_HEX = /^[0-9a-f]{24}$/i;
|
|
163
|
+
|
|
164
|
+
/** Resolve the `user` argument (an id or an email) to a user id. */
|
|
165
|
+
const resolveUserId = async (value: string): Promise<mongoose.Types.ObjectId | undefined> => {
|
|
166
|
+
// Only a 24-hex-character string is an id. isValidObjectId also accepts any 12-character
|
|
167
|
+
// string, which would read a short email like "ab@gmail.com" as an id.
|
|
168
|
+
if (OBJECT_ID_HEX.test(value)) {
|
|
169
|
+
return new mongoose.Types.ObjectId(value);
|
|
170
|
+
}
|
|
171
|
+
const userModel = mongoose.models.User;
|
|
172
|
+
if (!userModel) {
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
const email = value.trim();
|
|
176
|
+
const users = await userModel
|
|
177
|
+
.find({email: {$in: [...new Set([email, email.toLowerCase()])]}})
|
|
178
|
+
.limit(2)
|
|
179
|
+
.select({_id: 1})
|
|
180
|
+
.lean<Array<{_id: mongoose.Types.ObjectId}>>();
|
|
181
|
+
return users.length === 1 ? users[0]._id : undefined;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Revoke every MCP credential a user holds: OAuth connections and service tokens. Dry run counts
|
|
186
|
+
* what would be revoked.
|
|
187
|
+
*/
|
|
188
|
+
export const mcpSignOutEverywhere: ScriptRunner = async (wetRun, ctx) => {
|
|
189
|
+
const value = ctx?.args.getString("user");
|
|
190
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
191
|
+
return {results: ["Pass --user <user id or email>."], success: false};
|
|
192
|
+
}
|
|
193
|
+
const userId = await resolveUserId(value);
|
|
194
|
+
if (!userId) {
|
|
195
|
+
return {results: [`No single user matches "${value}".`], success: false};
|
|
196
|
+
}
|
|
197
|
+
if (!wetRun) {
|
|
198
|
+
const families = await McpOAuthToken.distinct("familyId", {
|
|
199
|
+
revokedAt: {$exists: false},
|
|
200
|
+
userId,
|
|
201
|
+
});
|
|
202
|
+
const tokens = await McpServiceToken.countDocuments({revokedAt: {$exists: false}, userId});
|
|
203
|
+
return {
|
|
204
|
+
results: [
|
|
205
|
+
`Would revoke ${families.length} OAuth connection(s) and ${tokens} service token(s) for user ${String(userId)}.`,
|
|
206
|
+
],
|
|
207
|
+
success: true,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const families = await McpOAuthToken.revokeAllForUser(userId);
|
|
211
|
+
const tokens = await McpServiceToken.revokeAllForUser(userId);
|
|
212
|
+
await ctx?.addLog("info", `Revoked MCP credentials for user ${String(userId)}`);
|
|
213
|
+
return {
|
|
214
|
+
results: [
|
|
215
|
+
`Revoked ${families} OAuth connection(s) and ${tokens} service token(s) for user ${String(userId)}.`,
|
|
216
|
+
],
|
|
217
|
+
success: true,
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
/** Admin scripts for MCP operators. Pass to `AdminApp({scripts})`. */
|
|
222
|
+
export const mcpAdminScripts = (): AdminScriptConfig[] => [
|
|
223
|
+
{
|
|
224
|
+
args: [
|
|
225
|
+
{
|
|
226
|
+
description: "User id or email whose MCP credentials to revoke",
|
|
227
|
+
example: "someone@example.com",
|
|
228
|
+
name: "user",
|
|
229
|
+
required: true,
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
description:
|
|
233
|
+
"Revoke every MCP OAuth connection and service token a user holds. Clients must reconnect.",
|
|
234
|
+
name: SIGN_OUT_SCRIPT_NAME,
|
|
235
|
+
runner: mcpSignOutEverywhere,
|
|
236
|
+
},
|
|
237
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"noEmit": true,
|
|
5
|
+
"composite": false,
|
|
6
|
+
"incremental": false,
|
|
7
|
+
"declaration": false,
|
|
8
|
+
"declarationMap": false,
|
|
9
|
+
"types": [
|
|
10
|
+
"node",
|
|
11
|
+
"bun"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"exclude": [
|
|
15
|
+
"node_modules",
|
|
16
|
+
"dist"
|
|
17
|
+
]
|
|
18
|
+
}
|