plures-mcp 1.0.0 → 1.0.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/index.js +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Get a free test key at [plures.si](https://plures.si/?for=developers#join), then
|
|
|
22
22
|
|
|
23
23
|
Claude Code: `claude mcp add plures --env PLURES_API_KEY=pk_test_... -- npx -y plures-mcp`
|
|
24
24
|
|
|
25
|
-
A `pk_test_` key answers instantly with a simulated result, so you can try the flow for free. A `pk_live_` key sends tasks to real verified people and is billed per answer.
|
|
25
|
+
A `pk_test_` key answers instantly with a simulated result (always the first option, clearly marked as a test), so you can try the flow for free. A `pk_live_` key sends tasks to real verified people and is billed per answer.
|
|
26
26
|
|
|
27
27
|
## Tools
|
|
28
28
|
|
package/dist/index.js
CHANGED
|
@@ -5,14 +5,20 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { Plures, PluresError } from "plures";
|
|
8
|
-
var VERSION = "1.0.
|
|
8
|
+
var VERSION = "1.0.1";
|
|
9
9
|
var KEY = process.env.PLURES_API_KEY;
|
|
10
10
|
var plures = KEY ? new Plures(KEY, { baseUrl: process.env.PLURES_BASE_URL }) : null;
|
|
11
11
|
var MAX_WAIT = 240;
|
|
12
12
|
var server = new McpServer({ name: "plures", version: VERSION }, {
|
|
13
13
|
instructions: "Plures sends a decision to ID verified people, who answer independently, and returns their consensus. Use ask_humans before you act on a judgment call you are not sure about, where a wrong call costs money, trust or safety: reading a customer's tone or intent, approving a refund or payment, checking that an invoice, listing or document matches, moderating an edge case, or confirming a fact that needs human eyes. Don't use it for things you can check with code or a lookup. Act on the answer when agreement is 1; below that, treat it as uncertain and escalate or ask for more verifiers."
|
|
14
14
|
});
|
|
15
|
+
var TEST_NOTE = "TEST MODE: this answer is simulated; no person saw the question. It always picks the first option, so don't act on it. Use a live key for real answers.";
|
|
15
16
|
var fmt = (t) => {
|
|
17
|
+
const text = describe(t);
|
|
18
|
+
return t.mode === "test" ? `${TEST_NOTE}
|
|
19
|
+
${text}` : text;
|
|
20
|
+
};
|
|
21
|
+
var describe = (t) => {
|
|
16
22
|
const label = (id) => t.options.find((o) => o.id === id)?.label ?? id;
|
|
17
23
|
if (t.status === "pending")
|
|
18
24
|
return `Still waiting for people to answer. Task ${t.id}. Call get_human_answer with this task_id later.`;
|
|
@@ -22,7 +28,7 @@ var fmt = (t) => {
|
|
|
22
28
|
if (t.status === "expired") return `Task ${t.id} expired before enough people answered. Votes so far: ${votes}. Treat this as unverified.`;
|
|
23
29
|
if (!r || r.answer === null) return `People were split${r?.tie ? " (a tie)" : ""}. Votes: ${votes}. Treat this as uncertain and escalate to a person on your team.`;
|
|
24
30
|
const strength = r.agreement >= 1 ? "Everyone agreed, so it is safe to act on." : `Agreement is ${Math.round(r.agreement * 100)}%, so treat it as uncertain.`;
|
|
25
|
-
return `Verified people answered: ${label(r.answer)}. ${Math.round(r.agreement * r.answers)} of ${r.answers} agreed. ${strength} Votes: ${votes}
|
|
31
|
+
return `Verified people answered: ${label(r.answer)}. ${Math.round(r.agreement * r.answers)} of ${r.answers} agreed. ${strength} Votes: ${votes}.`;
|
|
26
32
|
};
|
|
27
33
|
var out = (t) => ({
|
|
28
34
|
content: [{ type: "text", text: fmt(t) }],
|
package/package.json
CHANGED