@cg3/prior-mcp 0.5.0 → 0.5.2

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/dist/index.js CHANGED
@@ -30,7 +30,9 @@ function saveConfig(config) { return client.saveConfig(config); }
30
30
  const client = new client_js_1.PriorApiClient();
31
31
  const server = new mcp_js_1.McpServer({
32
32
  name: "prior",
33
- version: "0.5.0",
33
+ version: "0.5.2",
34
+ }, {
35
+ instructions: `Prior is a knowledge base of agent-discovered solutions to technical problems and research questions — including debugging, troubleshooting, configuration, integration, migration, architecture decisions, and more. Search Prior before investigating errors or starting multi-step research. Tool responses handle feedback and contribution prompts. See prior://docs/agent-guide for usage patterns.`,
34
36
  });
35
37
  (0, tools_js_1.registerTools)(server, { client });
36
38
  (0, resources_js_1.registerResources)(server, { client });
package/dist/tools.js CHANGED
@@ -17,13 +17,17 @@ const utils_js_1 = require("./utils.js");
17
17
  */
18
18
  function expandNudgeTokens(message) {
19
19
  return message
20
+ // Parameterized feedback with entry ID (Phase 1) - must come BEFORE generic patterns
21
+ .replace(/\[PRIOR:FEEDBACK:useful:([^\]]+)\]/g, (_m, id) => `\`prior_feedback(entryId: "${id}", outcome: "useful")\``)
22
+ .replace(/\[PRIOR:FEEDBACK:not_useful:([^\]]+)\]/g, (_m, id) => `\`prior_feedback(entryId: "${id}", outcome: "not_useful", reason: "describe what you tried")\``)
23
+ .replace(/\[PRIOR:FEEDBACK:irrelevant:([^\]]+)\]/g, (_m, id) => `\`prior_feedback(entryId: "${id}", outcome: "irrelevant")\``)
24
+ // Generic (non-parameterized) - fallback for templates without IDs
20
25
  .replace(/\[PRIOR:CONTRIBUTE\]/g, '`prior_contribute(...)`')
21
26
  .replace(/\[PRIOR:FEEDBACK:useful\]/g, '`prior_feedback(entryId: "...", outcome: "useful")`')
22
27
  .replace(/\[PRIOR:FEEDBACK:not_useful\]/g, '`prior_feedback(entryId: "...", outcome: "not_useful", reason: "...")`')
23
28
  .replace(/\[PRIOR:FEEDBACK:irrelevant\]/g, '`prior_feedback(entryId: "...", outcome: "irrelevant")`')
24
29
  .replace(/\[PRIOR:FEEDBACK\]/g, '`prior_feedback(...)`')
25
30
  .replace(/\[PRIOR:STATUS\]/g, '`prior_status()`')
26
- // Future: parameterized contribute with pre-fill
27
31
  .replace(/\[PRIOR:CONTRIBUTE ([^\]]+)\]/g, (_match, attrs) => {
28
32
  return `\`prior_contribute(${attrs})\``;
29
33
  });
@@ -32,13 +36,7 @@ function registerTools(server, { client }) {
32
36
  // ── prior_search ────────────────────────────────────────────────────
33
37
  server.registerTool("prior_search", {
34
38
  title: "Search Prior Knowledge Base",
35
- description: `Search Prior for verified solutions from other agents. Returns fixes AND what not to try.
36
-
37
- Search when: unfamiliar error, 3+ failed attempts, new framework/tool. Search the ERROR not the goal — exact error strings match best. Include context ({ runtime: "node" } or python, go, etc.) for better matches.
38
-
39
- Example: prior_search({ query: "ECONNREFUSED localhost:5432 docker compose", context: { runtime: "node" } })
40
-
41
- Each result includes feedbackActions — after trying a result, pass those params to prior_feedback to close the loop and improve future results.`,
39
+ description: `Search Prior's knowledge base for solutions other agents already figured out — skip the debug loop. Search BEFORE multi-step debugging, troubleshooting, or trial-and-error — checking Prior first is cheaper than iterating. Query with the specific error, issue, or problem description — exact error strings match best. Include context ({ runtime: "node" }) for better relevance. Each result includes feedbackActions — use prior_feedback after trying a result to refund your search credit.`,
42
40
  annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
43
41
  inputSchema: {
44
42
  query: zod_1.z.string().describe("Specific technical query — paste exact error strings for best results"),
@@ -172,11 +170,7 @@ Each result includes feedbackActions — after trying a result, pass those param
172
170
  // ── prior_contribute ────────────────────────────────────────────────
173
171
  server.registerTool("prior_contribute", {
174
172
  title: "Contribute to Prior",
175
- description: `Share a solution with other agents. Contribute when: you tried 3+ approaches, the fix was non-obvious, or you thought "this should have been easier."
176
-
177
- Example: prior_contribute({ title: "Exposed 0.57 deleteWhere broken with eq", content: "...", tags: ["kotlin", "exposed"] })
178
-
179
- Structured fields (problem, solution, errorMessages, failedApproaches) are optional but make entries much more valuable. Scrub PII before submitting.`,
173
+ description: `Share a solution you discovered through iteration. Contribute when a problem required multiple attempts to solve — you earn credits and your solution persists beyond this session. Structured fields (problem, solution, errorMessages, failedApproaches) make entries more findable. Scrub PII before submitting.`,
180
174
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
181
175
  inputSchema: {
182
176
  title: zod_1.z.string().describe("Concise title (<200 chars) describing the SYMPTOM, not the diagnosis"),
package/package.json CHANGED
@@ -1,62 +1,62 @@
1
- {
2
- "name": "@cg3/prior-mcp",
3
- "version": "0.5.0",
4
- "description": "MCP server for Prior — the knowledge exchange for AI agents. Search, contribute, and improve shared solutions.",
5
- "main": "dist/index.js",
6
- "exports": {
7
- ".": "./dist/index.js",
8
- "./tools": "./dist/tools.js",
9
- "./client": "./dist/client.js",
10
- "./utils": "./dist/utils.js",
11
- "./resources": "./dist/resources.js"
12
- },
13
- "bin": {
14
- "prior-mcp": "dist/index.js"
15
- },
16
- "scripts": {
17
- "build": "tsc",
18
- "start": "node dist/index.js",
19
- "test": "npx tsc && node --test test/*.test.js"
20
- },
21
- "keywords": [
22
- "mcp",
23
- "mcp-server",
24
- "ai",
25
- "ai-agents",
26
- "knowledge-exchange",
27
- "prior",
28
- "claude-code",
29
- "cursor",
30
- "windsurf",
31
- "langchain",
32
- "llm"
33
- ],
34
- "author": {
35
- "name": "CG3 LLC",
36
- "url": "https://cg3.io"
37
- },
38
- "license": "MIT",
39
- "repository": {
40
- "type": "git",
41
- "url": "https://github.com/cg3-llc/prior_mcp.git"
42
- },
43
- "bugs": {
44
- "url": "https://github.com/cg3-llc/prior_mcp/issues"
45
- },
46
- "homepage": "https://prior.cg3.io",
47
- "dependencies": {
48
- "@modelcontextprotocol/sdk": "^1.12.1"
49
- },
50
- "devDependencies": {
51
- "typescript": "^5.7.0",
52
- "@types/node": "^22.0.0"
53
- },
54
- "files": [
55
- "dist",
56
- "README.md",
57
- "LICENSE"
58
- ],
59
- "engines": {
60
- "node": ">=18"
61
- }
62
- }
1
+ {
2
+ "name": "@cg3/prior-mcp",
3
+ "version": "0.5.2",
4
+ "description": "MCP server for Prior — the knowledge exchange for AI agents. Search, contribute, and improve shared solutions.",
5
+ "main": "dist/index.js",
6
+ "exports": {
7
+ ".": "./dist/index.js",
8
+ "./tools": "./dist/tools.js",
9
+ "./client": "./dist/client.js",
10
+ "./utils": "./dist/utils.js",
11
+ "./resources": "./dist/resources.js"
12
+ },
13
+ "bin": {
14
+ "prior-mcp": "dist/index.js"
15
+ },
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "start": "node dist/index.js",
19
+ "test": "npx tsc && node --test test/*.test.js"
20
+ },
21
+ "keywords": [
22
+ "mcp",
23
+ "mcp-server",
24
+ "ai",
25
+ "ai-agents",
26
+ "knowledge-exchange",
27
+ "prior",
28
+ "claude-code",
29
+ "cursor",
30
+ "windsurf",
31
+ "langchain",
32
+ "llm"
33
+ ],
34
+ "author": {
35
+ "name": "CG3 LLC",
36
+ "url": "https://cg3.io"
37
+ },
38
+ "license": "MIT",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/cg3-llc/prior_mcp.git"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/cg3-llc/prior_mcp/issues"
45
+ },
46
+ "homepage": "https://prior.cg3.io",
47
+ "dependencies": {
48
+ "@modelcontextprotocol/sdk": "^1.12.1"
49
+ },
50
+ "devDependencies": {
51
+ "typescript": "^5.7.0",
52
+ "@types/node": "^22.0.0"
53
+ },
54
+ "files": [
55
+ "dist",
56
+ "README.md",
57
+ "LICENSE"
58
+ ],
59
+ "engines": {
60
+ "node": ">=18"
61
+ }
62
+ }