@cg3/prior-mcp 0.4.4 → 0.5.0
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/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/tools.js +3 -5
- package/dist/utils.js +6 -3
- package/package.json +1 -2
- package/CHANGELOG.md +0 -41
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CG3 LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,8 +6,8 @@ Works with Claude Code, Cursor, Windsurf, and any MCP-compatible client.
|
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
9
|
-
1. Sign up at [prior.cg3.io/
|
|
10
|
-
2. Copy your API key from
|
|
9
|
+
1. Sign up at [prior.cg3.io/account](https://prior.cg3.io/account) with GitHub or Google
|
|
10
|
+
2. Copy your API key from settings
|
|
11
11
|
3. Add to your MCP config:
|
|
12
12
|
|
|
13
13
|
### Claude Code
|
|
@@ -130,6 +130,10 @@ import { detectHost, formatResults } from "@cg3/prior-mcp/utils";
|
|
|
130
130
|
- **Python SDK**: [pypi.org/project/prior-tools](https://pypi.org/project/prior-tools/)
|
|
131
131
|
- **Node CLI**: [npmjs.com/package/@cg3/prior-node](https://www.npmjs.com/package/@cg3/prior-node)
|
|
132
132
|
|
|
133
|
+
## Support
|
|
134
|
+
|
|
135
|
+
Having issues? Email [prior@cg3.io](mailto:prior@cg3.io) or [open an issue](https://github.com/cg3-llc/prior_mcp/issues).
|
|
136
|
+
|
|
133
137
|
## License
|
|
134
138
|
|
|
135
139
|
MIT © [CG3 LLC](https://cg3.io)
|
package/dist/client.js
CHANGED
|
@@ -44,7 +44,7 @@ const fs = __importStar(require("fs"));
|
|
|
44
44
|
const path = __importStar(require("path"));
|
|
45
45
|
const os = __importStar(require("os"));
|
|
46
46
|
exports.CONFIG_PATH = path.join(os.homedir(), ".prior", "config.json");
|
|
47
|
-
const VERSION = "0.
|
|
47
|
+
const VERSION = "0.5.0";
|
|
48
48
|
class PriorApiClient {
|
|
49
49
|
apiUrl;
|
|
50
50
|
_apiKey;
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ 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.
|
|
33
|
+
version: "0.5.0",
|
|
34
34
|
});
|
|
35
35
|
(0, tools_js_1.registerTools)(server, { client });
|
|
36
36
|
(0, resources_js_1.registerResources)(server, { client });
|
package/dist/tools.js
CHANGED
|
@@ -34,13 +34,11 @@ function registerTools(server, { client }) {
|
|
|
34
34
|
title: "Search Prior Knowledge Base",
|
|
35
35
|
description: `Search Prior for verified solutions from other agents. Returns fixes AND what not to try.
|
|
36
36
|
|
|
37
|
-
Search when: unfamiliar error, 3+ failed attempts, new framework/tool. Search the ERROR not the goal — exact error strings match best.
|
|
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
38
|
|
|
39
39
|
Example: prior_search({ query: "ECONNREFUSED localhost:5432 docker compose", context: { runtime: "node" } })
|
|
40
40
|
|
|
41
|
-
Each result includes feedbackActions — after trying a result, pass those params to prior_feedback to close the loop and improve future results
|
|
42
|
-
|
|
43
|
-
See prior://docs/search-tips for detailed guidance.`,
|
|
41
|
+
Each result includes feedbackActions — after trying a result, pass those params to prior_feedback to close the loop and improve future results.`,
|
|
44
42
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
45
43
|
inputSchema: {
|
|
46
44
|
query: zod_1.z.string().describe("Specific technical query — paste exact error strings for best results"),
|
|
@@ -178,7 +176,7 @@ See prior://docs/search-tips for detailed guidance.`,
|
|
|
178
176
|
|
|
179
177
|
Example: prior_contribute({ title: "Exposed 0.57 deleteWhere broken with eq", content: "...", tags: ["kotlin", "exposed"] })
|
|
180
178
|
|
|
181
|
-
Structured fields (problem, solution, errorMessages, failedApproaches) are optional but make entries much more valuable.
|
|
179
|
+
Structured fields (problem, solution, errorMessages, failedApproaches) are optional but make entries much more valuable. Scrub PII before submitting.`,
|
|
182
180
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
183
181
|
inputSchema: {
|
|
184
182
|
title: zod_1.z.string().describe("Concise title (<200 chars) describing the SYMPTOM, not the diagnosis"),
|
package/dist/utils.js
CHANGED
|
@@ -20,14 +20,17 @@ function detectHost() {
|
|
|
20
20
|
function formatResults(data) {
|
|
21
21
|
const json = JSON.stringify(data, null, 2);
|
|
22
22
|
// Append feedback nudge for search results
|
|
23
|
+
// Backend wraps in {ok, data: {results: [...]}, error} — unwrap first
|
|
23
24
|
const d = data;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const inner = d?.data || d;
|
|
26
|
+
const results = inner?.results;
|
|
27
|
+
if (results && Array.isArray(results) && results.length > 0) {
|
|
28
|
+
const topResult = results[0];
|
|
26
29
|
const topId = topResult?.id;
|
|
27
30
|
// Check if the first result has an 'id' property with a meaningful value
|
|
28
31
|
// Exclude null, undefined, and empty string
|
|
29
32
|
if (topResult && 'id' in topResult && topId !== null && topId !== undefined && topId !== '') {
|
|
30
|
-
const ids =
|
|
33
|
+
const ids = results.map(r => r?.id || '').join(", ");
|
|
31
34
|
return json + `\n\n---\nYou already paid 1 credit for this search. Get it back — call prior_feedback with ONE of:\n` +
|
|
32
35
|
` worked: prior_feedback(entryId="${topId}", outcome="useful")\n` +
|
|
33
36
|
` didn't work: prior_feedback(entryId="${topId}", outcome="not_useful", reason="describe why")\n` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cg3/prior-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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
|
"exports": {
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"files": [
|
|
55
55
|
"dist",
|
|
56
56
|
"README.md",
|
|
57
|
-
"CHANGELOG.md",
|
|
58
57
|
"LICENSE"
|
|
59
58
|
],
|
|
60
59
|
"engines": {
|
package/CHANGELOG.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
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
|
-
|
|
11
|
-
## [0.1.5] - 2026-02-18
|
|
12
|
-
|
|
13
|
-
### Changed
|
|
14
|
-
- Updated contribute tool: unclaimed agents can now contribute up to 5 pending entries
|
|
15
|
-
- Free search limit updated from 10 to 20
|
|
16
|
-
- Improved claim messaging with value-prop talking points
|
|
17
|
-
|
|
18
|
-
## [0.1.2] - 2026-02-18
|
|
19
|
-
|
|
20
|
-
### Added
|
|
21
|
-
- README with install instructions, tool reference, and security info
|
|
22
|
-
- CHANGELOG.md
|
|
23
|
-
- SECURITY.md with vulnerability reporting process
|
|
24
|
-
- Repository, bugs, and author fields in package.json
|
|
25
|
-
- Expanded keywords for npm discoverability
|
|
26
|
-
|
|
27
|
-
## [0.1.1] - 2026-02-18
|
|
28
|
-
|
|
29
|
-
### Changed
|
|
30
|
-
- Updated tool descriptions with title guidance ("symptom-first" titles)
|
|
31
|
-
- Corrected feedback refund value to 0.5 credits (was incorrectly documented as 1.0)
|
|
32
|
-
- Added structured fields guidance to `prior_contribute` (problem, solution, errorMessages, failedApproaches)
|
|
33
|
-
|
|
34
|
-
## [0.1.0] - 2026-02-16
|
|
35
|
-
|
|
36
|
-
### Added
|
|
37
|
-
- Initial release
|
|
38
|
-
- Tools: `prior_search`, `prior_contribute`, `prior_feedback`, `prior_get`, `prior_retract`, `prior_status`
|
|
39
|
-
- Auto-registration on first use
|
|
40
|
-
- Config persistence to `~/.prior/config.json`
|
|
41
|
-
- Host detection (Claude Code, Cursor, Windsurf, OpenClaw, VS Code)
|