nixflex-mcp 0.2.0 → 0.2.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/index.js +10 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import { readFileSync } from 'node:fs';
|
|
|
26
26
|
import { homedir } from 'node:os';
|
|
27
27
|
import { join } from 'node:path';
|
|
28
28
|
|
|
29
|
-
const VERSION = '0.2.
|
|
29
|
+
const VERSION = '0.2.1';
|
|
30
30
|
const log = (...a) => process.stderr.write('[nixflex-mcp] ' + a.join(' ') + '\n');
|
|
31
31
|
|
|
32
32
|
// ---- key: env first, then the CLI's config file (so `nixflex login` is enough) ----
|
|
@@ -57,7 +57,15 @@ const preview = async (what, fetch) => { let current = null; try { current = awa
|
|
|
57
57
|
const summariseCall = (c) => ({ call_id: c.call_id, direction: c.direction, from_number: c.from_number, to_number: c.to_number, agent_id: c.agent_id, call_status: c.call_status, ended_reason: c.ended_reason, duration_ms: c.duration_ms, started_at: c.start_timestamp || c.created_at, call_summary: c.call_summary, call_successful: c.call_successful, caller_sentiment: c.caller_sentiment, bookings: Array.isArray(c.bookings) ? c.bookings.length : undefined });
|
|
58
58
|
|
|
59
59
|
const server = new McpServer({ name: 'nixflex', version: VERSION });
|
|
60
|
-
|
|
60
|
+
// Annotations are HINTS for clients (Claude asks before destructive tools) - never a
|
|
61
|
+
// security control. Rule: name starts with get_/list_ -> read-only; delete_/rotate_ ->
|
|
62
|
+
// destructive; everything else writes but is not destructive.
|
|
63
|
+
const annotate = (name) => name.startsWith('get_') || name.startsWith('list_')
|
|
64
|
+
? { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
|
|
65
|
+
: (name.startsWith('delete_') || name.startsWith('rotate_'))
|
|
66
|
+
? { readOnlyHint: false, destructiveHint: true, idempotentHint: false }
|
|
67
|
+
: { readOnlyHint: false, destructiveHint: false, idempotentHint: false };
|
|
68
|
+
const T = (name, description, schema, fn) => server.registerTool(name, { description, inputSchema: schema, annotations: annotate(name) }, run(fn));
|
|
61
69
|
|
|
62
70
|
// ============ account ============
|
|
63
71
|
T('get_usage', 'Usage and balance for this account.', z.object({}), () => client.usage.get());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nixflex-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "MCP server for the Nixflex voice AI platform - manage agents, calls, numbers and caller context from Claude Desktop, Cursor or any MCP client.",
|
|
5
5
|
"keywords": ["nixflex", "mcp", "model-context-protocol", "voice-ai", "phone", "claude"],
|
|
6
6
|
"homepage": "https://docs.nixflex.com/mcp/overview",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"files": ["index.js", "README.md", "LICENSE"],
|
|
12
12
|
"engines": { "node": ">=18" },
|
|
13
13
|
"scripts": {
|
|
14
|
-
"check": "node --test tests
|
|
14
|
+
"check": "node --test tests/tools.test.mjs tests/contract.test.mjs",
|
|
15
15
|
"start": "node index.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|