@owine/unifi-protect-mcp 2.6.0 → 2.7.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/README.md +1 -1
- package/dist/schemas/cameras.d.ts +137 -0
- package/dist/schemas/cameras.js +69 -0
- package/dist/schemas/common.d.ts +38 -0
- package/dist/schemas/common.js +55 -0
- package/dist/schemas/devices.d.ts +172 -0
- package/dist/schemas/devices.js +60 -0
- package/dist/schemas/misc.d.ts +184 -0
- package/dist/schemas/misc.js +108 -0
- package/dist/tools/arm-profiles.js +5 -1
- package/dist/tools/cameras.js +11 -4
- package/dist/tools/devices.d.ts +1 -0
- package/dist/tools/devices.js +18 -2
- package/dist/tools/files.js +3 -1
- package/dist/tools/liveviews.js +7 -2
- package/dist/tools/subscriptions.js +5 -2
- package/dist/tools/system.js +5 -2
- package/dist/tools/users.js +9 -4
- package/dist/utils/responses.d.ts +1 -0
- package/dist/utils/responses.js +7 -0
- package/dist/utils/safety.d.ts +1 -0
- package/package.json +8 -8
package/dist/tools/users.js
CHANGED
|
@@ -5,9 +5,11 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const responses_js_1 = require("../utils/responses.js");
|
|
6
6
|
const safety_js_1 = require("../utils/safety.js");
|
|
7
7
|
const url_js_1 = require("../utils/url.js");
|
|
8
|
+
const misc_js_1 = require("../schemas/misc.js");
|
|
8
9
|
function registerUserTools(server, client) {
|
|
9
10
|
server.registerTool("protect_list_users", {
|
|
10
|
-
description: "List all Protect users
|
|
11
|
+
description: "List all Protect users (filtered by the API key's access permissions). Returns array; each user includes (Integration API 7.1.60-verified): id, modelKey, name, firstName, lastName, email, ucoreUserId. The Integration API does NOT expose roles, permissions, login history, groups, or notification settings.",
|
|
12
|
+
outputSchema: misc_js_1.userListOutputSchema,
|
|
11
13
|
annotations: safety_js_1.READ_ONLY,
|
|
12
14
|
}, async () => {
|
|
13
15
|
try {
|
|
@@ -19,8 +21,9 @@ function registerUserTools(server, client) {
|
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
23
|
server.registerTool("protect_get_user", {
|
|
22
|
-
description: "Get details for a specific Protect user by ID",
|
|
24
|
+
description: "Get details for a specific Protect user by ID. Returns the same fields as protect_list_users entries: id, modelKey, name, firstName, lastName, email, ucoreUserId.",
|
|
23
25
|
inputSchema: { id: zod_1.z.string().describe("User ID") },
|
|
26
|
+
outputSchema: misc_js_1.userOutputSchema,
|
|
24
27
|
annotations: safety_js_1.READ_ONLY,
|
|
25
28
|
}, async ({ id }) => {
|
|
26
29
|
try {
|
|
@@ -32,7 +35,8 @@ function registerUserTools(server, client) {
|
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
server.registerTool("protect_list_ulp_users", {
|
|
35
|
-
description: "List all UniFi Identity (ULP) users
|
|
38
|
+
description: "List all UniFi Identity (ULP) users. Returns array; each ULP user includes (Integration API 7.1.60-verified): id, modelKey, firstName, lastName, fullName, status (e.g. ACTIVE). Enrolled-credential detail (NFC cards, fingerprints) is NOT exposed by this API surface.",
|
|
39
|
+
outputSchema: misc_js_1.ulpUserListOutputSchema,
|
|
36
40
|
annotations: safety_js_1.READ_ONLY,
|
|
37
41
|
}, async () => {
|
|
38
42
|
try {
|
|
@@ -44,8 +48,9 @@ function registerUserTools(server, client) {
|
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
server.registerTool("protect_get_ulp_user", {
|
|
47
|
-
description: "Get details for a specific UniFi Identity (ULP) user by ID",
|
|
51
|
+
description: "Get details for a specific UniFi Identity (ULP) user by ID. Returns: id, modelKey, firstName, lastName, fullName, status.",
|
|
48
52
|
inputSchema: { id: zod_1.z.string().describe("ULP user ID") },
|
|
53
|
+
outputSchema: misc_js_1.ulpUserOutputSchema,
|
|
49
54
|
annotations: safety_js_1.READ_ONLY,
|
|
50
55
|
}, async ({ id }) => {
|
|
51
56
|
try {
|
package/dist/utils/responses.js
CHANGED
|
@@ -3,10 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.formatSuccess = formatSuccess;
|
|
4
4
|
exports.formatError = formatError;
|
|
5
5
|
function formatSuccess(data) {
|
|
6
|
+
// structuredContent must be an object/record per MCP spec. When the response
|
|
7
|
+
// is a primitive or array, wrap it under `result` so the SDK accepts it and
|
|
8
|
+
// schemas downstream wrap accordingly.
|
|
9
|
+
const structured = data !== null && typeof data === "object" && !Array.isArray(data)
|
|
10
|
+
? data
|
|
11
|
+
: { result: data };
|
|
6
12
|
return {
|
|
7
13
|
content: [
|
|
8
14
|
{ type: "text", text: JSON.stringify(data, null, 2) },
|
|
9
15
|
],
|
|
16
|
+
structuredContent: structured,
|
|
10
17
|
};
|
|
11
18
|
}
|
|
12
19
|
function formatError(err) {
|
package/dist/utils/safety.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owine/unifi-protect-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "MCP server for UniFi Protect Integration API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": "^22.13.0 || ^24.0.0"
|
|
24
24
|
},
|
|
25
|
-
"packageManager": "pnpm@11.
|
|
25
|
+
"packageManager": "pnpm@11.2.2",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "https://github.com/owine/unifi-protect-mcp.git"
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
41
|
-
"ws": "8.
|
|
41
|
+
"ws": "8.21.0",
|
|
42
42
|
"zod": "4.4.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@eslint/js": "10.0.1",
|
|
46
46
|
"@types/node": "24.12.4",
|
|
47
47
|
"@types/ws": "8.18.1",
|
|
48
|
-
"@vitest/coverage-v8": "4.1.
|
|
49
|
-
"eslint": "10.
|
|
50
|
-
"lefthook": "2.1.
|
|
48
|
+
"@vitest/coverage-v8": "4.1.7",
|
|
49
|
+
"eslint": "10.4.0",
|
|
50
|
+
"lefthook": "2.1.8",
|
|
51
51
|
"typescript": "6.0.3",
|
|
52
|
-
"typescript-eslint": "8.59.
|
|
53
|
-
"vitest": "4.1.
|
|
52
|
+
"typescript-eslint": "8.59.4",
|
|
53
|
+
"vitest": "4.1.7"
|
|
54
54
|
}
|
|
55
55
|
}
|