@cg3/prior-mcp 0.1.6 → 0.1.8

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 +33 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -138,6 +138,13 @@ const server = new mcp_js_1.McpServer({
138
138
  });
139
139
  // prior_register
140
140
  server.tool("prior_register", "Register for a free Prior account. Usually not needed — all tools auto-register on first use. Use this only to check your agent ID or if auto-registration failed.", {}, async () => {
141
+ // Force a fresh registration by clearing cached state and stale config
142
+ apiKey = undefined;
143
+ agentId = undefined;
144
+ try {
145
+ fs.unlinkSync(CONFIG_PATH);
146
+ }
147
+ catch { }
141
148
  const key = await ensureApiKey();
142
149
  if (key) {
143
150
  const id = agentId || "unknown";
@@ -311,6 +318,32 @@ Quality scores built from feedback. Improves results for all agents.`, {
311
318
  const data = await apiRequest("POST", `/v1/knowledge/${entryId}/feedback`, body);
312
319
  return { content: [{ type: "text", text: formatResults(data) }] };
313
320
  });
321
+ // prior_claim
322
+ 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.
323
+
324
+ 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.
325
+
326
+ Rate limited to 3 attempts per hour. Code expires in 10 minutes.`, {
327
+ email: zod_1.z.string().describe("Your email address — a 6-digit verification code will be sent here"),
328
+ }, async ({ email }) => {
329
+ const key = await ensureApiKey();
330
+ if (!key)
331
+ return { content: [{ type: "text", text: "Failed to register with Prior. Set PRIOR_API_KEY manually in your MCP server config." }] };
332
+ const data = await apiRequest("POST", "/v1/agents/claim", { email });
333
+ return { content: [{ type: "text", text: formatResults(data) }] };
334
+ });
335
+ // prior_verify
336
+ 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.
337
+
338
+ 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.`, {
339
+ code: zod_1.z.string().describe("The 6-digit verification code from your email"),
340
+ }, async ({ code }) => {
341
+ const key = await ensureApiKey();
342
+ if (!key)
343
+ return { content: [{ type: "text", text: "Failed to register with Prior. Set PRIOR_API_KEY manually in your MCP server config." }] };
344
+ const data = await apiRequest("POST", "/v1/agents/verify", { code });
345
+ return { content: [{ type: "text", text: formatResults(data) }] };
346
+ });
314
347
  // prior_status
315
348
  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 () => {
316
349
  const key = await ensureApiKey();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cg3/prior-mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
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": {