@mafdet/mcp 1.4.32 → 1.5.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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { realpathSync } from "node:fs";
2
+ import { readFileSync, realpathSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -11,10 +11,11 @@ import { getBalance, getSubscription, getUsageSummary, listModels, searchDocsToo
11
11
  // it); everything diagnostic goes to stderr via logError. The five tools are
12
12
  // read-only; account tools need MAFDET_API_KEY, the two public tools do not.
13
13
  export function buildServer(config = loadConfig()) {
14
- const server = new McpServer({ name: "mafdet-mcp", version: "0.1.3" });
14
+ const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
15
+ const server = new McpServer({ name: "mafdet-mcp", version });
15
16
  server.registerTool("list_models", {
16
17
  title: "List Mafdet AI models",
17
- description: "List the models available on Mafdet AI with provider, tier, and per-1M-token pricing. No API key required.",
18
+ description: "List the models available on Mafdet AI with provider, tier, and pricing by modality and unit (tokens, images, seconds). No API key required.",
18
19
  inputSchema: {
19
20
  provider: z.string().min(1).max(40).optional(),
20
21
  tier: z.string().min(1).max(40).optional(),
package/dist/tools.js CHANGED
@@ -50,7 +50,11 @@ export async function listModels(config, args = {}) {
50
50
  .filter((m) => !tier || String(m.accessTier).toLowerCase() === tier)
51
51
  .map((m) => ({
52
52
  model_id: m.modelId,
53
+ price_dimensions: Array.isArray(m.priceDimensions)
54
+ ? m.priceDimensions
55
+ : [],
53
56
  display_name: m.displayName,
57
+ description: typeof m.description === "string" ? m.description : "",
54
58
  provider: m.provider,
55
59
  tier: m.accessTier,
56
60
  // GEMMOD-003: endpoint + content modalities (additive; defaults when absent).
@@ -80,7 +84,14 @@ export async function listModels(config, args = {}) {
80
84
  `${stage ? ` [${stage[1].toLowerCase()}]` : ""}` +
81
85
  `${m.trial ? " [trial]" : ""}${m.deprecated ? " [deprecated]" : ""}` +
82
86
  `${m.output_modalities.includes("IMAGE") ? " [image-out]" : ""}` +
83
- ` — in ${money(m.input_per_1m_micro_usd)}/1M, out ${money(m.output_per_1m_micro_usd)}/1M, ctx ${m.context_length}`);
87
+ ` — ${m.price_dimensions.length
88
+ ? m.price_dimensions
89
+ .map((p) => `${p.dimension.toLowerCase().replaceAll("_", " ")}: ${money(p.sellPriceMicroUsd)}/${p.unit}`)
90
+ .join(", ")
91
+ : m.api_surface === "CHAT_COMPLETIONS"
92
+ ? `in ${money(m.input_per_1m_micro_usd)}/1M, out ${money(m.output_per_1m_micro_usd)}/1M`
93
+ : "pricing unavailable; see model documentation"}, ctx ${m.context_length}` +
94
+ `${m.description ? ` — ${m.description.replace(/[\r\n]+/g, " ")}` : ""}`);
84
95
  });
85
96
  return ok(`Mafdet AI models (${models.length}):\n${lines.join("\n")}`);
86
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mafdet/mcp",
3
- "version": "1.4.32",
3
+ "version": "1.5.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",