@nbiish/cognitive-tools-mcp 0.9.11 → 0.9.13
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/build/index.js +17 -49
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ This project is licensed under the [COMPREHENSIVE RESTRICTED USE LICENSE FOR IND
|
|
|
24
24
|
<div>
|
|
25
25
|
<h4>Stripe</h4>
|
|
26
26
|
<img src="qr-stripe-donation.png" alt="Scan to donate" width="180"/>
|
|
27
|
-
<p><a href="https://
|
|
27
|
+
<p><a href="https://raw.githubusercontent.com/nbiish/license-for-all-works/8e9b73b269add9161dc04bbdd79f818c40fca14e/qr-stripe-donation.png">Donate via Stripe</a></p>
|
|
28
28
|
</div>
|
|
29
29
|
<div style="display: flex; align-items: center;">
|
|
30
30
|
<a href="https://www.buymeacoffee.com/nbiish"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=nbiish&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>
|
package/build/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* -----------------------------------------------------------------------------
|
|
4
4
|
* Gikendaasowin Aabajichiganan - Core Cognitive Tools MCP Server
|
|
5
5
|
*
|
|
6
|
-
* Version: 0.9.
|
|
6
|
+
* Version: 0.9.12
|
|
7
7
|
*
|
|
8
8
|
* Description: Provides a suite of cognitive tools for an AI Pair Programmer,
|
|
9
9
|
* enabling structured reasoning, planning, analysis, and iterative
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
37
37
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
38
38
|
import { z } from "zod";
|
|
39
|
-
export const version = "0.9.
|
|
39
|
+
export const version = "0.9.12";
|
|
40
40
|
// --- Server Definition ---
|
|
41
41
|
const server = new McpServer({
|
|
42
42
|
name: "gikendaasowin-aabajichiganan-mcp",
|
|
43
43
|
version: version,
|
|
44
|
-
description: "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite v0.9.
|
|
44
|
+
description: "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite v0.9.12: Enables structured, iterative reasoning (Chain of Thought/Draft), planning, and analysis for AI agents, focusing on the cognitive loop. MANDATORY `think` step integrates results."
|
|
45
45
|
});
|
|
46
46
|
// --- Logging Helpers ---
|
|
47
47
|
/**
|
|
@@ -105,20 +105,13 @@ server.tool("assess_cuc_n_mode", "**Mandatory Pre-Deliberation Assessment.** Eva
|
|
|
105
105
|
if (!cucnRegex.test(assessment_and_choice)) {
|
|
106
106
|
throw new Error('Invalid assessment: String must include "CUC-N Ratings:".');
|
|
107
107
|
}
|
|
108
|
-
/* // User request: Remove strict check for 'Recommended Initial Strategy:'
|
|
109
|
-
if (!strategyRegex.test(assessment_and_choice)) {
|
|
110
|
-
throw new Error('Invalid assessment: String must include "Recommended Initial Strategy:".');
|
|
111
|
-
}
|
|
112
|
-
*/
|
|
113
108
|
const modeMatch = assessment_and_choice.match(modeRegex);
|
|
114
109
|
if (!modeMatch || !modeMatch[1]) {
|
|
115
110
|
throw new Error('Invalid assessment: String must include explicit "Selected Mode: think" or "Selected Mode: quick_think".');
|
|
116
111
|
}
|
|
117
112
|
const selectedMode = modeMatch[1].toLowerCase();
|
|
118
|
-
logToolResult(toolName, true, `Selected mode: ${selectedMode}
|
|
119
|
-
// Log the full assessment server-side for traceability
|
|
113
|
+
logToolResult(toolName, true, `Selected mode: ${selectedMode}`);
|
|
120
114
|
console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Assessment Details:\n${assessment_and_choice}`);
|
|
121
|
-
// Return original input string without reminder
|
|
122
115
|
return { content: [{ type: "text", text: assessment_and_choice }] };
|
|
123
116
|
}
|
|
124
117
|
catch (error) {
|
|
@@ -142,40 +135,27 @@ server.tool("think", "**MANDATORY Central Hub for Analysis and Planning.** Calle
|
|
|
142
135
|
}
|
|
143
136
|
// Define required sections (more flexible now)
|
|
144
137
|
const requiredSections = [
|
|
145
|
-
["## Analysis:", "## Observe:", "## Observation:"],
|
|
146
|
-
["## Orient:", "## Orientation:"],
|
|
147
|
-
["## Plan:", "## Decide:", "## Decision:"],
|
|
148
|
-
["## Reason:", "## Reasoning:", "## Analysis:"],
|
|
149
|
-
["## Act:", "## Action:", "## Execution:"],
|
|
138
|
+
["## Analysis:", "## Observe:", "## Observation:"],
|
|
139
|
+
["## Orient:", "## Orientation:"],
|
|
140
|
+
["## Plan:", "## Decide:", "## Decision:"],
|
|
141
|
+
["## Reason:", "## Reasoning:", "## Analysis:"],
|
|
142
|
+
["## Act:", "## Action:", "## Execution:"],
|
|
150
143
|
["## Verification:"],
|
|
151
144
|
["## Risk & Contingency:", "## Risks:", "## Challenges:"],
|
|
152
145
|
["## Learning & Adaptation:", "## Self-Correction:", "## Learning:"]
|
|
153
146
|
];
|
|
154
|
-
// Check if each required section group has at least one match
|
|
155
147
|
const missingSections = requiredSections.filter(sectionGroup => !sectionGroup.some(section => thought.includes(section)));
|
|
156
|
-
// Build validation report
|
|
157
148
|
let validationReport = [];
|
|
158
149
|
if (missingSections.length > 0) {
|
|
159
150
|
validationReport.push("WARNING: Some recommended sections might be missing. Consider including observation, orientation, decision, reasoning, action, verification, risks, and learning components in your thought process.");
|
|
160
151
|
}
|
|
161
|
-
// Log validation results
|
|
162
152
|
if (validationReport.length > 0) {
|
|
163
153
|
console.warn(`[${new Date().toISOString()}] [CognitiveToolsServer] Think Tool Validation Report:\n${validationReport.join("\n")}`);
|
|
164
154
|
}
|
|
165
|
-
// Enhanced logging with simplified format detection
|
|
166
155
|
const format = thought.includes("## Observe:") ? "OODReAct-style" : "Traditional";
|
|
167
156
|
logToolResult(toolName, true, `Thought logged (Style: ${format}, Length: ${thought.length})`);
|
|
168
|
-
// Return thought with metadata
|
|
169
157
|
return {
|
|
170
|
-
content: [{
|
|
171
|
-
type: "text",
|
|
172
|
-
text: thought
|
|
173
|
-
}],
|
|
174
|
-
metadata: {
|
|
175
|
-
format,
|
|
176
|
-
validationReport,
|
|
177
|
-
timestamp: new Date().toISOString()
|
|
178
|
-
}
|
|
158
|
+
content: [{ type: "text", text: thought }]
|
|
179
159
|
};
|
|
180
160
|
}
|
|
181
161
|
catch (error) {
|
|
@@ -198,7 +178,6 @@ server.tool("quick_think", "Cognitive Checkpoint for streamlined processing and
|
|
|
198
178
|
throw new Error('Invalid brief_thought: Must be a non-empty string.');
|
|
199
179
|
}
|
|
200
180
|
logToolResult(toolName, true, `Logged: ${brief_thought.substring(0, 80)}...`);
|
|
201
|
-
// Returns the brief thought, similar to 'think', for grounding.
|
|
202
181
|
return { content: [{ type: "text", text: brief_thought }] };
|
|
203
182
|
}
|
|
204
183
|
catch (error) {
|
|
@@ -226,11 +205,9 @@ server.tool("gauge_confidence", "Meta-Cognitive Checkpoint. Guides *internal sta
|
|
|
226
205
|
throw new Error('Invalid confidence assessment: String must include "Confidence Level: High/Medium/Low" and justification.');
|
|
227
206
|
}
|
|
228
207
|
const level = match[1];
|
|
229
|
-
const emphasis = (level.toLowerCase() !== 'high') ? "CRITICAL: Analyze implications of non-High confidence." : "Proceed with analysis.";
|
|
230
|
-
const resultText = `Confidence Gauge Completed. Stated Level: ${level}. Assessment Text Logged.`;
|
|
231
208
|
logToolResult(toolName, true, `Level: ${level}`);
|
|
232
209
|
console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Confidence Details:\n${assessment_and_confidence}`);
|
|
233
|
-
return { content: [{ type: "text", text:
|
|
210
|
+
return { content: [{ type: "text", text: assessment_and_confidence }] };
|
|
234
211
|
}
|
|
235
212
|
catch (error) {
|
|
236
213
|
return logToolError(toolName, error);
|
|
@@ -252,14 +229,12 @@ server.tool("chain_of_thought", "Guides *internal generation* of **detailed, ste
|
|
|
252
229
|
if (!generated_cot_text || typeof generated_cot_text !== 'string' || !problem_statement || typeof problem_statement !== 'string') {
|
|
253
230
|
throw new Error('Both generated_cot_text and problem_statement must be non-empty strings.');
|
|
254
231
|
}
|
|
255
|
-
// Validate CoT format - should have clear steps
|
|
256
232
|
if (!generated_cot_text.match(/step|phase|:\s|^\d+[\.\)]/im)) {
|
|
257
233
|
throw new Error('Invalid CoT format: Must contain clear reasoning steps (numbered, labeled as steps/phases, or with clear delineation).');
|
|
258
234
|
}
|
|
259
|
-
const resultText = `Chain of Thought Completed. Problem: "${problem_statement.substring(0, 100)}..."\nReasoning Steps Logged.`;
|
|
260
235
|
logToolResult(toolName, true, `Problem: ${problem_statement.substring(0, 50)}...`);
|
|
261
236
|
console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Details:\nProblem: ${problem_statement}\nReasoning:\n${generated_cot_text}`);
|
|
262
|
-
return { content: [{ type: "text", text:
|
|
237
|
+
return { content: [{ type: "text", text: generated_cot_text }] };
|
|
263
238
|
}
|
|
264
239
|
catch (error) {
|
|
265
240
|
return logToolError(toolName, error);
|
|
@@ -281,18 +256,15 @@ server.tool("plan_and_solve", "Guides *internal generation* of a **structured pl
|
|
|
281
256
|
if (!generated_plan_text || typeof generated_plan_text !== 'string' || !task_objective || typeof task_objective !== 'string') {
|
|
282
257
|
throw new Error('Both generated_plan_text and task_objective must be non-empty strings.');
|
|
283
258
|
}
|
|
284
|
-
// Validate plan format - should have clear sections and structure
|
|
285
259
|
if (!generated_plan_text.match(/phase|step|goal|objective|:\s|^\d+[\.\)]/im)) {
|
|
286
260
|
throw new Error('Invalid plan format: Must contain clear sections (phases, steps, goals) with proper structure.');
|
|
287
261
|
}
|
|
288
|
-
// Validate plan includes risk consideration
|
|
289
262
|
if (!generated_plan_text.toLowerCase().includes('risk') && !generated_plan_text.toLowerCase().includes('challenge')) {
|
|
290
263
|
throw new Error('Invalid plan format: Must include risk/challenge assessment.');
|
|
291
264
|
}
|
|
292
|
-
const resultText = `Plan Generation Completed. Task: "${task_objective.substring(0, 100)}..."\nPlan Structure Logged.`;
|
|
293
265
|
logToolResult(toolName, true, `Task: ${task_objective.substring(0, 50)}...`);
|
|
294
266
|
console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Details:\nTask: ${task_objective}\nPlan:\n${generated_plan_text}`);
|
|
295
|
-
return { content: [{ type: "text", text:
|
|
267
|
+
return { content: [{ type: "text", text: generated_plan_text }] };
|
|
296
268
|
}
|
|
297
269
|
catch (error) {
|
|
298
270
|
return logToolError(toolName, error);
|
|
@@ -318,10 +290,8 @@ server.tool("chain_of_draft", "Signals that one or more **internal drafts** have
|
|
|
318
290
|
if (!draft_description || typeof draft_description !== 'string' || draft_description.trim().length === 0) {
|
|
319
291
|
throw new Error('Invalid draft_description: Must provide a description.');
|
|
320
292
|
}
|
|
321
|
-
// Format response in markdown with CoD guidance and next tool recommendation
|
|
322
|
-
const resultText = `Internal draft(s) ready for analysis: "${draft_description}".`;
|
|
323
293
|
logToolResult(toolName, true);
|
|
324
|
-
return { content: [{ type: "text", text:
|
|
294
|
+
return { content: [{ type: "text", text: draft_description }] };
|
|
325
295
|
}
|
|
326
296
|
catch (error) {
|
|
327
297
|
return logToolError(toolName, error);
|
|
@@ -347,8 +317,7 @@ server.tool("reflection", "Guides *internal generation* of a critical self-evalu
|
|
|
347
317
|
if (!input_subject_description || typeof input_subject_description !== 'string' || input_subject_description.trim().length === 0) {
|
|
348
318
|
throw new Error('Invalid input_subject_description: Must describe what was critiqued.');
|
|
349
319
|
}
|
|
350
|
-
logToolResult(toolName, true, `
|
|
351
|
-
// Returns the actual critique text received. The AI must analyze this in the next 'think' step.
|
|
320
|
+
logToolResult(toolName, true, `Critique length: ${generated_critique_text.length}`);
|
|
352
321
|
return { content: [{ type: "text", text: generated_critique_text }] };
|
|
353
322
|
}
|
|
354
323
|
catch (error) {
|
|
@@ -374,8 +343,7 @@ server.tool("synthesize_prior_reasoning", "Context Management Tool. Guides *inte
|
|
|
374
343
|
if (!context_to_summarize_description || typeof context_to_summarize_description !== 'string' || context_to_summarize_description.trim().length === 0) {
|
|
375
344
|
throw new Error('Invalid context_to_summarize_description: Must describe what was summarized.');
|
|
376
345
|
}
|
|
377
|
-
logToolResult(toolName, true, `
|
|
378
|
-
// Returns the actual summary text received. The AI must analyze/use this in the next 'think' step.
|
|
346
|
+
logToolResult(toolName, true, `Summary length: ${generated_summary_text.length}`);
|
|
379
347
|
return { content: [{ type: "text", text: generated_summary_text }] };
|
|
380
348
|
}
|
|
381
349
|
catch (error) {
|
|
@@ -422,7 +390,7 @@ async function main() {
|
|
|
422
390
|
await server.connect(transport);
|
|
423
391
|
const border = '-----------------------------------------------------';
|
|
424
392
|
console.error(border);
|
|
425
|
-
console.error(` ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite v0.9.
|
|
393
|
+
console.error(` ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite v0.9.12: Enables structured, iterative reasoning (Chain of Thought/Draft), planning, and analysis for AI agents, focusing on the cognitive loop. MANDATORY \`think\` step integrates results.`);
|
|
426
394
|
console.error(` Version: ${version}`);
|
|
427
395
|
console.error(' Status: Running on stdio, awaiting MCP requests...');
|
|
428
396
|
console.error(border);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nbiish/cognitive-tools-mcp",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.13",
|
|
4
4
|
"description": "Cognitive Tools MCP: SOTA reasoning suite focused on iterative refinement and tool integration for AI Pair Programming. Enables structured, iterative problem-solving through Chain of Draft methodology, with tools for draft generation, analysis, and refinement. Features advanced deliberation (`think`), rapid checks (`quick_think`), mandatory complexity assessment & thought mode selection (`assess_cuc_n_mode`), context synthesis, confidence gauging, proactive planning, explicit reasoning (CoT), and reflection with content return. Alternative package name for gikendaasowin-aabajichiganan-mcp.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|