Skip to content

Commit 391d825

Browse files
fix(mcp): support jq filtering on cloudflare workers
1 parent 1627904 commit 391d825

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"dependencies": {
3030
"isaacus": "file:../../dist/",
3131
"@modelcontextprotocol/sdk": "^1.11.5",
32-
"jq-web": "^0.6.2",
32+
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.2/jq-web.tar.gz",
3333
"yargs": "^17.7.2",
3434
"@cloudflare/cabidela": "^0.2.4",
3535
"zod": "^3.25.20",
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// @ts-nocheck
2+
import initJq from 'jq-web';
3+
14
export async function maybeFilter(args: Record<string, unknown> | undefined, response: any): Promise<any> {
25
const jqFilter = args?.['jq_filter'];
36
if (jqFilter && typeof jqFilter === 'string') {
@@ -7,7 +10,6 @@ export async function maybeFilter(args: Record<string, unknown> | undefined, res
710
}
811
}
912

10-
var jqWeb = require('jq-web');
1113
async function jq(json: any, jqFilter: string) {
12-
return (await jqWeb).json(json, jqFilter);
14+
return (await initJq).json(json, jqFilter);
1315
}

0 commit comments

Comments
 (0)