@mafdet/mcp 1.5.0 → 1.6.0
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/README.md +3 -3
- package/dist/client.js +15 -14
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ OpenAI API works by pointing its base URL and key at Mafdet AI.
|
|
|
17
17
|
- Base URL: `https://api.mafdet.ai/v1`
|
|
18
18
|
- Endpoints: `/chat/completions`, `/embeddings`, `/audio/speech`
|
|
19
19
|
- Providers: Google (Gemini), Kimi (Moonshot), Qwen, DeepSeek
|
|
20
|
-
-
|
|
20
|
+
- The catalogue changes; the authoritative model list
|
|
21
21
|
with current prices is [`models.json`](https://docs.mafdet.ai/models.json)
|
|
22
22
|
- Docs: <https://docs.mafdet.ai>
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ OpenAI API works by pointing its base URL and key at Mafdet AI.
|
|
|
25
25
|
|
|
26
26
|
| Tool | Needs a key | What it does |
|
|
27
27
|
| --- | --- | --- |
|
|
28
|
-
| `list_models` | no | List Mafdet AI models with provider, tier, per
|
|
28
|
+
| `list_models` | no | List Mafdet AI models with provider, tier, pricing per dimension (tokens, images, or seconds), and a `[preview]` / `[beta]` marker for models the provider has not declared generally available |
|
|
29
29
|
| `search_docs` | no | Search the Mafdet AI documentation (titles, URLs, summaries) |
|
|
30
30
|
| `get_balance` | yes | Your organization's wallet: balance, bonus, frozen, available |
|
|
31
31
|
| `get_usage_summary` | yes | Requests, tokens, and charge over the last N days (1–90) |
|
|
@@ -100,7 +100,7 @@ Omit `MAFDET_API_KEY` to use only the public tools (`list_models`,
|
|
|
100
100
|
|
|
101
101
|
## Notes
|
|
102
102
|
|
|
103
|
-
- Pin a major version (`@mafdet/mcp@
|
|
103
|
+
- Pin a major version (`@mafdet/mcp@1`) in automated setups to avoid surprise
|
|
104
104
|
upgrades.
|
|
105
105
|
- The server writes only JSON-RPC to stdout; diagnostics go to stderr and never
|
|
106
106
|
include your key.
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mafdet/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
44
|
-
"zod": "^4.
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
44
|
+
"zod": "^4.6.7"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^20.19.0",
|