@emseepea/server 0.25.9 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,6 +18,10 @@ eligibility, and support limits. See the
18
18
  [protocol coverage ledger](https://github.com/emseepea/emseepea/blob/main/docs/protocol-coverage.md)
19
19
  for the supported MCP subset and gaps.
20
20
 
21
+ ## Expose MCP tools in a browser
22
+
23
+ Use the optional `@emseepea/server/webmcp` entry point to register the tools from an existing connected MCP client. Follow [Expose MCP tools in a browser](https://emseepea.github.io/emseepea/webmcp/) for setup, optional filtering, cleanup and compatibility limits.
24
+
21
25
  ## Render a bounded result view
22
26
 
23
27
  Follow [Render an accessible result card](https://emseepea.github.io/emseepea/result-cards/)
@@ -0,0 +1,81 @@
1
+ /** Browser-only entry point: no server or transport runtime is imported. */
2
+ export interface McpWebTool {
3
+ readonly name: string;
4
+ readonly title?: string;
5
+ readonly description?: string;
6
+ readonly inputSchema: {
7
+ readonly type: "object";
8
+ readonly [key: string]: unknown;
9
+ };
10
+ readonly outputSchema?: unknown;
11
+ readonly annotations?: {
12
+ readonly readOnlyHint?: boolean;
13
+ readonly [key: string]: unknown;
14
+ };
15
+ }
16
+ export interface McpWebResult {
17
+ readonly content: readonly unknown[];
18
+ readonly isError?: boolean;
19
+ readonly structuredContent?: unknown;
20
+ }
21
+ /** The caller owns connection, authentication, endpoint selection and closing. */
22
+ export interface McpWebClient {
23
+ listTools(params?: {
24
+ cursor?: string;
25
+ }, options?: McpWebRequestOptions): Promise<{
26
+ tools: readonly McpWebTool[];
27
+ nextCursor?: string;
28
+ }>;
29
+ callTool(params: {
30
+ name: string;
31
+ arguments: Record<string, unknown>;
32
+ }, options?: McpWebRequestOptions): Promise<McpWebResult>;
33
+ }
34
+ export interface McpWebRequestOptions {
35
+ readonly signal?: AbortSignal;
36
+ }
37
+ export interface WebMcpTool {
38
+ readonly name: string;
39
+ readonly title?: string;
40
+ readonly description: string;
41
+ readonly inputSchema: McpWebTool["inputSchema"];
42
+ readonly annotations: {
43
+ readonly readOnlyHint?: boolean;
44
+ readonly consequentialHint: boolean;
45
+ readonly untrustedContentHint: true;
46
+ };
47
+ readonly execute: (input: Record<string, unknown>, options?: {
48
+ signal?: AbortSignal;
49
+ }) => Promise<string>;
50
+ }
51
+ /** Structural subset of the experimental browser API. */
52
+ export interface WebMcpModelContext {
53
+ getTools(): Promise<readonly {
54
+ name: string;
55
+ }[]>;
56
+ registerTool(tool: WebMcpTool, options: {
57
+ signal: AbortSignal;
58
+ }): Promise<void>;
59
+ }
60
+ export interface RegisterWebMcpOptions {
61
+ readonly client: McpWebClient;
62
+ readonly modelContext?: WebMcpModelContext;
63
+ /** All discovered tools are selected when this predicate is absent. */
64
+ readonly filter?: (tool: McpWebTool) => boolean;
65
+ readonly signal?: AbortSignal;
66
+ }
67
+ export type WebMcpRegistration = {
68
+ readonly available: false;
69
+ } | {
70
+ readonly available: true;
71
+ readonly tools: readonly string[];
72
+ /** MCP outputSchema describes structuredContent, not the complete result. */
73
+ readonly unsupported: readonly {
74
+ readonly tool: string;
75
+ readonly capability: "outputSchema";
76
+ }[];
77
+ readonly dispose: () => void;
78
+ };
79
+ /** Register the client-visible catalogue. Dispose before account/client changes. */
80
+ export declare function registerWebMcp(options: RegisterWebMcpOptions): Promise<WebMcpRegistration>;
81
+ //# sourceMappingURL=webmcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webmcp.d.ts","sourceRoot":"","sources":["../src/webmcp.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;QAAC,QAA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;KAAE,EAAE,CAAC;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEJ,oFAAoF;AACpF,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4EhG"}
package/dist/webmcp.js ADDED
@@ -0,0 +1,109 @@
1
+ /** Register the client-visible catalogue. Dispose before account/client changes. */
2
+ export async function registerWebMcp(options) {
3
+ const modelContext = options.modelContext ?? (typeof document === "undefined" ? undefined :
4
+ document.modelContext);
5
+ if (!modelContext)
6
+ return { available: false };
7
+ const lifetime = new AbortController();
8
+ const signal = options.signal ? AbortSignal.any([lifetime.signal, options.signal]) : lifetime.signal;
9
+ try {
10
+ const tools = [];
11
+ const names = new Set();
12
+ const cursors = new Set();
13
+ let cursor;
14
+ do {
15
+ const page = await run(signal, (requestSignal) => options.client.listTools(cursor === undefined ? undefined : { cursor }, { signal: requestSignal }));
16
+ for (const tool of page.tools) {
17
+ if (names.has(tool.name))
18
+ throw new Error("Duplicate MCP tool name.");
19
+ names.add(tool.name);
20
+ const snapshot = JSON.parse(json(tool));
21
+ if (!options.filter || options.filter(snapshot))
22
+ tools.push(snapshot);
23
+ }
24
+ cursor = page.nextCursor;
25
+ if (cursor !== undefined) {
26
+ if (cursors.has(cursor))
27
+ throw new Error("Repeated MCP catalogue cursor.");
28
+ cursors.add(cursor);
29
+ }
30
+ } while (cursor !== undefined);
31
+ const registered = await run(signal, () => modelContext.getTools());
32
+ if (tools.some((tool) => registered.some(({ name }) => name === tool.name))) {
33
+ throw new Error("WebMCP tool name collision.");
34
+ }
35
+ for (const tool of tools) {
36
+ const readOnly = tool.annotations?.readOnlyHint;
37
+ await run(signal, () => modelContext.registerTool({
38
+ name: tool.name,
39
+ ...(tool.title === undefined ? {} : { title: tool.title }),
40
+ description: tool.description ?? tool.title ?? tool.name,
41
+ inputSchema: tool.inputSchema,
42
+ annotations: {
43
+ ...(readOnly === undefined ? {} : { readOnlyHint: readOnly }),
44
+ consequentialHint: readOnly !== true,
45
+ untrustedContentHint: true,
46
+ },
47
+ async execute(input, execution) {
48
+ const callSignal = execution?.signal ? AbortSignal.any([signal, execution.signal]) : signal;
49
+ if (callSignal.aborted)
50
+ return failure("not-dispatched");
51
+ let args;
52
+ try {
53
+ if (!input || typeof input !== "object" || Array.isArray(input))
54
+ throw new Error("input");
55
+ args = JSON.parse(json(input));
56
+ }
57
+ catch {
58
+ return failure("not-dispatched");
59
+ }
60
+ let dispatched = false;
61
+ try {
62
+ return await run(callSignal, async (requestSignal) => {
63
+ requestSignal.throwIfAborted();
64
+ dispatched = true;
65
+ return json(await options.client.callTool({ name: tool.name, arguments: args }, { signal: requestSignal }));
66
+ });
67
+ }
68
+ catch {
69
+ return failure(dispatched ? "unknown" : "not-dispatched");
70
+ }
71
+ },
72
+ }, { signal }));
73
+ }
74
+ signal.throwIfAborted();
75
+ return {
76
+ available: true,
77
+ tools: Object.freeze(tools.map(({ name }) => name)),
78
+ unsupported: Object.freeze(tools.filter((tool) => tool.outputSchema !== undefined)
79
+ .map(({ name }) => Object.freeze({ tool: name, capability: "outputSchema" }))),
80
+ dispose: () => lifetime.abort(),
81
+ };
82
+ }
83
+ catch {
84
+ lifetime.abort();
85
+ throw new Error("WebMCP registration failed. Check browser support, catalogue names and the client session.");
86
+ }
87
+ }
88
+ function json(value) {
89
+ const result = JSON.stringify(value);
90
+ if (result === undefined)
91
+ throw new Error("Expected JSON.");
92
+ return result;
93
+ }
94
+ function failure(outcome) {
95
+ return JSON.stringify({ isError: true, outcome, content: [{ type: "text", text: outcome === "unknown"
96
+ ? "The server outcome is unknown. The operation may have completed. Do not automatically retry."
97
+ : "No MCP call was dispatched. Check the input and active client session." }] });
98
+ }
99
+ /** Honor cancellation even when a caller-owned client ignores its signal. */
100
+ function run(signal, work) {
101
+ signal.throwIfAborted();
102
+ return new Promise((resolve, reject) => {
103
+ const cleanup = () => signal.removeEventListener("abort", abort);
104
+ const abort = () => { cleanup(); reject(new Error("WebMCP operation cancelled.")); };
105
+ signal.addEventListener("abort", abort, { once: true });
106
+ Promise.resolve().then(() => { signal.throwIfAborted(); return work(signal); }).then((value) => { cleanup(); resolve(value); }, (error) => { cleanup(); reject(error); });
107
+ });
108
+ }
109
+ //# sourceMappingURL=webmcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webmcp.js","sourceRoot":"","sources":["../src/webmcp.ts"],"names":[],"mappings":"AAiEA,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAA8B;IACjE,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACxF,QAA6D,CAAC,YAAY,CAAC,CAAC;IAC/E,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;IACrG,IAAI,CAAC;QACH,MAAM,KAAK,GAAiB,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;QAChC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,IAAI,MAA0B,CAAC;QAC/B,GAAG,CAAC;YACF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CACxE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAA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AAC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAClF,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACzC,CAAC,KAAc,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAClD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/server",
3
- "version": "0.25.9",
3
+ "version": "0.26.0",
4
4
  "description": "Fastify-first framework for Model Context Protocol 2026-07-28 servers over Streamable HTTP",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,6 +43,10 @@
43
43
  "./events-google-worker": {
44
44
  "types": "./dist/events-google-worker.d.ts",
45
45
  "import": "./dist/events-google-worker.js"
46
+ },
47
+ "./webmcp": {
48
+ "types": "./dist/webmcp.d.ts",
49
+ "import": "./dist/webmcp.js"
46
50
  }
47
51
  },
48
52
  "files": [
@@ -53,7 +57,7 @@
53
57
  "scripts": {
54
58
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.type-tests.json",
55
59
  "test": "npm run test:built",
56
- "test:built": "node --test test/*.test.js",
60
+ "test:built": "node --test test/*.test.js && node --test test/webmcp-*.integration.mjs",
57
61
  "test:postgres": "node test/with-postgres-capture.mjs",
58
62
  "test:postgres:lifecycle": "node test/with-postgres-lifecycle.mjs",
59
63
  "test:postgres:delivery": "node test/with-postgres-delivery.mjs",
@@ -63,10 +67,10 @@
63
67
  "dependencies": {
64
68
  "@opentelemetry/api": "1.9.1",
65
69
  "@opentelemetry/api-logs": "0.221.0",
66
- "@modelcontextprotocol/core": "2.3.1",
70
+ "@modelcontextprotocol/core": "2.4.0",
67
71
  "@modelcontextprotocol/fastify": "2.0.1",
68
- "@modelcontextprotocol/node": "2.1.1",
69
- "@modelcontextprotocol/server": "2.3.1",
72
+ "@modelcontextprotocol/node": "2.1.2",
73
+ "@modelcontextprotocol/server": "2.4.0",
70
74
  "fastify": "5.12.6",
71
75
  "zod": "4.6.6"
72
76
  },