varmory 1.0.4 → 1.0.6
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 +13 -18
- package/dist/index.css +2 -2
- package/dist/varmory.mjs +14993 -10236
- package/dist/varmory.umd.js +532 -1483
- package/mcp/server.js +12 -10
- package/mcp/showcaseMcp.js +418 -112
- package/package.json +4 -4
- package/src/varmory/includes/normalizeQuasarApi.js +117 -0
- package/src/varmory/includes/package.json +1 -0
- package/dist/common-5lNzIzpb.mjs +0 -4
- package/dist/common-BKsX7fo_.mjs +0 -4
- package/dist/common-CF3aHLu9.mjs +0 -4
- package/dist/common-Choo61Du.mjs +0 -4
- package/dist/dark-BA_zVRY0.mjs +0 -4
- package/dist/dark-DOaFu-4U.mjs +0 -4
- package/dist/dark-DxprdSnN.mjs +0 -4
- package/dist/dark-KePaswAd.mjs +0 -4
- package/dist/light-3fU1ZoAr.mjs +0 -4
- package/dist/light-BjJD7fqj.mjs +0 -4
- package/dist/light-DtRlFPYS.mjs +0 -4
- package/dist/light-Ti6cE728.mjs +0 -4
package/mcp/server.js
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'path';
|
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import Fastify from 'fastify';
|
|
4
4
|
import fastifyStatic from '@fastify/static';
|
|
5
|
-
import cors from '@fastify/cors';
|
|
5
|
+
// import cors from '@fastify/cors';
|
|
6
6
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
7
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
8
8
|
import attachShowcase from './showcaseMcp.js';
|
|
@@ -12,7 +12,7 @@ const PORT = process.env.PORT || 3000;
|
|
|
12
12
|
|
|
13
13
|
const app = Fastify({ logger: true });
|
|
14
14
|
|
|
15
|
-
app.register(cors, { origin: true });
|
|
15
|
+
// app.register(cors, { origin: true });
|
|
16
16
|
|
|
17
17
|
// Serve the built SPA from ../demo
|
|
18
18
|
app.register(fastifyStatic, {
|
|
@@ -23,13 +23,13 @@ app.register(fastifyStatic, {
|
|
|
23
23
|
// MCP Streamable HTTP transport — stateless, one server per request
|
|
24
24
|
// CORS headers are set on the raw response since reply.hijack() bypasses Fastify's pipeline
|
|
25
25
|
app.all('/mcp', async (request, reply) => {
|
|
26
|
-
const origin = request.headers.origin;
|
|
27
|
-
if (origin) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
26
|
+
// const origin = request.headers.origin;
|
|
27
|
+
// if (origin) {
|
|
28
|
+
// reply.raw.setHeader('Access-Control-Allow-Origin', origin);
|
|
29
|
+
// reply.raw.setHeader('Access-Control-Allow-Methods', 'GET, POST, DELETE, OPTIONS');
|
|
30
|
+
// reply.raw.setHeader('Access-Control-Allow-Headers', 'Content-Type, Accept, Mcp-Session-Id');
|
|
31
|
+
// reply.raw.setHeader('Access-Control-Expose-Headers', 'Mcp-Session-Id');
|
|
32
|
+
// }
|
|
33
33
|
|
|
34
34
|
if (request.method === 'OPTIONS') {
|
|
35
35
|
reply.raw.writeHead(204);
|
|
@@ -38,7 +38,9 @@ app.all('/mcp', async (request, reply) => {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const server = new McpServer({ name: 'varmory', version: '1.0.0' });
|
|
41
|
-
|
|
41
|
+
// rootDir = repo root (one level up from this file); enables filesystem
|
|
42
|
+
// scanning of the showcase layout + Quasar src.
|
|
43
|
+
attachShowcase(server, { rootDir: path.join(__dirname, '..') });
|
|
42
44
|
|
|
43
45
|
const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
|
|
44
46
|
await server.connect(transport);
|