@nbiish/cognitive-tools-mcp 0.9.30 → 2.0.2

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 CHANGED
@@ -34,7 +34,7 @@ Copyright © 2025 ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimi
34
34
 
35
35
  This project is licensed under the [COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS](LICENSE).
36
36
 
37
- ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Gikendaasowin Aabajichiganan - 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 include advanced deliberation (`think`), rapid checks (`quick_think`), mandatory complexity assessment (`assess_cuc_n_mode`), context synthesis, confidence gauging, proactive planning, explicit reasoning (CoT), and reflection.
37
+ ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Agentic Cognitive Tools (v3.2): Implements Gikendaasowin v7 Guidelines. Enforces MANDATORY internal **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle: Starts with 'assess_and_orient', continues with 'think' deliberation before actions. Guides adaptive reasoning (**Chain-of-Thought (CoT)**, **Chain-of-Draft/Condensed Reasoning (CoD/CR)**, **Structured Chain-of-Thought (SCoT)**) & CodeAct preference. Returns Markdown.
38
38
 
39
39
  Known as:
40
40
  - Anishinaabemowin: [`@nbiish/gikendaasowin-aabajichiganan-mcp`](https://www.npmjs.com/package/@nbiish/gikendaasowin-aabajichiganan-mcp)
package/build/index.js CHANGED
@@ -1,27 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * -----------------------------------------------------------------------------
4
- * Gikendaasowin Aabajichiganan - Core Cognitive Tools MCP Server (v1.2 - Generalized)
4
+ * Gikendaasowin Aabajichiganan - Agentic Cognitive Tools MCP Server (v3.2)
5
5
  *
6
- * Description: Provides a streamlined suite of cognitive tools for an AI agent,
7
- * inspired by research on improving LLM reasoning (like Anthropic's 'think' tool)
8
- * applicable across domains (coding, research, planning, etc.).
9
- * Focuses on assessment (`assess_cuc_n_mode`) and a central deliberation
10
- * hub (`think`) used especially after receiving information/results.
11
- * `quick_think` is for trivial steps. CoT/CoD reasoning styles occur within `think`.
12
- * Returns Markdown.
6
+ * Description: Provides cognitive tools implementing the Gikendaasowin v7
7
+ * Agentic Operational Guidelines. Enforces a mandatory structured
8
+ * deliberation cycle, **Observe-Orient-Reason-Decide-Act (OOReDAct)**, via
9
+ * internal cognitive steps, initiated by mandatory assessment/orientation.
10
+ * Guides adaptive reasoning using techniques like **Chain-of-Thought (CoT)**,
11
+ * **Chain-of-Draft/Condensed Reasoning (CoD/CR)**, and **Structured
12
+ * Chain-of-Thought (SCoT)**. Aligns with dynamic tool environments,
13
+ * including CodeAct preference. Returns Markdown.
13
14
  *
14
- * Key Principles:
15
- * 1. **Structured Deliberation:** Tools guide assessment (`assess_cuc_n_mode`) and
16
- * thinking/analysis (`think`, `quick_think`).
17
- * 2. **Centralized Analysis (`think`):** The `think` tool is the hub for analysis (results, errors),
18
- * planning, reflection, policy checks, and reasoning (CoT/CoD). **Crucially used after info/results.**
19
- * 3. **CUC-N Assessment:** `assess_cuc_n_mode` guides initial cognitive depth choice.
20
- * 4. **Iterative Loop:** Assess -> [Action/Tool] -> Analyze Result/State (`think`) -> Plan (`think`) -> [Execute].
21
- * 5. **Traceability & Reliability:** Tool inputs logged; structured thinking enhances reliability across tasks.
22
- * 6. **Markdown Output:** Tool results formatted as Markdown.
23
- *
24
- * Protocol: Model Context Protocol (MCP) over stdio.
15
+ * v3.2 Enhancements:
16
+ * - Expanded cognitive technique acronyms (OOReDAct, CoT, CoD/CR, SCoT)
17
+ * with brief explanations on first use in descriptions.
18
+ * - Maintained internal system prompt framing.
25
19
  * -----------------------------------------------------------------------------
26
20
  */
27
21
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -29,13 +23,13 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
29
23
  import { z } from "zod";
30
24
  // --- Server Definition ---
31
25
  const serverInfo = {
32
- name: "gikendaasowin-aabajichiganan-mcp",
33
- version: "1.2.0", // Incremented version
34
- description: `ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools (Generalized v1.2): Focuses on Assess/Think loop, using 'think' for post-result/state analysis across domains (code, research, etc.) to improve reliability. CoT/CoD integrated into 'think'. Returns Markdown.`
26
+ name: "gikendaasowin-agentic-cognitive-tools-mcp",
27
+ version: "3.2.0", // Version reflects acronym expansion
28
+ // Updated description with expanded acronyms
29
+ description: `ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Agentic Cognitive Tools (v3.2): Implements Gikendaasowin v7 Guidelines. Enforces MANDATORY internal **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle: Starts with 'assess_and_orient', continues with 'think' deliberation before actions. Guides adaptive reasoning (**Chain-of-Thought (CoT)**, **Chain-of-Draft/Condensed Reasoning (CoD/CR)**, **Structured Chain-of-Thought (SCoT)**) & CodeAct preference. Returns Markdown.`
35
30
  };
36
31
  const server = new McpServer(serverInfo);
37
- // --- Logging Helpers ---
38
- // [Keep existing logToolCall, logToolResult, logToolError functions]
32
+ // --- Logging Helpers (Internal - No changes needed) ---
39
33
  /**
40
34
  * Logs an incoming tool call to stderr.
41
35
  * @param toolName The name of the tool being called.
@@ -56,7 +50,8 @@ function logToolResult(toolName, success, resultDetails) {
56
50
  console.error(`[${timestamp}] [MCP Server] < Tool Result: ${toolName} - ${success ? 'Success' : 'Failure'}${resultDetails ? ` - ${resultDetails}` : ''}`);
57
51
  }
58
52
  /**
59
- * Logs an error during tool execution and formats a standard error response for the LLM.
53
+ * Logs an error during tool execution and formats a standard error response for the LLM,
54
+ * guiding towards the mandatory internal deliberation cycle with expanded acronyms on first use.
60
55
  * @param toolName The name of the tool where the error occurred.
61
56
  * @param error The error object or message.
62
57
  * @returns An object matching the required MCP tool result structure containing the error message.
@@ -66,111 +61,119 @@ function logToolError(toolName, error) {
66
61
  const errorMessage = error instanceof Error ? error.message : String(error);
67
62
  console.error(`[${timestamp}] [MCP Server] ! Tool Error: ${toolName} - ${errorMessage}`);
68
63
  logToolResult(toolName, false, errorMessage); // Log failure result as well
69
- // Return a structured error message suitable for the LLM
64
+ // **Refined Error Guidance:** Expanded acronyms on first mention here.
70
65
  return {
71
66
  content: [{
72
67
  type: "text",
73
- text: `Error executing tool '${toolName}': ${errorMessage}. Use the 'think' tool to analyze this error, check context, and plan the next step.` // Enhanced suggestion
68
+ text: `**INTERNAL ERROR during '${toolName}':** ${errorMessage}\n\n**CORRECTIVE ACTION REQUIRED:** You MUST now perform the full **Observe-Orient-Reason-Decide-Act (OOReDAct)** deliberation cycle to address this error. Structure your thinking with: 1. **Observe** this error message. 2. **Orient** by analyzing the error in context of the goal and previous steps. 3. **Reason** about potential causes and solutions (use adaptive reasoning: **Chain-of-Thought (CoT)** for detailed steps, **Chain-of-Draft/Condensed Reasoning (CoD/CR)** for efficient summaries, or **Structured Chain-of-Thought (SCoT)** for plans/code, as appropriate). 4. **Decide** on the *single best* corrective action (e.g., retry, modify parameters, use different tool/CodeAct, ask USER). 5. **Act(Plan)** the exact parameters or code for the correction. 6. Define **Verification** and **Risk/Contingency**.`
74
69
  }]
75
70
  };
76
71
  }
77
- // --- Core Cognitive Deliberation & Refinement Tools ---
72
+ // --- Core Cognitive Deliberation & Refinement Steps (v3.2 - Expanded Acronyms) ---
78
73
  /**
79
- * Tool: assess_cuc_n_mode
80
- * Purpose: Initial assessment of task characteristics to guide cognitive strategy selection.
81
- * Workflow: Call BEFORE starting complex tasks or significantly changing strategy.
82
- * Output: Returns the full assessment text formatted as Markdown.
74
+ * Step: assess_and_orient (Mandatory Initial Assessment & Orientation)
75
+ * Purpose: **Mandatory first step** for every new user request AND before any significant strategic pivot.
76
+ * Establishes initial context by assessing task characteristics (Complexity, Uncertainty, Consequence, Novelty - CUC-N)
77
+ * and performing the initial Observe/Orient steps of the **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle.
78
+ * Workflow: **Perform this step** at the beginning of processing a user request or when changing overall approach.
79
+ * Its output informs the *first* full OOReDAct cycle (`think` step).
80
+ * Output: The assessment and initial orientation text formatted as Markdown.
83
81
  */
84
- server.tool("assess_cuc_n_mode", "**Initial Assessment.** Evaluates task Complexity, Uncertainty, Consequence, Novelty (CUC-N) to guide cognitive strategy. Call before complex tasks (coding, research, multi-step plans). Based on assessment, explicitly select and state whether the next step requires the detailed `think` tool (for analysis, planning, complex results) or the minimal `quick_think` tool (for trivial steps only).", {
85
- assessment_and_choice: z.string().describe("Your structured assessment including: 1) Situation/Task Description, 2) CUC-N Ratings (Low/Medium/High for each), 3) Rationale, 4) Recommended Cognitive Strategy (e.g., 'Requires careful step-by-step planning'), 5) Explicit Mode Selection ('Selected Mode: think' or 'Selected Mode: quick_think').")
86
- }, async ({ assessment_and_choice }) => {
87
- const toolName = 'assess_cuc_n_mode';
82
+ server.tool("assess_and_orient",
83
+ // **Internal Framing:** Expanded OOReDAct on first mention.
84
+ "**Mandatory Initial Assessment & Orientation:** At the start of EVERY user request AND before any major change in strategy, you MUST perform this initial assessment and orientation. Analyze the request/situation using CUC-N (Complexity, Uncertainty, Consequence, Novelty) to perform the initial 'Observe' and 'Orient' steps of the **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle. This assessment is CRITICAL for grounding your subsequent reasoning and planning within the main OOReDAct cycle.", {
85
+ assessment_and_orientation_text: z.string().describe("Provide your structured CUC-N assessment and initial Orientation. MUST include: 1) Task/Situation Summary (Observe). 2) CUC-N Analysis (Rationale for Low/Medium/High ratings). 3) Initial Orientation (Contextualize task based on CUC-N, goals, constraints, available tools/knowledge; identify key challenges/unknowns). 4) Strategic Implications (How CUC-N influences the approach, e.g., 'High consequence requires rigorous verification in subsequent OOReDAct cycles', 'High uncertainty suggests iterative refinement').")
86
+ }, async ({ assessment_and_orientation_text }) => {
87
+ const toolName = 'assess_and_orient';
88
88
  logToolCall(toolName);
89
89
  try {
90
- const modeRegex = /Selected Mode: (think|quick_think)/i;
91
- const modeMatch = assessment_and_choice.match(modeRegex);
92
- const selectedMode = modeMatch ? modeMatch[1].toLowerCase() : "unknown";
93
- if (assessment_and_choice.trim().length === 0) {
94
- throw new Error('Invalid assessment_and_choice: Must be a non-empty string.');
90
+ if (assessment_and_orientation_text.trim().length === 0) {
91
+ throw new Error('Invalid input: Must provide a non-empty CUC-N assessment and orientation.');
95
92
  }
96
- if (!modeMatch) {
97
- throw new Error('Invalid assessment: String must include explicit "Selected Mode: think" or "Selected Mode: quick_think".');
93
+ if (!assessment_and_orientation_text.includes("CUC-N Analysis") || !assessment_and_orientation_text.includes("Initial Orientation")) {
94
+ console.warn(`[${new Date().toISOString()}] [MCP Server] WARNING: '${toolName}' input may be missing key sections (CUC-N Analysis, Initial Orientation). Ensure full assessment.`);
98
95
  }
99
- logToolResult(toolName, true, `Selected mode (extracted): ${selectedMode}`);
100
- console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\n${assessment_and_choice}`);
101
- return {
102
- content: [{
103
- type: "text",
104
- text: assessment_and_choice
105
- }]
106
- };
96
+ logToolResult(toolName, true, `Assessment & Orientation logged (length: ${assessment_and_orientation_text.length})`);
97
+ console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\n${assessment_and_orientation_text}`);
98
+ return { content: [{ type: "text", text: assessment_and_orientation_text }] };
107
99
  }
108
100
  catch (error) {
109
101
  return logToolError(toolName, error);
110
102
  }
111
103
  });
112
104
  /**
113
- * Tool: think
114
- * Purpose: The **CENTRAL HUB** for structured reasoning, analysis, and planning across all complex tasks.
115
- * Workflow: Use this tool to **stop and think** *after* receiving information (tool results, calculations, user input, file content) or *before* taking a complex action (generating code, calling critical tools, formulating multi-part answers). Analyze inputs/results, check goals/policies/constraints, verify state, plan next steps, brainstorm, and perform detailed reasoning (CoT/CoD). Essential for reliability, error handling, and managing sequential tasks.
116
- * Output: Returns the structured thought text itself, formatted as Markdown.
105
+ * Step: think (Mandatory OOReDAct Deliberation Cycle)
106
+ * Purpose: The **REQUIRED & CENTRAL cognitive process** for the **MANDATORY** structured deliberation cycle
107
+ * (**Observe-Orient-Reason-Decide-Act (OOReDAct)**).
108
+ * Workflow: **You MUST perform this full, structured OOReDAct cycle** *after* the initial `assess_and_orient` step,
109
+ * *after* receiving subsequent new information (tool results, CodeAct output/errors, USER input, file reads),
110
+ * and *before* executing any non-trivial action or providing a final response. Use it to rigorously follow the OOReDAct
111
+ * structure, document reasoning (adapting reasoning styles like **Chain-of-Thought (CoT)**, **Chain-of-Draft/Condensed Reasoning (CoD/CR)**,
112
+ * or **Structured Chain-of-Thought (SCoT)** as needed), decide the next step, and plan actions precisely.
113
+ * Output: The structured thought process itself (Markdown), serving as your verifiable internal reasoning log.
117
114
  */
118
- server.tool("think", "**Central Hub for Analysis, Planning & Reasoning.** Use this tool to **stop and think**, especially *after* receiving information (tool results, errors, data) or before complex actions (coding, critical decisions). Analyze inputs/results, check goals/policies, verify information, plan next steps, and perform detailed reasoning (CoT/CoD) as needed. Crucial for reliability in coding, research, planning, and error recovery. Structure thought using clear headings (see prompt examples).", {
119
- thought: z.string().describe("Your **structured** internal deliberation. MUST follow prompt guidance (Observe, Orient, Decide, Reason, Act, etc.). Include analysis of information/results, context/goal/policy checks, planning, and rationale (CoT/CoD). Crucial for complex tasks.")
115
+ server.tool("think",
116
+ // **Internal Framing:** Expanded OOReDAct, CoT, CoD/CR, SCoT on first mention in this tool's description.
117
+ "**Mandatory OOReDAct Deliberation Cycle:** You MUST perform the full, structured **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle *after* the initial `assess_and_orient` step, *after* receiving new information (tool/CodeAct results, errors, USER input), and *before* any non-trivial action or final response. Follow the complete OOReDAct structure, adapting your reasoning style within the 'Reason' step (e.g., using detailed **Chain-of-Thought (CoT)** for complexity, concise **Chain-of-Draft/Condensed Reasoning (CoD/CR)** for efficiency, or **Structured Chain-of-Thought (SCoT)** for planning/code) for reliable, verifiable, and adaptive behavior.", {
118
+ // **Internal Framing:** Expanded acronyms with explanations in the input description.
119
+ thought: z.string().describe("Provide your **complete, structured OOReDAct deliberation**. MUST include ALL sections: ## Observe (Analyze latest inputs/results/errors objectively), ## Orient (Contextualize vs goal/policy/prior state/assessment), ## Reason (Justify decision; adapt reasoning style: use **Chain-of-Thought (CoT)** for detailed, step-by-step derivation when complexity is high; use **Chain-of-Draft/Condensed Reasoning (CoD/CR)** for a more concise, high-signal summary when appropriate; use **Structured Chain-of-Thought (SCoT)** for outlining plans or generating structured code), ## Decide (Single, immediate next action: specific tool call, CodeAct execution, query USER, final response), ## Act (Plan) (Detail execution: EXACT tool params per current schema, OR complete runnable CodeAct Python snippet, OR precise response draft), ## Verification (Expected outcome/success criteria for *this* step), ## Risk & Contingency (Brief fallback if verification fails).")
120
120
  }, async ({ thought }) => {
121
121
  const toolName = 'think';
122
122
  logToolCall(toolName);
123
123
  try {
124
124
  if (thought.trim().length === 0) {
125
- throw new Error('Invalid thought: Must be a non-empty string containing substantive reasoning, following the prompted structure.');
125
+ throw new Error('Invalid thought: Input cannot be empty.');
126
+ }
127
+ const requiredSections = ["## Observe", "## Orient", "## Reason", "## Decide", "## Act (Plan)", "## Verification", "## Risk & Contingency"];
128
+ const missingSections = requiredSections.filter(section => !thought.includes(section));
129
+ if (missingSections.length > 0) {
130
+ throw new Error(`Invalid thought structure: Missing required OOReDAct section(s): ${missingSections.join(', ')}. You must provide the complete deliberation.`);
126
131
  }
127
- logToolResult(toolName, true, `Thought logged (length: ${thought.length})`);
132
+ logToolResult(toolName, true, `Deliberation logged (length: ${thought.length})`);
128
133
  console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\n${thought}`);
129
- return {
130
- content: [{
131
- type: "text",
132
- text: thought
133
- }]
134
- };
134
+ return { content: [{ type: "text", text: thought }] };
135
135
  }
136
136
  catch (error) {
137
137
  return logToolError(toolName, error);
138
138
  }
139
139
  });
140
140
  /**
141
- * Tool: quick_think
142
- * Purpose: A minimal cognitive step for trivial actions or confirmations.
143
- * Workflow: Use ONLY for acknowledging *trivial* successes, simple variable passing, or confirming *immediately obvious* next steps where NO analysis, planning, policy check, or complex reasoning (handled by `think`) is needed. Use sparingly; prefer `think` for analyzing any tool output, error, or planning non-trivial actions.
144
- * Output: Returns the brief thought text, formatted as Markdown.
141
+ * Step: quick_think (Minimal Cognitive Acknowledgement)
142
+ * Purpose: For acknowledging *simple, expected, non-problematic* outcomes ONLY, where the next step is
143
+ * *already clearly defined* by a prior **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle (`think` step)
144
+ * and requires NO re-evaluation or adaptation.
145
+ * Workflow: Use sparingly to maintain cognitive flow in straightforward sequences. **Does NOT replace the mandatory OOReDAct cycle**.
146
+ * The full OOReDAct cycle (`think` step) is MANDATORY for handling new information, errors, planning changes,
147
+ * or any step requiring analysis or decision-making.
148
+ * Output: The brief acknowledgement text (Markdown).
145
149
  */
146
- server.tool("quick_think", "**Minimal Cognitive Step (Use Sparingly!).** Use ONLY for acknowledging *trivial* successes or confirming *obvious* next steps where NO analysis, planning, or policy check is needed (e.g., 'Action X succeeded, proceeding to Y'). All substantive analysis, error handling, planning, and reasoning (CoT/CoD) belongs in the `think` tool. Prefer `think` after most tool calls or before complex actions.", {
147
- brief_thought: z.string().describe("Your **extremely concise** confirmation or trivial thought (e.g., 'Tool success, continue', 'Passing ID to next step'). Must be non-empty but very short. Do NOT use for analysis or planning.")
150
+ server.tool("quick_think",
151
+ // **Internal Framing:** Expanded OOReDAct on first mention here.
152
+ "**Minimal Cognitive Acknowledgement:** Use ONLY for acknowledging *simple, expected, non-problematic* outcomes (e.g., 'Data fetch OK, proceeding with planned analysis') where the next step is *already determined* by a prior **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle (`think` step) and needs NO re-evaluation. Helps maintain flow in simple sequences. **This step DOES NOT satisfy the mandatory OOReDAct deliberation requirement.** Perform the full OOReDAct cycle (`think` step) for any analysis, planning, reasoning, error handling, or decision making.", {
153
+ // **Internal Framing:** Expanded OOReDAct on first mention here.
154
+ brief_thought: z.string().describe("Provide your **extremely concise** acknowledgement for a genuinely trivial step (max ~15 words recommended, e.g., 'Step X succeeded as expected.'). Must be non-empty. **Do NOT use this for ANY analysis, planning, reasoning, decision-making, or error handling** - perform the full **Observe-Orient-Reason-Decide-Act (OOReDAct)** cycle (`think` step) instead.")
148
155
  }, async ({ brief_thought }) => {
149
156
  const toolName = 'quick_think';
150
157
  logToolCall(toolName);
151
158
  try {
152
159
  if (brief_thought.trim().length === 0) {
153
- throw new Error('Invalid brief_thought: Must be a non-empty string.');
160
+ throw new Error('Invalid brief_thought: Must be non-empty.');
161
+ }
162
+ if (brief_thought.includes("##")) {
163
+ throw new Error("Invalid brief_thought: Cannot contain '##' sections. Use the full OOReDAct cycle (`think` step) for structured deliberation.");
164
+ }
165
+ if (brief_thought.length > 100) {
166
+ console.warn(`[${new Date().toISOString()}] [MCP Server] WARNING: 'quick_think' input is long (${brief_thought.length} chars). Confirm this step was truly trivial and required no OOReDAct deliberation.`);
154
167
  }
155
- // Optional: Add a length check if you want to enforce brevity strictly
156
- // if (brief_thought.length > 100) { // Example limit
157
- // throw new Error('Invalid brief_thought: Input is too long for quick_think. Use think tool for detailed reasoning.');
158
- // }
159
168
  logToolResult(toolName, true, `Logged: ${brief_thought.substring(0, 80)}...`);
160
169
  console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\n${brief_thought}`);
161
- return {
162
- content: [{
163
- type: "text",
164
- text: brief_thought
165
- }]
166
- };
170
+ return { content: [{ type: "text", text: brief_thought }] };
167
171
  }
168
172
  catch (error) {
169
173
  return logToolError(toolName, error);
170
174
  }
171
175
  });
172
- // --- Server Lifecycle and Error Handling ---
173
- // [Keep existing shutdown, process event handlers, main function]
176
+ // --- Server Lifecycle and Error Handling (Internal - No changes needed) ---
174
177
  /**
175
178
  * Gracefully shuts down the server.
176
179
  */
@@ -186,21 +189,21 @@ async function shutdown() {
186
189
  process.exit(1);
187
190
  }
188
191
  }
192
+ // Setup signal handlers
189
193
  process.on('SIGINT', shutdown);
190
194
  process.on('SIGTERM', shutdown);
195
+ // Setup global error handlers
191
196
  process.on('uncaughtException', (error, origin) => {
192
197
  const timestamp = new Date().toISOString();
193
198
  console.error(`[${timestamp}] [MCP Server] FATAL: Uncaught Exception at: ${origin}`, error);
194
- // Attempt graceful shutdown, but exit quickly if it fails
195
199
  shutdown().catch(() => process.exit(1));
196
200
  });
197
201
  process.on('unhandledRejection', (reason, promise) => {
198
202
  const timestamp = new Date().toISOString();
199
203
  console.error(`[${timestamp}] [MCP Server] FATAL: Unhandled Promise Rejection:`, reason);
200
- // Attempt graceful shutdown, but exit quickly if it fails
201
204
  shutdown().catch(() => process.exit(1));
202
205
  });
203
- // --- Start the Server ---
206
+ // --- Start the Server (Internal - No changes needed) ---
204
207
  /**
205
208
  * Initializes and starts the MCP server.
206
209
  */
@@ -208,10 +211,11 @@ async function main() {
208
211
  try {
209
212
  const transport = new StdioServerTransport();
210
213
  await server.connect(transport);
211
- const border = '-----------------------------------------------------';
214
+ const border = '=====================================================';
212
215
  console.error(border);
213
- console.error(` ${serverInfo.description}`);
216
+ console.error(` ${serverInfo.description}`); // Uses updated description
214
217
  console.error(` Version: ${serverInfo.version}`);
218
+ console.error(` Enforcing Gikendaasowin v7 Guidelines with Internal OOReDAct Cycle`);
215
219
  console.error(' Status: Running on stdio, awaiting MCP requests...');
216
220
  console.error(border);
217
221
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbiish/cognitive-tools-mcp",
3
- "version": "0.9.30",
3
+ "version": "2.0.2",
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",