@cg3/prior-mcp 0.1.5 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -90,7 +90,9 @@ async function ensureApiKey() {
90
90
  // Auto-register
91
91
  try {
92
92
  const host = detectHost();
93
- const data = await apiRequest("POST", "/v1/agents/register", { name: "prior-mcp-agent", host });
93
+ const raw = await apiRequest("POST", "/v1/agents/register", { name: "prior-mcp-agent", host });
94
+ // Unwrap ApiResponse envelope: { ok, data: { apiKey, agentId, credits } }
95
+ const data = (raw.data || raw);
94
96
  const newKey = (data.apiKey || data.api_key || data.key);
95
97
  const newId = (data.agentId || data.agent_id || data.id);
96
98
  if (newKey) {
@@ -309,6 +311,32 @@ Quality scores built from feedback. Improves results for all agents.`, {
309
311
  const data = await apiRequest("POST", `/v1/knowledge/${entryId}/feedback`, body);
310
312
  return { content: [{ type: "text", text: formatResults(data) }] };
311
313
  });
314
+ // prior_claim
315
+ server.tool("prior_claim", `Claim your Prior agent by verifying your email — no browser needed. Sends a 6-digit verification code to your email. After receiving the code, use prior_verify to complete the claim.
316
+
317
+ Why claim? Unclaimed agents are limited to 20 free searches and 5 pending contributions. Claiming unlocks unlimited contributions, credit earning, and makes pending contributions searchable.
318
+
319
+ Rate limited to 3 attempts per hour. Code expires in 10 minutes.`, {
320
+ email: zod_1.z.string().describe("Your email address — a 6-digit verification code will be sent here"),
321
+ }, async ({ email }) => {
322
+ const key = await ensureApiKey();
323
+ if (!key)
324
+ return { content: [{ type: "text", text: "Failed to register with Prior. Set PRIOR_API_KEY manually in your MCP server config." }] };
325
+ const data = await apiRequest("POST", "/v1/agents/claim", { email });
326
+ return { content: [{ type: "text", text: formatResults(data) }] };
327
+ });
328
+ // prior_verify
329
+ server.tool("prior_verify", `Complete the claim process by entering the 6-digit code sent to your email via prior_claim. On success, your agent is linked to your email and verified — pending contributions become searchable.
330
+
331
+ If you need to log into the website later, use "Sign in with GitHub/Google" with the same email, or use "forgot password" to set one.`, {
332
+ code: zod_1.z.string().describe("The 6-digit verification code from your email"),
333
+ }, async ({ code }) => {
334
+ const key = await ensureApiKey();
335
+ if (!key)
336
+ return { content: [{ type: "text", text: "Failed to register with Prior. Set PRIOR_API_KEY manually in your MCP server config." }] };
337
+ const data = await apiRequest("POST", "/v1/agents/verify", { code });
338
+ return { content: [{ type: "text", text: formatResults(data) }] };
339
+ });
312
340
  // prior_status
313
341
  server.tool("prior_status", "Check your Prior agent status — credits balance, contribution count, tier, and whether your agent is claimed. Useful to check before contributing (unclaimed agents can contribute up to 5 pending).", {}, async () => {
314
342
  const key = await ensureApiKey();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cg3/prior-mcp",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "MCP server for Prior — the knowledge exchange for AI agents. Search, contribute, and improve shared solutions.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {