uniqueness-mcp 0.1.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 +65 -0
- package/package.json +20 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Uniqueness Engine MCP server. Exposes the connection brief as an agent tool.
|
|
3
|
+
// Auth: UNIQUENESS_API_KEY env (get one: POST /api/signup, or `npx uniqueness signup`).
|
|
4
|
+
//
|
|
5
|
+
// Claude/Cursor/Codex config:
|
|
6
|
+
// { "mcpServers": { "uniqueness": {
|
|
7
|
+
// "command": "npx", "args": ["-y", "uniqueness-mcp"],
|
|
8
|
+
// "env": { "UNIQUENESS_API_KEY": "uq_live_..." } } } }
|
|
9
|
+
|
|
10
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
|
|
14
|
+
const BASE = process.env.UNIQUENESS_API_URL || "https://uniquenessengine.com";
|
|
15
|
+
const KEY = process.env.UNIQUENESS_API_KEY || "";
|
|
16
|
+
|
|
17
|
+
const server = new McpServer({ name: "uniqueness", version: "0.1.0" });
|
|
18
|
+
|
|
19
|
+
server.tool(
|
|
20
|
+
"get_connection_brief",
|
|
21
|
+
"Given a LinkedIn URL (or name + company, or email), return a fact-checked Connection Brief: " +
|
|
22
|
+
"verified personal + professional signal, each claim grounded in a source + verbatim quote, " +
|
|
23
|
+
"identity-gated (returns needs_review rather than guessing), with outreach angles. " +
|
|
24
|
+
"Every credit charge is reported. Use before personalized outreach, gifting, or call prep.",
|
|
25
|
+
{
|
|
26
|
+
linkedin_url: z.string().optional().describe("LinkedIn profile URL"),
|
|
27
|
+
name: z.string().optional().describe("Full name (use with company)"),
|
|
28
|
+
company: z.string().optional().describe("Company name (use with name)"),
|
|
29
|
+
email: z.string().optional().describe("Work email (optional disambiguator)"),
|
|
30
|
+
deep: z.boolean().optional().describe("Async deep social mode (when available)"),
|
|
31
|
+
},
|
|
32
|
+
async (args) => {
|
|
33
|
+
if (!KEY) {
|
|
34
|
+
return {
|
|
35
|
+
isError: true,
|
|
36
|
+
content: [{ type: "text", text: "Missing UNIQUENESS_API_KEY. Get a free key: POST https://uniquenessengine.com/api/signup {email}." }],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (!args.linkedin_url && !args.name) {
|
|
40
|
+
return { isError: true, content: [{ type: "text", text: "Provide linkedin_url, or name (+ company)." }] };
|
|
41
|
+
}
|
|
42
|
+
const body = {};
|
|
43
|
+
if (args.linkedin_url) body.linkedin_url = args.linkedin_url;
|
|
44
|
+
if (args.name) body.name = args.name;
|
|
45
|
+
if (args.company) body.company = args.company;
|
|
46
|
+
if (args.email) body.email = args.email;
|
|
47
|
+
if (args.deep) body.mode = "deep";
|
|
48
|
+
|
|
49
|
+
const res = await fetch(`${BASE}/api/brief`, {
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers: { "content-type": "application/json", authorization: `Bearer ${KEY}` },
|
|
52
|
+
body: JSON.stringify(body),
|
|
53
|
+
});
|
|
54
|
+
const json = await res.json().catch(() => ({}));
|
|
55
|
+
if (res.status === 401) return { isError: true, content: [{ type: "text", text: "401 unauthorized — invalid API key." }] };
|
|
56
|
+
if (res.status === 402) return { isError: true, content: [{ type: "text", text: "Out of credits. " + (json.message || "") }] };
|
|
57
|
+
if (!res.ok) return { isError: true, content: [{ type: "text", text: `brief failed (${res.status}): ${json.error || ""}` }] };
|
|
58
|
+
|
|
59
|
+
return { content: [{ type: "text", text: JSON.stringify(json, null, 2) }] };
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const transport = new StdioServerTransport();
|
|
64
|
+
await server.connect(transport);
|
|
65
|
+
console.error("uniqueness-mcp ready (stdio)");
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "uniqueness-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Uniqueness Engine — fact-checked connection briefs as an agent tool.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"uniqueness-mcp": "./index.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"index.mjs"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
17
|
+
"zod": "^3.23.0"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT"
|
|
20
|
+
}
|