@lowdefy/server-dev 0.0.0-experimental-20260829140049 → 0.0.0-experimental-20260829143236
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260829143236",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -45,39 +45,39 @@
|
|
|
45
45
|
"@hono/mcp": "0.3.0",
|
|
46
46
|
"@hono/node-server": "2.0.4",
|
|
47
47
|
"@hono/vite-dev-server": "0.26.0",
|
|
48
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
49
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
50
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
51
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
52
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
53
|
-
"@lowdefy/blocks-antd-x": "0.0.0-experimental-
|
|
54
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/blocks-captcha": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/blocks-tiptap": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/connection-axios-http": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/connection-mongodb": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/docs-content": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/errors": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
68
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
69
|
-
"@lowdefy/logger": "0.0.0-experimental-
|
|
70
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
71
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
72
|
-
"@lowdefy/operators-dayjs": "0.0.0-experimental-
|
|
73
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
74
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
75
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
76
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
77
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
78
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
79
|
-
"@lowdefy/plugin-better-auth": "0.0.0-experimental-
|
|
80
|
-
"@lowdefy/websockets-core": "0.0.0-experimental-
|
|
48
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20260829143236",
|
|
49
|
+
"@lowdefy/api": "0.0.0-experimental-20260829143236",
|
|
50
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260829143236",
|
|
51
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20260829143236",
|
|
52
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260829143236",
|
|
53
|
+
"@lowdefy/blocks-antd-x": "0.0.0-experimental-20260829143236",
|
|
54
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20260829143236",
|
|
55
|
+
"@lowdefy/blocks-captcha": "0.0.0-experimental-20260829143236",
|
|
56
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20260829143236",
|
|
57
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20260829143236",
|
|
58
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20260829143236",
|
|
59
|
+
"@lowdefy/blocks-tiptap": "0.0.0-experimental-20260829143236",
|
|
60
|
+
"@lowdefy/build": "0.0.0-experimental-20260829143236",
|
|
61
|
+
"@lowdefy/client": "0.0.0-experimental-20260829143236",
|
|
62
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20260829143236",
|
|
63
|
+
"@lowdefy/connection-mongodb": "0.0.0-experimental-20260829143236",
|
|
64
|
+
"@lowdefy/docs-content": "0.0.0-experimental-20260829143236",
|
|
65
|
+
"@lowdefy/engine": "0.0.0-experimental-20260829143236",
|
|
66
|
+
"@lowdefy/errors": "0.0.0-experimental-20260829143236",
|
|
67
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260829143236",
|
|
68
|
+
"@lowdefy/layout": "0.0.0-experimental-20260829143236",
|
|
69
|
+
"@lowdefy/logger": "0.0.0-experimental-20260829143236",
|
|
70
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260829143236",
|
|
71
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20260829143236",
|
|
72
|
+
"@lowdefy/operators-dayjs": "0.0.0-experimental-20260829143236",
|
|
73
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20260829143236",
|
|
74
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20260829143236",
|
|
75
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20260829143236",
|
|
76
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20260829143236",
|
|
77
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20260829143236",
|
|
78
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20260829143236",
|
|
79
|
+
"@lowdefy/plugin-better-auth": "0.0.0-experimental-20260829143236",
|
|
80
|
+
"@lowdefy/websockets-core": "0.0.0-experimental-20260829143236",
|
|
81
81
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
82
82
|
"@tailwindcss/postcss": "4.3.1",
|
|
83
83
|
"@vitejs/plugin-react": "6.0.2",
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260829143236",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -51,39 +51,39 @@
|
|
|
51
51
|
"@hono/mcp": "0.3.0",
|
|
52
52
|
"@hono/node-server": "2.0.4",
|
|
53
53
|
"@hono/vite-dev-server": "0.26.0",
|
|
54
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/blocks-antd-x": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/blocks-captcha": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/blocks-tiptap": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
68
|
-
"@lowdefy/connection-axios-http": "0.0.0-experimental-
|
|
69
|
-
"@lowdefy/connection-mongodb": "0.0.0-experimental-
|
|
70
|
-
"@lowdefy/docs-content": "0.0.0-experimental-
|
|
71
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
72
|
-
"@lowdefy/errors": "0.0.0-experimental-
|
|
73
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
74
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
75
|
-
"@lowdefy/logger": "0.0.0-experimental-
|
|
76
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
77
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
78
|
-
"@lowdefy/operators-dayjs": "0.0.0-experimental-
|
|
79
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
80
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
81
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
82
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
83
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
84
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
85
|
-
"@lowdefy/plugin-better-auth": "0.0.0-experimental-
|
|
86
|
-
"@lowdefy/websockets-core": "0.0.0-experimental-
|
|
54
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20260829143236",
|
|
55
|
+
"@lowdefy/api": "0.0.0-experimental-20260829143236",
|
|
56
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260829143236",
|
|
57
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20260829143236",
|
|
58
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260829143236",
|
|
59
|
+
"@lowdefy/blocks-antd-x": "0.0.0-experimental-20260829143236",
|
|
60
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20260829143236",
|
|
61
|
+
"@lowdefy/blocks-captcha": "0.0.0-experimental-20260829143236",
|
|
62
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20260829143236",
|
|
63
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20260829143236",
|
|
64
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20260829143236",
|
|
65
|
+
"@lowdefy/blocks-tiptap": "0.0.0-experimental-20260829143236",
|
|
66
|
+
"@lowdefy/build": "0.0.0-experimental-20260829143236",
|
|
67
|
+
"@lowdefy/client": "0.0.0-experimental-20260829143236",
|
|
68
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20260829143236",
|
|
69
|
+
"@lowdefy/connection-mongodb": "0.0.0-experimental-20260829143236",
|
|
70
|
+
"@lowdefy/docs-content": "0.0.0-experimental-20260829143236",
|
|
71
|
+
"@lowdefy/engine": "0.0.0-experimental-20260829143236",
|
|
72
|
+
"@lowdefy/errors": "0.0.0-experimental-20260829143236",
|
|
73
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260829143236",
|
|
74
|
+
"@lowdefy/layout": "0.0.0-experimental-20260829143236",
|
|
75
|
+
"@lowdefy/logger": "0.0.0-experimental-20260829143236",
|
|
76
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260829143236",
|
|
77
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20260829143236",
|
|
78
|
+
"@lowdefy/operators-dayjs": "0.0.0-experimental-20260829143236",
|
|
79
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20260829143236",
|
|
80
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20260829143236",
|
|
81
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20260829143236",
|
|
82
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20260829143236",
|
|
83
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20260829143236",
|
|
84
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20260829143236",
|
|
85
|
+
"@lowdefy/plugin-better-auth": "0.0.0-experimental-20260829143236",
|
|
86
|
+
"@lowdefy/websockets-core": "0.0.0-experimental-20260829143236",
|
|
87
87
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
88
88
|
"@tailwindcss/postcss": "4.3.1",
|
|
89
89
|
"@vitejs/plugin-react": "6.0.2",
|
package/src/routes/mcp.js
CHANGED
|
@@ -19,6 +19,7 @@ import { createMcpServer, getMcpResourceMetadataUri, getMcpResourceUri } from '@
|
|
|
19
19
|
import { type } from '@lowdefy/helpers';
|
|
20
20
|
|
|
21
21
|
import authJson from '../../lib/build/auth.js';
|
|
22
|
+
import normalizeMcpProtocolVersionHeader from './normalizeMcpProtocolVersionHeader.js';
|
|
22
23
|
|
|
23
24
|
// The RFC 6750 challenge for the MCP resource, pointing at its RFC 9728
|
|
24
25
|
// metadata. The invalid_token extension exists for the two failures a client
|
|
@@ -65,6 +66,7 @@ function isOriginAllowed({ c, context }) {
|
|
|
65
66
|
// boundary a role or scope shortfall stays opaque inside the tool surface,
|
|
66
67
|
// never a 403 or insufficient_scope.
|
|
67
68
|
async function mcpHandler(c) {
|
|
69
|
+
normalizeMcpProtocolVersionHeader({ request: c.req.raw });
|
|
68
70
|
const context = c.get('lowdefyContext');
|
|
69
71
|
const mcpConfig = await context.readConfigFile('mcp.json');
|
|
70
72
|
if (type.isNone(mcpConfig) || mcpConfig.configured !== true) {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Claude Code merges the protocol version it negotiated (mcp-protocol-version)
|
|
18
|
+
// with a static MCP-Protocol-Version it sets on every request, and the Fetch
|
|
19
|
+
// Headers constructor folds the two spellings of one header into a single
|
|
20
|
+
// comma-joined value: "2025-11-25, 2025-11-25". @hono/mcp compares that raw
|
|
21
|
+
// string against its supported list, so a client that agrees with the server
|
|
22
|
+
// twice over is answered 404 "Unsupported protocol version" - which Claude Code
|
|
23
|
+
// shows as "MCP endpoint not found". Collapsing a repeated value to the one
|
|
24
|
+
// version it names is lossless; a header naming two DIFFERENT versions is left
|
|
25
|
+
// for the transport to refuse. Runs before the transport reads the header: the
|
|
26
|
+
// transport reads c.req.header(), which reads the raw request headers live.
|
|
27
|
+
function normalizeMcpProtocolVersionHeader({ request }) {
|
|
28
|
+
const value = request.headers.get('mcp-protocol-version');
|
|
29
|
+
if (value === null || !value.includes(',')) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const versions = [
|
|
33
|
+
...new Set(
|
|
34
|
+
value
|
|
35
|
+
.split(',')
|
|
36
|
+
.map((version) => version.trim())
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
),
|
|
39
|
+
];
|
|
40
|
+
if (versions.length !== 1) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
request.headers.set('mcp-protocol-version', versions[0]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default normalizeMcpProtocolVersionHeader;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Hono } from 'hono';
|
|
18
|
+
|
|
19
|
+
import normalizeMcpProtocolVersionHeader from './normalizeMcpProtocolVersionHeader.js';
|
|
20
|
+
|
|
21
|
+
function createApp() {
|
|
22
|
+
const app = new Hono();
|
|
23
|
+
app.post('/api/mcp', (c) => {
|
|
24
|
+
normalizeMcpProtocolVersionHeader({ request: c.req.raw });
|
|
25
|
+
return c.json({ protocolVersion: c.req.header('mcp-protocol-version') ?? null });
|
|
26
|
+
});
|
|
27
|
+
return app;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function send(headerValue) {
|
|
31
|
+
const headers = new Headers();
|
|
32
|
+
if (headerValue !== undefined) {
|
|
33
|
+
headers.set('mcp-protocol-version', headerValue);
|
|
34
|
+
}
|
|
35
|
+
const res = await createApp().request('/api/mcp', { method: 'POST', headers });
|
|
36
|
+
return (await res.json()).protocolVersion;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
test('collapses a repeated protocol version to the single version it names', async () => {
|
|
40
|
+
expect(await send('2025-11-25, 2025-11-25')).toEqual('2025-11-25');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('collapses the value the Fetch Headers constructor builds from both header spellings', async () => {
|
|
44
|
+
const headers = new Headers({
|
|
45
|
+
'mcp-protocol-version': '2025-11-25',
|
|
46
|
+
'MCP-Protocol-Version': '2025-11-25',
|
|
47
|
+
});
|
|
48
|
+
const res = await createApp().request('/api/mcp', { method: 'POST', headers });
|
|
49
|
+
expect((await res.json()).protocolVersion).toEqual('2025-11-25');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('leaves a single protocol version untouched', async () => {
|
|
53
|
+
expect(await send('2025-06-18')).toEqual('2025-06-18');
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('leaves a header naming two different versions for the transport to refuse', async () => {
|
|
57
|
+
expect(await send('2025-11-25, 2025-06-18')).toEqual('2025-11-25, 2025-06-18');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('leaves an absent header absent', async () => {
|
|
61
|
+
expect(await send(undefined)).toEqual(null);
|
|
62
|
+
});
|