modality-mcp-kit 1.5.0 → 1.5.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.
- package/dist/util_mcp_proxy.js +19 -0
- package/package.json +1 -1
package/dist/util_mcp_proxy.js
CHANGED
|
@@ -210,6 +210,25 @@ export const mcpProxyHandler = (MCP_SERVERS) => async (c) => {
|
|
|
210
210
|
availableServers: Object.keys(MCP_SERVERS),
|
|
211
211
|
}, 400);
|
|
212
212
|
}
|
|
213
|
+
// Handle /_cache sub-routes (matched via app.use prefix routing)
|
|
214
|
+
const cachePathMatch = c.req.path.match(/\/_cache(?:\/(.+))?$/);
|
|
215
|
+
if (cachePathMatch) {
|
|
216
|
+
const cache = serverCaches.get(mcpName);
|
|
217
|
+
if (!cache) {
|
|
218
|
+
return c.json({ error: "No cache for this MCP server", keys: [] });
|
|
219
|
+
}
|
|
220
|
+
const cacheKey = cachePathMatch[1]
|
|
221
|
+
? decodeURIComponent(cachePathMatch[1])
|
|
222
|
+
: undefined;
|
|
223
|
+
if (cacheKey) {
|
|
224
|
+
const entry = cache.get(cacheKey, true);
|
|
225
|
+
if (!entry) {
|
|
226
|
+
return c.json({ error: "Cache key not found", cacheKey }, 404);
|
|
227
|
+
}
|
|
228
|
+
return c.json({ cacheKey, value: entry });
|
|
229
|
+
}
|
|
230
|
+
return c.json({ keys: cache.keys() });
|
|
231
|
+
}
|
|
213
232
|
// Handle CORS preflight
|
|
214
233
|
if (c.req.method === "OPTIONS") {
|
|
215
234
|
return new Response(null, {
|
package/package.json
CHANGED