skybridge 1.0.3 → 1.0.4

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 (46) hide show
  1. package/dist/cli/build-helpers.d.ts +7 -0
  2. package/dist/cli/build-helpers.js +82 -0
  3. package/dist/cli/build-helpers.js.map +1 -0
  4. package/dist/cli/build-helpers.test.d.ts +1 -0
  5. package/dist/cli/build-helpers.test.js +64 -0
  6. package/dist/cli/build-helpers.test.js.map +1 -0
  7. package/dist/cli/detect-port.d.ts +2 -2
  8. package/dist/cli/detect-port.js +9 -20
  9. package/dist/cli/detect-port.js.map +1 -1
  10. package/dist/commands/build.d.ts +0 -1
  11. package/dist/commands/build.js +17 -14
  12. package/dist/commands/build.js.map +1 -1
  13. package/dist/commands/start.js +7 -1
  14. package/dist/commands/start.js.map +1 -1
  15. package/dist/server/build-manifest.test.d.ts +1 -0
  16. package/dist/server/build-manifest.test.js +27 -0
  17. package/dist/server/build-manifest.test.js.map +1 -0
  18. package/dist/server/express.test.js +30 -0
  19. package/dist/server/express.test.js.map +1 -1
  20. package/dist/server/index.d.ts +1 -1
  21. package/dist/server/index.js +1 -1
  22. package/dist/server/index.js.map +1 -1
  23. package/dist/server/server.d.ts +10 -27
  24. package/dist/server/server.js +39 -0
  25. package/dist/server/server.js.map +1 -1
  26. package/dist/web/bridges/apps-sdk/adaptor.d.ts +1 -0
  27. package/dist/web/bridges/apps-sdk/adaptor.js +4 -0
  28. package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -1
  29. package/dist/web/bridges/mcp-app/adaptor.d.ts +2 -1
  30. package/dist/web/bridges/mcp-app/adaptor.js +3 -0
  31. package/dist/web/bridges/mcp-app/adaptor.js.map +1 -1
  32. package/dist/web/bridges/mcp-app/bridge.d.ts +3 -2
  33. package/dist/web/bridges/mcp-app/bridge.js +22 -1
  34. package/dist/web/bridges/mcp-app/bridge.js.map +1 -1
  35. package/dist/web/bridges/mcp-app/view-tools.test.d.ts +1 -0
  36. package/dist/web/bridges/mcp-app/view-tools.test.js +144 -0
  37. package/dist/web/bridges/mcp-app/view-tools.test.js.map +1 -0
  38. package/dist/web/bridges/types.d.ts +34 -1
  39. package/dist/web/bridges/types.js.map +1 -1
  40. package/dist/web/hooks/index.d.ts +1 -0
  41. package/dist/web/hooks/index.js +1 -0
  42. package/dist/web/hooks/index.js.map +1 -1
  43. package/dist/web/hooks/use-register-view-tool.d.ts +38 -0
  44. package/dist/web/hooks/use-register-view-tool.js +50 -0
  45. package/dist/web/hooks/use-register-view-tool.js.map +1 -0
  46. package/package.json +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"express.test.js","sourceRoot":"","sources":["../../src/server/express.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,oBAAoB,EAAE,GAAG,EAAE,CACzB,CAAC,CAAC,IAAa,EAAE,IAAa,EAAE,IAAgB,EAAE,EAAE,CAClD,IAAI,EAAE,CAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,cAAc,EAAE,CAAC,WAAoB,EAAE,EAAE,CACvC,CAAC,CAAC,IAAa,EAAE,IAAa,EAAE,IAAgB,EAAE,EAAE,CAClD,IAAI,EAAE,CAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,KAAK,UAAU,MAAM,CAAC,GAA4C;IAChE,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EA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AE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;YACzE,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACvC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;YACvD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;YAC3C,UAAU,GAAG,MAAM,CAAC;YAEpB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,oBAAoB,IAAI,qBAAqB,EAAE;gBACrE,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;YACH,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC/B,EAAE,CAAC,YAAY,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import http from \"node:http\";\nimport type { ErrorRequestHandler, RequestHandler } from \"express\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\nimport { McpServer } from \"./server.js\";\n\nvi.mock(\"@skybridge/devtools\", () => ({\n devtoolsStaticServer: () =>\n ((_req: unknown, _res: unknown, next: () => void) =>\n next()) as RequestHandler,\n}));\n\nvi.mock(\"./viewsDevServer.js\", () => ({\n viewsDevServer: (_httpServer: unknown) =>\n ((_req: unknown, _res: unknown, next: () => void) =>\n next()) as RequestHandler,\n}));\n\nasync function listen(app: Parameters<typeof http.createServer>[1]) {\n const server = http.createServer(app);\n await new Promise<void>((resolve) => server.listen(0, resolve));\n const port = (server.address() as { port: number }).port;\n return { port, server };\n}\n\nlet openServer: http.Server | undefined;\nafterEach(() => openServer?.close());\n\nasync function postMcp(port: number) {\n return fetch(`http://localhost:${port}/mcp`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ jsonrpc: \"2.0\", method: \"initialize\", id: 1 }),\n });\n}\n\nasync function postApi(port: number) {\n return fetch(`http://localhost:${port}/api/test`, { method: \"POST\" });\n}\n\ndescribe(\"McpServer.express\", () => {\n it(\"exposes a ready Express app immediately after construction\", () => {\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n expect(server.express).toBeDefined();\n expect(typeof server.express.use).toBe(\"function\");\n expect(typeof server.express.get).toBe(\"function\");\n });\n\n it(\"server.express.get registers a route reachable alongside /mcp\", async () => {\n const { createApp } = await import(\"./express.js\");\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.express.get(\"/health\", (_req, res) => {\n res.json({ status: \"ok\" });\n });\n\n const httpServer = http.createServer();\n await createApp({ mcpServer: server, httpServer });\n const { port, server: listening } = await listen(server.express);\n openServer = listening;\n\n const health = await fetch(`http://localhost:${port}/health`);\n expect(health.status).toBe(200);\n expect(await health.json()).toEqual({ status: \"ok\" });\n\n // /mcp still works (POST returns 200/4xx, not 404)\n const mcp = await postMcp(port);\n expect(mcp.status).not.toBe(404);\n });\n\n it(\"server.use and server.express.use produce the same registration order\", async () => {\n const { createApp } = await import(\"./express.js\");\n const callsA: string[] = [];\n const callsB: string[] = [];\n\n const buildServer = () => new McpServer({ name: \"t\", version: \"0.0.0\" });\n\n const sA = buildServer();\n sA.use((_req, _res, next) => {\n callsA.push(\"first\");\n next();\n });\n sA.express.use((_req, _res, next) => {\n callsA.push(\"second\");\n next();\n });\n\n const sB = buildServer();\n sB.express.use((_req, _res, next) => {\n callsB.push(\"first\");\n next();\n });\n sB.use((_req, _res, next) => {\n callsB.push(\"second\");\n next();\n });\n\n for (const s of [sA, sB]) {\n s.express.get(\"/probe\", (_req, res) => res.json({ ok: true }));\n const httpServer = http.createServer();\n await createApp({ mcpServer: s, httpServer });\n const { port, server: listening } = await listen(s.express);\n openServer = listening;\n await fetch(`http://localhost:${port}/probe`);\n listening.close();\n }\n\n expect(callsA).toEqual([\"first\", \"second\"]);\n expect(callsB).toEqual([\"first\", \"second\"]);\n });\n\n it(\"useOnError still wraps thrown /mcp errors after the route is mounted\", async () => {\n const { createApp } = await import(\"./express.js\");\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n // Register the error handler BEFORE createApp — useOnError should still\n // apply it after /mcp, so /mcp errors hit it.\n const seen: string[] = [];\n server.useOnError((_err, _req, res, _next) => {\n seen.push(\"useOnError\");\n res.status(503).json({ from: \"useOnError\" });\n });\n\n // Force the /mcp handler to throw so the error pipeline runs.\n vi.spyOn(server, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n\n const httpServer = http.createServer();\n await createApp({\n mcpServer: server,\n httpServer,\n // Mirror what run() does: forward the McpServer's useOnError handlers\n // to createApp so they get applied after /mcp.\n // biome-ignore lint/complexity/useLiteralKeys: test mirrors run() internals to verify useOnError ordering\n errorMiddleware: server[\"customErrorMiddleware\"],\n });\n const { port, server: listening } = await listen(server.express);\n openServer = listening;\n\n const res = await postMcp(port);\n expect(seen).toEqual([\"useOnError\"]);\n expect(res.status).toBe(503);\n expect(await res.json()).toEqual({ from: \"useOnError\" });\n });\n});\n\ndescribe(\"createApp\", () => {\n it(\"runs global custom middleware before the /mcp handler\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mw: RequestHandler = (_req, _res, next) => {\n calls.push(\"custom\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(mw);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"custom\"]);\n });\n\n it(\"runs path-scoped middleware on /mcp\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mw: RequestHandler = (_req, _res, next) => {\n calls.push(\"auth\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/mcp\", mw);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"auth\"]);\n });\n\n it(\"allows middleware to short-circuit with 401\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const reject: RequestHandler = (_req, res) => {\n calls.push(\"reject\");\n res.status(401).json({ error: \"Unauthorized\" });\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/mcp\", reject);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(calls).toEqual([\"reject\"]);\n expect(res.status).toBe(401);\n expect(await res.json()).toEqual({ error: \"Unauthorized\" });\n });\n\n it(\"runs multiple global middleware in registration order\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mwA: RequestHandler = (_req, _res, next) => {\n calls.push(\"A\");\n next();\n };\n const mwB: RequestHandler = (_req, _res, next) => {\n calls.push(\"B\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(mwA);\n server.use(mwB);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"A\", \"B\"]);\n });\n\n it(\"path-scoped middleware does not run on non-matching paths\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const apiMw: RequestHandler = (_req, _res, next) => {\n calls.push(\"api\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/api\", apiMw);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n // Hit /mcp — the /api middleware should NOT fire\n await postMcp(port);\n expect(calls).toEqual([]);\n });\n\n it(\"supports Express Router via custom middleware\", async () => {\n const { createApp } = await import(\"./express.js\");\n const { Router } = await import(\"express\");\n\n const router = Router();\n router.get(\"/health\", (_req, res) => {\n res.json({ status: \"ok\" });\n });\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(router as RequestHandler);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/health`);\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ status: \"ok\" });\n });\n\n it(\"supports path-prefixed Router\", async () => {\n const { createApp } = await import(\"./express.js\");\n const { Router } = await import(\"express\");\n\n const router = Router();\n router.get(\"/data\", (_req, res) => {\n res.json({ value: 42 });\n });\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/api\", router as RequestHandler);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/api/data`);\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ value: 42 });\n });\n\n it(\"server survives middleware errors without crashing\", async () => {\n const { createApp } = await import(\"./express.js\");\n\n const throwing: RequestHandler = () => {\n throw new Error(\"boom\");\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/explode\", throwing);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/explode`);\n expect(res.status).toBe(500);\n\n // Server process did not crash — it still accepts connections\n const followUp = await fetch(`http://localhost:${port}/explode`);\n expect(followUp.status).toBe(500);\n });\n\n it(\"returns 500 JSON-RPC error when the MCP handler throws and no error middleware is registered\", async () => {\n const { createApp } = await import(\"./express.js\");\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n // Force the express-level error path: make connectStatelessTransport\n // reject so the request handler hits its try/catch and calls next(error),\n // which lands in the default /mcp error handler.\n vi.spyOn(mcpServer, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(res.status).toBe(500);\n expect(await res.json()).toEqual({\n jsonrpc: \"2.0\",\n error: { code: -32603, message: \"Internal server error\" },\n id: null,\n });\n expect(consoleSpy).toHaveBeenCalledWith(\n \"Error handling MCP request:\",\n expect.any(Error),\n );\n consoleSpy.mockRestore();\n });\n\n it(\"invokes a custom error handler when the MCP handler throws\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const errorHandler: ErrorRequestHandler = (_err, _req, res, _next) => {\n calls.push(\"error-handler\");\n res.status(503).json({ custom: true });\n };\n\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n vi.spyOn(mcpServer, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n\n const httpServer = http.createServer();\n const app = await createApp({\n mcpServer,\n httpServer,\n errorMiddleware: [{ handlers: [errorHandler] }],\n });\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(calls).toEqual([\"error-handler\"]);\n expect(res.status).toBe(503);\n expect(await res.json()).toEqual({ custom: true });\n });\n\n it(\"invokes a path-scoped error handler only for matching routes\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mcpErrorHandler: ErrorRequestHandler = (_err, _req, res, _next) => {\n calls.push(\"mcp-error-handler\");\n res.status(503).json({ from: \"mcp-error-handler\" });\n };\n\n const throwingApiRoute: RequestHandler = (_req, _res, next) => {\n next(new Error(\"api error\"));\n };\n\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n vi.spyOn(mcpServer, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n mcpServer.use(\"/api/test\", throwingApiRoute);\n\n const httpServer = http.createServer();\n const app = await createApp({\n mcpServer,\n httpServer,\n errorMiddleware: [{ path: \"/mcp\", handlers: [mcpErrorHandler] }],\n });\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const mcpRes = await postMcp(port);\n expect(calls).toEqual([\"mcp-error-handler\"]);\n expect(mcpRes.status).toBe(503);\n expect(await mcpRes.json()).toEqual({ from: \"mcp-error-handler\" });\n\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n const apiRes = await postApi(port);\n expect(calls).toEqual([\"mcp-error-handler\"]);\n expect(apiRes.status).toBe(500);\n consoleSpy.mockRestore();\n });\n\n it(\"handles concurrent /mcp requests without 'Already connected to a transport'\", async () => {\n const { createApp } = await import(\"./express.js\");\n\n const mcpServer = new McpServer({\n name: \"concurrent-test\",\n version: \"0.0.0\",\n });\n // Slow tool: keeps the underlying transport bound long enough to overlap\n // with concurrent requests, exposing the shared-McpServer race.\n mcpServer.registerTool({ name: \"slow\", description: \"slow\" }, async () => {\n await new Promise((r) => setTimeout(r, 50));\n return { content: [{ type: \"text\" as const, text: \"done\" }] };\n });\n\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server } = await listen(app);\n openServer = server;\n\n const callBody = (id: number) =>\n JSON.stringify({\n jsonrpc: \"2.0\",\n method: \"tools/call\",\n id,\n params: { name: \"slow\", arguments: {} },\n });\n\n const N = 10;\n const responses = await Promise.all(\n Array.from({ length: N }, (_, i) =>\n fetch(`http://localhost:${port}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\",\n },\n body: callBody(i + 1),\n }),\n ),\n );\n\n expect(responses.map((r) => r.status)).toEqual(Array(N).fill(200));\n expect(consoleSpy).not.toHaveBeenCalledWith(\n \"Error handling MCP request:\",\n expect.any(Error),\n );\n consoleSpy.mockRestore();\n });\n});\n\ndescribe(\"createApp tunnel routes\", () => {\n it(\"proxies POST /__skybridge/tunnel to the cli control server in dev mode\", async () => {\n // Stand up a fake control listener that returns a known JSON body.\n const control = http.createServer((_req, res) => {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end('{\"status\":\"idle\"}');\n });\n await new Promise<void>((resolve) =>\n control.listen(0, \"127.0.0.1\", resolve),\n );\n const controlAddr = control.address();\n if (typeof controlAddr === \"string\" || controlAddr === null) {\n control.close();\n throw new Error(\"control server has no address\");\n }\n const controlPort = controlAddr.port;\n\n const prev = process.env.__TUNNEL_CONTROL_PORT;\n process.env.__TUNNEL_CONTROL_PORT = String(controlPort);\n try {\n const { createApp } = await import(\"./express.js\");\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server } = await listen(app);\n openServer = server;\n\n const res = await fetch(`http://localhost:${port}/__skybridge/tunnel`, {\n method: \"POST\",\n });\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ status: \"idle\" });\n } finally {\n if (prev === undefined) {\n delete process.env.__TUNNEL_CONTROL_PORT;\n } else {\n process.env.__TUNNEL_CONTROL_PORT = prev;\n }\n await new Promise<void>((resolve) => control.close(() => resolve()));\n }\n });\n\n it(\"does not expose /__skybridge/tunnel in production mode\", async () => {\n const prevEnv = process.env.NODE_ENV;\n process.env.NODE_ENV = \"production\";\n try {\n vi.resetModules();\n const { createApp } = await import(\"./express.js\");\n const { McpServer: ReloadedMcpServer } = await import(\"./server.js\");\n const mcpServer = new ReloadedMcpServer({ name: \"t\", version: \"0.0.0\" });\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server } = await listen(app);\n openServer = server;\n\n const res = await fetch(`http://localhost:${port}/__skybridge/tunnel`, {\n method: \"POST\",\n });\n expect(res.status).toBe(404);\n } finally {\n process.env.NODE_ENV = prevEnv;\n vi.resetModules();\n }\n });\n});\n"]}
1
+ {"version":3,"file":"express.test.js","sourceRoot":"","sources":["../../src/server/express.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,oBAAoB,EAAE,GAAG,EAAE,CACzB,CAAC,CAAC,IAAa,EAAE,IAAa,EAAE,IAAgB,EAAE,EAAE,CAClD,IAAI,EAAE,CAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,cAAc,EAAE,CAAC,WAAoB,EAAE,EAAE,CACvC,CAAC,CAAC,IAAa,EAAE,IAAa,EAAE,IAAgB,EAAE,EAAE,CAClD,IAAI,EAAE,CAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,KAAK,UAAU,MAAM,CAAC,GAA4C;IAChE,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,MAAM,IAAI,GAAI,MAAM,CAAC,OAAO,EAAuB,CAAC,IAAI,CAAC;IACzD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED,IAAI,UAAmC,CAAC;AACxC,SAAS,CAAC,GA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CAAC,CAAC;YACzE,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACvC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;YACvD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;YAC3C,UAAU,GAAG,MAAM,CAAC;YAEpB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,oBAAoB,IAAI,qBAAqB,EAAE;gBACrE,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;YACH,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC/B,EAAE,CAAC,YAAY,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import http from \"node:http\";\nimport type { ErrorRequestHandler, RequestHandler } from \"express\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\nimport { McpServer } from \"./server.js\";\n\nvi.mock(\"@skybridge/devtools\", () => ({\n devtoolsStaticServer: () =>\n ((_req: unknown, _res: unknown, next: () => void) =>\n next()) as RequestHandler,\n}));\n\nvi.mock(\"./viewsDevServer.js\", () => ({\n viewsDevServer: (_httpServer: unknown) =>\n ((_req: unknown, _res: unknown, next: () => void) =>\n next()) as RequestHandler,\n}));\n\nasync function listen(app: Parameters<typeof http.createServer>[1]) {\n const server = http.createServer(app);\n await new Promise<void>((resolve) => server.listen(0, resolve));\n const port = (server.address() as { port: number }).port;\n return { port, server };\n}\n\nlet openServer: http.Server | undefined;\nafterEach(() => openServer?.close());\n\nasync function postMcp(port: number) {\n return fetch(`http://localhost:${port}/mcp`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ jsonrpc: \"2.0\", method: \"initialize\", id: 1 }),\n });\n}\n\nasync function postApi(port: number) {\n return fetch(`http://localhost:${port}/api/test`, { method: \"POST\" });\n}\n\ndescribe(\"McpServer.express\", () => {\n it(\"exposes a ready Express app immediately after construction\", () => {\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n expect(server.express).toBeDefined();\n expect(typeof server.express.use).toBe(\"function\");\n expect(typeof server.express.get).toBe(\"function\");\n });\n\n it(\"server.express.get registers a route reachable alongside /mcp\", async () => {\n const { createApp } = await import(\"./express.js\");\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.express.get(\"/health\", (_req, res) => {\n res.json({ status: \"ok\" });\n });\n\n const httpServer = http.createServer();\n await createApp({ mcpServer: server, httpServer });\n const { port, server: listening } = await listen(server.express);\n openServer = listening;\n\n const health = await fetch(`http://localhost:${port}/health`);\n expect(health.status).toBe(200);\n expect(await health.json()).toEqual({ status: \"ok\" });\n\n // /mcp still works (POST returns 200/4xx, not 404)\n const mcp = await postMcp(port);\n expect(mcp.status).not.toBe(404);\n });\n\n it(\"server.use and server.express.use produce the same registration order\", async () => {\n const { createApp } = await import(\"./express.js\");\n const callsA: string[] = [];\n const callsB: string[] = [];\n\n const buildServer = () => new McpServer({ name: \"t\", version: \"0.0.0\" });\n\n const sA = buildServer();\n sA.use((_req, _res, next) => {\n callsA.push(\"first\");\n next();\n });\n sA.express.use((_req, _res, next) => {\n callsA.push(\"second\");\n next();\n });\n\n const sB = buildServer();\n sB.express.use((_req, _res, next) => {\n callsB.push(\"first\");\n next();\n });\n sB.use((_req, _res, next) => {\n callsB.push(\"second\");\n next();\n });\n\n for (const s of [sA, sB]) {\n s.express.get(\"/probe\", (_req, res) => res.json({ ok: true }));\n const httpServer = http.createServer();\n await createApp({ mcpServer: s, httpServer });\n const { port, server: listening } = await listen(s.express);\n openServer = listening;\n await fetch(`http://localhost:${port}/probe`);\n listening.close();\n }\n\n expect(callsA).toEqual([\"first\", \"second\"]);\n expect(callsB).toEqual([\"first\", \"second\"]);\n });\n\n it(\"useOnError still wraps thrown /mcp errors after the route is mounted\", async () => {\n const { createApp } = await import(\"./express.js\");\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n // Register the error handler BEFORE createApp — useOnError should still\n // apply it after /mcp, so /mcp errors hit it.\n const seen: string[] = [];\n server.useOnError((_err, _req, res, _next) => {\n seen.push(\"useOnError\");\n res.status(503).json({ from: \"useOnError\" });\n });\n\n // Force the /mcp handler to throw so the error pipeline runs.\n vi.spyOn(server, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n\n const httpServer = http.createServer();\n await createApp({\n mcpServer: server,\n httpServer,\n // Mirror what run() does: forward the McpServer's useOnError handlers\n // to createApp so they get applied after /mcp.\n // biome-ignore lint/complexity/useLiteralKeys: test mirrors run() internals to verify useOnError ordering\n errorMiddleware: server[\"customErrorMiddleware\"],\n });\n const { port, server: listening } = await listen(server.express);\n openServer = listening;\n\n const res = await postMcp(port);\n expect(seen).toEqual([\"useOnError\"]);\n expect(res.status).toBe(503);\n expect(await res.json()).toEqual({ from: \"useOnError\" });\n });\n});\n\ndescribe(\"createApp\", () => {\n it(\"runs global custom middleware before the /mcp handler\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mw: RequestHandler = (_req, _res, next) => {\n calls.push(\"custom\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(mw);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"custom\"]);\n });\n\n it(\"runs path-scoped middleware on /mcp\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mw: RequestHandler = (_req, _res, next) => {\n calls.push(\"auth\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/mcp\", mw);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"auth\"]);\n });\n\n it(\"allows middleware to short-circuit with 401\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const reject: RequestHandler = (_req, res) => {\n calls.push(\"reject\");\n res.status(401).json({ error: \"Unauthorized\" });\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/mcp\", reject);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(calls).toEqual([\"reject\"]);\n expect(res.status).toBe(401);\n expect(await res.json()).toEqual({ error: \"Unauthorized\" });\n });\n\n it(\"runs multiple global middleware in registration order\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mwA: RequestHandler = (_req, _res, next) => {\n calls.push(\"A\");\n next();\n };\n const mwB: RequestHandler = (_req, _res, next) => {\n calls.push(\"B\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(mwA);\n server.use(mwB);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"A\", \"B\"]);\n });\n\n it(\"path-scoped middleware does not run on non-matching paths\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const apiMw: RequestHandler = (_req, _res, next) => {\n calls.push(\"api\");\n next();\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/api\", apiMw);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n // Hit /mcp — the /api middleware should NOT fire\n await postMcp(port);\n expect(calls).toEqual([]);\n });\n\n it(\"supports Express Router via custom middleware\", async () => {\n const { createApp } = await import(\"./express.js\");\n const { Router } = await import(\"express\");\n\n const router = Router();\n router.get(\"/health\", (_req, res) => {\n res.json({ status: \"ok\" });\n });\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(router as RequestHandler);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/health`);\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ status: \"ok\" });\n });\n\n it(\"supports path-prefixed Router\", async () => {\n const { createApp } = await import(\"./express.js\");\n const { Router } = await import(\"express\");\n\n const router = Router();\n router.get(\"/data\", (_req, res) => {\n res.json({ value: 42 });\n });\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/api\", router as RequestHandler);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/api/data`);\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ value: 42 });\n });\n\n it(\"server survives middleware errors without crashing\", async () => {\n const { createApp } = await import(\"./express.js\");\n\n const throwing: RequestHandler = () => {\n throw new Error(\"boom\");\n };\n\n const server = new McpServer({ name: \"t\", version: \"0.0.0\" });\n server.use(\"/explode\", throwing);\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer: server, httpServer });\n\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/explode`);\n expect(res.status).toBe(500);\n\n // Server process did not crash — it still accepts connections\n const followUp = await fetch(`http://localhost:${port}/explode`);\n expect(followUp.status).toBe(500);\n });\n\n it(\"returns 500 JSON-RPC error when the MCP handler throws and no error middleware is registered\", async () => {\n const { createApp } = await import(\"./express.js\");\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n // Force the express-level error path: make connectStatelessTransport\n // reject so the request handler hits its try/catch and calls next(error),\n // which lands in the default /mcp error handler.\n vi.spyOn(mcpServer, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(res.status).toBe(500);\n expect(await res.json()).toEqual({\n jsonrpc: \"2.0\",\n error: { code: -32603, message: \"Internal server error\" },\n id: null,\n });\n expect(consoleSpy).toHaveBeenCalledWith(\n \"Error handling MCP request:\",\n expect.any(Error),\n );\n consoleSpy.mockRestore();\n });\n\n it(\"invokes a custom error handler when the MCP handler throws\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const errorHandler: ErrorRequestHandler = (_err, _req, res, _next) => {\n calls.push(\"error-handler\");\n res.status(503).json({ custom: true });\n };\n\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n vi.spyOn(mcpServer, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n\n const httpServer = http.createServer();\n const app = await createApp({\n mcpServer,\n httpServer,\n errorMiddleware: [{ handlers: [errorHandler] }],\n });\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(calls).toEqual([\"error-handler\"]);\n expect(res.status).toBe(503);\n expect(await res.json()).toEqual({ custom: true });\n });\n\n it(\"invokes a path-scoped error handler only for matching routes\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mcpErrorHandler: ErrorRequestHandler = (_err, _req, res, _next) => {\n calls.push(\"mcp-error-handler\");\n res.status(503).json({ from: \"mcp-error-handler\" });\n };\n\n const throwingApiRoute: RequestHandler = (_req, _res, next) => {\n next(new Error(\"api error\"));\n };\n\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n vi.spyOn(mcpServer, \"connectStatelessTransport\").mockRejectedValue(\n new Error(\"boom\"),\n );\n mcpServer.use(\"/api/test\", throwingApiRoute);\n\n const httpServer = http.createServer();\n const app = await createApp({\n mcpServer,\n httpServer,\n errorMiddleware: [{ path: \"/mcp\", handlers: [mcpErrorHandler] }],\n });\n const { port, server: httpListening } = await listen(app);\n openServer = httpListening;\n\n const mcpRes = await postMcp(port);\n expect(calls).toEqual([\"mcp-error-handler\"]);\n expect(mcpRes.status).toBe(503);\n expect(await mcpRes.json()).toEqual({ from: \"mcp-error-handler\" });\n\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n const apiRes = await postApi(port);\n expect(calls).toEqual([\"mcp-error-handler\"]);\n expect(apiRes.status).toBe(500);\n consoleSpy.mockRestore();\n });\n\n it(\"handles concurrent /mcp requests without 'Already connected to a transport'\", async () => {\n const { createApp } = await import(\"./express.js\");\n\n const mcpServer = new McpServer({\n name: \"concurrent-test\",\n version: \"0.0.0\",\n });\n // Slow tool: keeps the underlying transport bound long enough to overlap\n // with concurrent requests, exposing the shared-McpServer race.\n mcpServer.registerTool({ name: \"slow\", description: \"slow\" }, async () => {\n await new Promise((r) => setTimeout(r, 50));\n return { content: [{ type: \"text\" as const, text: \"done\" }] };\n });\n\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server } = await listen(app);\n openServer = server;\n\n const callBody = (id: number) =>\n JSON.stringify({\n jsonrpc: \"2.0\",\n method: \"tools/call\",\n id,\n params: { name: \"slow\", arguments: {} },\n });\n\n const N = 10;\n const responses = await Promise.all(\n Array.from({ length: N }, (_, i) =>\n fetch(`http://localhost:${port}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\",\n },\n body: callBody(i + 1),\n }),\n ),\n );\n\n expect(responses.map((r) => r.status)).toEqual(Array(N).fill(200));\n expect(consoleSpy).not.toHaveBeenCalledWith(\n \"Error handling MCP request:\",\n expect.any(Error),\n );\n consoleSpy.mockRestore();\n });\n});\n\ndescribe(\"createApp Vercel mode\", () => {\n it(\"server.run() returns the Express app without binding a port when VERCEL=1\", async () => {\n const prevVercel = process.env.VERCEL;\n const prevEnv = process.env.NODE_ENV;\n process.env.VERCEL = \"1\";\n process.env.NODE_ENV = \"production\";\n try {\n vi.resetModules();\n const { McpServer: Reloaded } = await import(\"./server.js\");\n const server = new Reloaded({ name: \"t\", version: \"0.0.0\" });\n const result = await server.run();\n expect(typeof result).toBe(\"function\");\n expect(result).toBe(server.express);\n const { port, server: listening } = await listen(server.express);\n openServer = listening;\n const res = await postMcp(port);\n expect(res.status).not.toBe(404);\n } finally {\n if (prevVercel === undefined) {\n delete process.env.VERCEL;\n } else {\n process.env.VERCEL = prevVercel;\n }\n process.env.NODE_ENV = prevEnv;\n vi.resetModules();\n }\n });\n});\n\ndescribe(\"createApp tunnel routes\", () => {\n it(\"proxies POST /__skybridge/tunnel to the cli control server in dev mode\", async () => {\n // Stand up a fake control listener that returns a known JSON body.\n const control = http.createServer((_req, res) => {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end('{\"status\":\"idle\"}');\n });\n await new Promise<void>((resolve) =>\n control.listen(0, \"127.0.0.1\", resolve),\n );\n const controlAddr = control.address();\n if (typeof controlAddr === \"string\" || controlAddr === null) {\n control.close();\n throw new Error(\"control server has no address\");\n }\n const controlPort = controlAddr.port;\n\n const prev = process.env.__TUNNEL_CONTROL_PORT;\n process.env.__TUNNEL_CONTROL_PORT = String(controlPort);\n try {\n const { createApp } = await import(\"./express.js\");\n const mcpServer = new McpServer({ name: \"t\", version: \"0.0.0\" });\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server } = await listen(app);\n openServer = server;\n\n const res = await fetch(`http://localhost:${port}/__skybridge/tunnel`, {\n method: \"POST\",\n });\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ status: \"idle\" });\n } finally {\n if (prev === undefined) {\n delete process.env.__TUNNEL_CONTROL_PORT;\n } else {\n process.env.__TUNNEL_CONTROL_PORT = prev;\n }\n await new Promise<void>((resolve) => control.close(() => resolve()));\n }\n });\n\n it(\"does not expose /__skybridge/tunnel in production mode\", async () => {\n const prevEnv = process.env.NODE_ENV;\n process.env.NODE_ENV = \"production\";\n try {\n vi.resetModules();\n const { createApp } = await import(\"./express.js\");\n const { McpServer: ReloadedMcpServer } = await import(\"./server.js\");\n const mcpServer = new ReloadedMcpServer({ name: \"t\", version: \"0.0.0\" });\n const httpServer = http.createServer();\n const app = await createApp({ mcpServer, httpServer });\n const { port, server } = await listen(app);\n openServer = server;\n\n const res = await fetch(`http://localhost:${port}/__skybridge/tunnel`, {\n method: \"POST\",\n });\n expect(res.status).toBe(404);\n } finally {\n process.env.NODE_ENV = prevEnv;\n vi.resetModules();\n }\n });\n});\n"]}
@@ -4,5 +4,5 @@ export { FileRef } from "./file-ref.js";
4
4
  export type { AnyToolRegistry, InferTools, ToolInput, ToolNames, ToolOutput, ToolResponseMetadata, } from "./inferUtilityTypes.js";
5
5
  export type { McpExtra, McpMethodString, McpMiddlewareFilter, McpMiddlewareFn, McpResultFor, McpTypedMiddlewareFn, McpWildcard, } from "./middleware.js";
6
6
  export type { HandlerContent, KnownToolMeta, McpServerTypes, SecurityScheme, ToolDef, ToolMeta, ViewConfig, ViewCsp, ViewHostType, ViewName, ViewNameRegistry, } from "./server.js";
7
- export { McpServer, normalizeContent, } from "./server.js";
7
+ export { __setBuildManifest, McpServer, normalizeContent, } from "./server.js";
8
8
  export { viewsDevServer } from "./viewsDevServer.js";
@@ -1,6 +1,6 @@
1
1
  export { InvalidTokenError, mcpAuthMetadataRouter, optionalBearerAuth, requireBearerAuth, } from "./auth.js";
2
2
  export { audio, embeddedResource, image, resourceLink, text, } from "./content-helpers.js";
3
3
  export { FileRef } from "./file-ref.js";
4
- export { McpServer, normalizeContent, } from "./server.js";
4
+ export { __setBuildManifest, McpServer, normalizeContent, } from "./server.js";
5
5
  export { viewsDevServer } from "./viewsDevServer.js";
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AA+BxC,OAAO,EACL,SAAS,EACT,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export {\n type AuthInfo,\n type AuthMetadataOptions,\n type BearerAuthMiddlewareOptions,\n InvalidTokenError,\n mcpAuthMetadataRouter,\n optionalBearerAuth,\n requireBearerAuth,\n} from \"./auth.js\";\nexport {\n audio,\n embeddedResource,\n image,\n resourceLink,\n text,\n} from \"./content-helpers.js\";\nexport { FileRef } from \"./file-ref.js\";\nexport type {\n AnyToolRegistry,\n InferTools,\n ToolInput,\n ToolNames,\n ToolOutput,\n ToolResponseMetadata,\n} from \"./inferUtilityTypes.js\";\nexport type {\n McpExtra,\n McpMethodString,\n McpMiddlewareFilter,\n McpMiddlewareFn,\n McpResultFor,\n McpTypedMiddlewareFn,\n McpWildcard,\n} from \"./middleware.js\";\nexport type {\n HandlerContent,\n KnownToolMeta,\n McpServerTypes,\n SecurityScheme,\n ToolDef,\n ToolMeta,\n ViewConfig,\n ViewCsp,\n ViewHostType,\n ViewName,\n ViewNameRegistry,\n} from \"./server.js\";\nexport {\n McpServer,\n normalizeContent,\n} from \"./server.js\";\nexport { viewsDevServer } from \"./viewsDevServer.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AA+BxC,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export {\n type AuthInfo,\n type AuthMetadataOptions,\n type BearerAuthMiddlewareOptions,\n InvalidTokenError,\n mcpAuthMetadataRouter,\n optionalBearerAuth,\n requireBearerAuth,\n} from \"./auth.js\";\nexport {\n audio,\n embeddedResource,\n image,\n resourceLink,\n text,\n} from \"./content-helpers.js\";\nexport { FileRef } from \"./file-ref.js\";\nexport type {\n AnyToolRegistry,\n InferTools,\n ToolInput,\n ToolNames,\n ToolOutput,\n ToolResponseMetadata,\n} from \"./inferUtilityTypes.js\";\nexport type {\n McpExtra,\n McpMethodString,\n McpMiddlewareFilter,\n McpMiddlewareFn,\n McpResultFor,\n McpTypedMiddlewareFn,\n McpWildcard,\n} from \"./middleware.js\";\nexport type {\n HandlerContent,\n KnownToolMeta,\n McpServerTypes,\n SecurityScheme,\n ToolDef,\n ToolMeta,\n ViewConfig,\n ViewCsp,\n ViewHostType,\n ViewName,\n ViewNameRegistry,\n} from \"./server.js\";\nexport {\n __setBuildManifest,\n McpServer,\n normalizeContent,\n} from \"./server.js\";\nexport { viewsDevServer } from \"./viewsDevServer.js\";\n"]}
@@ -199,34 +199,15 @@ interface McpServerBaseOmitted extends Omit<McpServerBase, "registerTool" | "con
199
199
  }
200
200
  declare const McpServerBaseOmitted: new (...args: ConstructorParameters<typeof McpServerBase>) => McpServerBaseOmitted;
201
201
  /**
202
- * The Skybridge server. Extends the MCP SDK's `McpServer` with a typed tool
203
- * registry, view resources, an embedded Express app, and protocol-level
204
- * middleware. Construct it with the same `Implementation` info you would pass
205
- * to the SDK, chain {@link McpServer.registerTool} calls to declare tools,
206
- * then call {@link McpServer.run} to start the HTTP server.
202
+ * Prime the build-time Vite manifest before user code constructs its
203
+ * `McpServer`. Called from the generated `dist/__entry.js`; not part of the
204
+ * user-facing API.
207
205
  *
208
- * The `TTools` generic accumulates each registered tool's input/output/meta
209
- * shape, so `typeof server` carries enough information for view-side helpers
210
- * like {@link generateHelpers} to produce fully-typed hooks.
211
- *
212
- * @typeParam TTools - Accumulated tool registry. Filled in by `registerTool`
213
- * chaining; you almost never set this manually.
214
- *
215
- * @example
216
- * ```ts
217
- * const server = new McpServer({ name: "my-app", version: "1.0.0" }, {})
218
- * .registerTool({
219
- * name: "search",
220
- * inputSchema: { query: z.string() },
221
- * view: { component: "search" },
222
- * }, async ({ query }) => ({ content: `Results for ${query}` }));
223
- *
224
- * await server.run();
225
- * export type AppType = typeof server;
226
- * ```
227
- *
228
- * @see https://docs.skybridge.tech/api-reference/mcp-server
206
+ * @internal
229
207
  */
208
+ export declare function __setBuildManifest(manifest: Record<string, {
209
+ file: string;
210
+ }>): void;
230
211
  export declare class McpServer<TTools extends Record<string, ToolDef> = Record<never, ToolDef>> extends McpServerBaseOmitted {
231
212
  readonly $types: McpServerTypes<TTools>;
232
213
  /**
@@ -336,11 +317,13 @@ export declare class McpServer<TTools extends Record<string, ToolDef> = Record<n
336
317
  *
337
318
  * On Cloudflare Workers / workerd, returns an object exposing `fetch` so
338
319
  * the runtime can bridge incoming requests to the Node HTTP server. On
320
+ * Vercel (`VERCEL === "1"`), returns the Express app directly so the
321
+ * serverless function entry can call it as a `(req, res)` handler. On
339
322
  * Node, returns `undefined` once listening.
340
323
  */
341
324
  run(): Promise<{
342
325
  fetch: (...args: unknown[]) => unknown;
343
- } | undefined>;
326
+ } | Express | undefined>;
344
327
  private enforceOneToolPerView;
345
328
  private resolveViewRequestContext;
346
329
  private registerViewResources;
@@ -65,6 +65,22 @@ const McpServerBaseOmitted = McpServerBase;
65
65
  *
66
66
  * @see https://docs.skybridge.tech/api-reference/mcp-server
67
67
  */
68
+ // Side channel populated by `dist/__entry.js` before user code is imported.
69
+ // Set at module scope rather than passed through the constructor because the
70
+ // wrapper has the manifest before the user's `new McpServer(...)` runs, and
71
+ // threading it through every call site (including user templates) is exactly
72
+ // the boilerplate this design is trying to hide.
73
+ let pendingBuildManifest = null;
74
+ /**
75
+ * Prime the build-time Vite manifest before user code constructs its
76
+ * `McpServer`. Called from the generated `dist/__entry.js`; not part of the
77
+ * user-facing API.
78
+ *
79
+ * @internal
80
+ */
81
+ export function __setBuildManifest(manifest) {
82
+ pendingBuildManifest = manifest;
83
+ }
68
84
  export class McpServer extends McpServerBaseOmitted {
69
85
  /**
70
86
  * The underlying Express app. Use this to extend the HTTP server with
@@ -93,6 +109,15 @@ export class McpServer extends McpServerBaseOmitted {
93
109
  this.serverOptions = options;
94
110
  this.express = express();
95
111
  this.express.use(express.json());
112
+ // Pick up the manifest if `dist/__entry.js` primed it before importing
113
+ // user code. Consume-once: clear after the first construction so a
114
+ // subsequent test that doesn't prime can't inherit stale state.
115
+ // Explicit `setViteManifest` calls still win because they happen after
116
+ // construction.
117
+ if (pendingBuildManifest) {
118
+ this.setViteManifest(pendingBuildManifest);
119
+ pendingBuildManifest = null;
120
+ }
96
121
  }
97
122
  use(pathOrHandler, ...handlers) {
98
123
  // Branching is load-bearing: Express's `app.use` overloads can't be
@@ -224,10 +249,24 @@ export class McpServer extends McpServerBaseOmitted {
224
249
  *
225
250
  * On Cloudflare Workers / workerd, returns an object exposing `fetch` so
226
251
  * the runtime can bridge incoming requests to the Node HTTP server. On
252
+ * Vercel (`VERCEL === "1"`), returns the Express app directly so the
253
+ * serverless function entry can call it as a `(req, res)` handler. On
227
254
  * Node, returns `undefined` once listening.
228
255
  */
229
256
  async run() {
230
257
  this.applyMcpMiddleware();
258
+ if (process.env.VERCEL === "1") {
259
+ // createApp only reads httpServer inside its dev-only branch
260
+ // (viewsDevServer); under VERCEL=1 + NODE_ENV=production it's a
261
+ // bare object passed to satisfy the required parameter.
262
+ const httpServer = http.createServer();
263
+ await createApp({
264
+ mcpServer: this,
265
+ httpServer,
266
+ errorMiddleware: this.customErrorMiddleware,
267
+ });
268
+ return this.express;
269
+ }
231
270
  const httpServer = http.createServer();
232
271
  await createApp({
233
272
  mcpServer: this,