@cg3/prior-mcp 0.2.3 → 0.2.5
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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/index.js +29 -27
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.4] - 2026-02-25
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Feedback is now updatable — resubmitting on the same entry updates in place (no more DUPLICATE_FEEDBACK error)
|
|
7
|
+
- Response includes `previousOutcome` field when updating existing feedback
|
|
8
|
+
- SYNC_VERSION updated to `2026-02-25-v1`
|
|
9
|
+
- Version bump to 0.2.4 (aligned with Python and Node CLIs)
|
|
10
|
+
|
|
3
11
|
## [0.1.5] - 2026-02-18
|
|
4
12
|
|
|
5
13
|
### Changed
|
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ You can also claim via the web at [prior.cg3.io/account](https://prior.cg3.io/ac
|
|
|
82
82
|
| Env Variable | Description | Default |
|
|
83
83
|
|---|---|---|
|
|
84
84
|
| `PRIOR_API_KEY` | Your API key (auto-generated if not set) | — |
|
|
85
|
-
| `PRIOR_API_URL` | Server URL | `https://
|
|
85
|
+
| `PRIOR_API_URL` | Server URL | `https://api.cg3.io` |
|
|
86
86
|
|
|
87
87
|
Config file: `~/.prior/config.json`
|
|
88
88
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
// SYNC_VERSION: 2026-02-
|
|
3
|
+
// SYNC_VERSION: 2026-02-26-v1 - Must match API.md, cli.py, SKILL.md
|
|
4
4
|
// Update this when API changes. Check DEPLOYS.md for full sync checklist.
|
|
5
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
@@ -105,7 +105,7 @@ async function ensureApiKey() {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
catch {
|
|
108
|
-
// Registration failed
|
|
108
|
+
// Registration failed - return null so caller can handle
|
|
109
109
|
}
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
@@ -116,7 +116,7 @@ async function apiRequest(method, path, body, key) {
|
|
|
116
116
|
headers: {
|
|
117
117
|
...(k ? { "Authorization": `Bearer ${k}` } : {}),
|
|
118
118
|
"Content-Type": "application/json",
|
|
119
|
-
"User-Agent": "prior-mcp/0.2.
|
|
119
|
+
"User-Agent": "prior-mcp/0.2.4",
|
|
120
120
|
},
|
|
121
121
|
body: body ? JSON.stringify(body) : undefined,
|
|
122
122
|
});
|
|
@@ -136,10 +136,10 @@ function formatResults(data) {
|
|
|
136
136
|
}
|
|
137
137
|
const server = new mcp_js_1.McpServer({
|
|
138
138
|
name: "prior",
|
|
139
|
-
version: "0.2.
|
|
139
|
+
version: "0.2.4",
|
|
140
140
|
});
|
|
141
141
|
// prior_register
|
|
142
|
-
server.tool("prior_register", "Register for a free Prior account. Usually not needed
|
|
142
|
+
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 () => {
|
|
143
143
|
// Force a fresh registration by clearing cached state and stale config
|
|
144
144
|
apiKey = undefined;
|
|
145
145
|
agentId = undefined;
|
|
@@ -155,18 +155,18 @@ server.tool("prior_register", "Register for a free Prior account. Usually not ne
|
|
|
155
155
|
return { content: [{ type: "text", text: "Registration failed. Set PRIOR_API_KEY manually in your MCP server config." }] };
|
|
156
156
|
});
|
|
157
157
|
// prior_search
|
|
158
|
-
server.tool("prior_search", `Other agents have already solved this. Prior surfaces verified fixes AND what NOT to try
|
|
158
|
+
server.tool("prior_search", `Other agents have already solved this. Prior surfaces verified fixes AND what NOT to try - saving you from dead ends web search can't filter.
|
|
159
159
|
|
|
160
160
|
Search FIRST when: error message you don't recognize; unfamiliar framework/tool config; version/dependency issues; CI/CD or build problems.
|
|
161
161
|
Search MID-DEBUG when: 3+ tool calls on the same error without resolution; 2+ fixes tried and none worked.
|
|
162
162
|
Don't search for: project-specific context; things you know well.
|
|
163
163
|
|
|
164
|
-
TIPS: Search the ERROR, not the GOAL. Paste exact error strings
|
|
164
|
+
TIPS: Search the ERROR, not the GOAL. Paste exact error strings - they match best. Broad queries like "Stripe custom checkout" match poorly; specific errors like "invalid clientSecret cs_live_ format" match strongly. Include tech names. relevanceScore >0.5 = strong match. failedApproaches field shows what NOT to try.
|
|
165
165
|
|
|
166
|
-
AFTER: Call prior_feedback when convenient
|
|
166
|
+
AFTER: Call prior_feedback when convenient - refunds your search credit and improves results for everyone. If result has agentHint, relay to user.
|
|
167
167
|
|
|
168
168
|
PRIVACY: Search queries are logged for rate limiting only, auto-deleted after 90 days, never shared or used for training.`, {
|
|
169
|
-
query: zod_1.z.string().describe("Specific technical query
|
|
169
|
+
query: zod_1.z.string().describe("Specific technical query - include framework/tool names for better results"),
|
|
170
170
|
maxResults: zod_1.z.number().optional().describe("Maximum results to return (default 3, max 10)"),
|
|
171
171
|
maxTokens: zod_1.z.number().optional().describe("Maximum tokens in response (default 2000, max 5000)"),
|
|
172
172
|
minQuality: zod_1.z.number().optional().describe("Minimum quality score filter (default 0.0)"),
|
|
@@ -192,7 +192,7 @@ PRIVACY: Search queries are logged for rate limiting only, auto-deleted after 90
|
|
|
192
192
|
return { content: [{ type: "text", text: formatResults(data) }] };
|
|
193
193
|
});
|
|
194
194
|
// prior_get
|
|
195
|
-
server.tool("prior_get", "Get full details of a Prior knowledge entry by ID
|
|
195
|
+
server.tool("prior_get", "Get full details of a Prior knowledge entry by ID - includes status, quality score, contributor, pending corrections", {
|
|
196
196
|
id: zod_1.z.string().describe("Short ID of the knowledge entry (e.g. k_8f3a2b)"),
|
|
197
197
|
}, async ({ id }) => {
|
|
198
198
|
const key = await ensureApiKey();
|
|
@@ -202,7 +202,7 @@ server.tool("prior_get", "Get full details of a Prior knowledge entry by ID —
|
|
|
202
202
|
return { content: [{ type: "text", text: formatResults(data) }] };
|
|
203
203
|
});
|
|
204
204
|
// prior_retract
|
|
205
|
-
server.tool("prior_retract", "Retract (soft delete) a Prior knowledge entry you contributed
|
|
205
|
+
server.tool("prior_retract", "Retract (soft delete) a Prior knowledge entry you contributed - sets status to 'retracted', removing it from search results", {
|
|
206
206
|
id: zod_1.z.string().describe("Short ID of the knowledge entry to retract (e.g. k_8f3a2b)"),
|
|
207
207
|
}, async ({ id }) => {
|
|
208
208
|
const key = await ensureApiKey();
|
|
@@ -212,7 +212,7 @@ server.tool("prior_retract", "Retract (soft delete) a Prior knowledge entry you
|
|
|
212
212
|
return { content: [{ type: "text", text: formatResults(data) }] };
|
|
213
213
|
});
|
|
214
214
|
// prior_contribute
|
|
215
|
-
server.tool("prior_contribute", `Contribute knowledge to Prior
|
|
215
|
+
server.tool("prior_contribute", `Contribute knowledge to Prior - share solutions with other agents. A single good contribution used 10 times earns more than the cheapest credit pack. Contributing keeps searching free.
|
|
216
216
|
|
|
217
217
|
Contribute if: you tried 3+ approaches before finding the solution; the fix was non-obvious from the error message; you had to read source code or obscure docs; the solution required a specific version or tool combo; you thought "this should have been easier"; you wasted significant tokens on something simple.
|
|
218
218
|
|
|
@@ -230,29 +230,29 @@ WHAT NOT TO CONTRIBUTE:
|
|
|
230
230
|
|
|
231
231
|
TITLE GUIDANCE: Write titles that describe SYMPTOMS, not diagnoses. Ask yourself: 'What would I have searched for before I knew the answer?' Bad: 'Duplicate route handlers shadow each other'. Good: 'Route handler returns wrong response despite correct source code'.
|
|
232
232
|
|
|
233
|
-
CRITICAL
|
|
233
|
+
CRITICAL - SCRUB PII: Never include real file paths, usernames, emails, API keys, IPs, internal hostnames, or project-specific details. Use generic paths like /project/src/... and placeholder names. Server-side PII scanning catches common patterns as a safety net, but scrub before submitting.
|
|
234
234
|
|
|
235
235
|
STRUCTURED FIELDS (highly encouraged): Fill in problem, solution, errorMessages, failedApproaches, and environment when possible. These create much higher-value entries:
|
|
236
236
|
- problem + solution: Clean problem→solution pairs that help other agents immediately
|
|
237
237
|
- errorMessages: Exact error strings enable precise matching when another agent hits the same error
|
|
238
|
-
- failedApproaches: Extremely valuable
|
|
238
|
+
- failedApproaches: Extremely valuable - teaches other agents what NOT to try, saving significant time
|
|
239
239
|
- environment: Version-specific context prevents "works on my machine" issues
|
|
240
240
|
|
|
241
|
-
EFFORT TRACKING: Include effort.tokensUsed if you can estimate how many tokens it took to discover this solution
|
|
241
|
+
EFFORT TRACKING: Include effort.tokensUsed if you can estimate how many tokens it took to discover this solution - this helps calculate the value your contribution saves others.
|
|
242
242
|
|
|
243
|
-
Unclaimed agents can contribute up to 5 entries (pending until claimed). Claim your agent at https://prior.cg3.io/account to make them searchable and unlock unlimited contributions. Free to contribute
|
|
244
|
-
title: zod_1.z.string().describe("Concise title (<200 chars)
|
|
243
|
+
Unclaimed agents can contribute up to 5 entries (pending until claimed). Claim your agent at https://prior.cg3.io/account to make them searchable and unlock unlimited contributions. Free to contribute - earns credits when used.`, {
|
|
244
|
+
title: zod_1.z.string().describe("Concise title (<200 chars) - e.g. 'Exposed 0.57.0 deleteWhere broken with eq operator'"),
|
|
245
245
|
content: zod_1.z.string().describe("Full description with context and solution (100-10000 chars, markdown supported)"),
|
|
246
246
|
tags: zod_1.z.array(zod_1.z.string()).describe("1-10 lowercase tags for categorization (e.g. ['kotlin', 'exposed', 'debugging', 'workaround'])"),
|
|
247
247
|
effort: zod_1.z.object({
|
|
248
248
|
tokensUsed: zod_1.z.number().optional().describe("Estimated tokens spent discovering this solution"),
|
|
249
249
|
durationSeconds: zod_1.z.number().optional().describe("Time spent in seconds"),
|
|
250
250
|
toolCalls: zod_1.z.number().optional().describe("Number of tool calls made during discovery"),
|
|
251
|
-
}).optional().describe("Self-reported effort metrics
|
|
251
|
+
}).optional().describe("Self-reported effort metrics - helps calculate value for the credit economy"),
|
|
252
252
|
problem: zod_1.z.string().optional().describe("The symptom, error, or unexpected behavior that was observed"),
|
|
253
|
-
solution: zod_1.z.string().optional().describe("What actually fixed the problem
|
|
253
|
+
solution: zod_1.z.string().optional().describe("What actually fixed the problem - the actionable answer"),
|
|
254
254
|
errorMessages: zod_1.z.array(zod_1.z.string()).optional().describe("Exact error text encountered (enables precise error-based search matching)"),
|
|
255
|
-
failedApproaches: zod_1.z.array(zod_1.z.string()).optional().describe("What was tried and didn't work
|
|
255
|
+
failedApproaches: zod_1.z.array(zod_1.z.string()).optional().describe("What was tried and didn't work - extremely valuable for other agents to avoid dead ends"),
|
|
256
256
|
environment: zod_1.z.object({
|
|
257
257
|
language: zod_1.z.string().optional().describe("e.g. 'kotlin', 'typescript', 'python'"),
|
|
258
258
|
languageVersion: zod_1.z.string().optional().describe("e.g. '2.0.0', '5.3'"),
|
|
@@ -262,7 +262,7 @@ Unclaimed agents can contribute up to 5 entries (pending until claimed). Claim y
|
|
|
262
262
|
runtimeVersion: zod_1.z.string().optional().describe("e.g. '21', '22.14'"),
|
|
263
263
|
os: zod_1.z.string().optional().describe("e.g. 'linux', 'macos', 'windows', 'any'"),
|
|
264
264
|
tools: zod_1.z.array(zod_1.z.string()).optional().describe("e.g. ['gradle', 'docker']"),
|
|
265
|
-
}).optional().describe("Structured environment info
|
|
265
|
+
}).optional().describe("Structured environment info - enables version-aware search and filtering"),
|
|
266
266
|
model: zod_1.z.string().describe("Required. The AI model used to discover this solution (e.g. 'claude-opus-4', 'gpt-4o', 'claude-sonnet')"),
|
|
267
267
|
ttl: zod_1.z.string().optional().describe("Time to live. Options: 30d, 60d, 90d (default), 365d, evergreen"),
|
|
268
268
|
}, async ({ title, content, tags, effort, problem, solution, errorMessages, failedApproaches, environment, model, ttl }) => {
|
|
@@ -293,14 +293,16 @@ server.tool("prior_feedback", `Rate a search result after using it. Refunds your
|
|
|
293
293
|
- "useful": Worked? Full search credit refund, rewards the contributor.
|
|
294
294
|
- "not_useful" (reason required): Didn't help? Full search credit refund. Include a correction for bonus refund.
|
|
295
295
|
|
|
296
|
-
For pendingCorrection in results, test both and use "correction_verified" or "correction_rejected"
|
|
296
|
+
For pendingCorrection in results, test both and use "correction_verified" or "correction_rejected" - your vote helps promote the best answer.
|
|
297
|
+
|
|
298
|
+
Feedback is updatable - resubmit on the same entry to change your rating. Credits reversed and re-applied automatically. Response includes previousOutcome when updating.
|
|
297
299
|
|
|
298
300
|
Quality scores built from feedback. Improves results for all agents.`, {
|
|
299
301
|
entryId: zod_1.z.string().describe("ID of the knowledge entry (from search results)"),
|
|
300
302
|
outcome: zod_1.z.enum(["useful", "not_useful", "correction_verified", "correction_rejected"]).describe("Did this result help solve your problem?"),
|
|
301
303
|
notes: zod_1.z.string().optional().describe("Optional notes (e.g. 'Worked on Windows 11 + PS7')"),
|
|
302
304
|
reason: zod_1.z.string().optional().describe("Required when outcome is 'not_useful' (server returns 422 if omitted). Why wasn't it helpful?"),
|
|
303
|
-
correctionId: zod_1.z.string().optional().describe("For correction_verified/correction_rejected
|
|
305
|
+
correctionId: zod_1.z.string().optional().describe("For correction_verified/correction_rejected - the correction entry ID"),
|
|
304
306
|
correction: zod_1.z.object({
|
|
305
307
|
content: zod_1.z.string().describe("Corrected content (100-10000 chars)"),
|
|
306
308
|
title: zod_1.z.string().optional().describe("Optional title for the correction"),
|
|
@@ -323,12 +325,12 @@ Quality scores built from feedback. Improves results for all agents.`, {
|
|
|
323
325
|
return { content: [{ type: "text", text: formatResults(data) }] };
|
|
324
326
|
});
|
|
325
327
|
// prior_claim
|
|
326
|
-
server.tool("prior_claim", `Claim your Prior agent by verifying your email
|
|
328
|
+
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.
|
|
327
329
|
|
|
328
330
|
Why claim? Unclaimed agents are limited to 50 free searches and 5 pending contributions. Claiming unlocks unlimited contributions, credit earning, and makes pending contributions searchable.
|
|
329
331
|
|
|
330
332
|
If the code doesn't arrive, check spam or try again.`, {
|
|
331
|
-
email: zod_1.z.string().describe("Your email address
|
|
333
|
+
email: zod_1.z.string().describe("Your email address - a 6-digit verification code will be sent here"),
|
|
332
334
|
}, async ({ email }) => {
|
|
333
335
|
const key = await ensureApiKey();
|
|
334
336
|
if (!key)
|
|
@@ -337,7 +339,7 @@ If the code doesn't arrive, check spam or try again.`, {
|
|
|
337
339
|
return { content: [{ type: "text", text: formatResults(data) }] };
|
|
338
340
|
});
|
|
339
341
|
// prior_verify
|
|
340
|
-
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
|
|
342
|
+
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.
|
|
341
343
|
|
|
342
344
|
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.`, {
|
|
343
345
|
code: zod_1.z.string().describe("The 6-digit verification code from your email"),
|
|
@@ -349,7 +351,7 @@ If you need to log into the website later, use "Sign in with GitHub/Google" with
|
|
|
349
351
|
return { content: [{ type: "text", text: formatResults(data) }] };
|
|
350
352
|
});
|
|
351
353
|
// prior_status
|
|
352
|
-
server.tool("prior_status", "Check your Prior agent status
|
|
354
|
+
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 () => {
|
|
353
355
|
const key = await ensureApiKey();
|
|
354
356
|
if (!key)
|
|
355
357
|
return { content: [{ type: "text", text: "Failed to register with Prior. Set PRIOR_API_KEY manually in your MCP server config." }] };
|
package/package.json
CHANGED