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.
- package/CHANGELOG.md +8 -1
- package/dist/browser.bundle.js +1 -1
- package/dist/browser.bundle.js.map +1 -1
- package/dist/cjs/cli/lib/indexes.js +1 -1
- package/dist/cjs/cli/lib/indexes.js.map +1 -1
- package/dist/cjs/cli/mcp.js +16 -6
- package/dist/cjs/cli/mcp.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server/impl/actions_impl.js.map +2 -2
- package/dist/cjs/server/index.js.map +2 -2
- package/dist/cjs-types/cli/mcp.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/index.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/actions_impl.d.ts +14 -0
- package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/index.d.ts +1 -0
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +1407 -8
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/cli/lib/indexes.js +1 -1
- package/dist/esm/cli/lib/indexes.js.map +1 -1
- package/dist/esm/cli/mcp.js +17 -7
- package/dist/esm/cli/mcp.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server/impl/actions_impl.js.map +2 -2
- package/dist/esm/server/index.js.map +2 -2
- package/dist/esm-types/cli/mcp.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/index.d.ts.map +1 -1
- package/dist/esm-types/server/impl/actions_impl.d.ts +14 -0
- package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/esm-types/server/index.d.ts +1 -0
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/react.bundle.js +1 -1
- package/dist/react.bundle.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/lib/indexes.ts +1 -1
- package/src/cli/mcp.ts +29 -7
- package/src/index.ts +1 -1
- package/src/server/impl/actions_impl.ts +3 -1
- package/src/server/index.ts +0 -3
package/package.json
CHANGED
package/src/cli/lib/indexes.ts
CHANGED
|
@@ -38,7 +38,7 @@ export function addProgressLinkIfSlow(
|
|
|
38
38
|
if (Date.now() - start > 10_000) {
|
|
39
39
|
const dashboardUrl = deploymentDashboardUrlPage(
|
|
40
40
|
deploymentName,
|
|
41
|
-
`/
|
|
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 {
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
* @
|
|
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");
|
package/src/server/index.ts
CHANGED