@surfaces-ui/engine-mcp 0.5.0 → 0.7.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/NOTICE CHANGED
@@ -2,3 +2,53 @@ Surfaces UI
2
2
  Copyright 2026 Josh Schoen
3
3
 
4
4
  This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ --------------------------------------------------------------------------------
7
+
8
+ @surfaces-ui/icons includes drawings from Lucide (https://lucide.dev), taken
9
+ from lucide-static 1.84.0. Other packages include some of them by depending on
10
+ it or by bundling it. They are used under this license:
11
+
12
+ ISC License
13
+
14
+ Copyright (c) 2026 Lucide Icons and Contributors
15
+
16
+ Permission to use, copy, modify, and/or distribute this software for any
17
+ purpose with or without fee is hereby granted, provided that the above
18
+ copyright notice and this permission notice appear in all copies.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
21
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
22
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
23
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
25
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
26
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27
+
28
+ ---
29
+
30
+ The following Lucide icons are derived from the Feather project:
31
+
32
+ airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
33
+
34
+ The MIT License (MIT) (for the icons listed above)
35
+
36
+ Copyright (c) 2013-present Cole Bemis
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining a copy
39
+ of this software and associated documentation files (the "Software"), to deal
40
+ in the Software without restriction, including without limitation the rights
41
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
42
+ copies of the Software, and to permit persons to whom the Software is
43
+ furnished to do so, subject to the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be included in all
46
+ copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
51
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
53
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54
+ SOFTWARE.
package/dist/client.d.ts CHANGED
@@ -7,5 +7,12 @@ export interface McpSqlOptions extends QueryToolOptions {
7
7
  /** Give up connecting, or waiting for one query, after this long. Default 60 seconds. */
8
8
  timeoutMs?: number;
9
9
  }
10
+ /**
11
+ * Where a host process can leave a function to be told how long each call to
12
+ * the database's server took, in milliseconds (`globalThis[DATABASE_CALL]`).
13
+ * A global and not an import, so this file still loads in a browser; only
14
+ * the time is passed, never the statement or its answer.
15
+ */
16
+ export declare const DATABASE_CALL: unique symbol;
10
17
  /** Connects to a database's MCP server and runs statements through its query tool. */
11
18
  export declare function mcpSql(options: McpSqlOptions): McpSql;
package/dist/client.js CHANGED
@@ -1,6 +1,13 @@
1
1
  import { Client } from "@modelcontextprotocol/client";
2
2
  import { sqlOver } from "./sql.js";
3
3
  export { databaseError, findQueryTool, sqlOver } from "./sql.js";
4
+ /**
5
+ * Where a host process can leave a function to be told how long each call to
6
+ * the database's server took, in milliseconds (`globalThis[DATABASE_CALL]`).
7
+ * A global and not an import, so this file still loads in a browser; only
8
+ * the time is passed, never the statement or its answer.
9
+ */
10
+ export const DATABASE_CALL = Symbol.for("surfaces-ui.database-call");
4
11
  /** Connects to a database's MCP server and runs statements through its query tool. */
5
12
  export function mcpSql(options) {
6
13
  const timeout = options.timeoutMs ?? 60_000;
@@ -16,7 +23,18 @@ export function mcpSql(options) {
16
23
  return {
17
24
  server: client.getServerVersion()?.name ?? "",
18
25
  list: async () => (await client.listTools()).tools,
19
- call: async (name, input, { signal }) => (await client.callTool({ name, arguments: input }, { signal, timeout })),
26
+ call: async (name, input, { signal }) => {
27
+ const told = globalThis[DATABASE_CALL];
28
+ if (typeof told !== "function")
29
+ return (await client.callTool({ name, arguments: input }, { signal, timeout }));
30
+ const start = performance.now();
31
+ try {
32
+ return (await client.callTool({ name, arguments: input }, { signal, timeout }));
33
+ }
34
+ finally {
35
+ told(performance.now() - start);
36
+ }
37
+ },
20
38
  close: () => client.close(),
21
39
  };
22
40
  }, options);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"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AAC;AACd,CAAC","sourcesContent":["import { Client } from \"@modelcontextprotocol/client\";\nimport type { Transport } from \"@modelcontextprotocol/client\";\nimport type { ToolAnswer } from \"./parse.js\";\nimport { type ListedTool, type McpSql, type QueryToolOptions, sqlOver } from \"./sql.js\";\n\nexport { type ListedTool, type McpSql, type QueryToolOptions, type ToolCaller, databaseError, findQueryTool, sqlOver } from \"./sql.js\";\n\nexport interface McpSqlOptions extends QueryToolOptions {\n /** How to reach the database's MCP server. Opened once, on first use. `stdioServer` and `httpServer` build one. */\n transport(): Transport | Promise<Transport>;\n /** Give up connecting, or waiting for one query, after this long. Default 60 seconds. */\n timeoutMs?: number;\n}\n\n/** Connects to a database's MCP server and runs statements through its query tool. */\nexport function mcpSql(options: McpSqlOptions): McpSql {\n const timeout = options.timeoutMs ?? 60_000;\n return sqlOver(async () => {\n const client = new Client({ name: \"surfaces-ui\", version: \"0\" });\n try {\n await client.connect(await options.transport(), { timeout });\n } catch (error) {\n await client.close().catch(() => {});\n throw error;\n }\n return {\n server: client.getServerVersion()?.name ?? \"\",\n list: async () => (await client.listTools()).tools as ListedTool[],\n call: async (name, input, { signal }) => (await client.callTool({ name, arguments: input }, { signal, timeout })) as ToolAnswer,\n close: () => client.close(),\n };\n }, options);\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,OAAO,EAAuD,OAAO,EAAE,MAAM,UAAU,CAAC;AAExF,OAAO,EAAwE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AASvI;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAErE,sFAAsF;AACtF,MAAM,UAAU,MAAM,CAAC,OAAsB;IAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;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GAAG,KAAK,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;YACD,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;SAC5B,CAAC;IACJ,CAAC,EAAE,OAAO,CAAC,CAAC;AACd,CAAC","sourcesContent":["import { Client } from \"@modelcontextprotocol/client\";\nimport type { Transport } from \"@modelcontextprotocol/client\";\nimport type { ToolAnswer } from \"./parse.js\";\nimport { type ListedTool, type McpSql, type QueryToolOptions, sqlOver } from \"./sql.js\";\n\nexport { type ListedTool, type McpSql, type QueryToolOptions, type ToolCaller, databaseError, findQueryTool, sqlOver } from \"./sql.js\";\n\nexport interface McpSqlOptions extends QueryToolOptions {\n /** How to reach the database's MCP server. Opened once, on first use. `stdioServer` and `httpServer` build one. */\n transport(): Transport | Promise<Transport>;\n /** Give up connecting, or waiting for one query, after this long. Default 60 seconds. */\n timeoutMs?: number;\n}\n\n/**\n * Where a host process can leave a function to be told how long each call to\n * the database's server took, in milliseconds (`globalThis[DATABASE_CALL]`).\n * A global and not an import, so this file still loads in a browser; only\n * the time is passed, never the statement or its answer.\n */\nexport const DATABASE_CALL = Symbol.for(\"surfaces-ui.database-call\");\n\n/** Connects to a database's MCP server and runs statements through its query tool. */\nexport function mcpSql(options: McpSqlOptions): McpSql {\n const timeout = options.timeoutMs ?? 60_000;\n return sqlOver(async () => {\n const client = new Client({ name: \"surfaces-ui\", version: \"0\" });\n try {\n await client.connect(await options.transport(), { timeout });\n } catch (error) {\n await client.close().catch(() => {});\n throw error;\n }\n return {\n server: client.getServerVersion()?.name ?? \"\",\n list: async () => (await client.listTools()).tools as ListedTool[],\n call: async (name, input, { signal }) => {\n const told = (globalThis as { [DATABASE_CALL]?: unknown })[DATABASE_CALL];\n if (typeof told !== \"function\") return (await client.callTool({ name, arguments: input }, { signal, timeout })) as ToolAnswer;\n const start = performance.now();\n try {\n return (await client.callTool({ name, arguments: input }, { signal, timeout })) as ToolAnswer;\n } finally {\n (told as (ms: number) => void)(performance.now() - start);\n }\n },\n close: () => client.close(),\n };\n }, options);\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { Transport } from "@modelcontextprotocol/client";
2
2
  import type { Engine } from "@surfaces-ui/engine";
3
3
  import { type McpSqlOptions } from "./client.js";
4
4
  import { type McpEngineSettings } from "./engine.js";
5
- export { type ListedTool, type McpSql, type McpSqlOptions, type QueryToolOptions, type ToolCaller, databaseError, findQueryTool, mcpSql, sqlOver } from "./client.js";
5
+ export { type ListedTool, type McpSql, type McpSqlOptions, type QueryToolOptions, type ToolCaller, DATABASE_CALL, databaseError, findQueryTool, mcpSql, sqlOver } from "./client.js";
6
6
  export { type McpEngineSettings, createMcpEngineOver, standardType, teradataMcpClient, typeOfValues } from "./engine.js";
7
7
  export interface McpEngineOptions extends McpSqlOptions, McpEngineSettings {
8
8
  }
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
2
2
  import { mcpSql } from "./client.js";
3
3
  import { createMcpEngineOver } from "./engine.js";
4
- export { databaseError, findQueryTool, mcpSql, sqlOver } from "./client.js";
4
+ export { DATABASE_CALL, databaseError, findQueryTool, mcpSql, sqlOver } from "./client.js";
5
5
  export { createMcpEngineOver, standardType, teradataMcpClient, typeOfValues } from "./engine.js";
6
6
  /** The engine over a database's MCP server that this process connects to. */
7
7
  export function createMcpEngine(options) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAI7E,OAAO,EAAsB,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAA0B,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAA4F,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtK,OAAO,EAA0B,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIzH,6EAA6E;AAC7E,MAAM,UAAU,eAAe,CAAC,OAAyB;IACvD,OAAO,mBAAmB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;AAC1H,CAAC;AACD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAiD,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,OAAO,GAAuE,EAAE;IACtH,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QAChC,OAAO,IAAI,6BAA6B,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACvK,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { StreamableHTTPClientTransport } from \"@modelcontextprotocol/client\";\nimport type { Transport } from \"@modelcontextprotocol/client\";\n\nimport type { Engine } from \"@surfaces-ui/engine\";\nimport { type McpSqlOptions, mcpSql } from \"./client.js\";\nimport { type McpEngineSettings, createMcpEngineOver } from \"./engine.js\";\n\nexport { type ListedTool, type McpSql, type McpSqlOptions, type QueryToolOptions, type ToolCaller, databaseError, findQueryTool, mcpSql, sqlOver } from \"./client.js\";\nexport { type McpEngineSettings, createMcpEngineOver, standardType, teradataMcpClient, typeOfValues } from \"./engine.js\";\n\nexport interface McpEngineOptions extends McpSqlOptions, McpEngineSettings {}\n\n/** The engine over a database's MCP server that this process connects to. */\nexport function createMcpEngine(options: McpEngineOptions): Promise<Engine> {\n return createMcpEngineOver((always) => mcpSql({ ...options, arguments: { ...always, ...options.arguments } }), options);\n}\nexport { inlineParams, literal } from \"./literal.js\";\nexport { type SqlColumn, type SqlRows, type ToolAnswer, readRows, toolError } from \"./parse.js\";\nexport { pythonLiteral } from \"./python.js\";\n\n/**\n * A database's MCP server over Streamable HTTP. `token` is called per\n * connection and its value sent as a bearer token; the host reads it from\n * its own environment or vault, never from config.\n */\nexport function httpServer(url: string, options: { token?(): string | undefined; headers?: Record<string, string> } = {}): () => Transport {\n return () => {\n const token = options.token?.();\n return new StreamableHTTPClientTransport(new URL(url), { requestInit: { headers: { ...options.headers, ...(token ? { Authorization: `Bearer ${token}` } : {}) } } });\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAI7E,OAAO,EAAsB,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAA0B,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAA4F,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrL,OAAO,EAA0B,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIzH,6EAA6E;AAC7E,MAAM,UAAU,eAAe,CAAC,OAAyB;IACvD,OAAO,mBAAmB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;AAC1H,CAAC;AACD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAiD,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,OAAO,GAAuE,EAAE;IACtH,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QAChC,OAAO,IAAI,6BAA6B,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACvK,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { StreamableHTTPClientTransport } from \"@modelcontextprotocol/client\";\nimport type { Transport } from \"@modelcontextprotocol/client\";\n\nimport type { Engine } from \"@surfaces-ui/engine\";\nimport { type McpSqlOptions, mcpSql } from \"./client.js\";\nimport { type McpEngineSettings, createMcpEngineOver } from \"./engine.js\";\n\nexport { type ListedTool, type McpSql, type McpSqlOptions, type QueryToolOptions, type ToolCaller, DATABASE_CALL, databaseError, findQueryTool, mcpSql, sqlOver } from \"./client.js\";\nexport { type McpEngineSettings, createMcpEngineOver, standardType, teradataMcpClient, typeOfValues } from \"./engine.js\";\n\nexport interface McpEngineOptions extends McpSqlOptions, McpEngineSettings {}\n\n/** The engine over a database's MCP server that this process connects to. */\nexport function createMcpEngine(options: McpEngineOptions): Promise<Engine> {\n return createMcpEngineOver((always) => mcpSql({ ...options, arguments: { ...always, ...options.arguments } }), options);\n}\nexport { inlineParams, literal } from \"./literal.js\";\nexport { type SqlColumn, type SqlRows, type ToolAnswer, readRows, toolError } from \"./parse.js\";\nexport { pythonLiteral } from \"./python.js\";\n\n/**\n * A database's MCP server over Streamable HTTP. `token` is called per\n * connection and its value sent as a bearer token; the host reads it from\n * its own environment or vault, never from config.\n */\nexport function httpServer(url: string, options: { token?(): string | undefined; headers?: Record<string, string> } = {}): () => Transport {\n return () => {\n const token = options.token?.();\n return new StreamableHTTPClientTransport(new URL(url), { requestInit: { headers: { ...options.headers, ...(token ? { Authorization: `Bearer ${token}` } : {}) } } });\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surfaces-ui/engine-mcp",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "A database's own MCP server as a Surfaces UI engine: sorts, filters and pages run as SQL through that server's query tool (Teradata, Postgres, MySQL, DuckDB)",
5
5
  "keywords": [
6
6
  "surfaces-ui",
@@ -46,10 +46,10 @@
46
46
  "@bufbuild/protobuf": "^2.17.0",
47
47
  "@modelcontextprotocol/client": "^2.4.0",
48
48
  "apache-arrow": "^21.2.0",
49
- "@surfaces-ui/engine": "0.5.0",
50
- "@surfaces-ui/engine-teradata": "0.5.0",
51
- "@surfaces-ui/proto": "0.5.0",
52
- "@surfaces-ui/sql": "0.5.0"
49
+ "@surfaces-ui/engine": "0.7.0",
50
+ "@surfaces-ui/engine-teradata": "0.7.0",
51
+ "@surfaces-ui/proto": "0.7.0",
52
+ "@surfaces-ui/sql": "0.7.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@modelcontextprotocol/server": "^2.4.0",