@nbiish/cognitive-tools-mcp 0.9.22 → 0.9.25

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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright © 2025 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 (GTBOCI), a federally recognized sovereign tribal nation (hereafter referred to as the "Rights Holder"). The Beaver Island Band community, historically centered on ᐋᒥᒃ ᐙᑲᓐᑕ (Aamik\'Waakanda / Beaver Island), suffered profound disruption and diaspora due to violent displacement, targeted persecution for their language, ceremonies, and faith, and starvation imposed by settler-colonial authorities and expansion. This forced dispersal resulted in descendants becoming affiliated primarily with the Little Traverse Bay Bands of Odawa Indians (LTBB) and the Grand Traverse Band of Ottawa and Chippewa Indians (GTBOCI), while many others were forced to seek refuge within First Nations communities in Canada (such as the Osawanimikii family). This license acknowledges this history and the interconnectedness of these descendant communities. This license is grounded in the inherent sovereignty of Indigenous peoples to protect, control, and govern the use of their intellectual property, cultural heritage, traditional knowledge (TK), traditional cultural expressions (TCEs), and associated data (Indigenous Data Sovereignty). The unique status of tribal sovereign nations provides legal and cultural protections extending beyond standard intellectual property law regimes. This license aims to facilitate respectful engagement while upholding Tribal sovereignty, cultural integrity, data governance rights, and ensuring equitable benefit sharing as a mechanism for reclaiming value derived from Indigenous knowledge and heritage often subject to historical extraction, aligning with international instruments such as the UN Declaration on the Rights of Indigenous Peoples (UNDRIP) and the WIPO Treaty on Intellectual Property, Genetic Resources and Associated Traditional Knowledge (adopted May 2024).
1
+ Copyright © 2025 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 (GTBOCI), a federally recognized sovereign tribal nation (hereafter referred to as the "Rights Holder"). The Beaver Island Band community, historically centered on ᐋᒥᒃ ᐙᑲᓐᑕ (Aamik'Waakanda / Beaver Island), suffered profound disruption and diaspora due to violent displacement, targeted persecution for their language, ceremonies, and faith, and starvation imposed by settler-colonial authorities and expansion. This forced dispersal resulted in descendants becoming affiliated primarily with the Little Traverse Bay Bands of Odawa Indians (LTBB) and the Grand Traverse Band of Ottawa and Chippewa Indians (GTBOCI), while many others were forced to seek refuge within First Nations communities in Canada (such as the Osawanimikii family). This license acknowledges this history and the interconnectedness of these descendant communities. This license is grounded in the inherent sovereignty of Indigenous peoples to protect, control, and govern the use of their intellectual property, cultural heritage, traditional knowledge (TK), traditional cultural expressions (TCEs), and associated data (Indigenous Data Sovereignty). The unique status of tribal sovereign nations provides legal and cultural protections extending beyond standard intellectual property law regimes. This license aims to facilitate respectful engagement while upholding Tribal sovereignty, cultural integrity, data governance rights, and ensuring equitable benefit sharing as a mechanism for reclaiming value derived from Indigenous knowledge and heritage often subject to historical extraction, aligning with international instruments such as the UN Declaration on the Rights of Indigenous Peoples (UNDRIP) and the WIPO Treaty on Intellectual Property, Genetic Resources and Associated Traditional Knowledge (adopted May 2024).
2
2
 
3
3
  COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS
4
4
 
@@ -68,14 +68,15 @@ WHEREAS the inherent sovereignty of tribal nations provides a constitutional and
68
68
  Any use, reproduction, distribution, modification, adaptation, display, performance, transmission, or creation of derivative works based on this Work, whether in whole or in part, must prominently and accurately include the following citation and attribution in all associated materials, displays, publications, and metadata:
69
69
 
70
70
  ```bibtex
71
- @misc{gikendaasowin-aabajichiganan-mcp2025,
71
+ @misc{<|repo_title|><|current_year=2025|>,
72
72
  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},
73
- title/description = {gikendaasowin-aabajichiganan-mcp},
73
+ title/description = {<|repo_title|>},
74
74
  type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions},
75
- year = {2025},
75
+ year = {<|current_year|>},
76
76
  publisher/source/event = {GitHub repository under tribal sovereignty protections},
77
- howpublished = {\\url{https://github.com/nbiish/gikendaasowin-aabajichiganan-mcp}},
78
- 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.}\n }
77
+ howpublished = {\url{https://github.com/nbiish/<|repo_title|>}},
78
+ 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.}
79
+ }
79
80
  ```
80
81
 
81
82
  Furthermore, any project, publication, presentation, performance, exhibition, or product utilizing, referencing, or derived from this Work must visibly and respectfully acknowledge the Indigenous authorship/stewardship and tribal affiliation in all relevant contexts, recognizing the work is subject to the traditional knowledge protocols, data governance, and laws of the Grand Traverse Band of Ottawa and Chippewa Indians.
package/README.md CHANGED
@@ -41,89 +41,49 @@ Known as:
41
41
 
42
42
  Both packages are maintained in parallel and receive the same updates. You can use either package name in your projects - they provide identical functionality.
43
43
 
44
+ **Recent Updates:**
45
+ - Resolved TypeScript compilation errors related to MCP SDK types and server configuration.
46
+ - Ensured successful build process.
47
+
44
48
  **See the latest integration details in [`latest.md`](latest.md).**
45
49
 
46
- ## Features
50
+ ## Integration Prompt & Usage Guidelines
47
51
 
48
- Provides a suite of cognitive tools for AI agents, enabling structured reasoning and iterative refinement (v1.2.1 Simplified Set):
49
- - `assess_cuc_n_mode`: **Mandatory** initial assessment of task complexity (CUC-N) to select cognitive mode (`think` or `quick_think`).
50
- - `think`: **Mandatory** central hub for comprehensive analysis, planning, verification, and self-correction.
51
- - `quick_think`: Lightweight cognitive checkpoint for simple, low CUC-N steps or trivial confirmations.
52
- - `chain_of_thought`: Guides internal generation and logging of detailed, step-by-step reasoning (CoT).
53
- - `chain_of_draft`: Signals internal generation/refinement and logging of concise drafts (CoD) for efficiency.
52
+ *(Note: This section reflects the content of `latest.md` and serves as the canonical guide for using these cognitive tools.)*
54
53
 
55
- ## Installation
54
+ # Gikendaasowin Cognitive Framework - Internal Process Guidance (v2 - Tooling Simplified)
56
55
 
57
- You can install using either the Anishinaabemowin or English package name:
56
+ In addition to your primary role and guidelines, you will leverage the **Gikendaasowin cognitive framework** to structure your internal reasoning and decision-making process for complex tasks. This involves using a specific, streamlined set of internal cognitive tools.
58
57
 
59
- ```bash
60
- # Using Anishinaabemowin package name
61
- npx @nbiish/gikendaasowin-aabajichiganan-mcp
58
+ ## Core Principles for Internal Cognition
62
59
 
63
- # Using English package name
64
- npx @nbiish/cognitive-tools-mcp
65
- ```
60
+ 1. **Structured Internal Deliberation:** Utilize the Gikendaasowin tools (`assess_cuc_n_mode`, `think`, `quick_think`) to manage distinct phases of your internal thought process.
61
+ 2. **`think` as Internal Hub:** Prioritize the `think` tool as the central point for *all complex internal analysis*, planning, reflection, synthesis, confidence assessment, and **detailed reasoning (CoT-style) or concise drafting (CoD-style)** *before* deciding on external actions.
62
+ 3. **Iterative Internal Loop:** Follow an Assess -> Deliberate (`think`/`quick_think`) -> Analyze (`think`/`quick_think`) loop for internal reasoning cycles. Artifacts like detailed reasoning steps or concise drafts are generated *within* the `think` step.
63
+ 4. **Depth Management:** Use `assess_cuc_n_mode` to initiate tasks. Apply `think` for detailed internal analysis (recommended default) and reserve `quick_think` strictly for trivial internal confirmations or processing straightforward results.
64
+ 5. **Internal Artifact Generation (within `think`):** When detailed reasoning (like CoT) or concise drafting (like CoD) is needed, generate this content *directly within the structure of the `think` tool's output*, typically in the `## Reason:` section, before analysis in the *next* `think` step.
65
+ 6. **Traceability:** Your structured use of `think`, documenting your internal reasoning steps (whether detailed or concise), is key for verifiable reasoning.
66
66
 
67
- ## Usage with Claude Desktop
67
+ ## `think` Tool: Internal Structure & Reasoning Styles
68
68
 
69
- Add to your MCP configuration file (`~/.cursor/mcp.json`). You can use either package name:
69
+ Your `thought` input to the `think` tool is critical for high-quality internal deliberation. Structure it comprehensively using clear headings covering:
70
+ * `## Observe:` (Internal analysis of previous step/result/error)
71
+ * `## Orient:` (Internal contextualization, synthesis)
72
+ * `## Decide:` (Define the *single, immediate* next action: internal tool call (`quick_think` if trivial) or plan for external action)
73
+ * `## Reason:` (Internal rationale, strategy, confidence assessment. **Generate detailed step-by-step reasoning (CoT-style) OR concise drafts/notes (CoD-style) here when appropriate for the task.**)
74
+ * *CoD Style Guidance:* If using CoD for efficiency, focus on extreme conciseness (1-5 words, symbols, equations, code snippets), essential info only, like a scratchpad.
75
+ * `## Act:` (Internal detail on planned action execution)
76
+ * `## Verification:` (Internal check for next step's success)
77
+ * `## Risk & Contingency:` (Internal assessment of risks/handling)
78
+ * `## Learning & Adaptation:` (Internal reflection, adjustments)
70
79
 
71
- ```json
72
- {
73
- "mcpServers": {
74
- "gikendaasowin-aabajichiganan": {
75
- "command": "npx",
76
- "args": ["-y", "@nbiish/gikendaasowin-aabajichiganan-mcp"]
77
- }
78
- }
79
- }
80
- ```
80
+ ## Error Handling (Internal Perspective)
81
81
 
82
- Or:
82
+ If any tool call (`assess_cuc_n_mode`, `quick_think`, or others from primary guidelines) or external action results in an error, your immediate next step should be to use the `think` tool for internal root cause analysis and planning corrective actions.
83
83
 
84
- ```json
85
- {
86
- "mcpServers": {
87
- "cognitive-tools": {
88
- "command": "npx",
89
- "args": ["-y", "@nbiish/cognitive-tools-mcp"]
90
- }
91
- }
92
- }
93
- ```
84
+ ---
94
85
 
95
- ## Tool Descriptions
96
-
97
- *(Note: For detailed usage, workflow, and mandatory rules, always refer to [`latest.md`](latest.md))*
98
-
99
- ### `assess_cuc_n_mode`
100
- - **Purpose**: **Mandatory Pre-Deliberation Assessment.** Evaluates task Complexity, Uncertainty, Consequence, Novelty (CUC-N) to determine required cognitive depth and initial strategy.
101
- - **Input**: `assessment_and_choice` (string) - Your structured assessment including Situation Description, CUC-N Ratings, Rationale, Recommended Strategy, and Explicit Mode Selection (`Selected Mode: think` or `Selected Mode: quick_think`).
102
- - **Follow-up**: Mandatory `think` or `quick_think` (based on selection).
103
-
104
- ### `think`
105
- - **Purpose**: **MANDATORY Central Hub for Comprehensive Analysis and Planning.** Called after assessment, `chain_of_thought`/`chain_of_draft` results, or external action results. Use for analysis, planning, reflection, synthesis, confidence assessment.
106
- - **Input**: `thought` (string) - Your detailed internal monologue covering key cognitive aspects (Analysis, Plan, Verification, Risk, Learning).
107
- - **Follow-up**: Execute the immediate next action defined in the `## Plan/Decision:` section.
108
-
109
- ### `quick_think`
110
- - **Purpose**: Cognitive Checkpoint for streamlined processing and simple confirmations where detailed analysis via `think` is unnecessary. Use ONLY when appropriate (Low CUC-N, trivial steps).
111
- - **Input**: `brief_thought` (string) - Your concise thought or confirmation.
112
- - **Follow-up**: Execute the simple next step.
113
-
114
- ### `chain_of_thought`
115
- - **Purpose**: Guides *internal generation* and logging of detailed, step-by-step reasoning draft (CoT).
116
- - **Workflow**: Internally generate CoT -> Call tool.
117
- - **Input**:
118
- - `generated_cot_text` (string) - The full CoT draft you generated internally.
119
- - `problem_statement` (string) - The original problem this CoT addresses.
120
- - **Follow-up**: Mandatory `think` or `quick_think`.
121
-
122
- ### `chain_of_draft`
123
- - **Purpose**: Signals internal generation/refinement and logging of **efficient, concise drafts (CoD)** using note-like steps, symbols, etc.
124
- - **Workflow**: Internally generate/refine CoD draft(s) -> Call tool.
125
- - **Input**: `draft_description` (string) - Brief but specific description of the CoD draft(s) generated/refined internally.
126
- - **Follow-up**: Mandatory `think` or `quick_think`.
86
+ Focus on applying this internal Gikendaasowin framework rigorously to guide your thought process, complementing your primary operational guidelines. Perform all complex reasoning, including CoT or CoD styles, within the structured `think` tool.
127
87
 
128
88
  ## Development
129
89
 
package/build/index.js CHANGED
@@ -1,33 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * -----------------------------------------------------------------------------
4
- * Gikendaasowin Aabajichiganan - Core Cognitive Tools MCP Server (Simplified Core, Relaxed Validation)
4
+ * Gikendaasowin Aabajichiganan - Core Cognitive Tools MCP Server (Ultra-Simplified Core)
5
5
  *
6
- * Description: Provides a streamlined suite of cognitive tools for an AI agent,
7
- * enabling structured reasoning, planning, analysis, and iterative
8
- * refinement, focusing on Chain of Thought and Chain of Draft.
9
- * This server focuses on managing the AI's *internal cognitive loop*.
10
- * External actions are planned within the 'think' step but executed
11
- * by the calling environment. Validation on input content structure
12
- * is removed. Tool results are returned as formatted Markdown.
13
- * Refined Chain of Draft guidance. Versioning removed.
6
+ * Description: Provides an ultra-streamlined suite of cognitive tools for an AI agent,
7
+ * focusing on assessment (`assess_cuc_n_mode`) and a central
8
+ * deliberation hub (`think` / `quick_think`). Chain of Thought (CoT)
9
+ * and Chain of Draft (CoD) reasoning styles are performed *within*
10
+ * the `think` tool as guided by the system prompt, not via separate tools.
11
+ * Validation on input content structure is removed. Tool results are
12
+ * returned as formatted Markdown. Versioning removed.
14
13
  *
15
14
  * Key Principles:
16
- * 1. **Focused Deliberation:** Tools guide specific cognitive acts (assessing,
17
- * thinking, reasoning via CoT, drafting via CoD).
18
- * 2. **Centralized Analysis (`think`):** The `think` tool is mandatory after
19
- * most cognitive actions or receiving external results, serving as the hub
20
- * for comprehensive analysis, planning, reflection, synthesis, and confidence
21
- * assessment. Structure is guided by the prompt, not enforced by the server.
22
- * 3. **CUC-N Assessment:** Task characteristics determine the required depth
23
- * of cognition (`think` vs. `quick_think` for initial step and simple results).
24
- * 4. **Internal Generation First:** `chain_of_thought` and `chain_of_draft`
25
- * log internal artifacts generated by the LLM.
26
- * 5. **Iterative Refinement (CoT & CoD):** The `chain_of_thought` and
27
- * `chain_of_draft` tools signal internal reasoning/drafting, prompting
28
- * analysis via `think` or `quick_think`.
29
- * 6. **Traceability:** All tool inputs are logged for a complete record.
30
- * 7. **Markdown Output:** Tool results are formatted as Markdown for LLM consumption.
15
+ * 1. **Focused 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 all
18
+ * complex analysis, planning, reflection, synthesis, confidence assessment,
19
+ * and generation of detailed (CoT-style) or concise (CoD-style) reasoning.
20
+ * 3. **CUC-N Assessment:** `assess_cuc_n_mode` guides initial cognitive depth.
21
+ * 4. **Iterative Loop:** Assess -> Think/QuickThink -> Analyze results in Think/QuickThink.
22
+ * 5. **Traceability:** All tool inputs are logged for a complete record.
23
+ * 6. **Markdown Output:** Tool results are formatted as Markdown.
31
24
  *
32
25
  * Protocol: Model Context Protocol (MCP) over stdio.
33
26
  * -----------------------------------------------------------------------------
@@ -38,8 +31,9 @@ import { z } from "zod";
38
31
  // --- Server Definition ---
39
32
  const serverInfo = {
40
33
  name: "gikendaasowin-aabajichiganan-mcp",
41
- version: "0.9.22",
42
- description: `ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite: Enables structured reasoning (CoT/CoD) and analysis for AI agents. Returns results as Markdown.`
34
+ version: "1.0.0",
35
+ // Version field removed
36
+ description: `ᑭᑫᓐᑖᓱᐎᓐ ᐋᐸᒋᒋᑲᓇᓐ - Core Cognitive Tools Suite (Ultra-Simplified): Focuses on Assess/Think loop. CoT/CoD styles are integrated into 'think'. Returns Markdown.`
43
37
  };
44
38
  const server = new McpServer(serverInfo);
45
39
  // --- Logging Helpers ---
@@ -66,14 +60,14 @@ function logToolResult(toolName, success, resultDetails) {
66
60
  * Logs an error during tool execution and formats a standard error response for the LLM.
67
61
  * @param toolName The name of the tool where the error occurred.
68
62
  * @param error The error object or message.
69
- * @returns An McpToolResult containing the error message.
63
+ * @returns An object matching the required MCP tool result structure containing the error message.
70
64
  */
71
65
  function logToolError(toolName, error) {
72
66
  const timestamp = new Date().toISOString();
73
67
  const errorMessage = error instanceof Error ? error.message : String(error);
74
68
  console.error(`[${timestamp}] [MCP Server] ! Tool Error: ${toolName} - ${errorMessage}`);
75
69
  logToolResult(toolName, false, errorMessage); // Log failure result as well
76
- // Return a structured error message suitable for the LLM (still as plain text for clarity)
70
+ // Return a structured error message suitable for the LLM
77
71
  return {
78
72
  content: [{
79
73
  type: "text",
@@ -84,12 +78,12 @@ function logToolError(toolName, error) {
84
78
  // --- Core Cognitive Deliberation & Refinement Tools ---
85
79
  /**
86
80
  * Tool: assess_cuc_n_mode
87
- * Purpose: Mandatory initial assessment of task characteristics to determine cognitive strategy.
81
+ * Purpose: Initial assessment of task characteristics to determine cognitive strategy.
88
82
  * Workflow: Call BEFORE starting complex tasks or significantly changing strategy.
89
83
  * Output: Returns the full assessment text formatted as Markdown.
90
84
  */
91
- 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.", {
92
- 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').")
85
+ server.tool("assess_cuc_n_mode", "**Initial Assessment.** Evaluates task Complexity, Uncertainty, Consequence, Novelty (CUC-N) to determine required cognitive depth and initial strategy. Call before starting complex tasks. Based on assessment, use either `think` (for structured analysis) or `quick_think` (for streamlined processing) in the next step.", {
86
+ 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., 'Proceed with think step'), 5) Explicit Mode Selection ('Selected Mode: think' or 'Selected Mode: quick_think').")
93
87
  }, async ({ assessment_and_choice }) => {
94
88
  const toolName = 'assess_cuc_n_mode';
95
89
  logToolCall(toolName);
@@ -98,14 +92,22 @@ server.tool("assess_cuc_n_mode", "**Mandatory Pre-Deliberation Assessment.** Eva
98
92
  const modeRegex = /Selected Mode: (think|quick_think)/i;
99
93
  const modeMatch = assessment_and_choice.match(modeRegex);
100
94
  const selectedMode = modeMatch ? modeMatch[1].toLowerCase() : "unknown"; // Extract mode for logging
95
+ // Ensure assessment_and_choice is a non-empty string
96
+ if (assessment_and_choice.trim().length === 0) {
97
+ throw new Error('Invalid assessment_and_choice: Must be a non-empty string.');
98
+ }
99
+ if (!modeMatch) {
100
+ // Add a check for the mode selection presence
101
+ throw new Error('Invalid assessment: String must include explicit "Selected Mode: think" or "Selected Mode: quick_think".');
102
+ }
101
103
  logToolResult(toolName, true, `Selected mode (extracted): ${selectedMode}`);
102
104
  // Log full input for traceability
103
105
  console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\n${assessment_and_choice}`);
104
- // Return the full assessment text formatted as Markdown
106
+ // Return the full assessment text, now without markdown wrappers
105
107
  return {
106
108
  content: [{
107
109
  type: "text",
108
- text: "```markdown\n" + assessment_and_choice + "\n```"
110
+ text: assessment_and_choice // Removed wrappers
109
111
  }]
110
112
  };
111
113
  }
@@ -116,11 +118,11 @@ server.tool("assess_cuc_n_mode", "**Mandatory Pre-Deliberation Assessment.** Eva
116
118
  /**
117
119
  * Tool: think
118
120
  * Purpose: The **CENTRAL, COMPREHENSIVE HUB** for the cognitive loop. Incorporates OODReAct principles.
119
- * Workflow: Handles all complex analysis, planning, reflection, synthesis, and confidence assessment. Structure is guided by the prompt.
121
+ * Workflow: Handles ALL complex analysis, planning, reflection, synthesis, confidence assessment, and generation of detailed (CoT-style) or concise (CoD-style) reasoning. Structure is guided by the prompt.
120
122
  * Output: Returns the structured thought text itself, formatted as Markdown.
121
123
  */
122
- server.tool("think", "**MANDATORY Central Hub for Comprehensive Analysis and Planning.** Called after assessment (`assess_cuc_n_mode`), after `chain_of_thought` or `chain_of_draft` results, or after external action results/errors. Incorporates OODReAct principles (Observe-Orient-Decide-Reason-Act) for enhanced problem-solving. This is where you perform ALL detailed analysis, planning (including multi-step strategies), reflection, synthesis, and confidence assessment. Structure your thought clearly using headings. For simpler follow-up steps, consider using `quick_think` instead.", {
123
- thought: z.string().describe("Your **detailed** internal monologue covering Analysis/Observation, Plan/Decision, Verification, Risk & Contingency, and Learning & Adaptation. Use clear headings. OODReAct-style headers are recommended.")
124
+ server.tool("think", "**Central Hub for Comprehensive Analysis and Planning.** Use after `assess_cuc_n_mode`, after external action results/errors, or after `quick_think` if deeper analysis is needed. Incorporates OODReAct principles. Perform ALL detailed analysis, planning, reflection, synthesis, confidence assessment, and detailed (CoT-style) or concise (CoD-style) reasoning within this tool. Structure your thought clearly using headings. For simpler follow-up steps, consider using `quick_think`.", {
125
+ thought: z.string().describe("Your **detailed** internal monologue covering Analysis/Observation, Plan/Decision, Verification, Risk & Contingency, and Learning & Adaptation. Include CoT/CoD style reasoning in the 'Reason' section when needed. Use clear headings. OODReAct-style headers are recommended.")
124
126
  }, async ({ thought }) => {
125
127
  const toolName = 'think';
126
128
  logToolCall(toolName);
@@ -132,11 +134,11 @@ server.tool("think", "**MANDATORY Central Hub for Comprehensive Analysis and Pla
132
134
  logToolResult(toolName, true, `Thought logged (length: ${thought.length})`);
133
135
  // Log full input for traceability
134
136
  console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\n${thought}`);
135
- // Returns the same thought text received, formatted as Markdown.
137
+ // Returns the same thought text received, now without markdown wrappers
136
138
  return {
137
139
  content: [{
138
140
  type: "text",
139
- text: "```markdown\n" + thought + "\n```"
141
+ text: thought // Removed wrappers
140
142
  }]
141
143
  };
142
144
  }
@@ -148,11 +150,11 @@ server.tool("think", "**MANDATORY Central Hub for Comprehensive Analysis and Pla
148
150
  /**
149
151
  * Tool: quick_think
150
152
  * Purpose: A lightweight cognitive checkpoint for streamlined processing and simple confirmations.
151
- * Workflow: Use when full structured analysis via `think` is not necessary.
153
+ * Workflow: Use ONLY when full structured analysis via `think` is genuinely unnecessary (Low CUC-N or trivial results).
152
154
  * Output: Returns the brief thought text, formatted as Markdown.
153
155
  */
154
- 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.", {
155
- 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.")
156
+ server.tool("quick_think", "Cognitive Checkpoint for streamlined processing and simple confirmations where detailed analysis via `think` is unnecessary. Use ONLY when full structured deliberation would be excessive (verified Low CUC-N or trivial results).", {
157
+ brief_thought: z.string().describe("Your **concise** thought or confirmation for this step. Briefly state the observation/action and explain why detailed analysis via 'think' isn't needed.")
156
158
  }, async ({ brief_thought }) => {
157
159
  const toolName = 'quick_think';
158
160
  logToolCall(toolName);
@@ -164,77 +166,11 @@ server.tool("quick_think", "Cognitive Checkpoint for streamlined processing and
164
166
  logToolResult(toolName, true, `Logged: ${brief_thought.substring(0, 80)}...`);
165
167
  // Log full input for traceability
166
168
  console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\n${brief_thought}`);
167
- // Return the brief thought text, formatted as Markdown
168
- return {
169
- content: [{
170
- type: "text",
171
- text: "```markdown\n" + brief_thought + "\n```"
172
- }]
173
- };
174
- }
175
- catch (error) {
176
- return logToolError(toolName, error);
177
- }
178
- });
179
- /**
180
- * Tool: chain_of_thought
181
- * Purpose: Guides *internal generation* and logging of detailed, step-by-step reasoning draft (CoT).
182
- * Workflow: Generate CoT -> Call this tool with CoT text -> Follow with either `think` or `quick_think`.
183
- * Output: Returns the CoT text formatted as Markdown.
184
- */
185
- server.tool("chain_of_thought", "Guides *internal generation* and logging of **detailed, step-by-step reasoning draft (CoT)**. Call this tool *with* the generated CoT text you created internally. Returns the CoT text formatted as Markdown. 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.", {
186
- generated_cot_text: z.string().describe("The **full, step-by-step Chain of Thought draft** you generated internally to solve or analyze the problem."),
187
- problem_statement: z.string().describe("The original problem statement or question this CoT addresses.")
188
- }, async ({ generated_cot_text, problem_statement }) => {
189
- const toolName = 'chain_of_thought';
190
- logToolCall(toolName);
191
- try {
192
- // Basic Zod validation ensures non-empty strings. Content validation removed.
193
- if (generated_cot_text.trim().length === 0) {
194
- throw new Error('Invalid generated_cot_text: Must be a non-empty string containing the CoT.');
195
- }
196
- if (problem_statement.trim().length === 0) {
197
- throw new Error('Invalid problem_statement: Must provide the original problem.');
198
- }
199
- logToolResult(toolName, true, `Problem: ${problem_statement.substring(0, 50)}...`);
200
- // Log full input for traceability
201
- console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\nProblem: ${problem_statement}\nReasoning:\n${generated_cot_text}`);
202
- // Return the CoT text, formatted as Markdown
203
- return {
204
- content: [{
205
- type: "text",
206
- text: "```markdown\n" + generated_cot_text + "\n```"
207
- }]
208
- };
209
- }
210
- catch (error) {
211
- return logToolError(toolName, error);
212
- }
213
- });
214
- /**
215
- * Tool: chain_of_draft
216
- * Purpose: Signals that internal drafts have been generated/refined using Chain of Draft (CoD) principles for efficient, concise reasoning.
217
- * Workflow: Internally generate/refine concise draft(s) following CoD guidelines -> Call this tool with a description -> Follow with either `think` or `quick_think`.
218
- * Output: Returns the draft description formatted as Markdown.
219
- */
220
- server.tool("chain_of_draft", "Signals that one or more **internal drafts** have been generated/refined using **Chain of Draft (CoD)** principles. CoD aims for **maximum efficiency** by mimicking human note-taking, focusing on minimal token usage while preserving reasoning quality. Use this *instead of* detailed Chain of Thought when speed and token economy are important, or when the reasoning involves calculations or symbolic manipulation.\n\n**How to Construct SOTA CoD Internally:**\n1. **Extreme Conciseness:** Each reasoning step or draft element should be extremely brief (e.g., often just 1-5 words, like a quick note). AVOID full sentences.\n2. **Symbols & Equations:** Prioritize mathematical notation (e.g., `x = 5*y`, `area = l*w`), code snippets (e.g., `user.id`, `config['key']`), or recognized symbols over descriptive text.\n3. **Essential Information Only:** Capture only the absolute minimum information needed to proceed. Omit explanations, justifications, or restatements of the problem unless strictly necessary for the next step.\n4. **Structure:** Can be a sequence of short phrases, key values, equations, or code elements, often line-by-line. Think 'scratchpad' not 'essay'.\n5. **Contrast with CoT:** Unlike CoT's verbose explanations, CoD focuses purely on the *result* or *key element* of each reasoning step.\n6. **Final Answer (Optional but Recommended):** If the CoD sequence leads directly to a final answer, clearly mark it at the end, often using `#### Final Answer: [answer]`.\n\nCall this tool *after* generating/refining draft(s) internally following these guidelines. Provide a brief description of the draft's purpose. Returns the description formatted as Markdown. Follow with either `think` (for complex drafts requiring detailed analysis) or `quick_think` (for straightforward drafts) to evaluate and plan next steps.", {
221
- draft_description: z.string().describe("Brief but specific description of the CoD draft(s) generated/refined internally (e.g., 'Calculated intermediate values x, y', 'API call structure draft', 'Error handling logic sketch', 'Key parameters extracted').")
222
- }, async ({ draft_description }) => {
223
- const toolName = 'chain_of_draft';
224
- logToolCall(toolName, `Description: ${draft_description}`);
225
- try {
226
- // Basic Zod validation ensures non-empty string. Content validation removed.
227
- if (draft_description.trim().length === 0) {
228
- throw new Error('Invalid draft_description: Must provide a description.');
229
- }
230
- logToolResult(toolName, true);
231
- // Log full input for traceability
232
- console.error(`[${new Date().toISOString()}] [MCP Server] - ${toolName} Input:\nDescription: ${draft_description}`);
233
- // Return the draft description, formatted as Markdown
169
+ // Return the brief thought text, now without markdown wrappers
234
170
  return {
235
171
  content: [{
236
172
  type: "text",
237
- text: "```markdown\n" + draft_description + "\n```"
173
+ text: brief_thought // Removed wrappers
238
174
  }]
239
175
  };
240
176
  }
@@ -242,6 +178,8 @@ server.tool("chain_of_draft", "Signals that one or more **internal drafts** have
242
178
  return logToolError(toolName, error);
243
179
  }
244
180
  });
181
+ // --- REMOVED chain_of_thought Tool ---
182
+ // --- REMOVED chain_of_draft Tool ---
245
183
  // --- Server Lifecycle and Error Handling ---
246
184
  /**
247
185
  * Gracefully shuts down the server.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbiish/cognitive-tools-mcp",
3
- "version": "0.9.22",
3
+ "version": "0.9.25",
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",