modality-mcp-kit 1.0.0 → 1.1.1

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.
@@ -27,7 +27,7 @@ import { ModalityFastMCP } from "modality-mcp-kit";
27
27
  import { JSONRPCManager, getLoggerInstance, } from "modality-kit";
28
28
  import { sseNotification, sseError, SSE_HEADERS, createSSEStream, } from "./sse-wrapper.js";
29
29
  import { McpSessionManager } from "./McpSessionManager.js";
30
- const defaultMcpPath = "mcp";
30
+ const defaultMcpPath = "/mcp";
31
31
  // Initialize FastMCP instance for internal use (NO SERVER)
32
32
  export class FastHonoMcp extends ModalityFastMCP {
33
33
  logger;
@@ -69,12 +69,12 @@ export class FastHonoMcp extends ModalityFastMCP {
69
69
  this.logger || getLoggerInstance("HonoMcpMiddleware", "debug");
70
70
  const url = new URL(c.req.url);
71
71
  // Only handle MCP routes
72
- if (!url.pathname.startsWith(`/${this.mcpPath}`)) {
72
+ if (!url.pathname.startsWith(this.mcpPath)) {
73
73
  return next();
74
74
  }
75
75
  try {
76
76
  // Handle DELETE for session disconnect
77
- if (c.req.method === "DELETE" && url.pathname === `/${this.mcpPath}`) {
77
+ if (c.req.method === "DELETE" && url.pathname === this.mcpPath) {
78
78
  const requestSessionId = c.req.header("mcp-session-id");
79
79
  // Validate session ID matches
80
80
  if (requestSessionId && requestSessionId !== this.currentSessionId) {
@@ -87,7 +87,7 @@ export class FastHonoMcp extends ModalityFastMCP {
87
87
  return c.json({ error: "Session not found" }, 404);
88
88
  }
89
89
  // Handle main MCP endpoint
90
- if (c.req.method === "POST" && url.pathname === `/${this.mcpPath}`) {
90
+ if (c.req.method === "POST" && url.pathname === this.mcpPath) {
91
91
  // Ensure session exists (creates new one if disconnected)
92
92
  this.ensureSession();
93
93
  const headers = {
@@ -126,8 +126,8 @@ export class FastHonoMcp extends ModalityFastMCP {
126
126
  initHono(app, path = defaultMcpPath) {
127
127
  this.mcpPath = path;
128
128
  const middlewareHandler = this.handler();
129
- app.use(`/${path}`, middlewareHandler);
130
- app.use(`/${path}/*`, middlewareHandler);
129
+ app.use(path, middlewareHandler);
130
+ app.use(`${path}/*`, middlewareHandler);
131
131
  return this;
132
132
  }
133
133
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0",
2
+ "version": "1.1.1",
3
3
  "name": "modality-mcp-kit",
4
4
  "repository": {
5
5
  "type": "git",
@@ -24,7 +24,10 @@
24
24
  "dependencies": {
25
25
  "modality-kit": "^0.14.17",
26
26
  "xsschema": "0.3.5",
27
- "zod": "^4.3.4",
27
+ "@valibot/to-json-schema": "^1.5.0",
28
+ "effect": "^3.19.14",
29
+ "sury": "^11.0.0-alpha.4",
30
+ "zod": "^4.3.5",
28
31
  "zod-to-json-schema": "^3.25.1"
29
32
  },
30
33
  "devDependencies": {