@capybara-hq/plugin-connector-mcp 0.1.0-rc.1 → 0.1.0-rc.11
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/.capybara-plugin/plugin.json +5 -28
- package/README.md +13 -0
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/dist/index.mjs +45 -45
- package/icon.svg +1 -0
- package/package.json +2 -2
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "connector-mcp",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.11",
|
|
5
5
|
"publisher": "Capybara",
|
|
6
6
|
"description": "MCP connector (connector@1): tools and resources of remote MCP servers over Streamable HTTP",
|
|
7
7
|
"displayName": {
|
|
8
8
|
"zh": "MCP 连接器",
|
|
9
9
|
"en": "MCP connector"
|
|
10
10
|
},
|
|
11
|
+
"icon": "./icon.svg",
|
|
11
12
|
"homepage": "https://github.com/capybara-hq/plugins/tree/main/plugins/connector-mcp#readme",
|
|
12
13
|
"extension": {
|
|
13
14
|
"entry": "./dist/index.mjs",
|
|
14
15
|
"manifest": {
|
|
15
16
|
"name": "connector-mcp",
|
|
16
|
-
"version": "0.1.0-rc.
|
|
17
|
-
"sdk": "^0.1.0-rc.
|
|
17
|
+
"version": "0.1.0-rc.11",
|
|
18
|
+
"sdk": "^0.1.0-rc.29",
|
|
18
19
|
"provides": [
|
|
19
20
|
"connector@1"
|
|
20
21
|
],
|
|
@@ -22,33 +23,9 @@
|
|
|
22
23
|
"optional": [],
|
|
23
24
|
"permissions": {},
|
|
24
25
|
"config": {
|
|
25
|
-
"deployment": [
|
|
26
|
-
{
|
|
27
|
-
"path": "allowInsecureLoopback",
|
|
28
|
-
"secret": false,
|
|
29
|
-
"hot": false
|
|
30
|
-
}
|
|
31
|
-
],
|
|
26
|
+
"deployment": [],
|
|
32
27
|
"org": []
|
|
33
28
|
}
|
|
34
|
-
},
|
|
35
|
-
"configSchemas": {
|
|
36
|
-
"deployment": {
|
|
37
|
-
"type": "object",
|
|
38
|
-
"properties": {
|
|
39
|
-
"allowInsecureLoopback": {
|
|
40
|
-
"default": false,
|
|
41
|
-
"type": "boolean",
|
|
42
|
-
"x-ui": {
|
|
43
|
-
"label": {
|
|
44
|
-
"zh": "允许本机 http 端点",
|
|
45
|
-
"en": "Allow loopback http endpoints"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"title": "Allow loopback http endpoints"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
29
|
}
|
|
53
30
|
}
|
|
54
31
|
}
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @capybara-hq/plugin-connector-mcp
|
|
2
|
+
|
|
3
|
+
MCP connector (connector@1): tools and resources of remote MCP servers over Streamable HTTP.
|
|
4
|
+
|
|
5
|
+
## Icon
|
|
6
|
+
|
|
7
|
+
`icon.svg`: the Model Context Protocol mark (owner: the Model Context Protocol project), downloaded on
|
|
8
|
+
2026-11-08 from https://github.com/modelcontextprotocol/modelcontextprotocol at 94f4ebc8ecb3
|
|
9
|
+
(docs/favicon.svg and docs/logo/light.svg / dark.svg, the logos of modelcontextprotocol.io). It is a
|
|
10
|
+
trademark of its owner, used only to identify the service this plugin connects to; the plugin is not
|
|
11
|
+
affiliated with or endorsed by the owner. The artwork is unchanged except for removing editor
|
|
12
|
+
metadata and setting a square viewBox; it draws the favicon's mark without its tile, black on light
|
|
13
|
+
backgrounds and white on dark ones as in logo/light.svg and logo/dark.svg.
|
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
This package bundles the third-party software listed below. Their license notices follow.
|
|
2
2
|
|
|
3
3
|
------------------------------------------------------------------------
|
|
4
|
-
@modelcontextprotocol/sdk@1.32.
|
|
4
|
+
@modelcontextprotocol/sdk@1.32.2 (MIT)
|
|
5
5
|
|
|
6
6
|
MIT License
|
|
7
7
|
|
package/dist/index.mjs
CHANGED
|
@@ -7305,15 +7305,15 @@ var require_content_type = __commonJS({
|
|
|
7305
7305
|
});
|
|
7306
7306
|
|
|
7307
7307
|
// src/index.ts
|
|
7308
|
-
import { CONNECTOR_EXTENSION_POINT, defineExtension
|
|
7309
|
-
import { z as z4 } from "zod";
|
|
7308
|
+
import { CONNECTOR_EXTENSION_POINT, defineExtension } from "@capybara-hq/plugin-sdk";
|
|
7310
7309
|
|
|
7311
7310
|
// src/session.ts
|
|
7312
7311
|
import {
|
|
7312
|
+
isNetDeniedError,
|
|
7313
7313
|
ToolError
|
|
7314
7314
|
} from "@capybara-hq/plugin-sdk";
|
|
7315
7315
|
|
|
7316
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
7316
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
7317
7317
|
import * as z3rt from "zod/v3";
|
|
7318
7318
|
import * as z4mini from "zod/v4-mini";
|
|
7319
7319
|
function isZ4Schema(s) {
|
|
@@ -7378,7 +7378,7 @@ function getLiteralValue(schema) {
|
|
|
7378
7378
|
return void 0;
|
|
7379
7379
|
}
|
|
7380
7380
|
|
|
7381
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
7381
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
7382
7382
|
import * as z from "zod/v4";
|
|
7383
7383
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
7384
7384
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
@@ -8899,12 +8899,12 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
8899
8899
|
}
|
|
8900
8900
|
};
|
|
8901
8901
|
|
|
8902
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
8902
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
8903
8903
|
function isTerminal(status) {
|
|
8904
8904
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
8905
8905
|
}
|
|
8906
8906
|
|
|
8907
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
8907
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
8908
8908
|
import * as z4mini2 from "zod/v4-mini";
|
|
8909
8909
|
|
|
8910
8910
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.6.7/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
@@ -8919,7 +8919,7 @@ import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2 } from "zod/v3";
|
|
|
8919
8919
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.6.7/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
8920
8920
|
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
8921
8921
|
|
|
8922
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
8922
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
8923
8923
|
function getMethodLiteral(schema) {
|
|
8924
8924
|
const shape = getObjectShape(schema);
|
|
8925
8925
|
const methodSchema = shape?.method;
|
|
@@ -8940,7 +8940,7 @@ function parseWithCompat(schema, data) {
|
|
|
8940
8940
|
return result.data;
|
|
8941
8941
|
}
|
|
8942
8942
|
|
|
8943
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
8943
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
8944
8944
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
8945
8945
|
var Protocol = class {
|
|
8946
8946
|
constructor(_options) {
|
|
@@ -9917,7 +9917,7 @@ function mergeCapabilities(base, additional) {
|
|
|
9917
9917
|
return result;
|
|
9918
9918
|
}
|
|
9919
9919
|
|
|
9920
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
9920
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
9921
9921
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
9922
9922
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
9923
9923
|
function createDefaultAjvInstance() {
|
|
@@ -9985,7 +9985,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
9985
9985
|
}
|
|
9986
9986
|
};
|
|
9987
9987
|
|
|
9988
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
9988
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
|
|
9989
9989
|
var ExperimentalClientTasks = class {
|
|
9990
9990
|
constructor(_client) {
|
|
9991
9991
|
this._client = _client;
|
|
@@ -10139,7 +10139,7 @@ var ExperimentalClientTasks = class {
|
|
|
10139
10139
|
}
|
|
10140
10140
|
};
|
|
10141
10141
|
|
|
10142
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
10142
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
10143
10143
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
10144
10144
|
if (!requests) {
|
|
10145
10145
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -10174,7 +10174,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
10174
10174
|
}
|
|
10175
10175
|
}
|
|
10176
10176
|
|
|
10177
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
10177
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
|
|
10178
10178
|
function applyElicitationDefaults(schema, data) {
|
|
10179
10179
|
if (!schema || data === null || typeof data !== "object")
|
|
10180
10180
|
return;
|
|
@@ -10685,7 +10685,7 @@ var Client = class extends Protocol {
|
|
|
10685
10685
|
}
|
|
10686
10686
|
};
|
|
10687
10687
|
|
|
10688
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
10688
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
|
|
10689
10689
|
var import_content_type = __toESM(require_content_type(), 1);
|
|
10690
10690
|
function mediaTypeEssence(header) {
|
|
10691
10691
|
if (!header) {
|
|
@@ -10702,7 +10702,7 @@ function mediaTypeEssence(header) {
|
|
|
10702
10702
|
}
|
|
10703
10703
|
}
|
|
10704
10704
|
|
|
10705
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
10705
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
|
|
10706
10706
|
function normalizeHeaders(headers) {
|
|
10707
10707
|
if (!headers)
|
|
10708
10708
|
return {};
|
|
@@ -10834,7 +10834,7 @@ async function pkceChallenge(length) {
|
|
|
10834
10834
|
};
|
|
10835
10835
|
}
|
|
10836
10836
|
|
|
10837
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
10837
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
10838
10838
|
import * as z2 from "zod/v4";
|
|
10839
10839
|
var SafeUrlSchema = z2.url().superRefine((val, ctx) => {
|
|
10840
10840
|
if (!URL.canParse(val)) {
|
|
@@ -10989,7 +10989,7 @@ var OAuthTokenRevocationRequestSchema = z2.object({
|
|
|
10989
10989
|
token_type_hint: z2.string().optional()
|
|
10990
10990
|
}).strip();
|
|
10991
10991
|
|
|
10992
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
10992
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
|
|
10993
10993
|
function resourceUrlFromServerUrl(url2) {
|
|
10994
10994
|
const resourceURL = typeof url2 === "string" ? new URL(url2) : new URL(url2.href);
|
|
10995
10995
|
resourceURL.hash = "";
|
|
@@ -11009,7 +11009,7 @@ function checkResourceAllowed({ requestedResource, configuredResource }) {
|
|
|
11009
11009
|
return requestedPath.startsWith(configuredPath);
|
|
11010
11010
|
}
|
|
11011
11011
|
|
|
11012
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
11012
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
|
|
11013
11013
|
var OAuthError = class extends Error {
|
|
11014
11014
|
constructor(message, errorUri) {
|
|
11015
11015
|
super(message);
|
|
@@ -11104,7 +11104,7 @@ var OAUTH_ERRORS = {
|
|
|
11104
11104
|
[InvalidTargetError.errorCode]: InvalidTargetError
|
|
11105
11105
|
};
|
|
11106
11106
|
|
|
11107
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
11107
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
|
|
11108
11108
|
var UnauthorizedError = class extends Error {
|
|
11109
11109
|
constructor(message) {
|
|
11110
11110
|
super(message ?? "Unauthorized");
|
|
@@ -11897,7 +11897,7 @@ var EventSourceParserStream = class extends TransformStream {
|
|
|
11897
11897
|
}
|
|
11898
11898
|
};
|
|
11899
11899
|
|
|
11900
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.
|
|
11900
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_@cfworker+json-schema@4.1.6_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
|
|
11901
11901
|
var DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
|
|
11902
11902
|
initialReconnectionDelay: 1e3,
|
|
11903
11903
|
maxReconnectionDelay: 3e4,
|
|
@@ -12314,23 +12314,18 @@ var REQUEST_TIMEOUT_MS = 36e5;
|
|
|
12314
12314
|
var MAX_PAGES = 100;
|
|
12315
12315
|
var MAX_LOGGED_BODY = 1e3;
|
|
12316
12316
|
var CREDENTIAL_HEADERS = /* @__PURE__ */ new Set(["authorization", "proxy-authorization", "cookie"]);
|
|
12317
|
-
var
|
|
12318
|
-
var isLoopbackHttp = (u) => u.protocol === "http:" && LOOPBACK_HOSTS.has(u.hostname);
|
|
12319
|
-
var urlAllowed = (raw, allowInsecureLoopback) => {
|
|
12317
|
+
var urlAllowed = (raw) => {
|
|
12320
12318
|
let u;
|
|
12321
12319
|
try {
|
|
12322
12320
|
u = new URL(raw);
|
|
12323
12321
|
} catch {
|
|
12324
12322
|
return true;
|
|
12325
12323
|
}
|
|
12326
|
-
|
|
12327
|
-
return allowInsecureLoopback && isLoopbackHttp(u);
|
|
12324
|
+
return u.protocol === "https:" || u.protocol === "http:";
|
|
12328
12325
|
};
|
|
12329
|
-
function endpointSchema(
|
|
12326
|
+
function endpointSchema() {
|
|
12330
12327
|
return z3.object({
|
|
12331
|
-
url: z3.url().refine(
|
|
12332
|
-
message: allowInsecureLoopback ? "URL must use https (plain http is only allowed for 127.0.0.1, localhost and [::1])" : "URL must use https"
|
|
12333
|
-
}),
|
|
12328
|
+
url: z3.url().refine(urlAllowed, { message: "URL must use http or https" }),
|
|
12334
12329
|
headers: z3.record(z3.string(), z3.string()).default({}).superRefine((h, ctx) => {
|
|
12335
12330
|
for (const name of Object.keys(h)) {
|
|
12336
12331
|
if (CREDENTIAL_HEADERS.has(name.toLowerCase())) {
|
|
@@ -12344,6 +12339,7 @@ function endpointSchema(allowInsecureLoopback) {
|
|
|
12344
12339
|
})
|
|
12345
12340
|
});
|
|
12346
12341
|
}
|
|
12342
|
+
var netDeniedText = (host, reason) => `The request to ${host || "the app's server"} was refused by the platform's network rules: ${reason} Ask an administrator to check the app endpoint URL.`;
|
|
12347
12343
|
var redirectText = (status) => `The app's server responded with a redirect (HTTP ${status}); redirects are not followed. Ask an administrator to check the app endpoint URL.`;
|
|
12348
12344
|
var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
12349
12345
|
var TITLE_MAX = 80;
|
|
@@ -12475,7 +12471,7 @@ async function guarded(work) {
|
|
|
12475
12471
|
throw mapError(e);
|
|
12476
12472
|
}
|
|
12477
12473
|
}
|
|
12478
|
-
function authedFetch(endpoint, args, log) {
|
|
12474
|
+
function authedFetch(net, endpoint, args, log) {
|
|
12479
12475
|
return async (input, init) => {
|
|
12480
12476
|
const method = (init?.method ?? "GET").toUpperCase();
|
|
12481
12477
|
const send = async () => {
|
|
@@ -12486,7 +12482,16 @@ function authedFetch(endpoint, args, log) {
|
|
|
12486
12482
|
for (const [k, v] of Object.entries(endpoint.headers)) if (!headers.has(k)) headers.set(k, v);
|
|
12487
12483
|
for (const [k, v] of Object.entries(inj.headers)) headers.set(k, v);
|
|
12488
12484
|
const signal = init?.signal ? AbortSignal.any([init.signal, args.signal]) : args.signal;
|
|
12489
|
-
|
|
12485
|
+
try {
|
|
12486
|
+
return await net(
|
|
12487
|
+
url2.toString(),
|
|
12488
|
+
{ ...init, headers, signal, redirect: "manual" },
|
|
12489
|
+
{ orgId: args.orgId }
|
|
12490
|
+
);
|
|
12491
|
+
} catch (e) {
|
|
12492
|
+
if (isNetDeniedError(e)) throw new ToolError(netDeniedText(e.host, e.message));
|
|
12493
|
+
throw e;
|
|
12494
|
+
}
|
|
12490
12495
|
};
|
|
12491
12496
|
const noRedirect = async (r) => {
|
|
12492
12497
|
if (r.status >= 300 && r.status < 400) {
|
|
@@ -12513,9 +12518,9 @@ function authedFetch(endpoint, args, log) {
|
|
|
12513
12518
|
return res;
|
|
12514
12519
|
};
|
|
12515
12520
|
}
|
|
12516
|
-
async function openSession(endpoint, args, log) {
|
|
12521
|
+
async function openSession(net, endpoint, args, log) {
|
|
12517
12522
|
const transport = new StreamableHTTPClientTransport(new URL(endpoint.url), {
|
|
12518
|
-
fetch: authedFetch(endpoint, args, log)
|
|
12523
|
+
fetch: authedFetch(net, endpoint, args, log)
|
|
12519
12524
|
});
|
|
12520
12525
|
const onElicit = args.onElicit;
|
|
12521
12526
|
const client = new Client(CLIENT_INFO, {
|
|
@@ -12657,32 +12662,27 @@ async function openSession(endpoint, args, log) {
|
|
|
12657
12662
|
return session;
|
|
12658
12663
|
}
|
|
12659
12664
|
function createMcpConnector(deps) {
|
|
12660
|
-
const schema = endpointSchema(
|
|
12665
|
+
const schema = endpointSchema();
|
|
12661
12666
|
return {
|
|
12662
12667
|
kind: "mcp",
|
|
12663
12668
|
endpointSchema: schema,
|
|
12664
|
-
open: (args) => openSession(schema.parse(args.endpoint), args, deps.log)
|
|
12669
|
+
open: (args) => openSession(deps.fetch, schema.parse(args.endpoint), args, deps.log)
|
|
12665
12670
|
};
|
|
12666
12671
|
}
|
|
12667
12672
|
|
|
12668
12673
|
// src/index.ts
|
|
12669
|
-
var DeploymentConfig = z4.object({
|
|
12670
|
-
/** 允许端点用本机 http(127.0.0.1 / localhost / [::1]),仅供开发与测试;默认关闭,生产只接受 https。 */
|
|
12671
|
-
allowInsecureLoopback: ui(z4.boolean().default(false), {
|
|
12672
|
-
label: { zh: "允许本机 http 端点", en: "Allow loopback http endpoints" }
|
|
12673
|
-
})
|
|
12674
|
-
});
|
|
12675
12674
|
var index_default = defineExtension({
|
|
12676
12675
|
name: "connector-mcp",
|
|
12677
|
-
version: "0.1.0-rc.
|
|
12678
|
-
sdk: "^0.1.0-rc.
|
|
12676
|
+
version: "0.1.0-rc.11",
|
|
12677
|
+
sdk: "^0.1.0-rc.29",
|
|
12679
12678
|
provides: [CONNECTOR_EXTENSION_POINT],
|
|
12680
|
-
config: { deployment: DeploymentConfig },
|
|
12681
12679
|
setup(ctx) {
|
|
12682
|
-
const { allowInsecureLoopback } = DeploymentConfig.parse(ctx.config ?? {});
|
|
12683
12680
|
ctx.provide(
|
|
12684
12681
|
CONNECTOR_EXTENSION_POINT,
|
|
12685
|
-
createMcpConnector({
|
|
12682
|
+
createMcpConnector({
|
|
12683
|
+
log: ctx.log,
|
|
12684
|
+
fetch: (url2, init, opts) => ctx.net.fetch(url2, init, opts)
|
|
12685
|
+
})
|
|
12686
12686
|
);
|
|
12687
12687
|
}
|
|
12688
12688
|
});
|
package/icon.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" shape-rendering="crispEdges"><title>MCP connector</title><style>@media (prefers-color-scheme: dark){path{fill:#FF6A13}}</style><path fill="#CC4609" d="M14 1.4h1.35v1.35h-1.35zM12.65 2.75h4.05v1.35h-4.05zM4.55 4.1h14.85v1.35h-14.85zM3.2 5.45h12.15v1.35h-12.15zM16.7 5.45h2.7v1.35h-2.7zM1.85 6.8h17.55v1.35h-17.55zM1.85 8.15h17.55v1.35h-17.55zM1.85 9.5h17.55v1.35h-17.55zM3.2 10.85h13.5v1.35h-13.5zM3.2 12.2h2.7v1.35h-2.7zM8.6 12.2h1.35v1.35h-1.35zM12.65 12.2h2.7v1.35h-2.7zM3.2 13.55h2.7v1.35h-2.7zM8.6 13.55h1.35v1.35h-1.35zM12.65 13.55h2.7v1.35h-2.7z"/><path fill="#CC4609" d="M15.95 15.1h2.3v1.15h-2.3zM19.4 15.1h2.3v1.15h-2.3zM15.95 16.25h2.3v1.15h-2.3zM19.4 16.25h2.3v1.15h-2.3zM14.8 17.4h8.05v1.15h-8.05zM14.8 18.55h8.05v1.15h-8.05zM15.95 19.7h5.75v1.15h-5.75zM17.1 20.85h3.45v1.15h-3.45zM18.25 22h1.15v1.15h-1.15z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/plugin-connector-mcp",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "MCP connector (connector@1): tools and resources of remote MCP servers over Streamable HTTP",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
".": "./dist/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@capybara-hq/plugin-sdk": "^0.1.0-rc.
|
|
18
|
+
"@capybara-hq/plugin-sdk": "^0.1.0-rc.29",
|
|
19
19
|
"zod": "^4.6.7"
|
|
20
20
|
}
|
|
21
21
|
}
|