@mafdet/mcp 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/client.js +15 -14
- package/dist/index.js +0 -0
- package/package.json +10 -10
package/dist/client.js
CHANGED
|
@@ -29,27 +29,28 @@ export async function getJson(options) {
|
|
|
29
29
|
signal: controller.signal,
|
|
30
30
|
redirect: "error",
|
|
31
31
|
});
|
|
32
|
+
if (!response.ok)
|
|
33
|
+
throw mapStatus(response.status);
|
|
34
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
35
|
+
if (!contentType.includes("application/json")) {
|
|
36
|
+
throw new MafdetClientError("bad_response", "Mafdet AI returned an unexpected (non-JSON) response");
|
|
37
|
+
}
|
|
38
|
+
const text = await readBounded(response);
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(text);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
throw new MafdetClientError("bad_response", "Mafdet AI returned malformed JSON");
|
|
44
|
+
}
|
|
32
45
|
}
|
|
33
46
|
catch (error) {
|
|
47
|
+
if (error instanceof MafdetClientError)
|
|
48
|
+
throw error;
|
|
34
49
|
throw new MafdetClientError("network", `could not reach Mafdet AI (${describeNetworkError(error)})`);
|
|
35
50
|
}
|
|
36
51
|
finally {
|
|
37
52
|
clearTimeout(timer);
|
|
38
53
|
}
|
|
39
|
-
if (!response.ok) {
|
|
40
|
-
throw mapStatus(response.status);
|
|
41
|
-
}
|
|
42
|
-
const contentType = response.headers.get("content-type") ?? "";
|
|
43
|
-
if (!contentType.includes("application/json")) {
|
|
44
|
-
throw new MafdetClientError("bad_response", "Mafdet AI returned an unexpected (non-JSON) response");
|
|
45
|
-
}
|
|
46
|
-
const text = await readBounded(response);
|
|
47
|
-
try {
|
|
48
|
-
return JSON.parse(text);
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
throw new MafdetClientError("bad_response", "Mafdet AI returned malformed JSON");
|
|
52
|
-
}
|
|
53
54
|
}
|
|
54
55
|
function buildUrl(baseUrl, path, query) {
|
|
55
56
|
const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mafdet/mcp",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Mafdet AI MCP server — read-only account tools (models, balance, usage, subscription, docs) for Claude Code, Cursor, Codex, OpenCode, and Claude Desktop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,15 +33,9 @@
|
|
|
33
33
|
"dist",
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "tsc -p tsconfig.json",
|
|
38
|
-
"lint": "prettier --check \"src/**/*.ts\" \"test/**/*.mjs\" package.json tsconfig.json",
|
|
39
|
-
"test": "pnpm run build && node --test \"test/**/*.test.mjs\"",
|
|
40
|
-
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
41
|
-
},
|
|
42
36
|
"dependencies": {
|
|
43
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
44
|
-
"zod": "^4.
|
|
37
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
38
|
+
"zod": "^4.6.7"
|
|
45
39
|
},
|
|
46
40
|
"devDependencies": {
|
|
47
41
|
"@types/node": "^20.19.0",
|
|
@@ -49,5 +43,11 @@
|
|
|
49
43
|
},
|
|
50
44
|
"engines": {
|
|
51
45
|
"node": ">=20"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc -p tsconfig.json",
|
|
49
|
+
"lint": "prettier --check \"src/**/*.ts\" \"test/**/*.mjs\" package.json tsconfig.json",
|
|
50
|
+
"test": "pnpm run build && node --test \"test/**/*.test.mjs\"",
|
|
51
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|