@nbiish/cognitive-tools-mcp 0.6.1 → 0.7.1
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 +565 -88
- package/README.md +25 -4
- package/build/index.js +78 -63
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# @nbiish/gikendaasowin-aabajichiganan-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
<hr width="50%">
|
|
5
|
+
|
|
6
|
+
<h3>Support This Project</h3>
|
|
7
|
+
<div style="display: flex; justify-content: center; gap: 20px; margin: 20px 0;">
|
|
8
|
+
<div>
|
|
9
|
+
<h4>Stripe</h4>
|
|
10
|
+
<img src="qr-stripe-donation.png" alt="Scan to donate" width="180"/>
|
|
11
|
+
<p><a href="https://donate.stripe.com/3cs29La1j8UGfnObII">Donate via Stripe</a></p>
|
|
12
|
+
</div>
|
|
13
|
+
<div style="display: flex; align-items: center;">
|
|
14
|
+
<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>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<hr width="50%">
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.7.1): SOTA internal reasoning suite aligned with AI Pair Programmer Prompt v0.7.1+. Features advanced deliberation (`think`), rapid checks (`quick_think`), mandatory complexity assessment & strategy selection, context synthesis, confidence gauging, proactive planning, explicit reasoning (CoT), and reflection, designed for robust agentic workflows.
|
|
4
22
|
|
|
5
23
|
Known as:
|
|
6
24
|
- Anishinaabemowin: [`@nbiish/gikendaasowin-aabajichiganan-mcp`](https://www.npmjs.com/package/@nbiish/gikendaasowin-aabajichiganan-mcp)
|
|
@@ -189,6 +207,7 @@ Example Response:
|
|
|
189
207
|
|
|
190
208
|
## Version History
|
|
191
209
|
|
|
210
|
+
- **0.7.1**: Updated to align with AI Pair Programmer Prompt v0.7.1+, renamed `assess_cuc_n_mode` to `assess_complexity_and_select_thought_mode`, enhanced cognitive tools for more explicit handling of tool needs
|
|
192
211
|
- **0.6.1**: Fixed tool naming issue for technical length limitation
|
|
193
212
|
- **0.3.9**: Updated tool descriptions and fixed error handling to improve reliability
|
|
194
213
|
- **0.3.6**: Updated repository URLs to point to gikendaasowin-aabajichiganan-mcp
|
|
@@ -205,14 +224,16 @@ This work is licensed under the [COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGE
|
|
|
205
224
|
|
|
206
225
|
## Citation
|
|
207
226
|
|
|
227
|
+
Please cite this project using the following BibTeX entry:
|
|
228
|
+
|
|
208
229
|
```bibtex
|
|
209
230
|
@misc{gikendaasowin-aabajichiganan-mcp2025,
|
|
210
|
-
author/creator/steward = {ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder)},
|
|
211
|
-
title/description = {
|
|
231
|
+
author/creator/steward = {ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band},
|
|
232
|
+
title/description = {gikendaasowin-aabajichiganan-mcp (Cognitive Tools MCP) - Advanced internal reasoning suite for LLM agents},
|
|
212
233
|
type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions},
|
|
213
234
|
year = {2025},
|
|
214
235
|
publisher/source/event = {GitHub repository under tribal sovereignty protections},
|
|
215
236
|
howpublished = {\url{https://github.com/nbiish/gikendaasowin-aabajichiganan-mcp}},
|
|
216
|
-
note = {Authored and stewarded by ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Indigenous intellectual property, traditional knowledge systems (TK), traditional cultural expressions (TCEs), and associated data protected under tribal law, federal Indian law, treaty rights, Indigenous Data Sovereignty principles, and international indigenous rights frameworks including UNDRIP. All usage, benefit-sharing, and data governance are governed by the COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS.}
|
|
237
|
+
note = {Authored and stewarded by ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band (whose community faced violent dispersal resulting in descendants affiliating with LTBB, GTBOCI, and First Nations in Canada, as detailed in the Preamble), an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Indigenous intellectual property, traditional knowledge systems (TK), traditional cultural expressions (TCEs), and associated data protected under tribal law, federal Indian law, treaty rights, Indigenous Data Sovereignty principles, and international indigenous rights frameworks including UNDRIP. All usage, benefit-sharing, and data governance are governed by the COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS.}
|
|
217
238
|
}
|
|
218
239
|
```
|
package/build/index.js
CHANGED
|
@@ -5,160 +5,175 @@ import { z } from "zod";
|
|
|
5
5
|
// Create the MCP server
|
|
6
6
|
const server = new McpServer({
|
|
7
7
|
name: "gikendaasowin-aabajichiganan-mcp",
|
|
8
|
-
// Version reflects
|
|
9
|
-
version: "0.
|
|
10
|
-
description: "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.
|
|
8
|
+
// Version reflects refined tool integration guidance
|
|
9
|
+
version: "0.7.1",
|
|
10
|
+
description: "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.7.1): SOTA internal reasoning suite aligned with AI Pair Programmer Prompt v0.7.1+. Features advanced deliberation (`think`), rapid checks (`quick_think`), mandatory complexity assessment & strategy selection, context synthesis, confidence gauging, proactive planning, explicit reasoning (CoT), and reflection, designed for robust agentic workflows including potential executable actions and dynamic tool discovery."
|
|
11
11
|
});
|
|
12
12
|
// --- Core Cognitive Deliberation Tools ---
|
|
13
13
|
server.tool("think",
|
|
14
14
|
// Main Description: For High Cognitive Load situations.
|
|
15
|
-
"MANDATORY Cognitive Hub for **High Complexity
|
|
15
|
+
"MANDATORY Cognitive Hub for **High/Medium Complexity, Uncertainty, Consequence, or Novelty (CUC-N)** situations. Use for deep analysis, planning, verification, risk assessment, self-correction, and integrating complex outputs (CoT, Plans, Critiques, Syntheses, Confidence Gauges). Logs detailed reasoning.", {
|
|
16
16
|
// Parameter Description: Must analyze inputs including novel tool outputs.
|
|
17
|
-
thought: z.string().describe("Your **detailed** internal monologue for complex situations. MUST explicitly analyze prior steps
|
|
17
|
+
thought: z.string().describe("Your **detailed** internal monologue for complex situations, triggered after CUC-N assessment indicates 'think' mode. MUST explicitly analyze prior steps & generated text (e.g., CoT text, Plan text including Anticipated Challenges, Reflection critique text, Synthesized summary text, Confidence justification text). Structure MANDATORY: ## Analysis, ## Plan, ## Verification, ## Anticipated Challenges Analysis & Contingency, ## Risk Assessment, ## Lookahead, ## Self-Correction & Learning.")
|
|
18
18
|
}, async ({ thought }) => {
|
|
19
19
|
if (!thought || typeof thought !== 'string' || thought.trim().length === 0) {
|
|
20
|
-
throw new Error('Invalid thought: Must be non-empty.');
|
|
20
|
+
throw new Error('Invalid thought: Must be non-empty, structured reasoning.');
|
|
21
21
|
}
|
|
22
22
|
console.error(`[CognitiveToolsServer] Think Tool Logged: ${thought.substring(0, 100)}...`);
|
|
23
|
-
|
|
23
|
+
// Output confirms deep thought logged, ready for next assessment or action.
|
|
24
|
+
return { content: [{ type: "text", text: `Deep Thought (structured analysis/plan/etc.) logged successfully.` }] };
|
|
24
25
|
});
|
|
25
26
|
server.tool("quick_think",
|
|
26
27
|
// Main Description: For Low Cognitive Load situations. Explicitly contrasted with 'think'.
|
|
27
|
-
"Cognitive Checkpoint for **Low
|
|
28
|
-
|
|
28
|
+
"Cognitive Checkpoint ONLY for situations explicitly assessed as **strictly Low CUC-N AND simple task nature** (e.g., confirmation, acknowledgement). Logs brief thought. **DO NOT USE** for analysis, planning, or after other cognitive tools.", {
|
|
29
|
+
// Parameter Description: Simpler input for brief thoughts.
|
|
30
|
+
brief_thought: z.string().describe("Your **concise** thought for strictly simple, low CUC-N situations (e.g., 'Acknowledged user input.', 'Proceeding with confirmed step 3.', 'Code execution successful.').")
|
|
29
31
|
}, async ({ brief_thought }) => {
|
|
30
32
|
if (!brief_thought || typeof brief_thought !== 'string' || brief_thought.trim().length === 0) {
|
|
31
33
|
throw new Error('Invalid brief_thought: Must be non-empty.');
|
|
32
34
|
}
|
|
33
35
|
console.error(`[CognitiveToolsServer] QuickThink Tool Logged: ${brief_thought.substring(0, 100)}...`);
|
|
34
|
-
|
|
36
|
+
// Output confirms brief thought logged.
|
|
37
|
+
return { content: [{ type: "text", text: `Quick Thought logged successfully.` }] };
|
|
35
38
|
});
|
|
36
39
|
// --- Novel Meta-Cognitive & Context Management Tools ---
|
|
37
|
-
server.tool("
|
|
40
|
+
server.tool("assess_complexity_and_select_thought_mode",
|
|
38
41
|
// Main Description: Forces explicit decision between think/quick_think.
|
|
39
|
-
"**Mandatory Pre-
|
|
42
|
+
"**Mandatory Pre-Cognitive Assessment.** Must be called BEFORE every `think` or `quick_think`. Guides the LLM to explicitly evaluate CUC-N, recommend an initial strategy, and commit to the next thought mode (`think` or `quick_think`).", {
|
|
40
43
|
// Parameter Description: LLM provides its assessment and chosen mode.
|
|
41
|
-
assessment_and_choice: z.string().describe("Input your assessment: 1)
|
|
44
|
+
assessment_and_choice: z.string().describe("Input your assessment *before* calling. MUST include: 1) Situation/Next Step Description. 2) CUC-N Ratings: Complexity(L/M/H), Uncertainty(L/M/H), Consequence(L/M/H), Novelty(L/M/H). 3) Recommended Initial Strategy (e.g., 'Start `think` analysis', 'Use `plan_and_solve`'). 4) Explicit Mode Selection: 'Selected Mode: think' or 'Selected Mode: quick_think'.")
|
|
42
45
|
}, async ({ assessment_and_choice }) => {
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
// Enhanced validation to check for key phrases expected from the prompt's instructions
|
|
47
|
+
const requiredPhrases = ["Complexity", "Uncertainty", "Consequence", "Novelty", "Recommended Initial Strategy", "Selected Mode:"];
|
|
48
|
+
const hasRequiredPhrases = requiredPhrases.every(phrase => assessment_and_choice.includes(phrase));
|
|
49
|
+
const hasModeSelection = assessment_and_choice.includes("Selected Mode: think") || assessment_and_choice.includes("Selected Mode: quick_think");
|
|
50
|
+
if (!assessment_and_choice || typeof assessment_and_choice !== 'string' || !hasRequiredPhrases || !hasModeSelection) {
|
|
51
|
+
throw new Error('Invalid assessment: String must include CUC-N ratings, Recommended Initial Strategy, and explicit Selected Mode ("think" or "quick_think").');
|
|
45
52
|
}
|
|
46
53
|
console.error(`[CognitiveToolsServer] AssessComplexity Tool Signaled: ${assessment_and_choice.substring(0, 150)}...`);
|
|
47
|
-
// Output confirms the assessment was made and which mode was selected.
|
|
48
54
|
const mode = assessment_and_choice.includes("Selected Mode: think") ? "think" : "quick_think";
|
|
49
|
-
|
|
55
|
+
// Output confirms the assessment was made and guides the next step.
|
|
56
|
+
return { content: [{ type: "text", text: `Cognitive Assessment Completed. Proceeding with selected mode: ${mode}. Full Assessment: ${assessment_and_choice}` }] };
|
|
50
57
|
});
|
|
51
58
|
server.tool("synthesize_prior_reasoning",
|
|
52
59
|
// Main Description: Manages context window and focuses reasoning.
|
|
53
|
-
"Context Management Tool. Guides the LLM to **generate a
|
|
54
|
-
// Parameter Description: LLM
|
|
55
|
-
context_to_summarize_description: z.string().describe("
|
|
60
|
+
"Context Management Tool. Guides the LLM to **internally generate a structured summary text** of preceding lengthy reasoning, focusing on **`Key Decisions Made`** and **`Open Questions/Uncertainties`**. Used to manage context and refocus attention.", {
|
|
61
|
+
// Parameter Description: Reminds LLM of the required internal summary structure.
|
|
62
|
+
context_to_summarize_description: z.string().describe("Describe the reasoning span being summarized. *You* (LLM) must now *internally generate the structured summary text (including Key Decisions, Open Questions)* before calling. This signals the summary is ready for `think` analysis.")
|
|
56
63
|
}, async ({ context_to_summarize_description }) => {
|
|
57
64
|
if (!context_to_summarize_description || typeof context_to_summarize_description !== 'string' || context_to_summarize_description.trim().length === 0) {
|
|
58
65
|
throw new Error('Invalid context description: Must be non-empty.');
|
|
59
66
|
}
|
|
60
67
|
console.error(`[CognitiveToolsServer] SynthesizeReasoning Tool Signaled for: ${context_to_summarize_description}...`);
|
|
61
|
-
// Output
|
|
62
|
-
return { content: [{ type: "text", text: `
|
|
68
|
+
// Output implies structured summary is ready for analysis.
|
|
69
|
+
return { content: [{ type: "text", text: `Structured synthesis internally generated for context: '${context_to_summarize_description}'. Ready for detailed analysis in next 'think' step.` }] };
|
|
63
70
|
});
|
|
64
71
|
server.tool("gauge_confidence",
|
|
65
72
|
// Main Description: Explicit meta-cognition about certainty.
|
|
66
|
-
"Meta-Cognitive Checkpoint. Guides the LLM to explicitly **state
|
|
67
|
-
// Parameter Description:
|
|
68
|
-
assessment_and_confidence: z.string().describe("Input the item being assessed (e.g., 'Confidence in
|
|
73
|
+
"Meta-Cognitive Checkpoint. Guides the LLM to explicitly **state confidence (High/Medium/Low) and justification** regarding a specific item (plan, conclusion, action). Output MUST be analyzed in next `think` step; Low/Medium confidence requires specific action.", {
|
|
74
|
+
// Parameter Description: Matches prompt requirements.
|
|
75
|
+
assessment_and_confidence: z.string().describe("Input the item being assessed (e.g., 'Confidence in proposed refactoring plan'). Then *internally determine and state*: 1) Confidence Level (High/Medium/Low). 2) Justification for this level. Call this tool *after* making the assessment.")
|
|
69
76
|
}, async ({ assessment_and_confidence }) => {
|
|
70
77
|
const confidenceRegex = /Confidence Level: (High|Medium|Low)/i;
|
|
71
78
|
if (!assessment_and_confidence || typeof assessment_and_confidence !== 'string' || !confidenceRegex.test(assessment_and_confidence)) {
|
|
72
|
-
throw new Error('Invalid confidence assessment:
|
|
79
|
+
throw new Error('Invalid confidence assessment: String must include "Confidence Level: High/Medium/Low" and justification.');
|
|
73
80
|
}
|
|
74
81
|
const match = assessment_and_confidence.match(confidenceRegex);
|
|
75
82
|
const level = match ? match[1] : "Unknown";
|
|
76
83
|
console.error(`[CognitiveToolsServer] GaugeConfidence Tool Signaled: Level ${level}`);
|
|
77
|
-
// Output confirms
|
|
78
|
-
return { content: [{ type: "text", text: `Confidence Gauge Completed. Level: ${level}. Assessment: ${assessment_and_confidence}
|
|
84
|
+
// Output confirms level and prepares for analysis.
|
|
85
|
+
return { content: [{ type: "text", text: `Confidence Gauge Completed. Level: ${level}. Assessment Text: ${assessment_and_confidence}. Ready for mandatory 'think' analysis (action required if Low/Medium).` }] };
|
|
79
86
|
});
|
|
80
|
-
// --- Supporting Cognitive Strategy Tools
|
|
87
|
+
// --- Supporting Cognitive Strategy Tools ---
|
|
81
88
|
server.tool("plan_and_solve",
|
|
82
|
-
// Main Description:
|
|
83
|
-
"Guides the LLM to **generate
|
|
84
|
-
// Parameter Description:
|
|
85
|
-
task_objective: z.string().describe("Input the
|
|
86
|
-
},
|
|
87
|
-
// Implementation: Signals Planning was performed.
|
|
88
|
-
async ({ task_objective }) => {
|
|
89
|
+
// Main Description: Emphasizes plan text structure and potential for other tools.
|
|
90
|
+
"Guides the LLM to **internally generate structured plan text**, including **`Anticipated Challenges/Risks`**. The plan steps might logically suggest the need for other tools (known or discovered). The generated plan text MUST be validated/detailed via `think`.", {
|
|
91
|
+
// Parameter Description: Reminds LLM of required internal generation content and openness.
|
|
92
|
+
task_objective: z.string().describe("Input the objective. *You* (LLM) must now *internally generate the structured plan text, including Anticipated Challenges/Risks, and noting steps where other tools might be applicable,* before calling. Signals plan text is ready for `think` analysis.")
|
|
93
|
+
}, async ({ task_objective }) => {
|
|
89
94
|
if (!task_objective || typeof task_objective !== 'string' || task_objective.trim().length === 0) {
|
|
90
|
-
throw new Error('Invalid task objective
|
|
95
|
+
throw new Error('Invalid task objective.');
|
|
91
96
|
}
|
|
92
97
|
console.error(`[CognitiveToolsServer] PlanAndSolve Tool Signaled for: ${task_objective.substring(0, 100)}...`);
|
|
93
|
-
|
|
98
|
+
// Output implies plan text *with risks and potential tool needs* is ready.
|
|
99
|
+
return { content: [{ type: "text", text: `Structured plan (incl. Risks/Challenges, potential tool needs) internally generated for objective: ${task_objective}. Ready for mandatory 'think' analysis.` }] };
|
|
94
100
|
});
|
|
95
101
|
server.tool("chain_of_thought",
|
|
96
|
-
// Main Description:
|
|
97
|
-
"Guides the LLM to **generate detailed, step-by-step reasoning text**.
|
|
98
|
-
// Parameter Description:
|
|
99
|
-
problem_statement: z.string().describe("Input the problem requiring detailed
|
|
102
|
+
// Main Description: Refined to explicitly mention potential for other tools within the reasoning.
|
|
103
|
+
"Guides the LLM to **internally generate detailed, step-by-step reasoning text (CoT)**. Steps within the CoT might logically identify points requiring external data, computation, code execution, or checks for other available tools. The generated CoT text MUST be analyzed via `think`.", {
|
|
104
|
+
// Parameter Description: Explicitly guides internal generation to consider tool needs.
|
|
105
|
+
problem_statement: z.string().describe("Input the specific problem requiring detailed CoT. *You* (LLM) must now *internally generate the full CoT text*, structuring it clearly and explicitly noting any steps where other tools (e.g., code execution, file access, web search, list_tools) might be needed *after* this CoT is analyzed. Call this tool *after* generating the text.")
|
|
100
106
|
},
|
|
101
|
-
// Implementation: Signals CoT was performed
|
|
107
|
+
// Implementation: Signals CoT was performed and is ready for analysis.
|
|
102
108
|
async ({ problem_statement }) => {
|
|
103
109
|
if (!problem_statement || typeof problem_statement !== 'string' || problem_statement.trim().length === 0) {
|
|
104
|
-
throw new Error('Invalid problem statement
|
|
110
|
+
throw new Error('Invalid problem statement.');
|
|
105
111
|
}
|
|
106
112
|
console.error(`[CognitiveToolsServer] ChainOfThought Tool Signaled for: ${problem_statement.substring(0, 100)}...`);
|
|
107
|
-
|
|
113
|
+
// Output implies CoT text *potentially identifying tool needs* is ready for analysis.
|
|
114
|
+
return { content: [{ type: "text", text: `Detailed CoT (potentially identifying needs for other tools) internally generated for problem: ${problem_statement}. Ready for mandatory 'think' analysis.` }] };
|
|
108
115
|
});
|
|
109
116
|
server.tool("chain_of_draft",
|
|
110
|
-
// Main Description: Positions for efficient exploration
|
|
111
|
-
"Guides the LLM to **generate concise, iterative reasoning draft texts** ('thought-sketches'). Useful for efficiently exploring multiple solution paths
|
|
112
|
-
// Parameter Description: Instructs LLM on draft generation.
|
|
113
|
-
problem_statement: z.string().describe("Input the problem or question for exploration. *You* (
|
|
117
|
+
// Main Description: Positions for efficient exploration, results analyzed by 'think'.
|
|
118
|
+
"Guides the LLM to **internally generate concise, iterative reasoning draft texts** ('thought-sketches'). Useful for efficiently exploring multiple solution paths or brainstorming hypotheses. Drafts MUST be analyzed comparatively via `think`.", {
|
|
119
|
+
// Parameter Description: Instructs LLM on internal draft generation.
|
|
120
|
+
problem_statement: z.string().describe("Input the problem or question for exploration. *You* (LLM) must now *internally generate brief, iterative draft texts* (e.g., key steps, pros/cons) for potential approaches before calling this tool. Signals drafts are ready for `think` analysis.")
|
|
114
121
|
},
|
|
115
122
|
// Implementation: Signals Drafting was performed.
|
|
116
123
|
async ({ problem_statement }) => {
|
|
117
124
|
if (!problem_statement || typeof problem_statement !== 'string' || problem_statement.trim().length === 0) {
|
|
118
|
-
throw new Error('Invalid problem statement
|
|
125
|
+
throw new Error('Invalid problem statement.');
|
|
119
126
|
}
|
|
120
127
|
console.error(`[CognitiveToolsServer] ChainOfDraft Tool Signaled for: ${problem_statement.substring(0, 100)}...`);
|
|
121
|
-
|
|
128
|
+
// Output implies draft texts are ready for comparative analysis.
|
|
129
|
+
return { content: [{ type: "text", text: `Reasoning drafts internally generated for problem: ${problem_statement}. Ready for mandatory 'think' analysis.` }] };
|
|
122
130
|
});
|
|
123
131
|
server.tool("reflection",
|
|
124
|
-
// Main Description: Explicitly mentions taking prior text as input for critique.
|
|
132
|
+
// Main Description: Explicitly mentions taking prior text as input for critique, results analyzed by 'think'.
|
|
125
133
|
"Guides the LLM to perform critical self-evaluation on **previously generated text** (reasoning, plans, code concepts). Essential for iterative refinement and improving accuracy. The *generated critique text* MUST be analyzed via `think`.", {
|
|
126
|
-
// Parameter Description: Input is the text to be critiqued.
|
|
127
|
-
input_reasoning_or_plan: z.string().describe("Input the **exact text** (e.g., from a prior `think` log, or internally generated plan/CoT/code concept) that *you* (the LLM) must now *internally generate a critique for*. Your critique should identify flaws and suggest improvements.")
|
|
134
|
+
// Parameter Description: Input is the specific text to be critiqued internally.
|
|
135
|
+
input_reasoning_or_plan: z.string().describe("Input the **exact text** (e.g., from a prior `think` log, or internally generated plan/CoT/code concept) that *you* (the LLM) must now *internally generate a critique for*. Your critique should identify flaws and suggest improvements. Call this tool *after* generating the critique.")
|
|
128
136
|
},
|
|
129
137
|
// Implementation: Signals Reflection was performed.
|
|
130
138
|
async ({ input_reasoning_or_plan }) => {
|
|
131
139
|
if (!input_reasoning_or_plan || typeof input_reasoning_or_plan !== 'string' || input_reasoning_or_plan.trim().length === 0) {
|
|
132
|
-
throw new Error('Invalid input reasoning/plan
|
|
140
|
+
throw new Error('Invalid input reasoning/plan.');
|
|
133
141
|
}
|
|
134
142
|
console.error(`[CognitiveToolsServer] Reflection Tool Signaled for analysis.`);
|
|
135
|
-
|
|
143
|
+
// Output implies critique text is ready for analysis.
|
|
144
|
+
return { content: [{ type: "text", text: `Reflection critique internally generated for input text: '${input_reasoning_or_plan.substring(0, 100)}...'. Ready for mandatory 'think' analysis.` }] };
|
|
136
145
|
});
|
|
137
146
|
// --- Server Lifecycle and Error Handling ---
|
|
138
147
|
process.on('SIGINT', async () => {
|
|
139
|
-
console.error('[CognitiveToolsServer] Received SIGINT, shutting down.');
|
|
148
|
+
console.error('\n[CognitiveToolsServer] Received SIGINT, shutting down gracefully.');
|
|
140
149
|
await server.close();
|
|
141
150
|
process.exit(0);
|
|
142
151
|
});
|
|
143
152
|
process.on('SIGTERM', async () => {
|
|
144
|
-
console.error('[CognitiveToolsServer] Received SIGTERM, shutting down.');
|
|
153
|
+
console.error('\n[CognitiveToolsServer] Received SIGTERM, shutting down gracefully.');
|
|
145
154
|
await server.close();
|
|
146
155
|
process.exit(0);
|
|
147
156
|
});
|
|
148
157
|
process.on('uncaughtException', (error) => {
|
|
149
|
-
console.error('[CognitiveToolsServer] Uncaught
|
|
150
|
-
//
|
|
158
|
+
console.error('[CognitiveToolsServer] FATAL: Uncaught Exception:', error);
|
|
159
|
+
// Attempt graceful shutdown, but prioritize process exit
|
|
160
|
+
server.close().catch(err => console.error('[CognitiveToolsServer] Error during shutdown on uncaughtException:', err)).finally(() => {
|
|
161
|
+
process.exit(1); // Exit on fatal error
|
|
162
|
+
});
|
|
151
163
|
});
|
|
152
164
|
process.on('unhandledRejection', (reason, promise) => {
|
|
153
|
-
console.error('[CognitiveToolsServer] Unhandled
|
|
154
|
-
//
|
|
165
|
+
console.error('[CognitiveToolsServer] FATAL: Unhandled Promise Rejection:', reason);
|
|
166
|
+
// Attempt graceful shutdown, but prioritize process exit
|
|
167
|
+
server.close().catch(err => console.error('[CognitiveToolsServer] Error during shutdown on unhandledRejection:', err)).finally(() => {
|
|
168
|
+
process.exit(1); // Exit on fatal error
|
|
169
|
+
});
|
|
155
170
|
});
|
|
156
171
|
// Start the server
|
|
157
172
|
async function main() {
|
|
158
173
|
try {
|
|
159
174
|
const transport = new StdioServerTransport();
|
|
160
175
|
await server.connect(transport);
|
|
161
|
-
console.error('ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.
|
|
176
|
+
console.error('ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.7.1) MCP Server running on stdio');
|
|
162
177
|
}
|
|
163
178
|
catch (error) {
|
|
164
179
|
console.error('[CognitiveToolsServer] Fatal error during startup:', error);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nbiish/cognitive-tools-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - (Cognitive Tools v0.7.1): SOTA internal reasoning suite aligned with AI Pair Programmer Prompt v0.7.1+. Features advanced deliberation (`think`), rapid checks (`quick_think`), mandatory complexity assessment & strategy selection (`assess_complexity_and_select_thought_mode`), context synthesis, confidence gauging, proactive planning, explicit reasoning (CoT), and reflection. Updated from v0.6.x series. Designed for robust agentic workflows including potential executable actions and dynamic tool discovery.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"
|
|
8
|
+
"cognitive-tools-mcp": "build/index.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"build"
|