@cognivia/mcp 0.1.0 → 0.2.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/README.md +1 -1
- package/package.json +2 -2
- package/server.mjs +40 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @cognivia/mcp
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol server that gives any AI agent Cognivia's learning
|
|
4
|
-
diagnostics as tools: `diagnose_error`, `get_memory_state`, `generate_report
|
|
4
|
+
diagnostics as tools: `diagnose_error`, `get_memory_state`, `generate_report`, and (with a live key) `set_item_misconceptions`, `set_concept_prerequisites` to sharpen diagnosis on your own content.
|
|
5
5
|
|
|
6
6
|
```jsonc
|
|
7
7
|
{ "mcpServers": { "cognivia": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognivia/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Model Context Protocol server for Cognivia. Gives any AI agent learning diagnostics (error type, memory state, session report) as callable tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": { "cognivia-mcp": "server.mjs" },
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"homepage": "https://cognivia-platform.vercel.app/intelligence",
|
|
11
11
|
"repository": { "type": "git", "url": "git+https://github.com/Manik-Maurya/cognivia-platform.git", "directory": "packages/mcp" },
|
|
12
12
|
"engines": { "node": ">=18" },
|
|
13
|
-
"dependencies": { "@cognivia/core": "^0.
|
|
13
|
+
"dependencies": { "@cognivia/core": "^0.2.0" },
|
|
14
14
|
"publishConfig": { "access": "public" },
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"author": "Manik Maurya"
|
package/server.mjs
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
// diagnose_error(subject, question, answer, correct, latencyMs, confidence)
|
|
8
8
|
// get_memory_state(attempts[])
|
|
9
9
|
// generate_report(attempts[])
|
|
10
|
+
// set_item_misconceptions(items[]) (live key; sharpens diagnose on your items)
|
|
11
|
+
// set_concept_prerequisites(prerequisites[]) (live key; enables prerequisite_gap)
|
|
10
12
|
//
|
|
11
13
|
// All computed by @cognivia/core - the same engine behind the site, console, CLI.
|
|
12
14
|
//
|
|
@@ -45,6 +47,34 @@ const TOOLS = [
|
|
|
45
47
|
description: "Build a full Cognivia Session Report (Learning Genome, per-item diagnosis, recommendation) from a set of attempts.",
|
|
46
48
|
inputSchema: { type: "object", properties: { attempts: { type: "array" } }, required: ["attempts"] },
|
|
47
49
|
},
|
|
50
|
+
{
|
|
51
|
+
name: "set_item_misconceptions",
|
|
52
|
+
description: "Upload item -> misconception maps so diagnose names the misconception behind a wrong answer to YOUR own items. Requires COGNIVIA_API_KEY (a self-serve live key).",
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: {
|
|
56
|
+
items: {
|
|
57
|
+
type: "array",
|
|
58
|
+
description: "[{ item_ref, distractors: { \"the wrong option\": \"the misconception it reveals\" } }]",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
required: ["items"],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "set_concept_prerequisites",
|
|
66
|
+
description: "Upload concept -> prerequisite maps so diagnose flags a prerequisite_gap when a learner is weak on a foundation you declared. Requires COGNIVIA_API_KEY (a self-serve live key).",
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: {
|
|
70
|
+
prerequisites: {
|
|
71
|
+
type: "array",
|
|
72
|
+
description: "[{ concept, requires: [\"prerequisite concept\", ...] }]",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
required: ["prerequisites"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
48
78
|
];
|
|
49
79
|
|
|
50
80
|
function textResult(obj, text) {
|
|
@@ -75,6 +105,15 @@ async function callTool(name, a = {}) {
|
|
|
75
105
|
const rep = core.buildReport(a.attempts || [], { idPrefix: "CGV-MCP" });
|
|
76
106
|
return textResult(rep, core.renderText(rep));
|
|
77
107
|
}
|
|
108
|
+
// Content maps are remote-only writes to the partner's account (a live key).
|
|
109
|
+
if (name === "set_item_misconceptions") {
|
|
110
|
+
if (!remote) throw new Error("Set COGNIVIA_API_KEY (a self-serve live key) to upload content maps.");
|
|
111
|
+
return textResult(await client.setItemMisconceptions(a.items || []));
|
|
112
|
+
}
|
|
113
|
+
if (name === "set_concept_prerequisites") {
|
|
114
|
+
if (!remote) throw new Error("Set COGNIVIA_API_KEY (a self-serve live key) to upload content maps.");
|
|
115
|
+
return textResult(await client.setConceptPrerequisites(a.prerequisites || []));
|
|
116
|
+
}
|
|
78
117
|
throw new Error("unknown tool: " + name);
|
|
79
118
|
}
|
|
80
119
|
|
|
@@ -90,7 +129,7 @@ rl.on("line", async (line) => {
|
|
|
90
129
|
ok(id, {
|
|
91
130
|
protocolVersion: "2024-11-05",
|
|
92
131
|
capabilities: { tools: {} },
|
|
93
|
-
serverInfo: { name: "cognivia", version: "0.
|
|
132
|
+
serverInfo: { name: "cognivia", version: "0.2.0" },
|
|
94
133
|
});
|
|
95
134
|
} else if (method === "tools/list") {
|
|
96
135
|
ok(id, { tools: TOOLS });
|