mcp-use 2.0.0-beta.11 → 2.0.0-beta.13
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/dist/.tsbuildinfo +1 -1
- package/dist/bin/main.d.ts.map +1 -1
- package/dist/bin.js +5 -2
- package/dist/bin.js.map +1 -1
- package/dist/branding.d.ts +7 -10
- package/dist/branding.d.ts.map +1 -1
- package/dist/{chunk-GTOOHAI2.js → chunk-JEVBOMCE.js} +4 -3
- package/dist/chunk-JEVBOMCE.js.map +1 -0
- package/dist/{chunk-5M5NVF36.js → chunk-RHITI5QM.js} +67 -8
- package/dist/chunk-RHITI5QM.js.map +1 -0
- package/dist/{chunk-DQ7LE4ZA.js → chunk-XKJP5S7C.js} +17 -14
- package/dist/chunk-XKJP5S7C.js.map +1 -0
- package/dist/cli/build.d.ts +1 -1
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/mcp-env-declaration.d.ts +20 -0
- package/dist/cli/mcp-env-declaration.d.ts.map +1 -0
- package/dist/cli/tunnel.d.ts.map +1 -1
- package/dist/cli/views.d.ts +7 -5
- package/dist/cli/views.d.ts.map +1 -1
- package/dist/commands/build.js +6 -6
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/client.d.ts.map +1 -1
- package/dist/commands/client.js +1 -1
- package/dist/commands/dev.js +79 -12
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/load-client.d.ts +2 -0
- package/dist/commands/load-client.d.ts.map +1 -1
- package/dist/commands/screenshot.js +1 -1
- package/dist/config.d.ts +8 -8
- package/dist/index.js +32 -51
- package/dist/index.js.map +1 -1
- package/dist/inspector-shell.d.ts +3 -0
- package/dist/inspector-shell.d.ts.map +1 -1
- package/dist/{landing-handler-3VN4BMR2.js → landing-handler-Z7WDR4S2.js} +6 -3
- package/dist/landing-handler-Z7WDR4S2.js.map +1 -0
- package/dist/landing-handler.d.ts +1 -1
- package/dist/landing-handler.d.ts.map +1 -1
- package/dist/landing.d.ts +2 -0
- package/dist/landing.d.ts.map +1 -1
- package/dist/landing.js +1 -1
- package/dist/react/types/register.d.ts +1 -1
- package/dist/react/types/register.d.ts.map +1 -1
- package/dist/server.d.ts +2 -3
- package/dist/server.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/chunk-5M5NVF36.js.map +0 -1
- package/dist/chunk-DQ7LE4ZA.js.map +0 -1
- package/dist/chunk-GTOOHAI2.js.map +0 -1
- package/dist/cli/tools-declaration.d.ts +0 -22
- package/dist/cli/tools-declaration.d.ts.map +0 -1
- package/dist/landing-handler-3VN4BMR2.js.map +0 -1
|
@@ -48,6 +48,8 @@ export interface InspectorShellOptions {
|
|
|
48
48
|
basePath: string;
|
|
49
49
|
/** Browser favicon URL, normally the server's root-level `/favicon.ico`. */
|
|
50
50
|
faviconHref?: string | undefined;
|
|
51
|
+
/** MIME type for the favicon link tag when known. */
|
|
52
|
+
faviconType?: string | undefined;
|
|
51
53
|
/**
|
|
52
54
|
* Full replacement URL for the inspector bundle script. Defaults to
|
|
53
55
|
* {@link DEFAULT_INSPECTOR_ASSETS_URL}.
|
|
@@ -80,6 +82,7 @@ export declare function createInspectorHandler(inspector: InspectorOptions | und
|
|
|
80
82
|
serverName: string;
|
|
81
83
|
basePath: string;
|
|
82
84
|
faviconHref?: string;
|
|
85
|
+
faviconType?: string;
|
|
83
86
|
}): FetchHandler | undefined;
|
|
84
87
|
/**
|
|
85
88
|
* @deprecated Use {@link createInspectorHandler}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector-shell.d.ts","sourceRoot":"","sources":["../src/inspector-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC;;;;;GAKG;AACH,eAA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Z2VFO.js";
|
|
@@ -13,7 +13,10 @@ function createLandingPageResponse(request, basePath, config, branding, tools, p
|
|
|
13
13
|
...config,
|
|
14
14
|
url,
|
|
15
15
|
...branding.favicon !== void 0 && {
|
|
16
|
-
iconUrl: new URL("/favicon.ico", `${origin}/`).href
|
|
16
|
+
iconUrl: new URL("/favicon.ico", `${origin}/`).href,
|
|
17
|
+
...branding.faviconMimeType !== void 0 && {
|
|
18
|
+
iconType: branding.faviconMimeType
|
|
19
|
+
}
|
|
17
20
|
},
|
|
18
21
|
tools: Array.from(tools, (entry) => entry.definition),
|
|
19
22
|
prompts: Array.from(prompts, (entry) => entry.definition),
|
|
@@ -31,4 +34,4 @@ function createLandingPageResponse(request, basePath, config, branding, tools, p
|
|
|
31
34
|
export {
|
|
32
35
|
createLandingPageResponse
|
|
33
36
|
};
|
|
34
|
-
//# sourceMappingURL=landing-handler-
|
|
37
|
+
//# sourceMappingURL=landing-handler-Z7WDR4S2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/landing-handler.ts"],"sourcesContent":["import {\n generateLandingPage,\n type LandingPageOptions,\n type LandingPagePrompt,\n type LandingPageResource,\n type LandingPageTool,\n} from \"./landing.js\";\nimport type { ServerBranding } from \"./branding.js\";\nimport { resolveServerOrigin } from \"./views/origin.js\";\n\n/**\n * Render a landing-page response without loading the renderer on MCP requests.\n *\n * @param request - Classified HTML GET or HEAD request.\n * @param basePath - Exact MCP endpoint path.\n * @param config - Server identity and description.\n * @param branding - Normalized browser and MCP identity branding.\n * @param tools - Frozen tool registry values.\n * @param prompts - Frozen prompt registry values.\n * @param resources - Frozen static-resource registry values.\n * @returns HTML response, with an empty body for HEAD.\n *\n * @internal\n */\nexport function createLandingPageResponse(\n request: Request,\n basePath: string,\n config: Pick<\n LandingPageOptions,\n \"name\" | \"title\" | \"version\" | \"description\"\n >,\n branding: Pick<ServerBranding, \"favicon\" | \"faviconMimeType\">,\n tools: Iterable<{ definition: LandingPageTool }>,\n prompts: Iterable<{ definition: LandingPagePrompt }>,\n resources: Iterable<{ definition: LandingPageResource }>\n): Response {\n const origin = resolveServerOrigin(request);\n const url = new URL(basePath, `${origin}/`).href;\n const html = generateLandingPage({\n ...config,\n url,\n ...(branding.favicon !== undefined && {\n iconUrl: new URL(\"/favicon.ico\", `${origin}/`).href,\n ...(branding.faviconMimeType !== undefined && {\n iconType: branding.faviconMimeType,\n }),\n }),\n tools: Array.from(tools, (entry) => entry.definition),\n prompts: Array.from(prompts, (entry) => entry.definition),\n resources: Array.from(resources, (entry) => entry.definition),\n });\n return new Response(request.method === \"HEAD\" ? null : html, {\n status: 200,\n headers: {\n \"cache-control\": \"no-store\",\n \"content-type\": \"text/html; charset=utf-8\",\n \"x-content-type-options\": \"nosniff\",\n },\n });\n}\n"],"mappings":";;;;;;;;AAwBO,SAAS,0BACd,SACA,UACA,QAIA,UACA,OACA,SACA,WACU;AACV,QAAM,SAAS,oBAAoB,OAAO;AAC1C,QAAM,MAAM,IAAI,IAAI,UAAU,GAAG,MAAM,GAAG,EAAE;AAC5C,QAAM,OAAO,oBAAoB;AAAA,IAC/B,GAAG;AAAA,IACH;AAAA,IACA,GAAI,SAAS,YAAY,UAAa;AAAA,MACpC,SAAS,IAAI,IAAI,gBAAgB,GAAG,MAAM,GAAG,EAAE;AAAA,MAC/C,GAAI,SAAS,oBAAoB,UAAa;AAAA,QAC5C,UAAU,SAAS;AAAA,MACrB;AAAA,IACF;AAAA,IACA,OAAO,MAAM,KAAK,OAAO,CAAC,UAAU,MAAM,UAAU;AAAA,IACpD,SAAS,MAAM,KAAK,SAAS,CAAC,UAAU,MAAM,UAAU;AAAA,IACxD,WAAW,MAAM,KAAK,WAAW,CAAC,UAAU,MAAM,UAAU;AAAA,EAC9D,CAAC;AACD,SAAO,IAAI,SAAS,QAAQ,WAAW,SAAS,OAAO,MAAM;AAAA,IAC3D,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,0BAA0B;AAAA,IAC5B;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -14,7 +14,7 @@ import type { ServerBranding } from "./branding.js";
|
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
export declare function createLandingPageResponse(request: Request, basePath: string, config: Pick<LandingPageOptions, "name" | "title" | "version" | "description">, branding: Pick<ServerBranding, "favicon">, tools: Iterable<{
|
|
17
|
+
export declare function createLandingPageResponse(request: Request, basePath: string, config: Pick<LandingPageOptions, "name" | "title" | "version" | "description">, branding: Pick<ServerBranding, "favicon" | "faviconMimeType">, tools: Iterable<{
|
|
18
18
|
definition: LandingPageTool;
|
|
19
19
|
}>, prompts: Iterable<{
|
|
20
20
|
definition: LandingPagePrompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"landing-handler.d.ts","sourceRoot":"","sources":["../src/landing-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,IAAI,CACV,kBAAkB,EAClB,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAC7C,EACD,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"landing-handler.d.ts","sourceRoot":"","sources":["../src/landing-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,IAAI,CACV,kBAAkB,EAClB,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAC7C,EACD,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,iBAAiB,CAAC,EAC7D,KAAK,EAAE,QAAQ,CAAC;IAAE,UAAU,EAAE,eAAe,CAAA;CAAE,CAAC,EAChD,OAAO,EAAE,QAAQ,CAAC;IAAE,UAAU,EAAE,iBAAiB,CAAA;CAAE,CAAC,EACpD,SAAS,EAAE,QAAQ,CAAC;IAAE,UAAU,EAAE,mBAAmB,CAAA;CAAE,CAAC,GACvD,QAAQ,CAwBV"}
|
package/dist/landing.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export interface LandingPageOptions {
|
|
|
53
53
|
resources?: readonly LandingPageResource[];
|
|
54
54
|
/** Optional absolute URL for the icon displayed above the server heading. */
|
|
55
55
|
iconUrl?: string;
|
|
56
|
+
/** MIME type for the favicon link tag when known. */
|
|
57
|
+
iconType?: string;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
60
|
* Generates an HTML landing page with connection instructions
|
package/dist/landing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"landing.d.ts","sourceRoot":"","sources":["../src/landing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoQH,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IAEb,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,EAAE,M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mC;IACnC,IAAI,EAAE,MAAM,CAAC;IAEb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qEAAqE;AACrE,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IAEZ,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IACjC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IAEb,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAEhB,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IAEZ,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,mDAAmD;IACnD,KAAK,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAEnC,qDAAqD;IACrD,OAAO,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAEvC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAE3C,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAyjBvE"}
|
package/dist/landing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/react/types/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/react/types/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,mEAAmE;AAEnE,MAAM,WAAW,QAAQ;CAAG;AAE5B,KAAK,qBAAqB,GAAG,QAAQ,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC,CAAA;CAAE,GAC5D,CAAC,GACD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEzB,KAAK,eAAe,CAAC,CAAC,IAAI;KAEvB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GACpD,CAAC,GACD,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAE9B,GAAG,EACH,MAAM,CAAC,EACP,MAAM,CAAC,CACR,GACG;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,CAAA;KAAE,GACvB,KAAK;CACV,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC9C,WAAW,CAAC,CAAC,CAAC,EAAE,GAChB,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtC,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -304,9 +304,8 @@ export declare class MCPServer<TUser = never> {
|
|
|
304
304
|
* Serve over HTTP on Node. Pass port `0` for an ephemeral port.
|
|
305
305
|
*
|
|
306
306
|
* Binds `config.host` (default `127.0.0.1`). Localhost-class binds get
|
|
307
|
-
* DNS-rebinding protection automatically
|
|
308
|
-
* `
|
|
309
|
-
* `Origin: null` on asset GETs). To serve publicly set `host: "0.0.0.0"`;
|
|
307
|
+
* DNS-rebinding Host protection automatically. Origin validation is off
|
|
308
|
+
* unless `allowedOrigins` is set. To serve publicly set `host: "0.0.0.0"`;
|
|
310
309
|
* behind a platform edge that is all that's needed, and `allowedHosts`
|
|
311
310
|
* restricts direct exposure (additive — localhost-class values stay allowed).
|
|
312
311
|
*
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EAGpB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAMpE,OAAO,EAWL,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAIL,KAAK,0BAA0B,EAE/B,KAAK,kBAAkB,EAGvB,KAAK,kBAAkB,EAExB,MAAM,gCAAgC,CAAC;AAQxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAY7D,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAE3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,eAAe,EAEf,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd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AO,GAAG,gBAAgB,CAInE;IAED;;;;;;;;;;;;OAYG;IACG,cAAc,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAIlD;IAED;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,EAClB,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EACvB,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC7B,IAAI,CAON;IAED;;;;;;;;;;;;;;OAcG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,EACjB,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EACvB,OAAO,EAAE,CAAC,SAAS,GAAG,MAAM,WAAW,GACnC,0BAA0B,GAC1B,kBAAkB,GACrB,IAAI,CASN;IAED;;;;;;;OAOG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAExC;IAED;;;;;;;OAOG;IACG,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1C;IAED;;;;;;;OAOG;IACG,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE5C;IAED;;;;;;;;;OASG;IACG,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtD;IAED;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CAAC,IAAI,SAAO,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAkEhE;IAED;;;;;;OAMG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAgC3B;CAu3BF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-use",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.13",
|
|
5
5
|
"description": "MCP framework and CLI built on the official v2 SDK",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"dist"
|
|
76
76
|
],
|
|
77
77
|
"engines": {
|
|
78
|
-
"node": ">=
|
|
78
|
+
"node": ">=22.22.2"
|
|
79
79
|
},
|
|
80
80
|
"bundledDependencies": [
|
|
81
81
|
"@modelcontextprotocol/client"
|
|
@@ -109,17 +109,17 @@
|
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@modelcontextprotocol/core": "https://pkg.pr.new/@modelcontextprotocol/core@f60b40179b0f090f6d64248be1312245a160b5ee",
|
|
111
111
|
"@testing-library/react": "^16.3.2",
|
|
112
|
-
"@types/node": "^
|
|
112
|
+
"@types/node": "^22.20.0",
|
|
113
113
|
"@types/react": "^19.2.17",
|
|
114
114
|
"@types/react-dom": "^19.2.3",
|
|
115
115
|
"happy-dom": "^20.10.6",
|
|
116
|
-
"react": "^19.2.
|
|
117
|
-
"react-dom": "^19.2.
|
|
118
|
-
"typescript": "7.0.
|
|
116
|
+
"react": "^19.2.7",
|
|
117
|
+
"react-dom": "^19.2.7",
|
|
118
|
+
"typescript": "^7.0.2",
|
|
119
119
|
"vitest": "^4.1.9",
|
|
120
120
|
"zod": "^4.4.3",
|
|
121
|
-
"@mcp-use/client": "2.0.0-beta.
|
|
122
|
-
"mcp-use": "2.0.0-beta.
|
|
121
|
+
"@mcp-use/client": "2.0.0-beta.3",
|
|
122
|
+
"mcp-use": "2.0.0-beta.13"
|
|
123
123
|
},
|
|
124
124
|
"publishConfig": {
|
|
125
125
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/client.ts","../src/commands/load-client.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { rm } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { parseArgs } from \"node:util\";\n\nimport type { MCPConnection } from \"@mcp-use/client\";\n\nimport { loadClientPackage } from \"./load-client.js\";\nimport {\n confirm,\n GLOBAL_STATE_DIR,\n openBrowser,\n pathExists,\n printResult,\n readJson,\n reportError,\n UsageError,\n wantsJson,\n writePrivateJson,\n} from \"./shared.js\";\n\ninterface SavedServer {\n url: string;\n oauth: boolean;\n protocol: \"auto\" | \"2026-07-28\" | \"2025-11-25\";\n}\n\ninterface SavedServers {\n servers: Record<string, SavedServer>;\n}\n\ninterface SavedCredentials {\n headers?: Record<string, string>;\n}\n\nconst CLIENT_DIR = join(GLOBAL_STATE_DIR, \"client\");\nconst SERVERS_PATH = join(CLIENT_DIR, \"servers.json\");\n\n/** Run the `mcp-use client` command family. */\nexport async function runClient(argv: readonly string[]): Promise<number> {\n const json = wantsJson(argv);\n try {\n const first = argv[0];\n if (first === \"connect\") return await connect(argv.slice(1), json);\n if (first === \"list\") return await list(argv.slice(1), json);\n if (first === \"remove\") return await remove(argv.slice(1), json);\n if (first === undefined) {\n throw new UsageError(\"Usage: mcp-use client <connect|list|remove|name>\");\n }\n return await savedServerCommand(first, argv.slice(1), json);\n } catch (error) {\n return reportError(\n error instanceof TypeError ? new UsageError(error.message) : error,\n json\n );\n }\n}\n\nasync function connect(\n argv: readonly string[],\n json: boolean\n): Promise<number> {\n const { values, positionals } = parseArgs({\n args: [...argv],\n allowPositionals: true,\n strict: true,\n options: {\n header: { type: \"string\", short: \"H\", multiple: true },\n \"no-oauth\": { type: \"boolean\" },\n \"auth-timeout\": { type: \"string\" },\n protocol: { type: \"string\", default: \"auto\" },\n json: { type: \"boolean\" },\n },\n });\n if (positionals.length !== 2) {\n throw new UsageError(\"Usage: mcp-use client connect <name> <url>\");\n }\n const [name, rawUrl] = positionals as [string, string];\n validateName(name);\n const url = new URL(rawUrl);\n if (![\"http:\", \"https:\"].includes(url.protocol)) {\n throw new UsageError(\"Client URLs must use http or https.\");\n }\n const protocol = parseProtocol(values.protocol);\n const timeout = parsePositiveInteger(\n values[\"auth-timeout\"] ?? \"300000\",\n \"--auth-timeout\"\n );\n const saved = await readServers();\n if (saved.servers[name] !== undefined) {\n throw new UsageError(`Saved server already exists: ${name}`);\n }\n const credentials = { headers: parseHeaders(values.header ?? []) };\n const definition: SavedServer = {\n url: url.href,\n oauth: values[\"no-oauth\"] !== true,\n protocol,\n };\n const connection = await openConnection(\n name,\n definition,\n credentials,\n timeout\n );\n await connection.disconnect();\n saved.servers[name] = definition;\n await writePrivateJson(SERVERS_PATH, saved);\n await writePrivateJson(credentialsPath(name), credentials);\n printResult(\n { name, url: definition.url, protocol },\n json,\n `Connected and saved ${name}.`\n );\n return 0;\n}\n\nasync function list(argv: readonly string[], json: boolean): Promise<number> {\n parseJsonOnly(argv);\n const saved = await readServers();\n const result = Object.entries(saved.servers).map(([name, server]) => ({\n name,\n ...server,\n }));\n printResult(\n result,\n json,\n result.map((server) => `${server.name}\\t${server.url}`).join(\"\\n\") ||\n \"No saved servers.\"\n );\n return 0;\n}\n\nasync function remove(argv: readonly string[], json: boolean): Promise<number> {\n const { values, positionals } = parseArgs({\n args: [...argv],\n allowPositionals: true,\n strict: true,\n options: { yes: { type: \"boolean\" }, json: { type: \"boolean\" } },\n });\n const name = one(positionals, \"mcp-use client remove <name>\");\n if (\n !(await confirm(`Remove saved server ${name}?`, {\n yes: values.yes === true,\n json,\n }))\n ) {\n return 0;\n }\n const saved = await readServers();\n delete saved.servers[name];\n await writePrivateJson(SERVERS_PATH, saved);\n await rm(credentialsDirectory(name), { recursive: true, force: true });\n printResult({ removed: name }, json, `Removed ${name}.`);\n return 0;\n}\n\nasync function savedServerCommand(\n name: string,\n argv: readonly string[],\n json: boolean\n): Promise<number> {\n const saved = await readServers();\n const definition = saved.servers[name];\n if (definition === undefined) {\n throw new UsageError(\n `Unknown saved server: ${name}. Run \\`mcp-use client connect ${name} <url>\\`.`\n );\n }\n const family = argv[0];\n const operation = argv[1];\n if (family === \"auth\") {\n if (operation === \"status\") {\n parseJsonOnly(argv.slice(2));\n const authenticated = await pathExists(oauthDirectory(name));\n printResult(\n { name, oauth: definition.oauth, authenticated },\n json,\n authenticated ? \"Authenticated.\" : \"No saved OAuth session.\"\n );\n return 0;\n }\n if (operation === \"logout\") {\n const { values, positionals } = parseArgs({\n args: [...argv.slice(2)],\n allowPositionals: true,\n strict: true,\n options: { yes: { type: \"boolean\" }, json: { type: \"boolean\" } },\n });\n if (positionals.length !== 0) {\n throw new UsageError(`Usage: mcp-use client ${name} auth logout`);\n }\n if (\n !(await confirm(`Delete OAuth credentials for ${name}?`, {\n yes: values.yes === true,\n json,\n }))\n ) {\n return 0;\n }\n await rm(oauthDirectory(name), { recursive: true, force: true });\n printResult({ loggedOut: name }, json, `Logged out ${name}.`);\n return 0;\n }\n }\n\n const credentials = await readJson<SavedCredentials>(\n credentialsPath(name),\n {}\n );\n const connection = await openConnection(\n name,\n definition,\n credentials,\n 300_000\n );\n try {\n if (family === \"tools\") {\n if (operation === \"list\") {\n parseJsonOnly(argv.slice(2));\n const tools = await connection.listTools();\n printResult(\n tools,\n json,\n tools\n .map((tool) => `${tool.name}\\t${tool.description ?? \"\"}`)\n .join(\"\\n\")\n );\n return 0;\n }\n if (operation === \"describe\") {\n const toolName = one(\n argv.slice(2),\n `mcp-use client ${name} tools describe <tool>`\n );\n const tool = (await connection.listTools()).find(\n (candidate) => candidate.name === toolName\n );\n if (tool === undefined)\n throw new UsageError(`Tool not found: ${toolName}`);\n printResult(tool, json);\n return 0;\n }\n if (operation === \"call\") {\n return await callTool(connection, name, argv.slice(2), json);\n }\n }\n if (family === \"resources\") {\n if (operation === \"list\") {\n parseJsonOnly(argv.slice(2));\n const resources = await connection.listResources();\n printResult(resources, json);\n return 0;\n }\n if (operation === \"read\") {\n const uri = one(\n argv.slice(2),\n `mcp-use client ${name} resources read <uri>`\n );\n printResult(await connection.readResource(uri), json);\n return 0;\n }\n }\n if (family === \"prompts\") {\n if (operation === \"list\") {\n parseJsonOnly(argv.slice(2));\n printResult(await connection.listPrompts(), json);\n return 0;\n }\n if (operation === \"get\") {\n const prompt = argv[2];\n if (prompt === undefined) {\n throw new UsageError(\n `Usage: mcp-use client ${name} prompts get <prompt> [args]`\n );\n }\n printResult(\n await connection.getPrompt(prompt, parseMcpArguments(argv.slice(3))),\n json\n );\n return 0;\n }\n }\n throw new UsageError(\n `Usage: mcp-use client ${name} <tools|resources|prompts|auth> ...`\n );\n } finally {\n await connection.disconnect();\n }\n}\n\nasync function callTool(\n connection: MCPConnection,\n serverName: string,\n argv: readonly string[],\n json: boolean\n): Promise<number> {\n const tool = argv[0];\n if (tool === undefined) {\n throw new UsageError(\n `Usage: mcp-use client ${serverName} tools call <tool> [args]`\n );\n }\n const { values, positionals } = parseArgs({\n args: [...argv.slice(1)],\n allowPositionals: true,\n strict: true,\n options: {\n timeout: { type: \"string\", default: \"30000\" },\n json: { type: \"boolean\" },\n },\n });\n const timeout = parsePositiveInteger(values.timeout, \"--timeout\");\n const result = await connection.callTool(\n tool,\n parseMcpArguments(positionals),\n { timeout }\n );\n if (result.isError === true) {\n throw new Error(\n `Tool ${tool} returned an error: ${JSON.stringify(result)}`\n );\n }\n printResult(result, json);\n return 0;\n}\n\nasync function openConnection(\n name: string,\n definition: SavedServer,\n credentials: SavedCredentials,\n authTimeoutMs: number\n): Promise<MCPConnection> {\n const { createOAuthProvider, MCPClient } = await loadClientPackage();\n const oauthBase = oauthDirectory(name);\n const authProvider = definition.oauth\n ? await createOAuthProvider(definition.url, {\n baseDir: oauthBase,\n authTimeoutMs,\n storageKeyPrefix: `mcp-use-cli:${name}`,\n openBrowser: (url: string) => {\n process.stderr.write(`Open this URL to authenticate:\\n${url}\\n`);\n openBrowser(url);\n },\n // Conditional exports select NodeOAuthOptions at runtime. TypeScript\n // resolves the package's browser-default declaration in this build.\n } as unknown as Parameters<typeof createOAuthProvider>[1])\n : undefined;\n const protocolNegotiation =\n definition.protocol === \"auto\" ? \"auto\" : { pin: definition.protocol };\n const client = new MCPClient({\n mcpServers: {\n [name]: {\n url: definition.url,\n ...(credentials.headers !== undefined\n ? { headers: credentials.headers }\n : {}),\n ...(authProvider !== undefined ? { authProvider } : { oauth: false }),\n protocolNegotiation,\n },\n },\n });\n return client.connect(name);\n}\n\n/**\n * Open a saved server for another CLI command.\n *\n * @internal\n */\nexport async function openSavedConnection(\n name: string,\n authTimeoutMs = 300_000\n): Promise<MCPConnection> {\n const saved = await readServers();\n const definition = saved.servers[name];\n if (definition === undefined) {\n throw new UsageError(`Unknown saved server: ${name}`);\n }\n const credentials = await readJson<SavedCredentials>(\n credentialsPath(name),\n {}\n );\n return openConnection(name, definition, credentials, authTimeoutMs);\n}\n\n/**\n * Open an ad-hoc HTTP MCP connection.\n *\n * @internal\n */\nexport async function openDirectConnection(\n url: string,\n headers: Record<string, string>\n): Promise<MCPConnection> {\n return openConnection(\n \"screenshot\",\n { url, oauth: false, protocol: \"auto\" },\n { headers },\n 300_000\n );\n}\n\n/**\n * Parse the CLI's JSON/key-value MCP argument grammar.\n *\n * @internal\n */\nexport function parseMcpArguments(\n argv: readonly string[]\n): Record<string, unknown> {\n if (argv.length === 0) return {};\n if (argv.length === 1 && argv[0]?.trimStart().startsWith(\"{\")) {\n const value = JSON.parse(argv[0]) as unknown;\n if (value === null || Array.isArray(value) || typeof value !== \"object\") {\n throw new UsageError(\"The JSON argument must be an object.\");\n }\n return value as Record<string, unknown>;\n }\n const result: Record<string, unknown> = {};\n for (const token of argv) {\n const typed = token.indexOf(\":=\");\n const plain = token.indexOf(\"=\");\n const separator = typed >= 0 ? typed : plain;\n const width = typed >= 0 ? 2 : 1;\n if (separator <= 0) {\n throw new UsageError(\n `Expected key=value or key:=<json>, received: ${token}`\n );\n }\n const key = token.slice(0, separator).replace(/^--/, \"\");\n const raw = token.slice(separator + width);\n result[key] = typed >= 0 ? (JSON.parse(raw) as unknown) : raw;\n }\n return result;\n}\n\nfunction parseHeaders(values: readonly string[]): Record<string, string> {\n const headers: Record<string, string> = {};\n for (const value of values) {\n const separator = value.indexOf(\":\");\n if (separator <= 0) throw new UsageError(`Invalid header: ${value}`);\n headers[value.slice(0, separator).trim()] = value\n .slice(separator + 1)\n .trim();\n }\n return headers;\n}\n\nfunction parseProtocol(value: string | undefined): SavedServer[\"protocol\"] {\n if (value !== \"auto\" && value !== \"2026-07-28\" && value !== \"2025-11-25\") {\n throw new UsageError(`Invalid protocol: ${value}`);\n }\n return value;\n}\n\nfunction parsePositiveInteger(value: string | undefined, name: string): number {\n const result = Number(value);\n if (!Number.isInteger(result) || result <= 0) {\n throw new UsageError(`${name} must be a positive integer.`);\n }\n return result;\n}\n\nfunction validateName(name: string): void {\n if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(name)) {\n throw new UsageError(\n \"Server names must be 1-64 filesystem-safe letters, numbers, dots, dashes, or underscores.\"\n );\n }\n}\n\nasync function readServers(): Promise<SavedServers> {\n return readJson(SERVERS_PATH, { servers: {} });\n}\n\nfunction credentialsDirectory(name: string): string {\n return join(\n CLIENT_DIR,\n \"credentials\",\n createHash(\"sha256\").update(name).digest(\"hex\")\n );\n}\n\nfunction credentialsPath(name: string): string {\n return join(credentialsDirectory(name), \"credentials.json\");\n}\n\nfunction oauthDirectory(name: string): string {\n return join(credentialsDirectory(name), \"oauth\");\n}\n\nfunction parseJsonOnly(argv: readonly string[]): void {\n parseArgs({\n args: [...argv],\n allowPositionals: false,\n strict: true,\n options: { json: { type: \"boolean\" } },\n });\n}\n\nfunction one(positionals: readonly string[], usage: string): string {\n if (positionals.length !== 1) throw new UsageError(`Usage: ${usage}`);\n return positionals[0]!;\n}\n","import { spawn } from \"node:child_process\";\nimport { readFileSync } from \"node:fs\";\nimport { chmod, mkdir } from \"node:fs/promises\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nimport {\n CommandError,\n GLOBAL_STATE_DIR,\n pathExists,\n UsageError,\n writePrivateJson,\n} from \"./shared.js\";\n\n/** Runtime surface loaded from the independently published client SDK. */\nexport type ClientPackage = typeof import(\"@mcp-use/client\");\n\nconst CLIENT_SDK_DIR = join(GLOBAL_STATE_DIR, \"client-sdk\");\nconst CLIENT_PACKAGE = \"@mcp-use/client\";\nconst DEFAULT_PEER_RANGE = \"^2.0.0-alpha.0\";\n\nconst INSTALL_HINT = [\n `[mcp-use] ${CLIENT_PACKAGE} is not installed.`,\n \"The `mcp-use client` and `mcp-use screenshot` commands require it.\",\n \"Install it in your project:\",\n \"\",\n \" npm install @mcp-use/client\",\n \"\",\n \" pnpm add @mcp-use/client\",\n \"\",\n \" bun add @mcp-use/client\",\n].join(\"\\n\");\n\n/**\n * Walk upward from `startDir` for the nearest directory containing\n * `package.json`.\n */\nexport async function findProjectRoot(\n startDir: string\n): Promise<string | undefined> {\n let current = resolve(startDir);\n for (;;) {\n if (await pathExists(join(current, \"package.json\"))) return current;\n const parent = dirname(current);\n if (parent === current) return undefined;\n current = parent;\n }\n}\n\n/**\n * Load `@mcp-use/client` on demand so the framework library entry does not\n * pull the client SDK (or legacy v1 transitive deps) into every install.\n *\n * @throws {@link UsageError} When the package is not installed and auto-install\n * fails or the retry import still cannot resolve it.\n */\nexport async function loadClientPackage(): Promise<ClientPackage> {\n try {\n return await importClientModule();\n } catch (error) {\n if (!isClientPackageMissing(error)) throw error;\n\n const location = await installClientPackage();\n try {\n return location === \"sandbox\"\n ? await importSandboxClientModule()\n : await importClientModule();\n } catch (retryError) {\n if (isClientPackageMissing(retryError)) {\n throw new UsageError(INSTALL_HINT);\n }\n throw retryError;\n }\n }\n}\n\nasync function installClientPackage(): Promise<\"project\" | \"sandbox\"> {\n const versionSpec = readClientPeerRange();\n const dependency = `${CLIENT_PACKAGE}@${versionSpec}`;\n const projectRoot = await findProjectRoot(process.cwd());\n\n process.stderr.write(`[mcp-use] installing ${CLIENT_PACKAGE}…\\n`);\n\n if (projectRoot !== undefined) {\n const [command, args] = packageManagerInstallArgs(dependency);\n const code = await spawnAndWait(command, args, projectRoot);\n if (code !== 0) {\n throw new CommandError(\n \"client_install_failed\",\n `Failed to install ${CLIENT_PACKAGE}.`\n );\n }\n return \"project\";\n }\n\n await mkdir(CLIENT_SDK_DIR, { recursive: true, mode: 0o700 });\n await chmod(CLIENT_SDK_DIR, 0o700);\n const manifestPath = join(CLIENT_SDK_DIR, \"package.json\");\n if (!(await pathExists(manifestPath))) {\n await writePrivateJson(manifestPath, {\n private: true,\n dependencies: {\n [CLIENT_PACKAGE]: versionSpec,\n },\n });\n }\n const code = await spawnAndWait(\n \"npm\",\n [\"install\", dependency],\n CLIENT_SDK_DIR\n );\n if (code !== 0) {\n throw new CommandError(\n \"client_install_failed\",\n `Failed to install ${CLIENT_PACKAGE}.`\n );\n }\n return \"sandbox\";\n}\n\nfunction packageManagerInstallArgs(dependency: string): [string, string[]] {\n const userAgent = process.env[\"npm_config_user_agent\"] ?? \"\";\n if (userAgent.startsWith(\"pnpm/\")) {\n return [\"pnpm\", [\"add\", dependency]];\n }\n if (userAgent.startsWith(\"bun/\")) {\n return [\"bun\", [\"add\", dependency]];\n }\n return [\"npm\", [\"install\", dependency]];\n}\n\nfunction readClientPeerRange(): string {\n for (const relative of [\"../package.json\", \"../../package.json\"]) {\n try {\n const raw = readFileSync(new URL(relative, import.meta.url), \"utf8\");\n const pkg = JSON.parse(raw) as {\n name?: unknown;\n peerDependencies?: Record<string, string>;\n };\n if (pkg.name !== \"mcp-use\") continue;\n const range = pkg.peerDependencies?.[CLIENT_PACKAGE];\n if (typeof range === \"string\" && range.length > 0) return range;\n } catch {\n // Try the next candidate layout.\n }\n }\n return DEFAULT_PEER_RANGE;\n}\n\nasync function importClientModule(): Promise<ClientPackage> {\n return import(\"@mcp-use/client\");\n}\n\nasync function importSandboxClientModule(): Promise<ClientPackage> {\n const entry = join(\n CLIENT_SDK_DIR,\n \"node_modules\",\n CLIENT_PACKAGE,\n \"dist\",\n \"index.js\"\n );\n const mod = (await import(pathToFileURL(entry).href)) as ClientPackage;\n return mod;\n}\n\nfunction isClientPackageMissing(error: unknown): boolean {\n if (!(error instanceof Error)) return false;\n const code = (error as NodeJS.ErrnoException).code;\n if (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") {\n return (\n error.message.includes(CLIENT_PACKAGE) ||\n error.message.includes(\"Cannot find package\")\n );\n }\n return false;\n}\n\nfunction spawnAndWait(\n command: string,\n args: string[],\n cwd: string\n): Promise<number> {\n return new Promise((resolveCode, reject) => {\n const child = spawn(command, args, {\n cwd,\n stdio: \"inherit\",\n shell: process.platform === \"win32\",\n });\n child.once(\"error\", reject);\n child.once(\"exit\", (code, signal) => {\n resolveCode(signal === \"SIGINT\" ? 130 : (code ?? 1));\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AACnB,SAAS,QAAAA,aAAY;AACrB,SAAS,iBAAiB;;;ACH1B,SAAS,aAAa;AACtB,SAAS,oBAAoB;AAC7B,SAAS,OAAO,aAAa;AAC7B,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,qBAAqB;AAa9B,IAAM,iBAAiB,KAAK,kBAAkB,YAAY;AAC1D,IAAM,iBAAiB;AACvB,IAAM,qBAAqB;AAE3B,IAAM,eAAe;AAAA,EACnB,aAAa,cAAc;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAMX,eAAsB,gBACpB,UAC6B;AAC7B,MAAI,UAAU,QAAQ,QAAQ;AAC9B,aAAS;AACP,QAAI,MAAM,WAAW,KAAK,SAAS,cAAc,CAAC,EAAG,QAAO;AAC5D,UAAM,SAAS,QAAQ,OAAO;AAC9B,QAAI,WAAW,QAAS,QAAO;AAC/B,cAAU;AAAA,EACZ;AACF;AASA,eAAsB,oBAA4C;AAChE,MAAI;AACF,WAAO,MAAM,mBAAmB;AAAA,EAClC,SAAS,OAAO;AACd,QAAI,CAAC,uBAAuB,KAAK,EAAG,OAAM;AAE1C,UAAM,WAAW,MAAM,qBAAqB;AAC5C,QAAI;AACF,aAAO,aAAa,YAChB,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MACR;AAAA,IACF;AAAA,EACF;AACF;AAEA,eAAe,cAAqC;AAClD,SAAO,SAAS,cAAc,EAAE,SAAS,CAAC,EAAE,CAAC;AAC/C;AAEA,SAAS,qBAAqB,MAAsB;AAClD,SAAOA;AAAA,IACL;AAAA,IACA;AAAA,IACA,WAAW,QAAQ,EAAE,OAAO,IAAI,EAAE,OAAO,KAAK;AAAA,EAChD;AACF;AAEA,SAAS,gBAAgB,MAAsB;AAC7C,SAAOA,MAAK,qBAAqB,IAAI,GAAG,kBAAkB;AAC5D;AAEA,SAAS,eAAe,MAAsB;AAC5C,SAAOA,MAAK,qBAAqB,IAAI,GAAG,OAAO;AACjD;AAEA,SAAS,cAAc,MAA+B;AACpD,YAAU;AAAA,IACR,MAAM,CAAC,GAAG,IAAI;AAAA,IACd,kBAAkB;AAAA,IAClB,QAAQ;AAAA,IACR,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,EAAE;AAAA,EACvC,CAAC;AACH;AAEA,SAAS,IAAI,aAAgC,OAAuB;AAClE,MAAI,YAAY,WAAW,EAAG,OAAM,IAAI,WAAW,UAAU,KAAK,EAAE;AACpE,SAAO,YAAY,CAAC;AACtB;","names":["join","code","join"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/entry.ts","../src/cli/vite-config.ts","../src/cli/tools-declaration.ts","../src/cli/workspace.ts","../src/cli/views.ts","../src/cli/views-plugin.ts"],"sourcesContent":["/**\n * Server-entry discovery for `mcp-use build` and `mcp-use dev`.\n *\n * The entry contract (CLI_SPEC.md): the user's entry module default-exports\n * the `MCPServer` instance and never calls `listen()` itself — the CLI owns\n * the socket.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\n\n/**\n * Conventional entry locations, checked in order relative to the project\n * root; the first existing file wins.\n *\n * @internal\n */\nexport const ENTRY_CANDIDATES = [\n \"src/index.ts\",\n \"src/server.ts\",\n \"index.ts\",\n \"server.ts\",\n] as const;\n\n/**\n * Locate the server entry for a project.\n *\n * With `override` set (the `--entry` flag), the path is resolved against\n * `cwd` and must exist. Otherwise the {@link ENTRY_CANDIDATES} are probed in\n * order and the first hit wins.\n *\n * @param cwd - Absolute path to the project root.\n * @param override - Explicit entry path (`--entry`), absolute or relative to `cwd`.\n * @returns Absolute path to the entry file.\n * @throws If the override does not exist, or no conventional candidate is\n * found — the error lists every location that was checked.\n *\n * @internal\n */\nexport function discoverEntry(cwd: string, override?: string): string {\n if (override !== undefined) {\n const entry = isAbsolute(override) ? override : resolve(cwd, override);\n if (!existsSync(entry)) {\n throw new Error(`Entry not found: ${entry} (from --entry \"${override}\")`);\n }\n return entry;\n }\n for (const candidate of ENTRY_CANDIDATES) {\n const entry = join(cwd, candidate);\n if (existsSync(entry)) {\n return entry;\n }\n }\n throw new Error(\n `No server entry found in ${cwd}. Looked for: ` +\n `${ENTRY_CANDIDATES.join(\", \")}. ` +\n `Create one of these (default-exporting your MCPServer instance) ` +\n `or pass --entry <path>.`\n );\n}\n","/**\n * Resolve the project-level Vite config used only by the views client build.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst VITE_CONFIG_CANDIDATES = [\n \"vite.config.ts\",\n \"vite.config.js\",\n \"vite.config.mts\",\n \"vite.config.cjs\",\n] as const;\n\n/**\n * Locate a project Vite config, or disable config loading when absent.\n *\n * @param cwd - Absolute project root.\n * @returns Absolute config path or `false`.\n *\n * @internal\n */\nexport function resolveUserViteConfig(cwd: string): string | false {\n for (const name of VITE_CONFIG_CANDIDATES) {\n const path = join(cwd, name);\n if (existsSync(path)) return path;\n }\n return false;\n}\n\n/**\n * Resolve the framework-owned Tailwind stylesheet for project CSS imports.\n *\n * @returns Absolute path exported by the installed `tailwindcss` dependency.\n *\n * @internal\n */\nexport function resolveTailwindCss(): string {\n return fileURLToPath(import.meta.resolve(\"tailwindcss/index.css\"));\n}\n","/**\n * Root-level tool registry declaration shared by `mcp-use dev` and\n * `mcp-use build`.\n *\n * The file contains no generated tool names. It creates a live type-only edge\n * to the user's server entry, so exported `ToolRef`s update in TypeScript\n * without rerunning the CLI.\n */\n\nimport { writeFile } from \"node:fs/promises\";\nimport { extname, join, relative, sep } from \"node:path\";\n\n/** Filename of the project-owned tool registry declaration. */\nexport const TOOLS_DECLARATION_NAME = \"tools.d.ts\";\n\nfunction declarationImportPath(cwd: string, entry: string): string {\n let importPath = relative(cwd, entry).split(sep).join(\"/\");\n const extension = extname(importPath);\n const runtimeExtension =\n extension === \".mts\"\n ? \".mjs\"\n : extension === \".cts\"\n ? \".cjs\"\n : extension === \".ts\" || extension === \".tsx\"\n ? \".js\"\n : extension;\n\n if (extension !== runtimeExtension) {\n importPath = `${importPath.slice(0, -extension.length)}${runtimeExtension}`;\n }\n return importPath.startsWith(\".\") ? importPath : `./${importPath}`;\n}\n\n/** Build the stable declaration contents for a discovered server entry. */\nexport function renderToolsDeclaration(cwd: string, entry: string): string {\n const importPath = declarationImportPath(cwd, entry);\n return [\n \"// Created by mcp-use when missing. Existing files are never overwritten.\",\n 'declare module \"mcp-use/react\" {',\n \" interface Register {\",\n ` tools: typeof import(${JSON.stringify(importPath)});`,\n \" }\",\n \"}\",\n \"\",\n \"export {};\",\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * Create the root `tools.d.ts` if absent.\n *\n * Exclusive-create mode makes this safe when dev and build start together and\n * guarantees that a user-authored declaration is never truncated or replaced.\n *\n * @returns `true` when this invocation created the file.\n */\nexport async function ensureToolsDeclaration(\n cwd: string,\n entry: string\n): Promise<boolean> {\n const declarationPath = join(cwd, TOOLS_DECLARATION_NAME);\n try {\n await writeFile(declarationPath, renderToolsDeclaration(cwd, entry), {\n encoding: \"utf8\",\n flag: \"wx\",\n });\n return true;\n } catch (error) {\n if (\n error !== null &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"EEXIST\"\n ) {\n return false;\n }\n throw error;\n }\n}\n","/**\n * The per-project `.mcp-use/` workspace convention — the Next.js `.next`\n * analog. Everything tooling writes for a project lives under this single,\n * gitignored directory so a checkout stays clean and `rm -rf .mcp-use` is\n * always safe.\n *\n * The layout is a fixed convention, not configuration: there is deliberately\n * no config file and no `outDir` knob (runtime/project configuration lives on\n * the `MCPServer` constructor).\n *\n * This module is PURE: it only derives path strings (no filesystem access).\n *\n * Layout (relative to the project root):\n *\n * ```text\n * .mcp-use/\n * ├─ build/ ← compiled server + manifest.json (this package)\n * ├─ generated/ ← output of the typegen escape-hatch command — reserved (VIEWS_SPEC.md)\n * ├─ cache/ ← disposable dev/build scratch\n * ├─ state/ ← mutable runtime state (e.g. tunnel.json)\n * └─ cloud/ ← cloud linkage (link.json)\n * ```\n *\n * `build/` must contain NO mutable runtime state (that is `state/`'s job) so\n * build output stays reproducible and disposable. This is the per-project\n * workspace, distinct from the global `~/.mcp-use/` store (CLI auth,\n * credentials, per-user caches).\n */\n\nimport { join } from \"node:path\";\n\n/**\n * Fixed name of the per-project workspace directory.\n *\n * @internal\n */\nexport const WORKSPACE_DIR_NAME = \".mcp-use\";\n\n/**\n * Basename of the build manifest written inside the build output directory.\n *\n * @internal\n */\nexport const BUILD_MANIFEST_NAME = \"manifest.json\";\n\n/**\n * Manifest written to `.mcp-use/build/manifest.json` by {@link runBuild} and\n * read back by `mcp-use start`.\n *\n * @internal\n */\nexport interface BuildManifest {\n /** Unique identifier for this build (random hex, regenerated per build). */\n buildId: string;\n /**\n * Filename of the emitted server entry, relative to the build directory\n * (e.g. `\"index.js\"`). `mcp-use start` imports `<build>/<entryPoint>` and\n * serves its default export.\n */\n entryPoint: string;\n /** ISO-8601 timestamp of when the build finished. */\n createdAt: string;\n /**\n * Whether the build was created with `mcp-use build --with-inspector`.\n * Consumed by `mcp-use start` to decide whether to mount the inspector shell.\n */\n inspector: boolean;\n}\n\n/**\n * Every resolved path for a project's `.mcp-use/` workspace.\n *\n * @internal\n */\nexport interface WorkspacePaths {\n /** The project root (the directory containing `.mcp-use/`). */\n projectRoot: string;\n /** The `.mcp-use/` workspace directory. */\n workspace: string;\n /** Build output directory: `.mcp-use/build`. */\n build: string;\n /**\n * Generated `.d.ts` artifacts directory — reserved for the typegen\n * escape-hatch command (VIEWS_SPEC.md § Typegen, demoted).\n */\n generated: string;\n /** Disposable dev/build scratch directory. */\n cache: string;\n /** Mutable runtime state directory. */\n state: string;\n /** Cloud linkage directory — reserved. */\n cloud: string;\n /** Build manifest: `<build>/manifest.json`. */\n buildManifest: string;\n /** Tunnel subdomain persistence: `<state>/tunnel.json`. */\n tunnel: string;\n}\n\n/**\n * Derive every workspace path for a project from its root. Pure — no\n * filesystem access.\n *\n * @param projectRoot - Absolute path to the project root.\n *\n * @example\n * ```ts\n * const paths = resolveWorkspacePaths(process.cwd());\n * console.log(paths.build); // <cwd>/.mcp-use/build\n * ```\n *\n * @internal\n */\nexport function resolveWorkspacePaths(projectRoot: string): WorkspacePaths {\n const workspace = join(projectRoot, WORKSPACE_DIR_NAME);\n const build = join(workspace, \"build\");\n return {\n projectRoot,\n workspace,\n build,\n generated: join(workspace, \"generated\"),\n cache: join(workspace, \"cache\"),\n state: join(workspace, \"state\"),\n cloud: join(workspace, \"cloud\"),\n buildManifest: join(build, BUILD_MANIFEST_NAME),\n tunnel: join(workspace, \"state\", \"tunnel.json\"),\n };\n}\n","/**\n * View discovery for `mcp-use build` / `mcp-use dev`.\n *\n * Views live under `resources/<name>/view.tsx` (VIEWS_SPEC.md § File-based views).\n */\n\nimport { existsSync, readdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { ViteDevServer } from \"vite\";\n\nimport type { ViewsManifest } from \"../views/types.js\";\n\n/** Prefix for per-view virtual entry modules (`virtual:mcp-use/views/<name>`). */\nexport const VIRTUAL_VIEW_PREFIX = \"virtual:mcp-use/views/\";\n\n/** Resolved virtual id prefix (Rollup null-prefixed module id). */\nexport const VIRTUAL_VIEW_RESOLVED_PREFIX = `\\0${VIRTUAL_VIEW_PREFIX}`;\n\n/**\n * One discovered view directory.\n *\n * @internal\n */\nexport interface DiscoveredView {\n /** View directory name (the `resources/<name>` segment). */\n name: string;\n /** Absolute path to `resources/<name>/view.tsx`. */\n entryPath: string;\n}\n\n/**\n * Scan `resources/<name>/view.tsx` under the project root.\n *\n * A missing or empty `resources/` directory yields an empty list — tool-only\n * projects keep byte-identical CLI behavior.\n *\n * @param cwd - Absolute project root.\n * @returns Discovered views sorted by name.\n *\n * @internal\n */\nexport function discoverViews(cwd: string): DiscoveredView[] {\n const resourcesDir = join(cwd, \"resources\");\n if (!existsSync(resourcesDir)) {\n return [];\n }\n\n const views: DiscoveredView[] = [];\n for (const entry of readdirSync(resourcesDir, { withFileTypes: true })) {\n if (!entry.isDirectory()) {\n continue;\n }\n const entryPath = join(resourcesDir, entry.name, \"view.tsx\");\n if (existsSync(entryPath)) {\n views.push({ name: entry.name, entryPath });\n }\n }\n views.sort((a, b) => a.name.localeCompare(b.name));\n return views;\n}\n\n/**\n * Virtual module id for a view entry (`virtual:mcp-use/views/<name>`).\n *\n * @param name - View directory name.\n *\n * @internal\n */\nexport function virtualViewId(name: string): string {\n return `${VIRTUAL_VIEW_PREFIX}${name}`;\n}\n\n/**\n * Dev URL path Vite serves a resolved virtual module at (browser-loadable).\n *\n * @param name - View directory name.\n *\n * @internal\n */\nexport function devVirtualEntryPath(name: string): string {\n return `/@id/__x00__${VIRTUAL_VIEW_PREFIX}${name}`;\n}\n\n/**\n * Whether a filesystem path is a view component file or lives under a view dir.\n *\n * @internal\n */\nexport function isViewPath(file: string, cwd: string): boolean {\n const rel = file.startsWith(cwd) ? file.slice(cwd.length + 1) : file;\n return (\n /^resources\\/[^/]+\\//.test(rel) || /^resources\\/[^/]+\\/view\\.tsx$/.test(rel)\n );\n}\n\n/**\n * Whether a path is a view's `view.tsx` entry.\n *\n * @internal\n */\nexport function isViewEntryPath(file: string, cwd: string): boolean {\n const rel = file.startsWith(cwd) ? file.slice(cwd.length + 1) : file;\n return /^resources\\/[^/]+\\/view\\.tsx$/.test(rel);\n}\n\n/**\n * Build a dev-shaped views manifest (Vite URLs, `/@vite/client` script hook).\n *\n * @internal\n */\nexport function buildDevViewsManifest(views: DiscoveredView[]): ViewsManifest {\n const manifest: ViewsManifest = {};\n for (const view of views) {\n manifest[view.name] = {\n kind: \"external\",\n entry: devVirtualEntryPath(view.name),\n css: [],\n scripts: [\"/@vite/client\"],\n };\n }\n return manifest;\n}\n\n/**\n * Create a temporary Vite dev server for build-time binding validation.\n *\n * @internal\n */\nexport async function createBindingValidationServer(\n cwd: string,\n cacheDir: string,\n configFile: string | false\n): Promise<ViteDevServer> {\n const { createServer } = await import(\"vite\");\n return createServer({\n root: cwd,\n configFile,\n envFile: false,\n logLevel: \"warn\",\n cacheDir,\n server: { middlewareMode: true, hmr: false },\n ssr: { external: true },\n });\n}\n","/**\n * Vite plugin: virtual view entry modules and optional SSR wrapper entry.\n */\n\nimport type { Plugin } from \"vite\";\n\nimport type { DiscoveredView } from \"./views.js\";\nimport {\n VIRTUAL_VIEW_PREFIX,\n VIRTUAL_VIEW_RESOLVED_PREFIX,\n virtualViewId,\n} from \"./views.js\";\n\nconst VIRTUAL_TAILWIND_ID = \"virtual:mcp-use/tailwind.css\";\nconst VIRTUAL_TAILWIND_RESOLVED_ID = `\\0${VIRTUAL_TAILWIND_ID}`;\n\n/**\n * Options for {@link mcpUseViewsPlugin}.\n *\n * @internal\n */\nexport interface McpUseViewsPluginOptions {\n /** Static list or live getter (dev rediscovery). */\n getViews: () => DiscoveredView[];\n /**\n * Dev-mode entry shape. When present, every virtual entry self-accepts HMR\n * updates (`import.meta.hot.accept()`) so an update that propagates past the\n * view module re-runs the bootstrap instead of full-reloading the iframe\n * document (which would wipe bridge state). Absent for builds — entries stay\n * byte-identical to the production contract.\n */\n dev?: {\n /**\n * Whether React Fast Refresh is active (`@vitejs/plugin-react` resolved).\n * When `true`, entries import the plugin's virtual refresh preamble\n * (`@vitejs/plugin-react/preamble`) before any component module so the\n * refresh runtime hooks the document — the role `transformIndexHtml`\n * plays for Vite-served HTML, which synthesized srcdoc documents never\n * pass through.\n */\n reactRefresh: boolean;\n };\n}\n\n/**\n * Vite plugin that resolves `virtual:mcp-use/views/<name>` to bootstrap code.\n *\n * Applies only to the **client** environment.\n *\n * @internal\n */\nexport function mcpUseViewsPlugin(options: McpUseViewsPluginOptions): Plugin {\n return {\n name: \"mcp-use-views\",\n applyToEnvironment(environment) {\n return environment.name === \"client\";\n },\n resolveId(id) {\n if (id === VIRTUAL_TAILWIND_ID) {\n return VIRTUAL_TAILWIND_RESOLVED_ID;\n }\n if (!id.startsWith(VIRTUAL_VIEW_PREFIX)) {\n return undefined;\n }\n return `\\0${id}`;\n },\n load(id) {\n if (id === VIRTUAL_TAILWIND_RESOLVED_ID) {\n return `@import \"tailwindcss\";`;\n }\n if (!id.startsWith(VIRTUAL_VIEW_RESOLVED_PREFIX)) {\n return undefined;\n }\n const name = id.slice(VIRTUAL_VIEW_RESOLVED_PREFIX.length);\n const view = options.getViews().find((v) => v.name === name);\n if (view === undefined) {\n return undefined;\n }\n const lines: string[] = [];\n if (options.dev?.reactRefresh === true) {\n // Must be the first import: the preamble hooks the refresh runtime\n // into the window before react-dom (via the bootstrap import below)\n // or any refresh-wrapped view module evaluates.\n lines.push(`import \"@vitejs/plugin-react/preamble\";`);\n }\n lines.push(`import ${JSON.stringify(VIRTUAL_TAILWIND_ID)};`);\n lines.push(\n `import { bootstrapView } from \"mcp-use/react\";`,\n `import * as viewModule from ${JSON.stringify(view.entryPath)};`,\n `bootstrapView(viewModule);`\n );\n if (options.dev !== undefined) {\n lines.push(\n `if (import.meta.hot) {`,\n ` import.meta.hot.accept();`,\n `}`\n );\n }\n lines.push(\"\");\n return lines.join(\"\\n\");\n },\n };\n}\n\n/**\n * Rollup input map for a client views build (one entry per view).\n *\n * @internal\n */\nexport function clientBuildInputs(\n views: DiscoveredView[]\n): Record<string, string> {\n const input: Record<string, string> = {};\n for (const view of views) {\n input[view.name] = virtualViewId(view.name);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AAS,CAAC;AAAA,QAC7D;AAAA,MACF;AACA,UAAI,QAAQ,QAAQ,QAAW;AAC7B,cAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AACA,YAAM,KAAK,EAAE;AACb,aAAO,MAAM,KAAK,IAAI;AAAA,IACxB;AAAA,EACF;AACF;","names":["existsSync","join","join","join","existsSync","join"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/landing.ts"],"sourcesContent":["/**\n * Landing page generator for MCP server endpoints\n *\n * Generates SEO-friendly HTML with connection instructions for MCP servers\n * from Claude Code, Cursor, VS Code, ChatGPT, and Manufact Inspector (hosted).\n */\n\n/**\n * Escapes HTML special characters to prevent XSS in user-provided content.\n */\nfunction escapeHtml(text: string): string {\n return text\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n\n/** Serialize data for an inline JSON script without creating an HTML end tag. */\nfunction serializeScriptJson(value: unknown): string {\n return JSON.stringify(value)\n .replace(/</g, \"\\\\u003c\")\n .replace(/>/g, \"\\\\u003e\");\n}\n\n/**\n * Sanitizes a server name for use in filenames and URLs.\n * Replaces non-alphanumeric characters with underscores and converts to lowercase.\n */\nfunction sanitizeServerName(name: string): string {\n return name.replace(/[^a-zA-Z0-9-_]/g, \"_\").toLowerCase();\n}\n\n/**\n * Generates a Cursor deep link for installing an MCP server.\n * The config is base64-encoded JSON containing the server URL.\n */\nfunction generateCursorDeepLink(url: string, name: string): string {\n const config = { url };\n const configJson = JSON.stringify(config);\n\n // Use Buffer in Node.js or btoa in browser-like environments\n const base64Config =\n typeof Buffer !== \"undefined\"\n ? Buffer.from(configJson).toString(\"base64\")\n : btoa(configJson);\n\n const sanitizedName = sanitizeServerName(name);\n return `cursor://anysphere.cursor-deeplink/mcp/install?config=${encodeURIComponent(base64Config)}&name=${encodeURIComponent(sanitizedName)}`;\n}\n\n/**\n * Generates a VS Code deep link for installing an MCP server.\n * The config is URL-encoded JSON containing the server URL.\n */\nfunction generateVSCodeDeepLink(url: string, name: string): string {\n const config = {\n url,\n name: sanitizeServerName(name),\n type: \"http\",\n };\n const configJson = JSON.stringify(config);\n const urlEncodedConfig = encodeURIComponent(configJson);\n return `vscode:mcp/install?${urlEncodedConfig}`;\n}\n\n/**\n * Generates a VS Code Insiders deep link for installing an MCP server.\n * The config is URL-encoded JSON containing the server URL.\n */\nfunction generateVSCodeInsidersDeepLink(url: string, name: string): string {\n const config = {\n url,\n name: sanitizeServerName(name),\n type: \"http\",\n };\n const configJson = JSON.stringify(config);\n const urlEncodedConfig = encodeURIComponent(configJson);\n return `vscode-insiders:mcp/install?${urlEncodedConfig}`;\n}\n\n/**\n * Generates a Claude Code CLI command for adding an MCP server.\n */\nfunction generateClaudeCommand(url: string, name: string): string {\n const sanitizedName = sanitizeServerName(name);\n const quotedUrl = `'${url.replace(/'/g, \"'\\\\''\")}'`;\n return `claude mcp add --transport http \"${sanitizedName}\" ${quotedUrl}`;\n}\n\n/** Hosted Manufact Inspector base (same as cloud deploy “Open in new tab”). */\nconst MANUFACT_INSPECTOR_ORIGIN = \"https://inspector.manufact.com\";\n\n/**\n * Deep link to hosted Manufact Inspector with this MCP server URL pre-filled\n * and the Chat tab selected (`tab=chat`).\n */\nfunction getManufactInspectorUrl(serverUrl: string): string {\n const params = new URLSearchParams({\n autoConnect: serverUrl,\n tab: \"chat\",\n });\n return `${MANUFACT_INSPECTOR_ORIGIN}/inspector?${params.toString()}`;\n}\n\nconst LOGO_SVG_PATHS = {\n path1:\n \"M105.933 0C164.437 0.000115889 211.865 47.607 211.865 106.333C211.865 131.828 210.494 158.401 221.068 181.6L228.976 198.947C243.585 230.997 269.266 256.7 301.304 271.336L316.156 278.121C340.143 289.079 367.695 287.335 394.067 287.335C452.572 287.335 500 334.942 500 393.668C500 452.394 452.572 500.001 394.067 500.001C335.563 500.001 288.135 452.394 288.135 393.668C288.135 368.974 289.241 343.275 278.992 320.807L270.587 302.38C255.949 270.289 230.214 244.565 198.118 229.939L180.164 221.758C157.282 211.331 131.078 212.666 105.933 212.666C47.4278 212.666 4.92992e-05 165.059 0 106.333C0 47.607 47.4278 0 105.933 0Z\",\n circle: { cx: 100.426, cy: 399.575, r: 100.426 },\n path2:\n \"M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z\",\n};\n\nconst LINE_INTERSECTION_PATH =\n \"M10.5 4C10.5 7.31371 7.81371 10 4.5 10H0.5V11H4.5C7.81371 11 10.5 13.6863 10.5 17V21H11.5V17C11.5 13.6863 14.1863 11 17.5 11H21.5V10H17.5C14.1863 10 11.5 7.31371 11.5 4V0H10.5V4Z\";\n\n/** Returns the inline WebGL mesh gradient script (no deps). */\nfunction getMeshGradientScript(): string {\n const VERT = `#version 300 es\nin vec4 a_position;\nout vec2 v_objectUV;\nvoid main(){\n gl_Position=a_position;\n v_objectUV=a_position.xy*0.5+0.5;\n}`;\n\n const FRAG = `#version 300 es\nprecision mediump float;\nuniform float u_time;\nuniform vec4 u_colors[4];\nuniform float u_colorsCount;\nuniform float u_distortion;\nuniform float u_swirl;\nuniform float u_grainMixer;\nuniform float u_grainOverlay;\nin vec2 v_objectUV;\nout vec4 fragColor;\n#define PI 3.14159265359\nvec2 rotate(vec2 uv,float th){return mat2(cos(th),sin(th),-sin(th),cos(th))*uv;}\nfloat hash21(vec2 p){\n p=fract(p*vec2(0.3183099,0.3678794))+0.1;\n p+=dot(p,p+19.19);\n return fract(p.x*p.y);\n}\nfloat valueNoise(vec2 st){\n vec2 i=floor(st);vec2 f=fract(st);\n float a=hash21(i),b=hash21(i+vec2(1.,0.)),c=hash21(i+vec2(0.,1.)),d=hash21(i+vec2(1.,1.));\n vec2 u=f*f*(3.-2.*f);\n return mix(mix(a,b,u.x),mix(c,d,u.x),u.y);\n}\nvec2 getPosition(int i,float t){\n float a=float(i)*.37,b=.6+fract(float(i)/3.)*.9,c=.8+fract(float(i+1)/4.);\n float x=sin(t*b+a),y=cos(t*c+a*1.5);\n return .5+.5*vec2(x,y);\n}\nvoid main(){\n vec2 uv=v_objectUV;uv+=.5;\n vec2 grainUV=uv*1000.;\n float grain=valueNoise(grainUV);\n float mixerGrain=.4*u_grainMixer*(grain-.5);\n float t=.5*(u_time+41.5);\n float radius=smoothstep(0.,1.,length(uv-.5));\n float center=1.-radius;\n for(float i=1.;i<=2.;i++){\n uv.x+=u_distortion*center/i*sin(t+i*.4*smoothstep(0.,1.,uv.y))*cos(.2*t+i*2.4*smoothstep(0.,1.,uv.y));\n uv.y+=u_distortion*center/i*cos(t+i*2.*smoothstep(0.,1.,uv.x));\n }\n vec2 uvR=uv-vec2(.5);\n float angle=3.*u_swirl*radius;\n uvR=rotate(uvR,-angle);uvR+=vec2(.5);\n vec3 color=vec3(0.);float opacity=0.,totalWeight=0.;\n for(int i=0;i<4;i++){\n if(i>=int(u_colorsCount))break;\n vec2 pos=getPosition(i,t)+mixerGrain;\n vec3 cf=u_colors[i].rgb*u_colors[i].a;\n float opacityF=u_colors[i].a;\n float dist=length(uvR-pos);\n dist=pow(dist,3.5);\n float w=1./(dist+1e-3);\n color+=cf*w;opacity+=opacityF*w;totalWeight+=w;\n }\n color/=max(1e-4,totalWeight);\n opacity/=max(1e-4,totalWeight);\n float grainO=valueNoise(rotate(grainUV,1.)+vec2(3.));\n grainO=mix(grainO,valueNoise(rotate(grainUV,2.)+vec2(-1.)),.5);\n grainO=pow(grainO,1.3);\n float grainOV=grainO*2.-1.;\n vec3 grainOC=vec3(step(0.,grainOV));\n float grainOS=u_grainOverlay*abs(grainOV);\n grainOS=pow(grainOS,.8);\n color=mix(color,grainOC,.35*grainOS);\n opacity+=.5*grainOS;\n fragColor=vec4(color,clamp(opacity,0.,1.));\n}`;\n\n return `(function(){\nvar c=document.getElementById('mesh-bg');\nif(!c)return;\nvar wrap=c.parentElement;\nif(!wrap)return;\nvar gl=c.getContext('webgl2');\nif(!gl)return;\nfunction compileShader(typ,src){\n var s=gl.createShader(typ);\n gl.shaderSource(s,src);\n gl.compileShader(s);\n if(!gl.getShaderParameter(s,gl.COMPILE_STATUS)){console.error(gl.getShaderInfoLog(s));return null;}\n return s;\n}\nvar vs=compileShader(gl.VERTEX_SHADER,${JSON.stringify(VERT)});\nvar fs=compileShader(gl.FRAGMENT_SHADER,${JSON.stringify(FRAG)});\nif(!vs||!fs)return;\nvar prog=gl.createProgram();\ngl.attachShader(prog,vs);\ngl.attachShader(prog,fs);\ngl.linkProgram(prog);\nif(!gl.getProgramParameter(prog,gl.LINK_STATUS)){console.error(gl.getProgramInfoLog(prog));return;}\ngl.useProgram(prog);\nvar posLoc=gl.getAttribLocation(prog,'a_position');\nvar buf=gl.createBuffer();\ngl.bindBuffer(gl.ARRAY_BUFFER,buf);\ngl.bufferData(gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),gl.STATIC_DRAW);\ngl.enableVertexAttribArray(posLoc);\ngl.vertexAttribPointer(posLoc,2,gl.FLOAT,false,0,0);\nfunction hexToRgba(hex){\n var r=(parseInt(hex.slice(1,3),16))/255;\n var g=(parseInt(hex.slice(3,5),16))/255;\n var b=(parseInt(hex.slice(5,7),16))/255;\n return[r,g,b,1];\n}\nvar colors=[hexToRgba('#e0eaff'),hexToRgba('#f9ffbd'),hexToRgba('#dedede'),hexToRgba('#ffffff')];\nvar uTime=gl.getUniformLocation(prog,'u_time');\nvar uColors=[gl.getUniformLocation(prog,'u_colors[0]'),gl.getUniformLocation(prog,'u_colors[1]'),gl.getUniformLocation(prog,'u_colors[2]'),gl.getUniformLocation(prog,'u_colors[3]')];\nvar uColorsCount=gl.getUniformLocation(prog,'u_colorsCount');\nvar uDistortion=gl.getUniformLocation(prog,'u_distortion');\nvar uSwirl=gl.getUniformLocation(prog,'u_swirl');\nvar uGrainMixer=gl.getUniformLocation(prog,'u_grainMixer');\nvar uGrainOverlay=gl.getUniformLocation(prog,'u_grainOverlay');\nvar time=0,speed=1,raf;\nfunction resize(){\n var dpr=Math.min(2,window.devicePixelRatio||1);\n c.width=Math.floor(wrap.clientWidth*dpr);\n c.height=Math.floor(wrap.clientHeight*dpr);\n gl.viewport(0,0,c.width,c.height);\n}\nfunction draw(){\n if(document.hidden){raf=requestAnimationFrame(draw);return;}\n time+=0.016*speed;\n gl.uniform1f(uTime,time);\n for(var i=0;i<4;i++)gl.uniform4fv(uColors[i],colors[i]);\n gl.uniform1f(uColorsCount,4);\n gl.uniform1f(uDistortion,0.8);\n gl.uniform1f(uSwirl,0.1);\n gl.uniform1f(uGrainMixer,0);\n gl.uniform1f(uGrainOverlay,0.3);\n gl.drawArrays(gl.TRIANGLES,0,6);\n raf=requestAnimationFrame(draw);\n}\nresize();\nnew ResizeObserver(resize).observe(wrap);\ndraw();\n})();`;\n}\n\n/** A tool shown in the landing page's primitives list. */\nexport interface LandingPageTool {\n /** Protocol-facing tool name. */\n name: string;\n\n /** Optional human-readable tool title. */\n title?: string;\n\n /** Optional tool description. */\n description?: string;\n}\n\n/** A prompt shown in the landing page's primitives list. */\nexport interface LandingPagePrompt {\n /** Protocol-facing prompt name. */\n name: string;\n\n /** Optional human-readable prompt title. */\n title?: string;\n\n /** Optional prompt description. */\n description?: string;\n}\n\n/** A static resource shown in the landing page's primitives list. */\nexport interface LandingPageResource {\n /** Resource URI. */\n uri: string;\n\n /** Optional protocol-facing resource name. */\n name?: string;\n\n /** Optional human-readable resource title. */\n title?: string;\n\n /** Optional resource description. */\n description?: string;\n}\n\n/** Inputs used to render the v1-compatible MCP server landing page. */\nexport interface LandingPageOptions {\n /** Protocol-facing server name. */\n name: string;\n\n /** Optional human-readable server title used as the page heading. */\n title?: string;\n\n /** Server version shown beside the heading. */\n version: string;\n\n /** Absolute public URL of the MCP endpoint. */\n url: string;\n\n /** Optional server description. */\n description?: string;\n\n /** Optional tools shown in the primitives list. */\n tools?: readonly LandingPageTool[];\n\n /** Optional prompts shown in the primitives list. */\n prompts?: readonly LandingPagePrompt[];\n\n /** Optional static resources shown in the primitives list. */\n resources?: readonly LandingPageResource[];\n\n /** Optional absolute URL for the icon displayed above the server heading. */\n iconUrl?: string;\n}\n\n/**\n * Generates an HTML landing page with connection instructions\n * for Claude Code, Cursor, VS Code, ChatGPT, and Manufact Inspector.\n *\n * @param options - Server identity, endpoint, icon, and primitive metadata.\n * @returns HTML landing page with connection instructions\n */\nexport function generateLandingPage(options: LandingPageOptions): string {\n const {\n name: protocolName,\n title,\n version,\n url,\n description,\n tools,\n prompts,\n resources,\n iconUrl,\n } = options;\n const name = title ?? protocolName;\n const cursorDeepLink = generateCursorDeepLink(url, name);\n const vscodeDeepLink = generateVSCodeDeepLink(url, name);\n const vscodeInsidersDeepLink = generateVSCodeInsidersDeepLink(url, name);\n const claudeCommand = generateClaudeCommand(url, name);\n const manufactInspectorUrl = getManufactInspectorUrl(url);\n\n const safeName = escapeHtml(name);\n const safeDescription = description ? escapeHtml(description) : \"\";\n const rawMetaDescription =\n description ||\n `${name} MCP Server — Connect with Claude Code, Cursor, and VS Code. Model Context Protocol server.`;\n const metaDescription = escapeHtml(rawMetaDescription);\n const pageTitle = `${safeName} MCP Server — Connect with Claude Code, Cursor & VS Code`;\n\n const jsonLd = serializeScriptJson({\n \"@context\": \"https://schema.org\",\n \"@type\": \"SoftwareApplication\",\n name: name,\n softwareVersion: version,\n description: rawMetaDescription,\n applicationCategory: \"DeveloperApplication\",\n });\n\n const normalizedTools: LandingPageTool[] =\n tools && tools.length > 0\n ? tools.map((tool) => ({\n name: tool.title ?? tool.name,\n ...(tool.description !== undefined && {\n description: tool.description,\n }),\n }))\n : [];\n\n const toolsListHtml =\n normalizedTools.length > 0\n ? normalizedTools\n .map(\n (t) =>\n `<div class=\"spec-item\"><code class=\"spec-name\">${escapeHtml(t.name)}</code>${t.description ? `<p class=\"spec-desc\">${escapeHtml(t.description)}</p>` : \"\"}</div>`\n )\n .join(\"\\n\")\n : \"\";\n\n const promptsListHtml =\n prompts && prompts.length > 0\n ? prompts\n .map(\n (p) =>\n `<div class=\"spec-item\"><code class=\"spec-name\">${escapeHtml(p.title ?? p.name)}</code>${p.description ? `<p class=\"spec-desc\">${escapeHtml(p.description)}</p>` : \"\"}</div>`\n )\n .join(\"\\n\")\n : \"\";\n\n const resourcesListHtml =\n resources && resources.length > 0\n ? resources\n .map(\n (r) =>\n `<div class=\"spec-item\"><code class=\"spec-uri\">${escapeHtml(r.uri)}</code>${r.description ? `<p class=\"spec-desc\">${escapeHtml(r.description)}</p>` : \"\"}</div>`\n )\n .join(\"\\n\")\n : \"\";\n\n return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>${pageTitle}</title>\n<meta name=\"description\" content=\"${metaDescription}\">\n<meta property=\"og:title\" content=\"${pageTitle}\">\n<meta property=\"og:description\" content=\"${metaDescription}\">\n<meta property=\"og:type\" content=\"website\">\n<meta name=\"twitter:card\" content=\"summary\">\n<meta name=\"twitter:title\" content=\"${pageTitle}\">\n<meta name=\"twitter:description\" content=\"${metaDescription}\">\n${iconUrl ? `<link rel=\"icon\" href=\"${escapeHtml(iconUrl)}\">` : \"\"}\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap\" rel=\"stylesheet\">\n<script type=\"application/ld+json\">${jsonLd}</script>\n<style>\n* { box-sizing: border-box; }\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n font-size: 16px;\n line-height: 1.6;\n color: #1e293b;\n background-color: #fdfcfc;\n min-height: 100vh;\n}\n.layout {\n max-width: 48rem;\n margin: 0 auto;\n padding: 2rem 1.5rem;\n position: relative;\n}\n.rail-left, .rail-right {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n background: rgba(0,0,0,0.08);\n}\n.rail-left { left: 1.5rem; }\n.rail-right { right: 1.5rem; }\n.rail-top, .rail-bottom {\n height: 1px;\n background: rgba(0,0,0,0.08);\n position: absolute;\n left: 1.5rem;\n right: 1.5rem;\n}\n.rail-top { top: 0; }\n.rail-bottom { bottom: 0; }\n.corner {\n position: absolute;\n width: 22px;\n height: 21px;\n color: rgba(0,0,0,0.08);\n}\n.corner-tl { left: 1.5rem; top: 0; transform: translate(-50%, -50%); }\n.corner-tr { right: 1.5rem; top: 0; transform: translate(50%, -50%); left: auto; }\n.corner-bl { left: 1.5rem; bottom: 0; transform: translate(-50%, 50%); top: auto; }\n.corner-br { right: 1.5rem; bottom: 0; transform: translate(50%, 50%); left: auto; top: auto; }\n.card {\n background: #fff;\n border-top: 1px solid rgba(0,0,0,0.08);\n border-bottom: 1px solid rgba(0,0,0,0.08);\n margin-bottom: 1.5rem;\n overflow: hidden;\n}\n.card-header {\n padding: 1.5rem 1.5rem 0.5rem;\n}\n.card-content { padding: 0 1.5rem 1.5rem; }\n.hero-card .card-header {\n text-align: center;\n padding: 0 1.5rem 1.25rem;\n}\n.hero-card .card-header.has-icon {\n padding-top: 1.5rem;\n}\n.hero-icon {\n width: 64px;\n height: 64px;\n border-radius: 14px;\n object-fit: contain;\n margin-bottom: 0.75rem;\n}\n.hero-row {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n margin-bottom: 0.35rem;\n}\n.hero h1 {\n font-size: 1.75rem;\n font-weight: 700;\n color: #172037;\n margin: 0.75rem 0 0;\n}\n.hero-card .card-header.has-icon .hero h1 { margin-top: 0; }\n.hero .version { font-size: 0.95rem; color: #64748b; font-weight: 500; }\n.hero-description {\n color: rgba(23,32,55,0.8);\n font-size: 1rem;\n margin: 0.35rem 0 0;\n max-width: 36rem;\n margin-left: auto;\n margin-right: auto;\n}\n.logo-symbol {\n display: inline-block;\n cursor: default;\n flex-shrink: 0;\n}\n.logo-symbol svg {\n width: 32px;\n height: 32px;\n color: #172037;\n}\n.logo-fill { transition: opacity 0.2s ease; }\n.logo-stroke path,\n.logo-stroke circle {\n fill: none;\n stroke: currentColor;\n stroke-width: 6;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-dasharray: 2000;\n stroke-dashoffset: 2000;\n opacity: 0;\n}\n.logo-symbol:hover .logo-fill {\n animation: logo-fill-out 0.2s forwards, logo-fill-in 0.6s 0.9s forwards;\n}\n.logo-symbol:hover .logo-stroke path,\n.logo-symbol:hover .logo-stroke circle {\n opacity: 1;\n animation: logo-draw 0.7s 0.2s ease-in-out forwards;\n}\n@keyframes logo-fill-out { to { opacity: 0; } }\n@keyframes logo-fill-in { to { opacity: 1; } }\n@keyframes logo-draw { to { stroke-dashoffset: 0; } }\n.footer-content { text-align: center; padding: 2.5rem 1.5rem; border-top: 1px solid rgba(0,0,0,0.08); display: flex; justify-content: center; align-items: center; }\n.footer-brand-link { justify-content: center; }\n.footer-brand-link .logo-symbol svg { width: 22px; height: 22px; }\n.hero-powered { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; margin-top: 0.75rem; font-family: \"Outfit\", -apple-system, BlinkMacSystemFont, sans-serif; font-size: 0.875rem; font-weight: 500; color: rgba(23,32,55,0.6); }\n.hero-powered a { color: #000; text-decoration: none; display: inline-flex; align-items: center; }\n.hero-powered a:hover { text-decoration: underline; }\n.footer-brand-link { display: inline-flex; align-items: center; gap: 0.5rem; font-family: \"Outfit\", -apple-system, BlinkMacSystemFont, sans-serif; font-size: 1.5rem; font-weight: 600; color: #172037; text-decoration: none; }\n.footer-brand-link:hover { color: #0f172a; }\n.hero-url-block { display: flex; justify-content: center; margin: 0.75rem 0; }\n.hero-cta-row {\n display: flex;\n justify-content: center;\n margin: 0.35rem 0 0.5rem;\n}\n.hero-primary-btn {\n display: inline-block;\n padding: 0.625rem 1.25rem;\n background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);\n color: #fff;\n border-radius: 9999px;\n text-decoration: none;\n font-weight: 600;\n font-size: 0.9375rem;\n box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 2px 8px rgba(15,23,42,0.15);\n transition: background 0.15s;\n border: 1px solid rgba(0,0,0,0.12);\n}\n.hero-primary-btn:hover {\n background: linear-gradient(180deg, #334155 0%, #1e293b 100%);\n text-decoration: none;\n color: #fff;\n}\n.hero-url-block .url-block { max-width: 100%; }\n.hero-url-block .url-box {\n font-size: 0.938rem;\n background: #fff;\n border: 1px solid rgba(0,0,0,0.12);\n border-radius: 9999px;\n padding: 0.75rem 3rem 0.75rem 1rem;\n margin: 1rem 0;\n}\n.hero-powered .gh-icon { width: 18px; height: 18px; margin-right: 0.25rem; vertical-align: -0.2em; }\n.hero-powered .gh-shield { height: 18px; width: auto; margin-left: 0.4rem; vertical-align: -0.2em; }\n.card-title { font-size: 1.25rem; font-weight: 600; color: #172037; margin: 0 0 0.25rem; }\n.card-desc { font-size: 0.875rem; color: rgba(23,32,55,0.8); margin: 0 0 1rem; }\n.url-block {\n position: relative;\n margin: 1rem 0;\n}\n.url-block .url-box {\n margin: 0;\n padding-right: 2.75rem;\n}\n.url-block .copy-btn { top: 50%; right: 0.5rem; transform: translateY(-50%); }\n.url-box {\n font-family: ui-monospace, monospace;\n font-size: 0.813rem;\n background: #f8fafc;\n padding: 0.5rem 0.75rem;\n border-radius: 6px;\n color: #475569;\n margin: 1rem 0;\n}\n.spec-section { margin-top: 1.5rem; }\n.spec-section h3 { font-size: 1rem; font-weight: 600; color: #172037; margin: 0 0 0.75rem; }\n.spec-item { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f1f5f9; }\n.spec-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }\n.spec-name, .spec-uri { font-family: ui-monospace, monospace; font-size: 0.813rem; background: #f1f5f9; padding: 0.2rem 0.4rem; border-radius: 4px; }\n.spec-uri { word-break: break-all; }\n.spec-desc { margin: 0.5rem 0 0; font-size: 0.875rem; color: #64748b; line-height: 1.5; }\n.tabs-row {\n display: flex;\n gap: 2px;\n background: rgba(23,32,55,0.05);\n padding: 3px;\n border-radius: 8px;\n margin-bottom: 1.5rem;\n flex-wrap: wrap;\n}\n.tab {\n flex: 1;\n min-width: 80px;\n padding: 0.5rem 0.75rem;\n font-size: 0.813rem;\n font-weight: 500;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: #64748b;\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n}\n.tab:hover { color: #172037; background: rgba(255,255,255,0.6); }\n.tab.active { background: #fff; color: #172037; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }\n.tab-panel { display: none; }\n.tab-panel.active { display: block; }\n.tab-panel h3 { font-size: 1.125rem; font-weight: 600; color: #172037; margin: 0 0 1rem; }\n.install-btn {\n display: inline-block;\n padding: 0.375rem 0.875rem;\n background: #0f172a;\n color: #fff;\n border-radius: 9999px;\n text-decoration: none;\n font-weight: 500;\n font-size: 0.813rem;\n margin-bottom: 1rem;\n transition: background 0.15s;\n}\n.install-btn:hover { background: #1e293b; }\n.code-block {\n position: relative;\n margin: 1rem 0;\n}\n.code-block pre {\n margin: 0;\n padding: 0.5rem 0.75rem;\n background: #f8fafc;\n color: #475569;\n border-radius: 8px;\n font-family: ui-monospace, monospace;\n font-size: 0.875rem;\n overflow-x: auto;\n border: 1px solid rgba(0,0,0,0.08);\n}\n.code-block .copy-btn { top: 50%; right: 0.375rem; transform: translateY(-50%); }\n.copy-btn {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n width: 2rem;\n height: 2rem;\n padding: 0;\n border: none;\n border-radius: 6px;\n background: #fff;\n color: #172037;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.15s;\n}\n.copy-btn:hover { background: #f1f5f9; }\n.copy-btn.copied { background: #fff; color: #172037; }\n.copy-btn svg { width: 14px; height: 14px; }\nol.steps { margin: 0; padding-left: 1.25rem; }\nol.steps li { margin: 0.5rem 0; color: #475569; }\na { color: #0522a5; text-decoration: none; }\na:hover { text-decoration: underline; }\n.hero-gradient-wrap {\n position: relative;\n padding: 1.5rem;\n overflow: hidden;\n}\n.hero-gradient-wrap canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n display: block;\n}\n.hero-inner {\n position: relative;\n z-index: 1;\n background: rgba(253,252,252,0.9);\n -webkit-backdrop-filter: blur(12px);\n backdrop-filter: blur(12px);\n padding: 1.25rem 1.5rem;\n border: 1px solid rgba(0,0,0,0.06);\n}\n.hero-inner .card-header { padding: 0; }\n.hero-inner .card-header.has-icon { padding-top: 0.5rem; }\n</style>\n</head>\n<body>\n<div class=\"layout\">\n <div class=\"rail-left\"></div>\n <div class=\"rail-right\"></div>\n <div class=\"rail-top\"></div>\n <div class=\"rail-bottom\"></div>\n <svg class=\"corner corner-tl\" viewBox=\"0 0 22 21\" fill=\"none\"><path d=\"${LINE_INTERSECTION_PATH}\" fill=\"currentColor\"/></svg>\n <svg class=\"corner corner-tr\" viewBox=\"0 0 22 21\" fill=\"none\"><path d=\"${LINE_INTERSECTION_PATH}\" fill=\"currentColor\"/></svg>\n <svg class=\"corner corner-bl\" viewBox=\"0 0 22 21\" fill=\"none\"><path d=\"${LINE_INTERSECTION_PATH}\" fill=\"currentColor\"/></svg>\n <svg class=\"corner corner-br\" viewBox=\"0 0 22 21\" fill=\"none\"><path d=\"${LINE_INTERSECTION_PATH}\" fill=\"currentColor\"/></svg>\n\n <div class=\"card hero-card\">\n <div class=\"hero-gradient-wrap\" id=\"hero-gradient-wrap\">\n <canvas id=\"mesh-bg\" aria-hidden=\"true\"></canvas>\n <div class=\"hero-inner\">\n <div class=\"card-header ${iconUrl ? \"has-icon\" : \"\"}\">\n ${iconUrl ? `<img src=\"${escapeHtml(iconUrl)}\" alt=\"\" class=\"hero-icon\" width=\"64\" height=\"64\" />` : \"\"}\n <div class=\"hero-row\">\n <h1>${safeName} <span class=\"version\">(v${escapeHtml(version)})</span></h1>\n </div>\n ${safeDescription ? `<p class=\"hero-description\">${safeDescription}</p>` : \"\"}\n <div class=\"hero-url-block\">\n <div class=\"url-block\">\n <div class=\"url-box\" data-copy=\"${escapeHtml(url)}\">${escapeHtml(url)}</div>\n <button type=\"button\" class=\"copy-btn\" data-copy=\"${escapeHtml(url)}\" aria-label=\"Copy URL\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"/><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"/></svg></button>\n </div>\n </div>\n <div class=\"hero-cta-row\">\n <a href=\"${escapeHtml(manufactInspectorUrl)}\" class=\"hero-primary-btn\" target=\"_blank\" rel=\"noopener noreferrer\">Open in Inspector</a>\n </div>\n <div class=\"hero-powered\">\n <span>Powered by</span>\n <a href=\"https://github.com/mcp-use/mcp-use\" target=\"_blank\" rel=\"noopener noreferrer\">\n <svg class=\"gh-icon\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z\"/></svg>\n github.com/mcp-use/mcp-use\n <img src=\"https://img.shields.io/github/stars/mcp-use/mcp-use\" alt=\"GitHub stars\" class=\"gh-shield\" width=\"90\" height=\"18\" loading=\"lazy\" />\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"card\">\n <div class=\"card-header\">\n <h2 class=\"card-title\">Installation Guide</h2>\n <p class=\"card-desc\">Choose your preferred MCP client</p>\n </div>\n <div class=\"card-content\">\n <div class=\"tabs-row\" role=\"tablist\">\n <button type=\"button\" class=\"tab active\" role=\"tab\" data-tab=\"claude-code\" aria-selected=\"true\">Claude Code</button>\n <button type=\"button\" class=\"tab\" role=\"tab\" data-tab=\"cursor\" aria-selected=\"false\">Cursor</button>\n <button type=\"button\" class=\"tab\" role=\"tab\" data-tab=\"vscode\" aria-selected=\"false\">VS Code</button>\n <button type=\"button\" class=\"tab\" role=\"tab\" data-tab=\"vscode-insiders\" aria-selected=\"false\">VS Code Insiders</button>\n <button type=\"button\" class=\"tab\" role=\"tab\" data-tab=\"chatgpt\" aria-selected=\"false\">ChatGPT</button>\n </div>\n\n <div id=\"panel-claude-code\" class=\"tab-panel active\">\n <h3>Install in Claude Code</h3>\n <p>Run this command in your terminal:</p>\n <div class=\"code-block\">\n <pre data-copy=\"${escapeHtml(claudeCommand)}\">${escapeHtml(claudeCommand)}</pre>\n <button type=\"button\" class=\"copy-btn\" aria-label=\"Copy\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"/><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"/></svg></button>\n </div>\n </div>\n\n <div id=\"panel-cursor\" class=\"tab-panel\">\n <h3>Install in Cursor</h3>\n <p>Click the button below to add this MCP server to Cursor:</p>\n <a href=\"${cursorDeepLink}\" class=\"install-btn\">Open in Cursor</a>\n <p>Or add manually: Settings → MCP → Add server</p>\n </div>\n\n <div id=\"panel-vscode\" class=\"tab-panel\">\n <h3>Install in VS Code</h3>\n <p>Click the button below to add this MCP server to VS Code:</p>\n <a href=\"${vscodeDeepLink}\" class=\"install-btn\">Open in VS Code</a>\n <p>Or add manually: Settings → MCP → Add server</p>\n </div>\n\n <div id=\"panel-vscode-insiders\" class=\"tab-panel\">\n <h3>Install in VS Code Insiders</h3>\n <p>Click the button below to add this MCP server to VS Code Insiders:</p>\n <a href=\"${vscodeInsidersDeepLink}\" class=\"install-btn\">Open in VS Code Insiders</a>\n <p>Or add manually: Settings → MCP → Add server</p>\n </div>\n\n <div id=\"panel-chatgpt\" class=\"tab-panel\">\n <h3>Connect with ChatGPT</h3>\n <ol class=\"steps\">\n <li><strong>Enable Developer Mode:</strong> Settings → Connectors → Advanced → Developer mode</li>\n <li><strong>Import this MCP server:</strong> Go to Connectors tab and add: ${escapeHtml(url)}</li>\n <li><strong>Use in conversations:</strong> Choose the MCP server from the Plus menu</li>\n </ol>\n </div>\n </div>\n </div>\n\n ${\n toolsListHtml || promptsListHtml || resourcesListHtml\n ? `\n <div class=\"card\">\n <div class=\"card-header\">\n <h2 class=\"card-title\">Primitives</h2>\n ${toolsListHtml ? `<div class=\"spec-section\"><h3>Tools (${normalizedTools.length})</h3>${toolsListHtml}</div>` : \"\"}\n ${promptsListHtml ? `<div class=\"spec-section\"><h3>Prompts (${prompts!.length})</h3>${promptsListHtml}</div>` : \"\"}\n ${resourcesListHtml ? `<div class=\"spec-section\"><h3>Resources (${resources!.length})</h3>${resourcesListHtml}</div>` : \"\"}\n </div>\n </div>\n `\n : \"\"\n }\n\n <footer class=\"footer-content\">\n <a href=\"https://manufact.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"footer-brand-link\" aria-label=\"Manufact\">\n <span class=\"logo-symbol\">\n <svg viewBox=\"0 0 500 500\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"logo-fill\" fill=\"currentColor\" fill-rule=\"nonzero\">\n <path d=\"${LOGO_SVG_PATHS.path1}\"/>\n <circle cx=\"${LOGO_SVG_PATHS.circle.cx}\" cy=\"${LOGO_SVG_PATHS.circle.cy}\" r=\"${LOGO_SVG_PATHS.circle.r}\"/>\n <path d=\"${LOGO_SVG_PATHS.path2}\"/>\n </g>\n <g class=\"logo-stroke\">\n <path d=\"${LOGO_SVG_PATHS.path1}\"/>\n <circle cx=\"${LOGO_SVG_PATHS.circle.cx}\" cy=\"${LOGO_SVG_PATHS.circle.cy}\" r=\"${LOGO_SVG_PATHS.circle.r}\"/>\n <path d=\"${LOGO_SVG_PATHS.path2}\"/>\n </g>\n </svg>\n </span>\n <span>Manufact</span>\n </a>\n </footer>\n</div>\n\n<script>${getMeshGradientScript()}</script>\n<script>\n(function(){\n var tabs = document.querySelectorAll('.tab');\n var panels = document.querySelectorAll('.tab-panel');\n tabs.forEach(function(tab){\n tab.addEventListener('click', function(){\n var target = tab.getAttribute('data-tab');\n tabs.forEach(function(t){ t.classList.remove('active'); t.setAttribute('aria-selected','false'); });\n panels.forEach(function(p){\n var match = p.id === 'panel-' + target;\n p.classList.toggle('active', match);\n p.hidden = !match;\n });\n tab.classList.add('active');\n tab.setAttribute('aria-selected','true');\n });\n });\n var copySvg = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"/><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"/></svg>';\n var checkSvg = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6L9 17l-5-5\"/></svg>';\n document.querySelectorAll('.copy-btn').forEach(function(btn){\n btn.addEventListener('click', function(){\n var text = btn.getAttribute('data-copy');\n if (!text) {\n var pre = btn.parentElement.querySelector('pre');\n text = pre ? (pre.getAttribute('data-copy') || pre.textContent) : '';\n }\n if (text) navigator.clipboard.writeText(text).then(function(){\n btn.classList.add('copied');\n btn.innerHTML = checkSvg;\n setTimeout(function(){ btn.classList.remove('copied'); btn.innerHTML = copySvg; }, 2000);\n });\n });\n });\n panels.forEach(function(p){ if(!p.classList.contains('active')) p.hidden = true; });\n})();\n</script>\n</body>\n</html>`;\n}\n"],"mappings":";AAUA,SAAS,WAAW,MAAsB;AACxC,SAAO,KACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAC1B;AAGA,SAAS,oBAAoB,OAAwB;AACnD,SAAO,KAAK,UAAU,KAAK,EACxB,QAAQ,MAAM,SAAS,EACvB,QAAQ,MAAM,SAAS;AAC5B;AAMA,SAAS,mBAAmB,MAAsB;AAChD,SAAO,KAAK,QAAQ,mBAAmB,GAAG,EAAE,YAAY;AAC1D;AAMA,SAAS,uBAAuB,KAAa,MAAsB;AACjE,QAAM,SAAS,EAAE,IAAI;AACrB,QAAM,aAAa,KAAK,UAAU,MAAM;AAGxC,QAAM,eACJ,OAAO,WAAW,cACd,OAAO,KAAK,UAAU,EAAE,SAAS,QAAQ,IACzC,KAAK,UAAU;AAErB,QAAM,gBAAgB,mBAAmB,IAAI;AAC7C,SAAO,yDAAyD,mBAAmB,YAAY,CAAC,SAAS,mBAAmB,aAAa,CAAC;AAC5I;AAMA,SAAS,uBAAuB,KAAa,MAAsB;AACjE,QAAM,SAAS;AAAA,IACb;AAAA,IACA,MAAM,mBAAmB,IAAI;AAAA,IAC7B,MAAM;AAAA,EACR;AACA,QAAM,aAAa,KAAK,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|
|
2
|
-
* Root-level tool registry declaration shared by `mcp-use dev` and
|
|
3
|
-
* `mcp-use build`.
|
|
4
|
-
*
|
|
5
|
-
* The file contains no generated tool names. It creates a live type-only edge
|
|
6
|
-
* to the user's server entry, so exported `ToolRef`s update in TypeScript
|
|
7
|
-
* without rerunning the CLI.
|
|
8
|
-
*/
|
|
9
|
-
/** Filename of the project-owned tool registry declaration. */
|
|
10
|
-
export declare const TOOLS_DECLARATION_NAME = "tools.d.ts";
|
|
11
|
-
/** Build the stable declaration contents for a discovered server entry. */
|
|
12
|
-
export declare function renderToolsDeclaration(cwd: string, entry: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Create the root `tools.d.ts` if absent.
|
|
15
|
-
*
|
|
16
|
-
* Exclusive-create mode makes this safe when dev and build start together and
|
|
17
|
-
* guarantees that a user-authored declaration is never truncated or replaced.
|
|
18
|
-
*
|
|
19
|
-
* @returns `true` when this invocation created the file.
|
|
20
|
-
*/
|
|
21
|
-
export declare function ensureToolsDeclaration(cwd: string, entry: string): Promise<boolean>;
|
|
22
|
-
//# sourceMappingURL=tools-declaration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools-declaration.d.ts","sourceRoot":"","sources":["../../src/cli/tools-declaration.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,eAAe,CAAC;AAoBnD,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAazE;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/landing-handler.ts"],"sourcesContent":["import {\n generateLandingPage,\n type LandingPageOptions,\n type LandingPagePrompt,\n type LandingPageResource,\n type LandingPageTool,\n} from \"./landing.js\";\nimport type { ServerBranding } from \"./branding.js\";\nimport { resolveServerOrigin } from \"./views/origin.js\";\n\n/**\n * Render a landing-page response without loading the renderer on MCP requests.\n *\n * @param request - Classified HTML GET or HEAD request.\n * @param basePath - Exact MCP endpoint path.\n * @param config - Server identity and description.\n * @param branding - Normalized browser and MCP identity branding.\n * @param tools - Frozen tool registry values.\n * @param prompts - Frozen prompt registry values.\n * @param resources - Frozen static-resource registry values.\n * @returns HTML response, with an empty body for HEAD.\n *\n * @internal\n */\nexport function createLandingPageResponse(\n request: Request,\n basePath: string,\n config: Pick<\n LandingPageOptions,\n \"name\" | \"title\" | \"version\" | \"description\"\n >,\n branding: Pick<ServerBranding, \"favicon\">,\n tools: Iterable<{ definition: LandingPageTool }>,\n prompts: Iterable<{ definition: LandingPagePrompt }>,\n resources: Iterable<{ definition: LandingPageResource }>\n): Response {\n const origin = resolveServerOrigin(request);\n const url = new URL(basePath, `${origin}/`).href;\n const html = generateLandingPage({\n ...config,\n url,\n ...(branding.favicon !== undefined && {\n iconUrl: new URL(\"/favicon.ico\", `${origin}/`).href,\n }),\n tools: Array.from(tools, (entry) => entry.definition),\n prompts: Array.from(prompts, (entry) => entry.definition),\n resources: Array.from(resources, (entry) => entry.definition),\n });\n return new Response(request.method === \"HEAD\" ? null : html, {\n status: 200,\n headers: {\n \"cache-control\": \"no-store\",\n \"content-type\": \"text/html; charset=utf-8\",\n \"x-content-type-options\": \"nosniff\",\n },\n });\n}\n"],"mappings":";;;;;;;;AAwBO,SAAS,0BACd,SACA,UACA,QAIA,UACA,OACA,SACA,WACU;AACV,QAAM,SAAS,oBAAoB,OAAO;AAC1C,QAAM,MAAM,IAAI,IAAI,UAAU,GAAG,MAAM,GAAG,EAAE;AAC5C,QAAM,OAAO,oBAAoB;AAAA,IAC/B,GAAG;AAAA,IACH;AAAA,IACA,GAAI,SAAS,YAAY,UAAa;AAAA,MACpC,SAAS,IAAI,IAAI,gBAAgB,GAAG,MAAM,GAAG,EAAE;AAAA,IACjD;AAAA,IACA,OAAO,MAAM,KAAK,OAAO,CAAC,UAAU,MAAM,UAAU;AAAA,IACpD,SAAS,MAAM,KAAK,SAAS,CAAC,UAAU,MAAM,UAAU;AAAA,IACxD,WAAW,MAAM,KAAK,WAAW,CAAC,UAAU,MAAM,UAAU;AAAA,EAC9D,CAAC;AACD,SAAO,IAAI,SAAS,QAAQ,WAAW,SAAS,OAAO,MAAM;AAAA,IAC3D,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,0BAA0B;AAAA,IAC5B;AAAA,EACF,CAAC;AACH;","names":[]}
|