
clarity mcp
multiple thinking tools based on @waldzellai/clear-thought
Repository Info
About This Server
multiple thinking tools based on @waldzellai/clear-thought
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Clarity Mcp Server
A Model Context Protocol (MCP) server that provides structured reasoning and thinking tools for AI assistants. This server implements multiple cognitive frameworks and reasoning methodologies to enhance problem-solving capabilities.
🧠 Features
The Clarity Mcp Server provides the following reasoning tools:
Core Reasoning Tools
- 🧠 Sequential Thinking: Step-by-step reasoning with revision and branching capabilities
- 🔍 Mental Models: Apply structured mental models (first principles, opportunity cost, etc.)
- 🏗️ Design Patterns: Software architecture and implementation patterns
- ⚡ Programming Paradigms: Different programming approaches (functional, OOP, etc.)
- 🔍 Debugging Approaches: Systematic debugging methodologies
- 🧮 Memory Management: Persistent memory graph with semantic search capabilities
Advanced Reasoning Tools
- 👥 Collaborative Reasoning: Multi-perspective problem solving with virtual personas
- ⚖️ Decision Framework: Structured decision analysis and evaluation
- 🧮 Metacognitive Monitoring: Self-assessment of knowledge and reasoning quality
- 🔬 Scientific Method: Formal scientific reasoning and hypothesis testing
- 📝 Structured Argumentation: Dialectical reasoning and argument analysis
- 🎨 Visual Reasoning: Visual thinking and diagram-based problem solving
🚀 Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
Installation
- Clone and setup:
git clone https://github.com/pronitdas/clarity-mcp.git
cd clarity-mcp
pnpm install
- Build the server:
pnpm run build
- Run the server:
pnpm start
Development
# Watch mode for development
pnpm run dev
# Clean build files
pnpm run clean
🛠️ Usage
MCP Integration Guide
The Clear Thought MCP Server is designed to be integrated with AI assistants through the Model Context Protocol (MCP). Here's how to integrate and use the server:
1. Server Connection
- The server runs on stdio transport by default
- Ensure your MCP client is configured to connect via stdio
- Connection URL format:
mcp://localhost:0/clear-thinking
2. Authentication
- No authentication required for local development
- For production, implement your authentication strategy in
index.ts
3. Tool Registration
Register the tools with your MCP client:
const tools = {
sequentialthinking: {
name: "sequentialthinking",
description: "Step-by-step reasoning with revision capabilities",
parameters: {
thought: "string",
thoughtNumber: "number",
totalThoughts: "number",
nextThoughtNeeded: "boolean"
}
},
// ... other tools ...
};
4. Error Handling
- Tools return structured error responses
- Check response.error for error details
- Handle timeouts and connection issues appropriately
MCP Client Configuration
The server can be integrated with MCP-compatible clients using a simple configuration file. Here's a typical example:
{
"command": "npx",
"args": [
"clarity-mcp-server"
],
}
Place this configuration in your client's MCP configuration file (e.g., mcp.json). The server will be started automatically when the client needs to use the reasoning tools.
Example Tool Usage
Sequential Thinking
{
"name": "sequentialthinking",
"arguments": {
"thought": "Let me analyze this step by step...",
"thoughtNumber": 1,
"totalThoughts": 5,
"nextThoughtNeeded": true
}
}
Mental Models
{
"name": "mentalmodel",
"arguments": {
"modelName": "first_principles",
"problem": "How to optimize database performance"
}
}
Design Patterns
{
"name": "designpattern",
"arguments": {
"patternName": "modular_architecture",
"context": "Building a scalable web application"
}
}
Collaborative Reasoning
{
"name": "collaborativereasoning",
"arguments": {
"topic": "Should we implement microservices?",
"personas": [
{
"id": "architect",
"name": "Senior Architect",
"expertise": ["system design", "scalability"],
"background": "10+ years in enterprise architecture"
}
],
"stage": "problem-definition",
"sessionId": "session-1",
"iteration": 0,
"nextContributionNeeded": true
}
}
📋 Tool Reference
Server Components
SequentialThinkingServer: Manages step-by-step reasoning processesMentalModelServer: Handles mental model applicationDesignPatternServer: Processes software design patternsProgrammingParadigmServer: Manages programming approach selectionDebuggingApproachServer: Handles debugging methodologiesCollaborativeReasoningServer: Manages multi-perspective analysisDecisionFrameworkServer: Handles decision analysisMetacognitiveMonitoringServer: Manages self-assessmentScientificMethodServer: Handles scientific reasoningStructuredArgumentationServer: Manages dialectical analysisVisualReasoningServer: Handles visual thinking toolsMemoryServer: Manages persistent memory operations
Mental Models Available
first_principles- Break down to fundamental truthsopportunity_cost- Analyze trade-offs and alternativeserror_propagation- Understand how errors compoundrubber_duck- Explain problems step-by-steppareto_principle- Focus on vital few factorsoccams_razor- Prefer simpler explanations
Design Patterns Available
modular_architecture- Component-based designapi_integration- Service integration patternsstate_management- State handling strategiesasync_processing- Asynchronous operation patternsscalability- Scaling and performance patternssecurity- Security implementation patternsagentic_design- Autonomous agent patterns
Programming Paradigms Available
imperative- Step-by-step instruction styleprocedural- Function-based organizationobject_oriented- Class and object modelingfunctional- Function-based computationdeclarative- Outcome-focused programminglogic- Rule-based programmingevent_driven- Event-based programmingaspect_oriented- Cross-cutting concern separationconcurrent- Parallel execution patternsreactive- Event-driven data flows
Debugging Approaches Available
binary_search- Bisection debugging methodreverse_engineering- Backward trace analysisdivide_conquer- Component isolation methodbacktracking- Execution path tracingcause_elimination- Process of eliminationprogram_slicing- Code dependency analysis
Memory Operations Available
add- Add new memory nodeslink- Create relationships between memoriessearch- Search across stored memoriescontext- Retrieve memory context and relationships
Visual Reasoning Operations
- Operations:
create,update,delete,transform,observe - Diagram Types:
graph,flowchart,stateDiagram,conceptMap,treeDiagram,custom - Element Types:
node,edge,container,annotation - Transform Types:
rotate,move,resize,recolor,regroup
🏗️ Architecture
clear-thinking/
├── index.ts # Main MCP server entry point
├── tools/ # Tool implementations
│ ├── mentalModelServer.ts
│ ├── sequentialThinkingServer.ts
│ ├── designPatternServer.ts
│ ├── programmingParadigmServer.ts
│ ├── debuggingApproachServer.ts
│ ├── collaborativeReasoningServer.ts
│ └── ... # Other reasoning tools
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
🔧 Configuration
MCP Server Configuration
The server supports the following configuration options in index.ts:
const config = {
transport: "stdio", // or "tcp" for network transport
port: 0, // default for stdio
timeout: 30000, // tool execution timeout in ms
maxConcurrent: 10, // max concurrent tool executions
logging: {
level: "info",
format: "json"
}
};
// Server initialization
const server = new Server({
name: "clarity-mcp-server",
version: "1.1.2",
config
}, {
capabilities: {
tools: { /* tool definitions */ }
}
});
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built on the Model Context Protocol
- Inspired by various cognitive science and reasoning frameworks
- Uses TypeScript for type safety and developer experience
🐛 Troubleshooting
Common Issues
Build Errors:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
npm run build
Runtime Errors:
- Check that all dependencies are installed
- Verify Node.js version (18+)
- Check TypeScript compilation errors
MCP Connection Issues:
- Ensure the server is running on stdio
- Check client MCP configuration
- Verify tool schema compatibility
MCP-Specific Issues
Tool Execution Timeouts:
- Increase timeout in server configuration
- Check for blocking operations in tool implementation
- Monitor system resources
Schema Validation Errors:
- Verify tool parameter types match schema
- Check for required parameters
- Validate enum values are correct
Transport Issues:
- For stdio: Check process stdin/stdout handling
- For TCP: Verify network connectivity and ports
- Check for conflicting transport configurations
📖 Further Reading
- Model Context Protocol Documentation
- TypeScript Documentation
- Reasoning and Cognitive Science Resources
Quick Start
Clone the repository
git clone https://github.com/pronitdas/clarity-mcpInstall dependencies
cd clarity-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.