uniqueness-mcp 0.1.1 → 0.2.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/index.mjs +53 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { z } from "zod";
|
|
|
14
14
|
const BASE = process.env.UNIQUENESS_API_URL || "https://uniquenessengine.com";
|
|
15
15
|
const KEY = process.env.UNIQUENESS_API_KEY || "";
|
|
16
16
|
|
|
17
|
-
const server = new McpServer({ name: "uniqueness", version: "0.
|
|
17
|
+
const server = new McpServer({ name: "uniqueness", version: "0.2.0" });
|
|
18
18
|
|
|
19
19
|
server.tool(
|
|
20
20
|
"get_connection_brief",
|
|
@@ -60,6 +60,58 @@ server.tool(
|
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
+
server.tool(
|
|
64
|
+
"submit_feedback",
|
|
65
|
+
"Rate a Connection Brief 👍/👎 so the engine can improve. Pass the canonical_id " +
|
|
66
|
+
"from the brief's identity (or the job_id if you have one) plus rating 'up' or 'down' " +
|
|
67
|
+
"and an optional note on what was right or wrong.",
|
|
68
|
+
{
|
|
69
|
+
rating: z.enum(["up", "down"]).describe("'up' or 'down'"),
|
|
70
|
+
canonical_id: z
|
|
71
|
+
.string()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("brief.identity.canonical_id (preferred)"),
|
|
74
|
+
job_id: z.string().optional().describe("job id, if you enriched async"),
|
|
75
|
+
note: z.string().optional().describe("what was right/wrong (optional)"),
|
|
76
|
+
},
|
|
77
|
+
async (args) => {
|
|
78
|
+
if (!KEY) {
|
|
79
|
+
return {
|
|
80
|
+
isError: true,
|
|
81
|
+
content: [{ type: "text", text: "Missing UNIQUENESS_API_KEY." }],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (!args.canonical_id && !args.job_id) {
|
|
85
|
+
return {
|
|
86
|
+
isError: true,
|
|
87
|
+
content: [
|
|
88
|
+
{ type: "text", text: "Provide canonical_id (or job_id) to rate." },
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const res = await fetch(`${BASE}/api/feedback`, {
|
|
93
|
+
method: "POST",
|
|
94
|
+
headers: {
|
|
95
|
+
"content-type": "application/json",
|
|
96
|
+
authorization: `Bearer ${KEY}`,
|
|
97
|
+
},
|
|
98
|
+
body: JSON.stringify({ ...args, source: "mcp" }),
|
|
99
|
+
});
|
|
100
|
+
const json = await res.json().catch(() => ({}));
|
|
101
|
+
if (!res.ok)
|
|
102
|
+
return {
|
|
103
|
+
isError: true,
|
|
104
|
+
content: [
|
|
105
|
+
{
|
|
106
|
+
type: "text",
|
|
107
|
+
text: `feedback failed (${res.status}): ${json.error || ""}`,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
return { content: [{ type: "text", text: "Thanks — feedback recorded." }] };
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
|
|
63
115
|
const transport = new StdioServerTransport();
|
|
64
116
|
await server.connect(transport);
|
|
65
117
|
console.error("uniqueness-mcp ready (stdio)");
|