Skip to content

Commit e0eebca

Browse files
fix(mcp): remove ajv dependency so MCP servers are more compatible with Cloudflare Workers
1 parent 20f0218 commit e0eebca

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

packages/mcp-server/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"dependencies": {
3030
"isaacus": "file:../../dist/",
3131
"@modelcontextprotocol/sdk": "^1.6.1",
32-
"yargs": "^17.7.2",
33-
"ajv": "^8.17.1"
32+
"yargs": "^17.7.2"
3433
},
3534
"bin": {
3635
"mcp-server": "dist/index.js"

packages/mcp-server/src/compat.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { Tool } from '@modelcontextprotocol/sdk/types.js';
22
import { Endpoint } from './tools';
3-
import Ajv from 'ajv';
4-
5-
const ajv = new Ajv();
63

74
export interface ClientCapabilities {
85
topLevelUnions: boolean;
@@ -23,14 +20,9 @@ export const defaultClientCapabilities: ClientCapabilities = {
2320
};
2421

2522
/**
26-
* Attempts to parse strings into JSON objects if initial schema
27-
* validation fails.
23+
* Attempts to parse strings into JSON objects
2824
*/
2925
export function parseEmbeddedJSON(args: Record<string, unknown>, schema: Record<string, unknown>) {
30-
if (ajv.validate(schema, args)) {
31-
return args;
32-
}
33-
3426
let updated = false;
3527
const newArgs: Record<string, unknown> = Object.assign({}, args);
3628

0 commit comments

Comments
 (0)