@nbiish/cognitive-tools-mcp 0.9.9 → 0.9.11
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 +16 -8
- package/build/index.js +69 -61
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @nbiish/gikendaasowin-aabajichiganan-mcp
|
|
2
2
|
|
|
3
|
+
```bibtex
|
|
4
|
+
@misc{gikendaasowin-aabajichiganan-mcp2025,
|
|
5
|
+
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 and enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians},
|
|
6
|
+
title/description = {gikendaasowin-aabajichiganan-mcp},
|
|
7
|
+
type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions},
|
|
8
|
+
year = {2025},
|
|
9
|
+
publisher/source/event = {GitHub repository under tribal sovereignty protections},
|
|
10
|
+
howpublished = {\url{https://github.com/nbiish/gikendaasowin-aabajichiganan-mcp}},
|
|
11
|
+
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 and 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.}
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Copyright © 2025 ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), a descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band, and an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Traditional Knowledge and Traditional Cultural Expressions. All rights reserved.
|
|
16
|
+
|
|
17
|
+
This project is licensed under the [COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS](LICENSE).
|
|
18
|
+
|
|
3
19
|
<div align="center">
|
|
4
20
|
<hr width="50%">
|
|
5
21
|
|
|
@@ -271,14 +287,6 @@ Example Response:
|
|
|
271
287
|
}
|
|
272
288
|
```
|
|
273
289
|
|
|
274
|
-
## Copyright
|
|
275
|
-
|
|
276
|
-
Copyright © 2025 ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), a descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band, and an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Traditional Knowledge and Traditional Cultural Expressions. All rights reserved.
|
|
277
|
-
|
|
278
|
-
## License
|
|
279
|
-
|
|
280
|
-
This work is licensed under the [COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS](LICENSE).
|
|
281
|
-
|
|
282
290
|
## Citation
|
|
283
291
|
|
|
284
292
|
Please cite this project using the following BibTeX entry:
|
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.10
|
|
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.10";
|
|
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.10: 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
|
/**
|
|
@@ -78,7 +78,7 @@ function logToolError(toolName, error) {
|
|
|
78
78
|
return {
|
|
79
79
|
content: [{
|
|
80
80
|
type: "text",
|
|
81
|
-
text: `Error executing tool '${toolName}': ${errorMessage}
|
|
81
|
+
text: `Error executing tool '${toolName}': ${errorMessage}.`
|
|
82
82
|
}]
|
|
83
83
|
};
|
|
84
84
|
}
|
|
@@ -89,7 +89,7 @@ function logToolError(toolName, error) {
|
|
|
89
89
|
* Workflow: Call BEFORE starting complex tasks or significantly changing strategy.
|
|
90
90
|
* Output: Confirms assessment and selected mode (`think` or `quick_think`). Result MUST inform the subsequent cognitive flow.
|
|
91
91
|
*/
|
|
92
|
-
server.tool("assess_cuc_n_mode", "**Mandatory Pre-Deliberation Assessment.** Evaluates task Complexity, Uncertainty, Consequence, Novelty (CUC-N) to determine required cognitive depth and initial strategy. MUST be called before starting complex tasks or changing strategy.
|
|
92
|
+
server.tool("assess_cuc_n_mode", "**Mandatory Pre-Deliberation Assessment.** Evaluates task Complexity, Uncertainty, Consequence, Novelty (CUC-N) to determine required cognitive depth and initial strategy. MUST be called before starting complex tasks or changing strategy. Based on assessment, use either `think` (for structured analysis) or `quick_think` (for streamlined processing) in the next step.", {
|
|
93
93
|
assessment_and_choice: z.string().describe("Your structured assessment including: 1) Situation Description, 2) CUC-N Ratings (Low/Medium/High for each), 3) Rationale for ratings, 4) Recommended Initial Cognitive Strategy (e.g., 'Start with chain_of_thought then think'), 5) Explicit Mode Selection ('Selected Mode: think' or 'Selected Mode: quick_think').")
|
|
94
94
|
}, async ({ assessment_and_choice }) => {
|
|
95
95
|
const toolName = 'assess_cuc_n_mode';
|
|
@@ -127,29 +127,56 @@ server.tool("assess_cuc_n_mode", "**Mandatory Pre-Deliberation Assessment.** Eva
|
|
|
127
127
|
});
|
|
128
128
|
/**
|
|
129
129
|
* Tool: think
|
|
130
|
-
* Purpose: The **CENTRAL HUB** for the cognitive loop
|
|
131
|
-
* Workflow:
|
|
130
|
+
* Purpose: The **CENTRAL HUB** for the cognitive loop, incorporating OODReAct principles (Observe-Orient-Decide-Reason-Act).
|
|
131
|
+
* Workflow: Combines observation, orientation, decision-making, reasoning, and action for enhanced problem-solving.
|
|
132
132
|
* Output: Returns the structured thought text itself, grounding the AI's reasoning process in the context.
|
|
133
133
|
*/
|
|
134
|
-
server.tool("think", "**MANDATORY Central Hub for Analysis
|
|
135
|
-
thought: z.string().describe("Your **detailed** internal monologue
|
|
134
|
+
server.tool("think", "**MANDATORY Central Hub for Analysis and Planning.** Called after assessment (`assess_cuc_n_mode`), other cognitive tools (`plan_and_solve`, `chain_of_thought`, `chain_of_draft`, `reflection`, `synthesize_prior_reasoning`, `gauge_confidence`), internal drafts (`chain_of_draft`), or external action results. Incorporates OODReAct principles (Observe-Orient-Decide-Reason-Act) for enhanced problem-solving. Consider structuring your thought process to: 1) Observe new information and changes, 2) Orient by analyzing context and patterns, 3) Decide on potential actions, 4) Reason through implications and alternatives, and 5) Act by planning specific execution steps. Follow the MANDATORY structure in the `thought` parameter. For simpler follow-up steps, consider using `quick_think` instead.", {
|
|
135
|
+
thought: z.string().describe("Your **detailed** internal monologue. While any clear, structured format is accepted, consider following OODReAct principles in your thinking:\n- Observe: What new information/signals are available?\n- Orient: How does this fit into the bigger picture?\n- Decide: What are the potential actions to take?\n- Reason: What are the implications and alternatives?\n- Act: How to execute the chosen action?\n\nRequired sections:\n## Analysis/Observation\n## Plan/Decision\n## Verification\n## Risk & Contingency\n## Learning & Adaptation")
|
|
136
136
|
}, async ({ thought }) => {
|
|
137
137
|
const toolName = 'think';
|
|
138
138
|
logToolCall(toolName);
|
|
139
139
|
try {
|
|
140
140
|
if (!thought || typeof thought !== 'string' || thought.trim().length === 0) {
|
|
141
|
-
throw new Error('Invalid thought: Must be a non-empty string containing
|
|
141
|
+
throw new Error('Invalid thought: Must be a non-empty string containing substantive reasoning.');
|
|
142
142
|
}
|
|
143
|
-
//
|
|
144
|
-
const requiredSections = [
|
|
145
|
-
|
|
143
|
+
// Define required sections (more flexible now)
|
|
144
|
+
const requiredSections = [
|
|
145
|
+
["## Analysis:", "## Observe:", "## Observation:"], // Accept various observation formats
|
|
146
|
+
["## Orient:", "## Orientation:"], // Optional but recognized
|
|
147
|
+
["## Plan:", "## Decide:", "## Decision:"], // Decision-related sections
|
|
148
|
+
["## Reason:", "## Reasoning:", "## Analysis:"], // Reasoning-related sections
|
|
149
|
+
["## Act:", "## Action:", "## Execution:"], // Action-related sections
|
|
150
|
+
["## Verification:"],
|
|
151
|
+
["## Risk & Contingency:", "## Risks:", "## Challenges:"],
|
|
152
|
+
["## Learning & Adaptation:", "## Self-Correction:", "## Learning:"]
|
|
153
|
+
];
|
|
154
|
+
// Check if each required section group has at least one match
|
|
155
|
+
const missingSections = requiredSections.filter(sectionGroup => !sectionGroup.some(section => thought.includes(section)));
|
|
156
|
+
// Build validation report
|
|
157
|
+
let validationReport = [];
|
|
146
158
|
if (missingSections.length > 0) {
|
|
147
|
-
|
|
159
|
+
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.");
|
|
148
160
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
161
|
+
// Log validation results
|
|
162
|
+
if (validationReport.length > 0) {
|
|
163
|
+
console.warn(`[${new Date().toISOString()}] [CognitiveToolsServer] Think Tool Validation Report:\n${validationReport.join("\n")}`);
|
|
164
|
+
}
|
|
165
|
+
// Enhanced logging with simplified format detection
|
|
166
|
+
const format = thought.includes("## Observe:") ? "OODReAct-style" : "Traditional";
|
|
167
|
+
logToolResult(toolName, true, `Thought logged (Style: ${format}, Length: ${thought.length})`);
|
|
168
|
+
// Return thought with metadata
|
|
169
|
+
return {
|
|
170
|
+
content: [{
|
|
171
|
+
type: "text",
|
|
172
|
+
text: thought
|
|
173
|
+
}],
|
|
174
|
+
metadata: {
|
|
175
|
+
format,
|
|
176
|
+
validationReport,
|
|
177
|
+
timestamp: new Date().toISOString()
|
|
178
|
+
}
|
|
179
|
+
};
|
|
153
180
|
}
|
|
154
181
|
catch (error) {
|
|
155
182
|
return logToolError(toolName, error);
|
|
@@ -157,12 +184,12 @@ server.tool("think", "**MANDATORY Central Hub for Analysis, Planning, and Refine
|
|
|
157
184
|
});
|
|
158
185
|
/**
|
|
159
186
|
* Tool: quick_think
|
|
160
|
-
* Purpose: A lightweight cognitive checkpoint for
|
|
161
|
-
* Workflow: Use
|
|
187
|
+
* Purpose: A lightweight cognitive checkpoint for streamlined processing and simple confirmations.
|
|
188
|
+
* Workflow: Use when full structured analysis via `think` is not necessary.
|
|
162
189
|
* Output: Logs the brief thought.
|
|
163
190
|
*/
|
|
164
|
-
server.tool("quick_think", "Cognitive Checkpoint
|
|
165
|
-
brief_thought: z.string().describe("Your **concise** thought or confirmation for this
|
|
191
|
+
server.tool("quick_think", "Cognitive Checkpoint for streamlined processing and simple confirmations where detailed analysis via `think` is unnecessary. Use when full structured deliberation would be excessive for the current step.", {
|
|
192
|
+
brief_thought: z.string().describe("Your **concise** thought or confirmation for this step. Briefly state the observation/action and explain why detailed analysis isn't needed.")
|
|
166
193
|
}, async ({ brief_thought }) => {
|
|
167
194
|
const toolName = 'quick_think';
|
|
168
195
|
logToolCall(toolName);
|
|
@@ -181,10 +208,10 @@ server.tool("quick_think", "Cognitive Checkpoint ONLY for situations explicitly
|
|
|
181
208
|
/**
|
|
182
209
|
* Tool: gauge_confidence
|
|
183
210
|
* Purpose: Meta-Cognitive Checkpoint to explicitly state confidence in a preceding analysis, plan, or draft.
|
|
184
|
-
* Workflow: Generate assessment -> Call this tool with assessment text ->
|
|
185
|
-
* Output: Confirms confidence gauging and level.
|
|
211
|
+
* Workflow: Generate assessment -> Call this tool with assessment text -> Follow with either `think` or `quick_think`.
|
|
212
|
+
* Output: Confirms confidence gauging and level.
|
|
186
213
|
*/
|
|
187
|
-
server.tool("gauge_confidence", "Meta-Cognitive Checkpoint. Guides *internal stating* of **confidence (High/Medium/Low) and justification** regarding a specific plan, analysis, or draft you just formulated. Call this tool *with* the text containing your confidence assessment.
|
|
214
|
+
server.tool("gauge_confidence", "Meta-Cognitive Checkpoint. Guides *internal stating* of **confidence (High/Medium/Low) and justification** regarding a specific plan, analysis, or draft you just formulated. Call this tool *with* the text containing your confidence assessment. Follow with either `think` (for detailed analysis) or `quick_think` (for straightforward confirmation) based on the confidence level and complexity.", {
|
|
188
215
|
assessment_and_confidence: z.string().describe("The text containing the item being assessed AND your explicit internal assessment: 1) Confidence Level: (High/Medium/Low). 2) Justification for this level.")
|
|
189
216
|
}, async ({ assessment_and_confidence }) => {
|
|
190
217
|
const toolName = 'gauge_confidence';
|
|
@@ -200,7 +227,7 @@ server.tool("gauge_confidence", "Meta-Cognitive Checkpoint. Guides *internal sta
|
|
|
200
227
|
}
|
|
201
228
|
const level = match[1];
|
|
202
229
|
const emphasis = (level.toLowerCase() !== 'high') ? "CRITICAL: Analyze implications of non-High confidence." : "Proceed with analysis.";
|
|
203
|
-
const resultText = `Confidence Gauge Completed. Stated Level: ${level}. Assessment Text Logged
|
|
230
|
+
const resultText = `Confidence Gauge Completed. Stated Level: ${level}. Assessment Text Logged.`;
|
|
204
231
|
logToolResult(toolName, true, `Level: ${level}`);
|
|
205
232
|
console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Confidence Details:\n${assessment_and_confidence}`);
|
|
206
233
|
return { content: [{ type: "text", text: resultText }] };
|
|
@@ -212,10 +239,10 @@ server.tool("gauge_confidence", "Meta-Cognitive Checkpoint. Guides *internal sta
|
|
|
212
239
|
/**
|
|
213
240
|
* Tool: chain_of_thought
|
|
214
241
|
* Purpose: Guides *internal generation* of detailed, step-by-step reasoning draft (CoT).
|
|
215
|
-
* Workflow: Generate CoT -> Call this tool with CoT text ->
|
|
216
|
-
* Output: Returns the CoT text for analysis.
|
|
242
|
+
* Workflow: Generate CoT -> Call this tool with CoT text -> Follow with either `think` or `quick_think`.
|
|
243
|
+
* Output: Returns the CoT text for analysis.
|
|
217
244
|
*/
|
|
218
|
-
server.tool("chain_of_thought", "Guides *internal generation* of **detailed, step-by-step reasoning draft (CoT)**. Call this tool *with* the generated CoT text you created internally. Returns the CoT text.
|
|
245
|
+
server.tool("chain_of_thought", "Guides *internal generation* of **detailed, step-by-step reasoning draft (CoT)**. Call this tool *with* the generated CoT text you created internally. Returns the CoT text. Follow with either `think` (for complex reasoning chains requiring detailed analysis) or `quick_think` (for straightforward reasoning steps) to process the CoT and plan next actions.", {
|
|
219
246
|
generated_cot_text: z.string().describe("The **full, step-by-step Chain of Thought draft** you generated internally to solve or analyze the problem."),
|
|
220
247
|
problem_statement: z.string().describe("The original problem statement or question this CoT addresses.")
|
|
221
248
|
}, async ({ generated_cot_text, problem_statement }) => {
|
|
@@ -229,7 +256,7 @@ server.tool("chain_of_thought", "Guides *internal generation* of **detailed, ste
|
|
|
229
256
|
if (!generated_cot_text.match(/step|phase|:\s|^\d+[\.\)]/im)) {
|
|
230
257
|
throw new Error('Invalid CoT format: Must contain clear reasoning steps (numbered, labeled as steps/phases, or with clear delineation).');
|
|
231
258
|
}
|
|
232
|
-
const resultText = `Chain of Thought Completed. Problem: "${problem_statement.substring(0, 100)}..."\nReasoning Steps Logged
|
|
259
|
+
const resultText = `Chain of Thought Completed. Problem: "${problem_statement.substring(0, 100)}..."\nReasoning Steps Logged.`;
|
|
233
260
|
logToolResult(toolName, true, `Problem: ${problem_statement.substring(0, 50)}...`);
|
|
234
261
|
console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Details:\nProblem: ${problem_statement}\nReasoning:\n${generated_cot_text}`);
|
|
235
262
|
return { content: [{ type: "text", text: resultText }] };
|
|
@@ -241,10 +268,10 @@ server.tool("chain_of_thought", "Guides *internal generation* of **detailed, ste
|
|
|
241
268
|
/**
|
|
242
269
|
* Tool: plan_and_solve
|
|
243
270
|
* Purpose: Guides *internal generation* of a structured plan draft.
|
|
244
|
-
* Workflow: Generate plan -> Call this tool with plan text ->
|
|
245
|
-
* Output: Returns the plan text for analysis.
|
|
271
|
+
* Workflow: Generate plan -> Call this tool with plan text -> Follow with either `think` or `quick_think`.
|
|
272
|
+
* Output: Returns the plan text for analysis.
|
|
246
273
|
*/
|
|
247
|
-
server.tool("plan_and_solve", "Guides *internal generation* of a **structured plan draft**. Call this tool *with* the generated plan text you created internally. Returns the plan text.
|
|
274
|
+
server.tool("plan_and_solve", "Guides *internal generation* of a **structured plan draft**. Call this tool *with* the generated plan text you created internally. Returns the plan text. Follow with either `think` (for complex plans requiring detailed analysis) or `quick_think` (for straightforward plans) to evaluate feasibility and confirm next steps.", {
|
|
248
275
|
generated_plan_text: z.string().describe("The **full, structured plan draft** you generated internally, including goals, steps, potential external tool needs, assumptions, and risks."),
|
|
249
276
|
task_objective: z.string().describe("The original high-level task objective this plan addresses.")
|
|
250
277
|
}, async ({ generated_plan_text, task_objective }) => {
|
|
@@ -262,7 +289,7 @@ server.tool("plan_and_solve", "Guides *internal generation* of a **structured pl
|
|
|
262
289
|
if (!generated_plan_text.toLowerCase().includes('risk') && !generated_plan_text.toLowerCase().includes('challenge')) {
|
|
263
290
|
throw new Error('Invalid plan format: Must include risk/challenge assessment.');
|
|
264
291
|
}
|
|
265
|
-
const resultText = `Plan Generation Completed. Task: "${task_objective.substring(0, 100)}..."\nPlan Structure Logged
|
|
292
|
+
const resultText = `Plan Generation Completed. Task: "${task_objective.substring(0, 100)}..."\nPlan Structure Logged.`;
|
|
266
293
|
logToolResult(toolName, true, `Task: ${task_objective.substring(0, 50)}...`);
|
|
267
294
|
console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Details:\nTask: ${task_objective}\nPlan:\n${generated_plan_text}`);
|
|
268
295
|
return { content: [{ type: "text", text: resultText }] };
|
|
@@ -274,7 +301,7 @@ server.tool("plan_and_solve", "Guides *internal generation* of a **structured pl
|
|
|
274
301
|
/**
|
|
275
302
|
* Tool: chain_of_draft
|
|
276
303
|
* Purpose: Signals that internal drafts have been generated/refined using Chain of Draft (CoD) principles.
|
|
277
|
-
* Workflow: Internally generate/refine concise draft(s) -> Call this tool ->
|
|
304
|
+
* Workflow: Internally generate/refine concise draft(s) -> Call this tool -> Follow with either `think` or `quick_think`.
|
|
278
305
|
* Best Practices from Research:
|
|
279
306
|
* - Keep each draft step short (< 5 words) like human notes
|
|
280
307
|
* - Use equations, symbols, or brief phrases instead of sentences
|
|
@@ -282,7 +309,7 @@ server.tool("plan_and_solve", "Guides *internal generation* of a **structured pl
|
|
|
282
309
|
* - End with #### followed by final answer/conclusion
|
|
283
310
|
* Output: Returns markdown-formatted response with CoD guidance and next tool recommendation.
|
|
284
311
|
*/
|
|
285
|
-
server.tool("chain_of_draft", "Signals that one or more **internal drafts** have been generated/refined using Chain of Draft (CoD) principles. CoD is an efficient prompting technique that uses concise, note-like drafts instead of full sentences. Best practices:\n- Keep each step short (< 5 words)\n- Use equations/symbols when possible\n- Focus on essential information\n- End with #### followed by conclusion\n\nCall this tool *after* generating/refining draft(s) internally. Returns markdown-formatted response with next tool recommendation.
|
|
312
|
+
server.tool("chain_of_draft", "Signals that one or more **internal drafts** have been generated/refined using Chain of Draft (CoD) principles. CoD is an efficient prompting technique that uses concise, note-like drafts instead of full sentences. Best practices:\n- Keep each step short (< 5 words)\n- Use equations/symbols when possible\n- Focus on essential information\n- End with #### followed by conclusion\n\nCall this tool *after* generating/refining draft(s) internally. Returns markdown-formatted response with next tool recommendation. Follow with either `think` (for complex drafts requiring detailed analysis) or `quick_think` (for straightforward drafts) to evaluate and plan next steps.", {
|
|
286
313
|
draft_description: z.string().describe("Brief but specific description of the draft(s) generated/refined internally (e.g., 'Initial API function - params defined', 'Error handling v2', 'README structure').")
|
|
287
314
|
}, async ({ draft_description }) => {
|
|
288
315
|
const toolName = 'chain_of_draft';
|
|
@@ -292,26 +319,7 @@ server.tool("chain_of_draft", "Signals that one or more **internal drafts** have
|
|
|
292
319
|
throw new Error('Invalid draft_description: Must provide a description.');
|
|
293
320
|
}
|
|
294
321
|
// Format response in markdown with CoD guidance and next tool recommendation
|
|
295
|
-
const resultText =
|
|
296
|
-
#### Draft Description
|
|
297
|
-
${draft_description}
|
|
298
|
-
|
|
299
|
-
#### Chain of Draft (CoD) Reminders
|
|
300
|
-
- Keep steps concise (< 5 words)
|
|
301
|
-
- Use equations/symbols when possible
|
|
302
|
-
- Focus on essential information
|
|
303
|
-
- End drafts with #### + conclusion
|
|
304
|
-
|
|
305
|
-
#### Next Steps
|
|
306
|
-
1. MANDATORY: Use \`think\` tool to analyze this draft:
|
|
307
|
-
- Evaluate correctness and completeness
|
|
308
|
-
- Check alignment with goals
|
|
309
|
-
- Plan concrete next actions
|
|
310
|
-
2. Consider using \`reflection\` tool if deeper critique needed
|
|
311
|
-
3. Use \`synthesize_prior_reasoning\` if context consolidation helpful
|
|
312
|
-
|
|
313
|
-
#### Status
|
|
314
|
-
Draft(s) ready for analysis. Proceed with mandatory \`think\` step.`;
|
|
322
|
+
const resultText = `Internal draft(s) ready for analysis: "${draft_description}".`;
|
|
315
323
|
logToolResult(toolName, true);
|
|
316
324
|
return { content: [{ type: "text", text: resultText }] };
|
|
317
325
|
}
|
|
@@ -324,9 +332,9 @@ Draft(s) ready for analysis. Proceed with mandatory \`think\` step.`;
|
|
|
324
332
|
* Purpose: Guides *internal generation* of a critical self-evaluation (critique) on a prior step, draft, plan, or outcome.
|
|
325
333
|
* Call this tool *with* the **generated critique text** you created internally.
|
|
326
334
|
* Returns the critique text.
|
|
327
|
-
*
|
|
335
|
+
* Follow with either `think` or `quick_think` to process the critique.
|
|
328
336
|
*/
|
|
329
|
-
server.tool("reflection", "Guides *internal generation* of a critical self-evaluation (critique) on a prior step, draft, plan, or outcome. Call this tool *with* the **generated critique text** you created internally. Returns the critique text.
|
|
337
|
+
server.tool("reflection", "Guides *internal generation* of a critical self-evaluation (critique) on a prior step, draft, plan, or outcome. Call this tool *with* the **generated critique text** you created internally. Returns the critique text. Follow with either `think` (for complex critiques requiring detailed analysis) or `quick_think` (for straightforward critiques) to process the feedback and plan improvements.", {
|
|
330
338
|
generated_critique_text: z.string().describe("The **full critique text** you generated internally, identifying specific flaws, strengths, assumptions, alternative approaches, and concrete suggestions for improvement."),
|
|
331
339
|
input_subject_description: z.string().describe("A brief description of the original reasoning, plan, code draft, or action result that was critiqued (e.g., 'Critique of the plan generated via plan_and_solve', 'Reflection on the CoT for problem X').")
|
|
332
340
|
}, async ({ generated_critique_text, input_subject_description }) => {
|
|
@@ -350,10 +358,10 @@ server.tool("reflection", "Guides *internal generation* of a critical self-evalu
|
|
|
350
358
|
/**
|
|
351
359
|
* Tool: synthesize_prior_reasoning
|
|
352
360
|
* Purpose: Context Management Tool. Guides the *internal generation* of a structured summary of preceding context.
|
|
353
|
-
* Workflow: Internally generate summary -> Call this tool *with* the summary text ->
|
|
361
|
+
* Workflow: Internally generate summary -> Call this tool *with* the summary text -> Follow with either `think` or `quick_think`.
|
|
354
362
|
* Output: Returns the provided summary text for grounding and analysis.
|
|
355
363
|
*/
|
|
356
|
-
server.tool("synthesize_prior_reasoning", "Context Management Tool. Guides *internal generation* of a **structured summary** of preceding steps, decisions, key findings, or relevant context to consolidate understanding before proceeding. Call this tool *with* the generated summary text you created internally. Returns the summary.
|
|
364
|
+
server.tool("synthesize_prior_reasoning", "Context Management Tool. Guides *internal generation* of a **structured summary** of preceding steps, decisions, key findings, or relevant context to consolidate understanding before proceeding. Call this tool *with* the generated summary text you created internally. Returns the summary. Follow with either `think` (for complex context requiring detailed analysis) or `quick_think` (for straightforward context) to leverage this summary and inform next actions.", {
|
|
357
365
|
generated_summary_text: z.string().describe("The **full, structured summary text** you generated internally (e.g., key decisions made, open questions, current state of implementation, relevant facts gathered)."),
|
|
358
366
|
context_to_summarize_description: z.string().describe("Description of the reasoning span or context that was summarized (e.g., 'Summary of the last 5 steps', 'Consolidated findings from tool results A and B').")
|
|
359
367
|
}, async ({ generated_summary_text, context_to_summarize_description }) => {
|
|
@@ -414,7 +422,7 @@ async function main() {
|
|
|
414
422
|
await server.connect(transport);
|
|
415
423
|
const border = '-----------------------------------------------------';
|
|
416
424
|
console.error(border);
|
|
417
|
-
console.error(` ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite v0.9.
|
|
425
|
+
console.error(` ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite v0.9.10: Enables structured, iterative reasoning (Chain of Thought/Draft), planning, and analysis for AI agents, focusing on the cognitive loop. MANDATORY \`think\` step integrates results.`);
|
|
418
426
|
console.error(` Version: ${version}`);
|
|
419
427
|
console.error(' Status: Running on stdio, awaiting MCP requests...');
|
|
420
428
|
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.11",
|
|
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",
|