convex 1.45.0-alpha.0 → 1.45.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/browser.bundle.js +1 -1
  3. package/dist/browser.bundle.js.map +1 -1
  4. package/dist/cjs/cli/lib/indexes.js +1 -1
  5. package/dist/cjs/cli/lib/indexes.js.map +1 -1
  6. package/dist/cjs/cli/mcp.js +16 -6
  7. package/dist/cjs/cli/mcp.js.map +2 -2
  8. package/dist/cjs/index.js +1 -1
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/server/impl/actions_impl.js.map +2 -2
  11. package/dist/cjs/server/index.js.map +2 -2
  12. package/dist/cjs-types/cli/mcp.d.ts.map +1 -1
  13. package/dist/cjs-types/index.d.ts +1 -1
  14. package/dist/cjs-types/index.d.ts.map +1 -1
  15. package/dist/cjs-types/server/impl/actions_impl.d.ts +14 -0
  16. package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
  17. package/dist/cjs-types/server/index.d.ts +1 -0
  18. package/dist/cjs-types/server/index.d.ts.map +1 -1
  19. package/dist/cli.bundle.cjs +1407 -8
  20. package/dist/cli.bundle.cjs.map +4 -4
  21. package/dist/esm/cli/lib/indexes.js +1 -1
  22. package/dist/esm/cli/lib/indexes.js.map +1 -1
  23. package/dist/esm/cli/mcp.js +17 -7
  24. package/dist/esm/cli/mcp.js.map +2 -2
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/server/impl/actions_impl.js.map +2 -2
  28. package/dist/esm/server/index.js.map +2 -2
  29. package/dist/esm-types/cli/mcp.d.ts.map +1 -1
  30. package/dist/esm-types/index.d.ts +1 -1
  31. package/dist/esm-types/index.d.ts.map +1 -1
  32. package/dist/esm-types/server/impl/actions_impl.d.ts +14 -0
  33. package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
  34. package/dist/esm-types/server/index.d.ts +1 -0
  35. package/dist/esm-types/server/index.d.ts.map +1 -1
  36. package/dist/react.bundle.js +1 -1
  37. package/dist/react.bundle.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/cli/lib/indexes.ts +1 -1
  40. package/src/cli/mcp.ts +29 -7
  41. package/src/index.ts +1 -1
  42. package/src/server/impl/actions_impl.ts +3 -1
  43. package/src/server/index.ts +0 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "convex",
3
3
  "description": "Client for the Convex Cloud",
4
- "version": "1.45.0-alpha.0",
4
+ "version": "1.45.0",
5
5
  "author": "Convex, Inc. <no-reply@convex.dev>",
6
6
  "homepage": "https://convex.dev",
7
7
  "repository": {
@@ -38,7 +38,7 @@ export function addProgressLinkIfSlow(
38
38
  if (Date.now() - start > 10_000) {
39
39
  const dashboardUrl = deploymentDashboardUrlPage(
40
40
  deploymentName,
41
- `/data?showSchema=true`,
41
+ `/schema?showSchema=true`,
42
42
  );
43
43
  msg = msg.concat(`\nSee progress here: ${dashboardUrl}`);
44
44
  }
package/src/cli/mcp.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from "@commander-js/extra-typings";
2
2
  import { oneoffContext } from "../bundler/context.js";
3
+ import { logError } from "../bundler/log.js";
3
4
  import { CallToolRequest, Server } from "@modelcontextprotocol/server";
4
- import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
5
+ import { serveStdio } from "@modelcontextprotocol/server/stdio";
5
6
  import { actionDescription } from "./lib/command.js";
6
7
  import { checkAuthorization } from "./lib/login.js";
7
8
  import {
@@ -57,11 +58,10 @@ mcp
57
58
  .action(async (options) => {
58
59
  const ctx = await oneoffContext(options);
59
60
  try {
60
- const server = makeServer(options);
61
- const transport = new StdioServerTransport();
62
- await server.connect(transport);
63
- // Keep the process running
64
- await new Promise(() => {});
61
+ // `serveStdio` only calls the factory once a client connects, and answers
62
+ // a factory throw with an opaque `-32603`, so reject a bad
63
+ // `--disable-tools` here instead.
64
+ enabledTools(options);
65
65
  } catch (error: any) {
66
66
  await ctx.crash({
67
67
  exitCode: 1,
@@ -70,9 +70,27 @@ mcp
70
70
  printedMessage: `Failed to start MCP server: ${error}`,
71
71
  });
72
72
  }
73
+ // The SDK picks the era from the client's opening message: a request
74
+ // carrying the 2026-07-28 `_meta` envelope pins a stateless connection,
75
+ // while an `initialize` is still served by the same factory over the legacy
76
+ // protocol.
77
+ // The returned handle's `close()` is intentionally never called: the
78
+ // server lives until the client kills the process, and process exit tears
79
+ // the transport down.
80
+ serveStdio(() => makeServer(options), {
81
+ legacy: "serve",
82
+ // The only channel for out-of-band failures (transport errors, dropped
83
+ // malformed notifications). stdout carries the protocol, so they go to
84
+ // stderr.
85
+ onerror: (error) => logError(`MCP server error: ${error.message}`),
86
+ });
87
+ // Keep the process running
88
+ await new Promise(() => {});
73
89
  });
74
90
 
75
- export function makeServer(options: McpOptions) {
91
+ function enabledTools(
92
+ options: McpOptions,
93
+ ): Record<string, ConvexTool<any, any>> {
76
94
  const disabledToolNames = new Set<string>();
77
95
  for (const toolName of options.disableTools?.split(",") ?? []) {
78
96
  const name = toolName.trim();
@@ -91,7 +109,11 @@ export function makeServer(options: McpOptions) {
91
109
  enabledToolsByName[tool.name] = tool;
92
110
  }
93
111
  }
112
+ return enabledToolsByName;
113
+ }
94
114
 
115
+ export function makeServer(options: McpOptions) {
116
+ const enabledToolsByName = enabledTools(options);
95
117
  const mutex = new Mutex();
96
118
  const server = new Server(
97
119
  {
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.45.0-alpha.0";
1
+ export const version = "1.45.0";
@@ -64,7 +64,9 @@ export function setupActionCalls(requestId: string) {
64
64
  * cached, so a later call retries.
65
65
  *
66
66
  * @param service - The service the credential may access.
67
- * @internal
67
+ * @returns A JWT to send as `Authorization: Bearer <token>`. Keep it inside
68
+ * the action: don't return it to clients or store it in environment
69
+ * variables.
68
70
  */
69
71
  export async function getServiceToken(service: "ai-gateway"): Promise<string> {
70
72
  validateArg(service, 1, "getServiceToken", "service");
@@ -103,9 +103,6 @@ export {
103
103
  internalMutationGeneric,
104
104
  internalQueryGeneric,
105
105
  } from "./impl/registration_impl.js";
106
- /**
107
- * @internal
108
- */
109
106
  export { getServiceToken } from "./impl/actions_impl.js";
110
107
  export type {
111
108
  TransactionMetric,