@chrischall/microsoft-teams-mcp 0.2.5 → 0.2.7
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/dist/bundle.js +376 -71
- package/dist/version.js +1 -1
- package/package.json +6 -6
- package/server.json +2 -2
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "MCP server for Microsoft Teams — read your chats, teams, channels, and their currently open messages",
|
|
10
|
-
"version": "0.2.
|
|
10
|
+
"version": "0.2.7"
|
|
11
11
|
},
|
|
12
12
|
"plugins": [
|
|
13
13
|
{
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"displayName": "Microsoft Teams",
|
|
16
16
|
"source": "./",
|
|
17
17
|
"description": "MCP server for Microsoft Teams — read your chats, teams, channels, and their currently open messages, via your signed-in browser session",
|
|
18
|
-
"version": "0.2.
|
|
18
|
+
"version": "0.2.7",
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Chris Hall"
|
|
21
21
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microsoft-teams-mcp",
|
|
3
3
|
"displayName": "Microsoft Teams",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.7",
|
|
5
5
|
"description": "Microsoft Teams for Claude — read your chats, teams, channels, and their currently open messages, using your signed-in browser session",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Chris Hall",
|
package/dist/bundle.js
CHANGED
|
@@ -2335,11 +2335,23 @@ var require_websocket = __commonJS({
|
|
|
2335
2335
|
this._isServer = false;
|
|
2336
2336
|
this._redirects = 0;
|
|
2337
2337
|
if (protocols === void 0) {
|
|
2338
|
-
protocols
|
|
2338
|
+
if (!options || options.protocols === void 0) {
|
|
2339
|
+
protocols = [];
|
|
2340
|
+
} else if (Array.isArray(options.protocols)) {
|
|
2341
|
+
protocols = options.protocols;
|
|
2342
|
+
} else {
|
|
2343
|
+
protocols = [options.protocols];
|
|
2344
|
+
}
|
|
2339
2345
|
} else if (!Array.isArray(protocols)) {
|
|
2340
2346
|
if (typeof protocols === "object" && protocols !== null) {
|
|
2341
2347
|
options = protocols;
|
|
2342
|
-
protocols
|
|
2348
|
+
if (options.protocols === void 0) {
|
|
2349
|
+
protocols = [];
|
|
2350
|
+
} else if (Array.isArray(options.protocols)) {
|
|
2351
|
+
protocols = options.protocols;
|
|
2352
|
+
} else {
|
|
2353
|
+
protocols = [options.protocols];
|
|
2354
|
+
}
|
|
2343
2355
|
} else {
|
|
2344
2356
|
protocols = [protocols];
|
|
2345
2357
|
}
|
|
@@ -2536,7 +2548,6 @@ var require_websocket = __commonJS({
|
|
|
2536
2548
|
}
|
|
2537
2549
|
return;
|
|
2538
2550
|
}
|
|
2539
|
-
this._readyState = _WebSocket.CLOSING;
|
|
2540
2551
|
this._sender.close(code, data, !this._isServer, (err) => {
|
|
2541
2552
|
if (err) return;
|
|
2542
2553
|
this._closeFrameSent = true;
|
|
@@ -2544,6 +2555,7 @@ var require_websocket = __commonJS({
|
|
|
2544
2555
|
this._socket.end();
|
|
2545
2556
|
}
|
|
2546
2557
|
});
|
|
2558
|
+
this._readyState = _WebSocket.CLOSING;
|
|
2547
2559
|
setCloseTimer(this);
|
|
2548
2560
|
}
|
|
2549
2561
|
/**
|
|
@@ -2768,6 +2780,7 @@ var require_websocket = __commonJS({
|
|
|
2768
2780
|
socketPath: void 0,
|
|
2769
2781
|
hostname: void 0,
|
|
2770
2782
|
protocol: void 0,
|
|
2783
|
+
protocols: void 0,
|
|
2771
2784
|
timeout: void 0,
|
|
2772
2785
|
method: "GET",
|
|
2773
2786
|
host: void 0,
|
|
@@ -21514,8 +21527,8 @@ function currencyCode2(_params) {
|
|
|
21514
21527
|
return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
|
|
21515
21528
|
}
|
|
21516
21529
|
function hash(alg, params) {
|
|
21517
|
-
const
|
|
21518
|
-
const format = `${alg}_${
|
|
21530
|
+
const enc7 = params?.enc ?? "hex";
|
|
21531
|
+
const format = `${alg}_${enc7}`;
|
|
21519
21532
|
const regex = regexes_exports[format];
|
|
21520
21533
|
if (!regex)
|
|
21521
21534
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
@@ -24390,7 +24403,7 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
24390
24403
|
token_type_hint: string2().optional()
|
|
24391
24404
|
}).strip();
|
|
24392
24405
|
|
|
24393
|
-
// node_modules/@modelcontextprotocol/server/dist/src-
|
|
24406
|
+
// node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs
|
|
24394
24407
|
var BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
|
|
24395
24408
|
function stampErrorBrands(instance, ctor) {
|
|
24396
24409
|
const brands = /* @__PURE__ */ new Set();
|
|
@@ -26633,7 +26646,8 @@ function build() {
|
|
|
26633
26646
|
ListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),
|
|
26634
26647
|
ReadResourceResultResponseSchema: wireResultResponse(union([ReadResourceResultSchema$1, InputRequiredResultSchema])),
|
|
26635
26648
|
CompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),
|
|
26636
|
-
DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1)
|
|
26649
|
+
DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1),
|
|
26650
|
+
SubscriptionsListenResultResponseSchema: wireResultResponse(SubscriptionsListenResultSchema$1)
|
|
26637
26651
|
};
|
|
26638
26652
|
}
|
|
26639
26653
|
var memo2;
|
|
@@ -27141,6 +27155,9 @@ function isSpecRequestMethod(method) {
|
|
|
27141
27155
|
function isSpecNotificationMethod(method) {
|
|
27142
27156
|
return ALL_CODECS.some((codec2) => codec2.hasNotificationMethod(method));
|
|
27143
27157
|
}
|
|
27158
|
+
function isExtensionReusedRequestMethod(method) {
|
|
27159
|
+
return method === "tasks/get" || method === "tasks/cancel";
|
|
27160
|
+
}
|
|
27144
27161
|
var ALL_CODECS = [rev2025Codec, rev2026Codec];
|
|
27145
27162
|
function isPlainObject$3(value) {
|
|
27146
27163
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -28118,6 +28135,8 @@ var Protocol = class {
|
|
|
28118
28135
|
_transport;
|
|
28119
28136
|
_requestMessageId = 0;
|
|
28120
28137
|
_requestHandlers = /* @__PURE__ */ new Map();
|
|
28138
|
+
/** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
|
|
28139
|
+
_customSchemaRequestMethods = /* @__PURE__ */ new Set();
|
|
28121
28140
|
_requestHandlerAbortControllers = /* @__PURE__ */ new Map();
|
|
28122
28141
|
_notificationHandlers = /* @__PURE__ */ new Map();
|
|
28123
28142
|
_responseHandlers = /* @__PURE__ */ new Map();
|
|
@@ -28401,7 +28420,7 @@ var Protocol = class {
|
|
|
28401
28420
|
return;
|
|
28402
28421
|
}
|
|
28403
28422
|
}
|
|
28404
|
-
if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method)) {
|
|
28423
|
+
if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method) && !(isExtensionReusedRequestMethod(request.method) && this._customSchemaRequestMethods.has(request.method))) {
|
|
28405
28424
|
sendErrorResponse(ProtocolErrorCode.MethodNotFound, "Method not found");
|
|
28406
28425
|
return;
|
|
28407
28426
|
}
|
|
@@ -28534,8 +28553,11 @@ var Protocol = class {
|
|
|
28534
28553
|
}
|
|
28535
28554
|
request(request, schemaOrOptions, maybeOptions) {
|
|
28536
28555
|
const codec2 = this._resolveOutboundCodec(request.method);
|
|
28556
|
+
if (isStandardSchema(schemaOrOptions)) {
|
|
28557
|
+
if (!isExtensionReusedRequestMethod(request.method)) this._assertOutboundRequestInEra(codec2, request.method);
|
|
28558
|
+
return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
|
|
28559
|
+
}
|
|
28537
28560
|
this._assertOutboundRequestInEra(codec2, request.method);
|
|
28538
|
-
if (isStandardSchema(schemaOrOptions)) return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
|
|
28539
28561
|
const validate2 = codecResultValidator(codec2, request.method);
|
|
28540
28562
|
if (validate2 === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);
|
|
28541
28563
|
return this._requestWithSchemaViaCodec(codec2, request, validate2, schemaOrOptions);
|
|
@@ -28779,6 +28801,8 @@ var Protocol = class {
|
|
|
28779
28801
|
return maybeHandler(parsed.data, ctx);
|
|
28780
28802
|
};
|
|
28781
28803
|
else throw new TypeError("setRequestHandler: handler is required");
|
|
28804
|
+
if (typeof schemasOrHandler === "function") this._customSchemaRequestMethods.delete(method);
|
|
28805
|
+
else this._customSchemaRequestMethods.add(method);
|
|
28782
28806
|
this._requestHandlers.set(method, this._wrapHandler(method, stored));
|
|
28783
28807
|
}
|
|
28784
28808
|
/**
|
|
@@ -28808,6 +28832,7 @@ var Protocol = class {
|
|
|
28808
28832
|
*/
|
|
28809
28833
|
removeRequestHandler(method) {
|
|
28810
28834
|
this._requestHandlers.delete(method);
|
|
28835
|
+
this._customSchemaRequestMethods.delete(method);
|
|
28811
28836
|
}
|
|
28812
28837
|
/**
|
|
28813
28838
|
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
|
|
@@ -36050,7 +36075,7 @@ var Ajv = import_ajv.Ajv;
|
|
|
36050
36075
|
// node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
|
|
36051
36076
|
import process2 from "node:process";
|
|
36052
36077
|
|
|
36053
|
-
// node_modules/@modelcontextprotocol/server/dist/mcp-
|
|
36078
|
+
// node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs
|
|
36054
36079
|
var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
|
|
36055
36080
|
function isCompletable(schema) {
|
|
36056
36081
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -36115,7 +36140,7 @@ var StdioListenRouter = class {
|
|
|
36115
36140
|
_serverCapabilities;
|
|
36116
36141
|
/**
|
|
36117
36142
|
* The serving instance's identity, stamped onto the graceful-close
|
|
36118
|
-
* results' `_meta` (the spec's `
|
|
36143
|
+
* results' `_meta` (the spec's `SubscriptionsListenResultMetaObject` extends
|
|
36119
36144
|
* `ResultMetaObject`). Handed over together with the capabilities.
|
|
36120
36145
|
*/
|
|
36121
36146
|
_serverInfo;
|
|
@@ -36447,6 +36472,11 @@ var Server = class extends Protocol {
|
|
|
36447
36472
|
if (modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler("server/discover", () => this._ondiscover());
|
|
36448
36473
|
if (this._capabilities.logging) this._registerLoggingHandler();
|
|
36449
36474
|
}
|
|
36475
|
+
/** Attaches to the given transport; rejects while this instance is connected to another one. */
|
|
36476
|
+
async connect(transport) {
|
|
36477
|
+
if (this.transport !== void 0) throw new SdkError(SdkErrorCode.AlreadyConnected, "Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");
|
|
36478
|
+
await super.connect(transport);
|
|
36479
|
+
}
|
|
36450
36480
|
/**
|
|
36451
36481
|
* Registers the built-in `logging/setLevel` request handler.
|
|
36452
36482
|
*
|
|
@@ -37000,21 +37030,41 @@ var Server = class extends Protocol {
|
|
|
37000
37030
|
function discoverAdvertisedCapabilities(capabilities) {
|
|
37001
37031
|
return { ...capabilities };
|
|
37002
37032
|
}
|
|
37033
|
+
function toolInputElementCount(value, max) {
|
|
37034
|
+
let count = 0;
|
|
37035
|
+
const stack = [value];
|
|
37036
|
+
while (stack.length > 0) {
|
|
37037
|
+
const node2 = stack.pop();
|
|
37038
|
+
if (node2 === null || typeof node2 !== "object") continue;
|
|
37039
|
+
if (Array.isArray(node2)) for (const child of node2) {
|
|
37040
|
+
if (++count > max) return count;
|
|
37041
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
37042
|
+
}
|
|
37043
|
+
else for (const key in node2) {
|
|
37044
|
+
if (!Object.prototype.hasOwnProperty.call(node2, key)) continue;
|
|
37045
|
+
if (++count > max) return count;
|
|
37046
|
+
const child = node2[key];
|
|
37047
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
37048
|
+
}
|
|
37049
|
+
}
|
|
37050
|
+
return count;
|
|
37051
|
+
}
|
|
37052
|
+
function resolveMaxToolInputElements(value) {
|
|
37053
|
+
if (value === void 0 || value === Infinity) return void 0;
|
|
37054
|
+
if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
37055
|
+
return value;
|
|
37056
|
+
}
|
|
37003
37057
|
var McpServer = class {
|
|
37004
37058
|
/**
|
|
37005
37059
|
* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
|
|
37006
37060
|
*/
|
|
37007
37061
|
server;
|
|
37062
|
+
_maxToolInputElements;
|
|
37008
37063
|
_registeredResources = {};
|
|
37009
37064
|
_registeredResourceTemplates = {};
|
|
37010
37065
|
_registeredTools = {};
|
|
37011
37066
|
_registeredPrompts = {};
|
|
37012
|
-
/**
|
|
37013
|
-
* Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
|
|
37014
|
-
* registration-time scan and the pre-dispatch validation step share one
|
|
37015
|
-
* conversion instead of paying it twice per request under the
|
|
37016
|
-
* per-request-factory `createMcpHandler` model.
|
|
37017
|
-
*/
|
|
37067
|
+
/** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
|
|
37018
37068
|
_toolInputSchemaJson = {};
|
|
37019
37069
|
/**
|
|
37020
37070
|
* The JSON-serialized `inputSchema` of a registered tool, or `undefined`
|
|
@@ -37039,6 +37089,7 @@ var McpServer = class {
|
|
|
37039
37089
|
}
|
|
37040
37090
|
constructor(serverInfo, options) {
|
|
37041
37091
|
this.server = new Server(serverInfo, options);
|
|
37092
|
+
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
37042
37093
|
if (options?.capabilities?.tools) this.setToolRequestHandlers();
|
|
37043
37094
|
if (options?.capabilities?.resources) this.setResourceRequestHandlers();
|
|
37044
37095
|
if (options?.capabilities?.prompts) this.setPromptRequestHandlers();
|
|
@@ -37111,7 +37162,7 @@ var McpServer = class {
|
|
|
37111
37162
|
name,
|
|
37112
37163
|
title: tool.title,
|
|
37113
37164
|
description: tool.description,
|
|
37114
|
-
inputSchema: tool.inputSchema ?
|
|
37165
|
+
inputSchema: tool.inputSchema ? convertListedInputSchema(name, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,
|
|
37115
37166
|
annotations: tool.annotations,
|
|
37116
37167
|
icons: tool.icons,
|
|
37117
37168
|
execution: tool.execution,
|
|
@@ -37156,6 +37207,7 @@ var McpServer = class {
|
|
|
37156
37207
|
* Validates tool input arguments against the tool's input schema.
|
|
37157
37208
|
*/
|
|
37158
37209
|
async validateToolInput(tool, args, toolName) {
|
|
37210
|
+
if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
|
|
37159
37211
|
if (!tool.inputSchema) return;
|
|
37160
37212
|
const parseResult = await validateStandardSchema(tool.inputSchema, args ?? {});
|
|
37161
37213
|
if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);
|
|
@@ -37430,20 +37482,19 @@ var McpServer = class {
|
|
|
37430
37482
|
}
|
|
37431
37483
|
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
|
|
37432
37484
|
validateAndWarnToolName(name);
|
|
37433
|
-
if (inputSchema !== void 0) try {
|
|
37434
|
-
const json2 = standardSchemaToJsonSchema(inputSchema, "input");
|
|
37435
|
-
this._toolInputSchemaJson[name] = json2;
|
|
37436
|
-
const scan = scanXMcpHeaderDeclarations(json2);
|
|
37437
|
-
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
37438
|
-
} catch {
|
|
37439
|
-
}
|
|
37440
37485
|
let currentHandler = handler;
|
|
37486
|
+
let outputSchemaJson;
|
|
37441
37487
|
const registeredTool = {
|
|
37442
37488
|
title,
|
|
37443
37489
|
description,
|
|
37444
37490
|
inputSchema,
|
|
37445
37491
|
outputSchema,
|
|
37446
|
-
outputSchemaJson
|
|
37492
|
+
get outputSchemaJson() {
|
|
37493
|
+
return outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);
|
|
37494
|
+
},
|
|
37495
|
+
set outputSchemaJson(value) {
|
|
37496
|
+
outputSchemaJson = value;
|
|
37497
|
+
},
|
|
37447
37498
|
annotations,
|
|
37448
37499
|
icons,
|
|
37449
37500
|
execution,
|
|
@@ -37570,6 +37621,12 @@ var EMPTY_OBJECT_JSON_SCHEMA = {
|
|
|
37570
37621
|
type: "object",
|
|
37571
37622
|
properties: {}
|
|
37572
37623
|
};
|
|
37624
|
+
function convertListedInputSchema(name, inputSchema) {
|
|
37625
|
+
const json2 = standardSchemaToJsonSchema(inputSchema, "input");
|
|
37626
|
+
const scan = scanXMcpHeaderDeclarations(json2);
|
|
37627
|
+
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
37628
|
+
return json2;
|
|
37629
|
+
}
|
|
37573
37630
|
function convertOutputSchemaJson(outputSchema) {
|
|
37574
37631
|
if (outputSchema === void 0) return void 0;
|
|
37575
37632
|
try {
|
|
@@ -37582,7 +37639,7 @@ function createPromptHandler(name, argsSchema, callback) {
|
|
|
37582
37639
|
if (argsSchema) {
|
|
37583
37640
|
const typedCallback = callback;
|
|
37584
37641
|
return async (args, ctx) => {
|
|
37585
|
-
const parseResult = await validateStandardSchema(argsSchema, args);
|
|
37642
|
+
const parseResult = await validateStandardSchema(argsSchema, args ?? {});
|
|
37586
37643
|
if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);
|
|
37587
37644
|
return typedCallback(parseResult.data, ctx);
|
|
37588
37645
|
};
|
|
@@ -38396,7 +38453,10 @@ function surfaceToolHints(server) {
|
|
|
38396
38453
|
));
|
|
38397
38454
|
}
|
|
38398
38455
|
async function createMcpServer(opts) {
|
|
38399
|
-
const server = new McpServer({ name: opts.name, version: opts.version }, {
|
|
38456
|
+
const server = new McpServer({ name: opts.name, version: opts.version }, {
|
|
38457
|
+
supportedProtocolVersions: [...SERVER_PROTOCOL_VERSIONS],
|
|
38458
|
+
...opts.maxToolInputElements !== void 0 ? { maxToolInputElements: opts.maxToolInputElements } : {}
|
|
38459
|
+
});
|
|
38400
38460
|
if (opts.surfaceHints !== false)
|
|
38401
38461
|
surfaceToolHints(server);
|
|
38402
38462
|
if (opts.banner !== void 0) {
|
|
@@ -38620,7 +38680,7 @@ function toolAnnotations(opts = {}) {
|
|
|
38620
38680
|
|
|
38621
38681
|
// src/version.ts
|
|
38622
38682
|
var PACKAGE_NAME = "microsoft-teams-mcp";
|
|
38623
|
-
var VERSION = "0.2.
|
|
38683
|
+
var VERSION = "0.2.7";
|
|
38624
38684
|
|
|
38625
38685
|
// node_modules/@fetchproxy/protocol/dist/crypto.js
|
|
38626
38686
|
var subtle = globalThis.crypto.subtle;
|
|
@@ -38824,6 +38884,60 @@ var KNOWN_CAPABILITIES = /* @__PURE__ */ new Set([
|
|
|
38824
38884
|
"graphql",
|
|
38825
38885
|
"write_cookies"
|
|
38826
38886
|
]);
|
|
38887
|
+
var ACCOUNT_KEY_FRAME = "account-key";
|
|
38888
|
+
var ACCOUNT_ATTEST_FRAME = "account-attest";
|
|
38889
|
+
var BRIDGE_ROLE_FRAME = "bridge-role";
|
|
38890
|
+
var BRIDGE_SERVE_FRAME = "bridge-serve";
|
|
38891
|
+
var ROOM_PING_FRAME = "room-ping";
|
|
38892
|
+
var ROOM_PONG_FRAME = "room-pong";
|
|
38893
|
+
var BRIDGE_ROLE_LABEL_MAX = 64;
|
|
38894
|
+
var ROOM_FRAME_ACCEPTS = Object.freeze({
|
|
38895
|
+
[BRIDGE_ROLE_FRAME]: BRIDGE_ROLE_FRAME,
|
|
38896
|
+
[BRIDGE_SERVE_FRAME]: BRIDGE_SERVE_FRAME,
|
|
38897
|
+
[ROOM_PING_FRAME]: ROOM_PING_FRAME,
|
|
38898
|
+
[ROOM_PONG_FRAME]: ROOM_PING_FRAME
|
|
38899
|
+
});
|
|
38900
|
+
|
|
38901
|
+
// node_modules/@fetchproxy/protocol/dist/mcp-id.js
|
|
38902
|
+
var ID_RE = /^([^:]+):([^:]+):([0-9a-f]{16})$/;
|
|
38903
|
+
function generateMcpId(serverName, version2) {
|
|
38904
|
+
if (serverName.includes(":")) {
|
|
38905
|
+
throw new Error(`serverName cannot contain ':': ${serverName}`);
|
|
38906
|
+
}
|
|
38907
|
+
if (version2.includes(":")) {
|
|
38908
|
+
throw new Error(`version cannot contain ':': ${version2}`);
|
|
38909
|
+
}
|
|
38910
|
+
const rand = randomHex(8);
|
|
38911
|
+
return `${serverName}:${version2}:${rand}`;
|
|
38912
|
+
}
|
|
38913
|
+
function isValidMcpId(id) {
|
|
38914
|
+
return typeof id === "string" && ID_RE.test(id);
|
|
38915
|
+
}
|
|
38916
|
+
function randomHex(bytes) {
|
|
38917
|
+
const arr = new Uint8Array(bytes);
|
|
38918
|
+
globalThis.crypto.getRandomValues(arr);
|
|
38919
|
+
return Array.from(arr, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
38920
|
+
}
|
|
38921
|
+
|
|
38922
|
+
// node_modules/@fetchproxy/protocol/dist/account-attest.js
|
|
38923
|
+
var ACCOUNT_ATTEST_CONSENTS = Object.freeze([
|
|
38924
|
+
"silent",
|
|
38925
|
+
"confirm",
|
|
38926
|
+
"confirm-each"
|
|
38927
|
+
]);
|
|
38928
|
+
var NO_SCOPE_DIGEST = "0".repeat(64);
|
|
38929
|
+
var ACCOUNT_ID_RE = /^[A-Za-z0-9_.\-]{1,128}$/;
|
|
38930
|
+
var HEX64_RE = /^[0-9a-f]{64}$/;
|
|
38931
|
+
var ACCOUNT_KID_RE = /^[0-9a-f]{16}$/;
|
|
38932
|
+
var enc2 = new TextEncoder();
|
|
38933
|
+
|
|
38934
|
+
// node_modules/@fetchproxy/protocol/dist/awaiting-approval.js
|
|
38935
|
+
var AWAITING_APPROVAL_REASON_PREFIX = "awaiting-approval:";
|
|
38936
|
+
function parseAwaitingApprovalReason(reason) {
|
|
38937
|
+
if (!reason.startsWith(AWAITING_APPROVAL_REASON_PREFIX))
|
|
38938
|
+
return null;
|
|
38939
|
+
return reason.slice(AWAITING_APPROVAL_REASON_PREFIX.length).trim();
|
|
38940
|
+
}
|
|
38827
38941
|
|
|
38828
38942
|
// node_modules/@fetchproxy/protocol/dist/capability-availability.js
|
|
38829
38943
|
var CAPABILITY_UNAVAILABLE_CODE = "capability_unavailable";
|
|
@@ -38849,27 +38963,6 @@ function parseUnsupportedCapabilityReason(reason) {
|
|
|
38849
38963
|
return rest.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
38850
38964
|
}
|
|
38851
38965
|
|
|
38852
|
-
// node_modules/@fetchproxy/protocol/dist/mcp-id.js
|
|
38853
|
-
var ID_RE = /^([^:]+):([^:]+):([0-9a-f]{16})$/;
|
|
38854
|
-
function generateMcpId(serverName, version2) {
|
|
38855
|
-
if (serverName.includes(":")) {
|
|
38856
|
-
throw new Error(`serverName cannot contain ':': ${serverName}`);
|
|
38857
|
-
}
|
|
38858
|
-
if (version2.includes(":")) {
|
|
38859
|
-
throw new Error(`version cannot contain ':': ${version2}`);
|
|
38860
|
-
}
|
|
38861
|
-
const rand = randomHex(8);
|
|
38862
|
-
return `${serverName}:${version2}:${rand}`;
|
|
38863
|
-
}
|
|
38864
|
-
function isValidMcpId(id) {
|
|
38865
|
-
return typeof id === "string" && ID_RE.test(id);
|
|
38866
|
-
}
|
|
38867
|
-
function randomHex(bytes) {
|
|
38868
|
-
const arr = new Uint8Array(bytes);
|
|
38869
|
-
globalThis.crypto.getRandomValues(arr);
|
|
38870
|
-
return Array.from(arr, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
38871
|
-
}
|
|
38872
|
-
|
|
38873
38966
|
// node_modules/@fetchproxy/protocol/dist/json-pointer.js
|
|
38874
38967
|
function matchesDeclaredKey(requested, declared) {
|
|
38875
38968
|
for (const decl of declared) {
|
|
@@ -39465,6 +39558,16 @@ function validateFrame(raw) {
|
|
|
39465
39558
|
return { type: "extension-disconnected" };
|
|
39466
39559
|
if (t === "peer-gone")
|
|
39467
39560
|
return validatePeerGone(raw);
|
|
39561
|
+
if (t === ACCOUNT_KEY_FRAME)
|
|
39562
|
+
return validateAccountKey(raw);
|
|
39563
|
+
if (t === ACCOUNT_ATTEST_FRAME)
|
|
39564
|
+
return validateAccountAttest(raw);
|
|
39565
|
+
if (t === BRIDGE_ROLE_FRAME)
|
|
39566
|
+
return validateBridgeRole(raw);
|
|
39567
|
+
if (t === BRIDGE_SERVE_FRAME || t === ROOM_PING_FRAME || t === ROOM_PONG_FRAME) {
|
|
39568
|
+
assertExactFields(raw, TYPE_ONLY_FIELDS, t);
|
|
39569
|
+
return { type: t };
|
|
39570
|
+
}
|
|
39468
39571
|
throw new ProtocolError3(`unknown frame type: ${String(t)}`);
|
|
39469
39572
|
}
|
|
39470
39573
|
function validateHello(raw) {
|
|
@@ -39668,6 +39771,165 @@ function validateHelloRejected(raw) {
|
|
|
39668
39771
|
}
|
|
39669
39772
|
return { type: "hello-rejected", mcpId: raw.mcpId, reason: raw.reason };
|
|
39670
39773
|
}
|
|
39774
|
+
var DISPLAY_FORBIDDEN_RE = /[\u0000-\u001f\u007f-\u009f\u200e\u200f\u202a-\u202e\u2066-\u2069]/;
|
|
39775
|
+
function assertExactFields(raw, allowed, label) {
|
|
39776
|
+
for (const k of Object.keys(raw)) {
|
|
39777
|
+
if (!allowed.includes(k)) {
|
|
39778
|
+
throw new ProtocolError3(`${label}: unexpected field ${JSON.stringify(k)}`);
|
|
39779
|
+
}
|
|
39780
|
+
}
|
|
39781
|
+
}
|
|
39782
|
+
function assertMatch(x, re, label, what) {
|
|
39783
|
+
assertString(x, label);
|
|
39784
|
+
if (!re.test(x))
|
|
39785
|
+
throw new ProtocolError3(`${label}: must be ${what}`);
|
|
39786
|
+
}
|
|
39787
|
+
function assertPositiveSafeInt(x, label) {
|
|
39788
|
+
if (typeof x !== "number" || !Number.isSafeInteger(x) || x <= 0) {
|
|
39789
|
+
throw new ProtocolError3(`${label}: expected positive safe integer`);
|
|
39790
|
+
}
|
|
39791
|
+
}
|
|
39792
|
+
function assertDisplayString(x, label, min, max) {
|
|
39793
|
+
assertString(x, label);
|
|
39794
|
+
if (x.length < min || x.length > max) {
|
|
39795
|
+
throw new ProtocolError3(`${label}: must be ${min}-${max} characters`);
|
|
39796
|
+
}
|
|
39797
|
+
if (DISPLAY_FORBIDDEN_RE.test(x)) {
|
|
39798
|
+
throw new ProtocolError3(`${label}: control or bidi-override character`);
|
|
39799
|
+
}
|
|
39800
|
+
}
|
|
39801
|
+
var ACCOUNT_KEY_FIELDS = [
|
|
39802
|
+
"type",
|
|
39803
|
+
"accountId",
|
|
39804
|
+
"slug",
|
|
39805
|
+
"displayName",
|
|
39806
|
+
"confirmedBy",
|
|
39807
|
+
"tokenId",
|
|
39808
|
+
"kid",
|
|
39809
|
+
"publicKey",
|
|
39810
|
+
"generation",
|
|
39811
|
+
"bridgedRegistrations"
|
|
39812
|
+
];
|
|
39813
|
+
function validateAccountKey(raw) {
|
|
39814
|
+
const L = "account-key";
|
|
39815
|
+
assertMatch(raw.accountId, ACCOUNT_ID_RE, `${L}.accountId`, "an account id");
|
|
39816
|
+
assertMatch(raw.slug, ACCOUNT_ID_RE, `${L}.slug`, "a slug");
|
|
39817
|
+
assertDisplayString(raw.displayName, `${L}.displayName`, 0, 128);
|
|
39818
|
+
assertDisplayString(raw.confirmedBy, `${L}.confirmedBy`, 1, 256);
|
|
39819
|
+
assertMatch(raw.tokenId, ACCOUNT_ID_RE, `${L}.tokenId`, "a token id");
|
|
39820
|
+
assertMatch(raw.kid, ACCOUNT_KID_RE, `${L}.kid`, "16 lowercase hex");
|
|
39821
|
+
assertBase64Bytes(raw.publicKey, `${L}.publicKey`, 32);
|
|
39822
|
+
assertPositiveSafeInt(raw.generation, `${L}.generation`);
|
|
39823
|
+
const n = raw.bridgedRegistrations;
|
|
39824
|
+
if (typeof n !== "number" || !Number.isSafeInteger(n) || n < 0) {
|
|
39825
|
+
throw new ProtocolError3(`${L}.bridgedRegistrations: expected non-negative safe integer`);
|
|
39826
|
+
}
|
|
39827
|
+
assertExactFields(raw, ACCOUNT_KEY_FIELDS, L);
|
|
39828
|
+
return {
|
|
39829
|
+
type: ACCOUNT_KEY_FRAME,
|
|
39830
|
+
accountId: raw.accountId,
|
|
39831
|
+
slug: raw.slug,
|
|
39832
|
+
displayName: raw.displayName,
|
|
39833
|
+
confirmedBy: raw.confirmedBy,
|
|
39834
|
+
tokenId: raw.tokenId,
|
|
39835
|
+
kid: raw.kid,
|
|
39836
|
+
publicKey: raw.publicKey,
|
|
39837
|
+
generation: raw.generation,
|
|
39838
|
+
bridgedRegistrations: n
|
|
39839
|
+
};
|
|
39840
|
+
}
|
|
39841
|
+
var ACCOUNT_ATTEST_FIELDS = [
|
|
39842
|
+
"type",
|
|
39843
|
+
"mcpId",
|
|
39844
|
+
"accountId",
|
|
39845
|
+
"generation",
|
|
39846
|
+
"tokenId",
|
|
39847
|
+
"kid",
|
|
39848
|
+
"registrationId",
|
|
39849
|
+
"slug",
|
|
39850
|
+
"identityHash",
|
|
39851
|
+
"identityEd25519Pub",
|
|
39852
|
+
"scopeDigest",
|
|
39853
|
+
"consent",
|
|
39854
|
+
"notAfter",
|
|
39855
|
+
"sig"
|
|
39856
|
+
];
|
|
39857
|
+
function validateAccountAttest(raw) {
|
|
39858
|
+
const L = "account-attest";
|
|
39859
|
+
if (!isValidMcpId(raw.mcpId))
|
|
39860
|
+
throw new ProtocolError3(`${L}.mcpId: invalid format`);
|
|
39861
|
+
assertMatch(raw.accountId, ACCOUNT_ID_RE, `${L}.accountId`, "an account id");
|
|
39862
|
+
assertPositiveSafeInt(raw.generation, `${L}.generation`);
|
|
39863
|
+
assertMatch(raw.tokenId, ACCOUNT_ID_RE, `${L}.tokenId`, "a token id");
|
|
39864
|
+
assertMatch(raw.kid, ACCOUNT_KID_RE, `${L}.kid`, "16 lowercase hex");
|
|
39865
|
+
assertMatch(raw.registrationId, ACCOUNT_ID_RE, `${L}.registrationId`, "a registration id");
|
|
39866
|
+
assertMatch(raw.slug, ACCOUNT_ID_RE, `${L}.slug`, "a slug");
|
|
39867
|
+
assertMatch(raw.identityHash, HEX64_RE, `${L}.identityHash`, "64 lowercase hex");
|
|
39868
|
+
assertBase64Bytes(raw.identityEd25519Pub, `${L}.identityEd25519Pub`, 32);
|
|
39869
|
+
assertMatch(raw.scopeDigest, HEX64_RE, `${L}.scopeDigest`, "64 lowercase hex");
|
|
39870
|
+
assertString(raw.consent, `${L}.consent`);
|
|
39871
|
+
const consent = raw.consent;
|
|
39872
|
+
const known = ACCOUNT_ATTEST_CONSENTS.find((c) => c === consent);
|
|
39873
|
+
if (known === void 0) {
|
|
39874
|
+
throw new ProtocolError3(`${L}.consent: must be one of ${ACCOUNT_ATTEST_CONSENTS.join(", ")}`);
|
|
39875
|
+
}
|
|
39876
|
+
assertPositiveSafeInt(raw.notAfter, `${L}.notAfter`);
|
|
39877
|
+
assertBase64Bytes(raw.sig, `${L}.sig`, 64);
|
|
39878
|
+
assertExactFields(raw, ACCOUNT_ATTEST_FIELDS, L);
|
|
39879
|
+
return {
|
|
39880
|
+
type: ACCOUNT_ATTEST_FRAME,
|
|
39881
|
+
mcpId: raw.mcpId,
|
|
39882
|
+
accountId: raw.accountId,
|
|
39883
|
+
generation: raw.generation,
|
|
39884
|
+
tokenId: raw.tokenId,
|
|
39885
|
+
kid: raw.kid,
|
|
39886
|
+
registrationId: raw.registrationId,
|
|
39887
|
+
slug: raw.slug,
|
|
39888
|
+
identityHash: raw.identityHash,
|
|
39889
|
+
identityEd25519Pub: raw.identityEd25519Pub,
|
|
39890
|
+
scopeDigest: raw.scopeDigest,
|
|
39891
|
+
consent: known,
|
|
39892
|
+
notAfter: raw.notAfter,
|
|
39893
|
+
sig: raw.sig
|
|
39894
|
+
};
|
|
39895
|
+
}
|
|
39896
|
+
var TYPE_ONLY_FIELDS = ["type"];
|
|
39897
|
+
var BRIDGE_ROLE_FIELDS = ["type", "role", "canServe", "serving"];
|
|
39898
|
+
var BRIDGE_ROLE_SERVING_FIELDS = ["label", "since"];
|
|
39899
|
+
function validateBridgeRole(raw) {
|
|
39900
|
+
const L = BRIDGE_ROLE_FRAME;
|
|
39901
|
+
const role = raw.role;
|
|
39902
|
+
if (role !== "serving" && role !== "standby") {
|
|
39903
|
+
throw new ProtocolError3(`${L}.role: must be one of serving, standby`);
|
|
39904
|
+
}
|
|
39905
|
+
const canServe = raw.canServe;
|
|
39906
|
+
assertBoolean(canServe, `${L}.canServe`);
|
|
39907
|
+
assertExactFields(raw, BRIDGE_ROLE_FIELDS, L);
|
|
39908
|
+
const serving = raw.serving;
|
|
39909
|
+
if (role === "serving") {
|
|
39910
|
+
if (serving !== void 0) {
|
|
39911
|
+
throw new ProtocolError3(`${L}.serving: must be absent when role is serving`);
|
|
39912
|
+
}
|
|
39913
|
+
return { type: BRIDGE_ROLE_FRAME, role, canServe };
|
|
39914
|
+
}
|
|
39915
|
+
if (serving === void 0) {
|
|
39916
|
+
throw new ProtocolError3(`${L}.serving: required when role is standby`);
|
|
39917
|
+
}
|
|
39918
|
+
assertObject(serving, `${L}.serving`);
|
|
39919
|
+
const label = serving.label;
|
|
39920
|
+
assertDisplayString(label, `${L}.serving.label`, 1, BRIDGE_ROLE_LABEL_MAX);
|
|
39921
|
+
const since = serving.since;
|
|
39922
|
+
if (typeof since !== "number" || !Number.isSafeInteger(since) || since < 0) {
|
|
39923
|
+
throw new ProtocolError3(`${L}.serving.since: expected non-negative safe integer (Unix ms)`);
|
|
39924
|
+
}
|
|
39925
|
+
assertExactFields(serving, BRIDGE_ROLE_SERVING_FIELDS, `${L}.serving`);
|
|
39926
|
+
return {
|
|
39927
|
+
type: BRIDGE_ROLE_FRAME,
|
|
39928
|
+
role,
|
|
39929
|
+
canServe,
|
|
39930
|
+
serving: { label, since }
|
|
39931
|
+
};
|
|
39932
|
+
}
|
|
39671
39933
|
function validateInnerFrame(raw) {
|
|
39672
39934
|
assertObject(raw, "inner");
|
|
39673
39935
|
const t = raw.type;
|
|
@@ -40135,10 +40397,10 @@ function validateInnerResponse(raw) {
|
|
|
40135
40397
|
}
|
|
40136
40398
|
|
|
40137
40399
|
// node_modules/@fetchproxy/protocol/dist/pair-code.js
|
|
40138
|
-
var
|
|
40400
|
+
var enc3 = new TextEncoder();
|
|
40139
40401
|
var PAIR_LABEL = "fetchproxy/4/pair";
|
|
40140
40402
|
async function pairTranscript(mcpIdentityPub, extIdentityPub, mcpNonce, extNonce, mcpSessionPub) {
|
|
40141
|
-
const label =
|
|
40403
|
+
const label = enc3.encode(PAIR_LABEL);
|
|
40142
40404
|
const parts = [mcpIdentityPub, extIdentityPub, mcpNonce, extNonce, mcpSessionPub];
|
|
40143
40405
|
const out = new Uint8Array(label.length + 1 + parts.reduce((n, p) => n + p.length, 0));
|
|
40144
40406
|
out.set(label, 0);
|
|
@@ -40159,7 +40421,7 @@ function digits(hash2) {
|
|
|
40159
40421
|
}
|
|
40160
40422
|
|
|
40161
40423
|
// node_modules/@fetchproxy/protocol/dist/seal.js
|
|
40162
|
-
var
|
|
40424
|
+
var enc4 = new TextEncoder();
|
|
40163
40425
|
var dec = new TextDecoder();
|
|
40164
40426
|
function randomIv() {
|
|
40165
40427
|
const iv = new Uint8Array(12);
|
|
@@ -40172,14 +40434,14 @@ function base64Length(byteLength) {
|
|
|
40172
40434
|
return Math.ceil(byteLength / 3) * 4;
|
|
40173
40435
|
}
|
|
40174
40436
|
function encodeInnerFrame(inner) {
|
|
40175
|
-
return
|
|
40437
|
+
return enc4.encode(JSON.stringify(inner));
|
|
40176
40438
|
}
|
|
40177
40439
|
function plaintextOf(inner) {
|
|
40178
40440
|
return inner instanceof Uint8Array ? inner : encodeInnerFrame(inner);
|
|
40179
40441
|
}
|
|
40180
40442
|
function sealedFrameWireBytes(mcpId, seq, inner) {
|
|
40181
40443
|
const plaintext = plaintextOf(inner).length;
|
|
40182
|
-
const envelope =
|
|
40444
|
+
const envelope = enc4.encode(JSON.stringify({ type: "frame", mcpId, seq, iv: "", ciphertext: "" })).length;
|
|
40183
40445
|
return envelope + IV_B64_BYTES + base64Length(plaintext + AES_GCM_TAG_BYTES);
|
|
40184
40446
|
}
|
|
40185
40447
|
var MAX_FRAME_BYTES = 42 * 1024 * 1024;
|
|
@@ -40519,14 +40781,23 @@ var FetchproxyHelloRejectedError = class extends Error {
|
|
|
40519
40781
|
platform;
|
|
40520
40782
|
/**
|
|
40521
40783
|
* #418: the remedy, when the reason is one this package knows how to
|
|
40522
|
-
* explain —
|
|
40523
|
-
*
|
|
40784
|
+
* explain — `unsupported-capability`, which blames the browser rather than
|
|
40785
|
+
* the MCP, and (D12) `awaiting-approval`, which says to approve in the
|
|
40786
|
+
* browser. `null` otherwise.
|
|
40524
40787
|
*/
|
|
40525
40788
|
hint;
|
|
40789
|
+
/**
|
|
40790
|
+
* D12: `true` only for an `awaiting-approval:` refusal — the extension has
|
|
40791
|
+
* queued an approval card and nobody is at the browser yet, so the same call
|
|
40792
|
+
* succeeds once the person approves. Every other refusal is the extension's
|
|
40793
|
+
* final answer, and retrying unchanged is refused the same way.
|
|
40794
|
+
*/
|
|
40795
|
+
retryable;
|
|
40526
40796
|
constructor(info) {
|
|
40527
40797
|
const unavailable = parseUnsupportedCapabilityReason(info.reason);
|
|
40798
|
+
const awaiting = parseAwaitingApprovalReason(info.reason);
|
|
40528
40799
|
const platform = info.platform ?? null;
|
|
40529
|
-
const hint = unavailable !== null ? `${platform ? `this browser (${platform})` : "this browser"} cannot serve any of the capabilities this MCP needs (${unavailable.join(", ")}) \u2014 ContextMint Bridge checked for the browser APIs and they are missing. Nothing is wrong with the MCP or your pairing, and updating will not change it: use this MCP from a browser that provides them (for example Chrome).` : null;
|
|
40800
|
+
const hint = awaiting !== null ? `The extension is waiting for you to approve this MCP` + (awaiting !== "" ? ` (${awaiting})` : "") + ` \u2014 open ContextMint Bridge in your browser, approve it there, then retry. Nothing is wrong with the MCP or your sign-in.` : unavailable !== null ? `${platform ? `this browser (${platform})` : "this browser"} cannot serve any of the capabilities this MCP needs (${unavailable.join(", ")}) \u2014 ContextMint Bridge checked for the browser APIs and they are missing. Nothing is wrong with the MCP or your pairing, and updating will not change it: use this MCP from a browser that provides them (for example Chrome).` : null;
|
|
40530
40801
|
super(`fetchproxy: the extension refused the connection for "${info.mcpId}": ${info.reason}. ` + (hint !== null ? hint : `This is the extension's own reason \u2014 it is not a timeout, and retrying unchanged will be refused the same way.`));
|
|
40531
40802
|
this.name = "FetchproxyHelloRejectedError";
|
|
40532
40803
|
this.mcpId = info.mcpId;
|
|
@@ -40534,6 +40805,7 @@ var FetchproxyHelloRejectedError = class extends Error {
|
|
|
40534
40805
|
this.unavailableCapabilities = unavailable ?? [];
|
|
40535
40806
|
this.platform = platform;
|
|
40536
40807
|
this.hint = hint;
|
|
40808
|
+
this.retryable = awaiting !== null;
|
|
40537
40809
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
40538
40810
|
}
|
|
40539
40811
|
};
|
|
@@ -41086,7 +41358,7 @@ function originVerdict(origin, allowLocal) {
|
|
|
41086
41358
|
}
|
|
41087
41359
|
var HANDSHAKE_TIMEOUT_MS = 15e3;
|
|
41088
41360
|
var MAX_PAYLOAD_BYTES = MAX_FRAME_BYTES;
|
|
41089
|
-
var
|
|
41361
|
+
var enc5 = new TextEncoder();
|
|
41090
41362
|
var OWN_DECRYPT_FAILURES_BEFORE_REHANDSHAKE = 3;
|
|
41091
41363
|
async function startHost(opts) {
|
|
41092
41364
|
const allowLocalOrigins = envAllowsLocalOrigins();
|
|
@@ -41157,10 +41429,20 @@ async function startHost(opts) {
|
|
|
41157
41429
|
let resolveOwnSession;
|
|
41158
41430
|
let rejectOwnSession;
|
|
41159
41431
|
let ownSessionReady;
|
|
41432
|
+
let ownRetryableRefusal = false;
|
|
41433
|
+
let ownSessionSettled = false;
|
|
41160
41434
|
function resetSessionPromise() {
|
|
41435
|
+
ownRetryableRefusal = false;
|
|
41436
|
+
ownSessionSettled = false;
|
|
41161
41437
|
ownSessionReady = new Promise((resolve, reject) => {
|
|
41162
|
-
resolveOwnSession =
|
|
41163
|
-
|
|
41438
|
+
resolveOwnSession = (st) => {
|
|
41439
|
+
ownSessionSettled = true;
|
|
41440
|
+
resolve(st);
|
|
41441
|
+
};
|
|
41442
|
+
rejectOwnSession = (e) => {
|
|
41443
|
+
ownSessionSettled = true;
|
|
41444
|
+
reject(e);
|
|
41445
|
+
};
|
|
41164
41446
|
});
|
|
41165
41447
|
ownSessionReady.catch(() => {
|
|
41166
41448
|
});
|
|
@@ -41427,13 +41709,15 @@ async function startHost(opts) {
|
|
|
41427
41709
|
const extPub = fromB64(frame.extensionSessionPub);
|
|
41428
41710
|
const shared = await ecdhX25519(held.priv, extPub);
|
|
41429
41711
|
const salt = await transcriptHash(held.nonce, extNonce, held.pub, extPub);
|
|
41430
|
-
const key = await hkdfSha256(shared, salt,
|
|
41712
|
+
const key = await hkdfSha256(shared, salt, enc5.encode(HKDF_SESSION_INFO), 32);
|
|
41431
41713
|
if (extensionWs !== ws)
|
|
41432
41714
|
return;
|
|
41433
41715
|
ownSession = new SessionState(key);
|
|
41434
41716
|
ownSessionInfo = sessionInfoFromHello(verifiedHello);
|
|
41435
41717
|
ownDecryptFailures = 0;
|
|
41436
41718
|
ownPendingPairCode = null;
|
|
41719
|
+
if (ownRetryableRefusal)
|
|
41720
|
+
resetSessionPromise();
|
|
41437
41721
|
resolveOwnSession(ownSession);
|
|
41438
41722
|
} else {
|
|
41439
41723
|
const slot = peers.get(frame.mcpId);
|
|
@@ -41502,11 +41786,17 @@ async function startHost(opts) {
|
|
|
41502
41786
|
}
|
|
41503
41787
|
if (frame.type === "hello-rejected" && identified === "extension") {
|
|
41504
41788
|
if (frame.mcpId === opts.ownMcpId) {
|
|
41505
|
-
|
|
41789
|
+
const refusal = new FetchproxyHelloRejectedError({
|
|
41506
41790
|
mcpId: frame.mcpId,
|
|
41507
41791
|
reason: frame.reason,
|
|
41508
41792
|
platform: extensionHello?.platform ?? null
|
|
41509
|
-
})
|
|
41793
|
+
});
|
|
41794
|
+
if (ownRetryableRefusal)
|
|
41795
|
+
resetSessionPromise();
|
|
41796
|
+
const settlesPending = !ownSessionSettled;
|
|
41797
|
+
rejectOwnSession(refusal);
|
|
41798
|
+
if (refusal.retryable && settlesPending)
|
|
41799
|
+
ownRetryableRefusal = true;
|
|
41510
41800
|
} else {
|
|
41511
41801
|
const slot = peers.get(frame.mcpId);
|
|
41512
41802
|
if (slot?.helloFrame.accepts?.includes("hello-rejected")) {
|
|
@@ -41622,7 +41912,7 @@ async function startHost(opts) {
|
|
|
41622
41912
|
|
|
41623
41913
|
// node_modules/@fetchproxy/server/dist/peer.js
|
|
41624
41914
|
var PEER_DIAL_TIMEOUT_MS = 5e3;
|
|
41625
|
-
var
|
|
41915
|
+
var enc6 = new TextEncoder();
|
|
41626
41916
|
function notSentError() {
|
|
41627
41917
|
return new Error("fetchproxy: request not sent \u2014 the connection to the bridge host closed before it went out, so nothing reached the browser. It is safe to retry.");
|
|
41628
41918
|
}
|
|
@@ -41722,7 +42012,9 @@ async function startPeer(opts) {
|
|
|
41722
42012
|
let rejectFirstReady;
|
|
41723
42013
|
let sessionPromise;
|
|
41724
42014
|
let sessionPromiseSettled = false;
|
|
42015
|
+
let retryableRefusal = false;
|
|
41725
42016
|
function resetSessionPromise() {
|
|
42017
|
+
retryableRefusal = false;
|
|
41726
42018
|
sessionPromiseSettled = false;
|
|
41727
42019
|
sessionPromise = new Promise((resolve, reject) => {
|
|
41728
42020
|
resolveFirstReady = (st) => {
|
|
@@ -41819,6 +42111,8 @@ async function startPeer(opts) {
|
|
|
41819
42111
|
raw = JSON.parse(data.toString());
|
|
41820
42112
|
const frame = validateFrame(raw);
|
|
41821
42113
|
if (frame.type === "hello" && frame.role === "extension") {
|
|
42114
|
+
if (retryableRefusal)
|
|
42115
|
+
resetSessionPromise();
|
|
41822
42116
|
extensionHello = frame;
|
|
41823
42117
|
const mintedKeypair = await generateSessionKeypair();
|
|
41824
42118
|
const mintedHello = await buildServerHello({
|
|
@@ -41848,6 +42142,8 @@ async function startPeer(opts) {
|
|
|
41848
42142
|
session = null;
|
|
41849
42143
|
if (sessionPromiseSettled)
|
|
41850
42144
|
resetSessionPromise();
|
|
42145
|
+
} else if (retryableRefusal) {
|
|
42146
|
+
resetSessionPromise();
|
|
41851
42147
|
}
|
|
41852
42148
|
extensionDisconnectListeners.forEach((cb) => cb());
|
|
41853
42149
|
return;
|
|
@@ -41869,7 +42165,7 @@ async function startPeer(opts) {
|
|
|
41869
42165
|
const extNonce = fromB64(authenticated.sessionNonce);
|
|
41870
42166
|
const shared = await ecdhX25519(held.priv, extPub);
|
|
41871
42167
|
const salt = await transcriptHash(held.nonce, extNonce, held.pub, extPub);
|
|
41872
|
-
const sessionKey = await hkdfSha256(shared, salt,
|
|
42168
|
+
const sessionKey = await hkdfSha256(shared, salt, enc6.encode(HKDF_SESSION_INFO), 32);
|
|
41873
42169
|
if (sessionEphemeral !== held) {
|
|
41874
42170
|
console.warn(`[fetchproxy] ${opts.serverName}: dropping a session derived against an ephemeral that was superseded while it was being derived`);
|
|
41875
42171
|
return;
|
|
@@ -41882,16 +42178,24 @@ async function startPeer(opts) {
|
|
|
41882
42178
|
if (isRenegotiation) {
|
|
41883
42179
|
renegotiateListeners.forEach((cb) => cb());
|
|
41884
42180
|
} else {
|
|
42181
|
+
if (retryableRefusal)
|
|
42182
|
+
resetSessionPromise();
|
|
41885
42183
|
resolveFirstReady(session);
|
|
41886
42184
|
}
|
|
41887
42185
|
return;
|
|
41888
42186
|
}
|
|
41889
42187
|
if (frame.type === "hello-rejected" && frame.mcpId === opts.mcpId) {
|
|
41890
|
-
|
|
42188
|
+
const refusal = new FetchproxyHelloRejectedError({
|
|
41891
42189
|
mcpId: frame.mcpId,
|
|
41892
42190
|
reason: frame.reason,
|
|
41893
42191
|
platform: extensionHello?.platform ?? null
|
|
41894
|
-
})
|
|
42192
|
+
});
|
|
42193
|
+
if (retryableRefusal)
|
|
42194
|
+
resetSessionPromise();
|
|
42195
|
+
const settlesPending = !sessionPromiseSettled;
|
|
42196
|
+
rejectFirstReady(refusal);
|
|
42197
|
+
if (refusal.retryable && settlesPending)
|
|
42198
|
+
retryableRefusal = true;
|
|
41895
42199
|
}
|
|
41896
42200
|
if (frame.type === "pair-pending" && frame.mcpId === opts.mcpId) {
|
|
41897
42201
|
const hello2 = extensionHello;
|
|
@@ -42055,8 +42359,9 @@ function classifyFetchError(error62, code) {
|
|
|
42055
42359
|
|
|
42056
42360
|
// node_modules/@fetchproxy/server/dist/classify-bridge-error.js
|
|
42057
42361
|
function classifyBridgeError(err) {
|
|
42058
|
-
if (err instanceof FetchproxyHelloRejectedError)
|
|
42059
|
-
return "hello_rejected";
|
|
42362
|
+
if (err instanceof FetchproxyHelloRejectedError) {
|
|
42363
|
+
return err.retryable ? "awaiting_approval" : "hello_rejected";
|
|
42364
|
+
}
|
|
42060
42365
|
if (err instanceof FetchproxySessionNotReadyError)
|
|
42061
42366
|
return "session_not_ready";
|
|
42062
42367
|
if (err instanceof FetchproxyTimeoutError)
|
|
@@ -45148,7 +45453,7 @@ await runMcp({
|
|
|
45148
45453
|
});
|
|
45149
45454
|
/*! Bundled license information:
|
|
45150
45455
|
|
|
45151
|
-
@modelcontextprotocol/server/dist/src-
|
|
45456
|
+
@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs:
|
|
45152
45457
|
(*!
|
|
45153
45458
|
* content-type
|
|
45154
45459
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrischall/microsoft-teams-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"mcpName": "io.github.chrischall/microsoft-teams-mcp",
|
|
5
5
|
"description": "Microsoft Teams MCP server for Claude — developed and maintained by AI (Claude Code)",
|
|
6
6
|
"author": "Claude Code (AI) <https://www.anthropic.com/claude>",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"typecheck": "tsc -p tsconfig.check.json"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@chrischall/mcp-utils": "^2.
|
|
49
|
-
"@fetchproxy/protocol": "^3.
|
|
50
|
-
"@fetchproxy/server": "^3.
|
|
51
|
-
"@modelcontextprotocol/server": "^2.
|
|
48
|
+
"@chrischall/mcp-utils": "^2.15.0",
|
|
49
|
+
"@fetchproxy/protocol": "^3.6.0",
|
|
50
|
+
"@fetchproxy/server": "^3.6.0",
|
|
51
|
+
"@modelcontextprotocol/server": "^2.3.0",
|
|
52
52
|
"dotenv": "^18.0.1",
|
|
53
53
|
"zod": "^4.6.5"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@modelcontextprotocol/client": "^2.
|
|
56
|
+
"@modelcontextprotocol/client": "^2.3.0",
|
|
57
57
|
"@types/node": "^26.0.0",
|
|
58
58
|
"@vitest/coverage-v8": "^5.0.0",
|
|
59
59
|
"esbuild": "^0.28.1",
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/chrischall/microsoft-teams-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.7",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@chrischall/microsoft-teams-mcp",
|
|
14
|
-
"version": "0.2.
|
|
14
|
+
"version": "0.2.7",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|