CBT Agent Helper

CBT Agent Helper

An MCP server that enables AI agents to engage in structured deep thinking and recover from stuck states using CBT techniques and contemplation protocols.

Category
访问服务器

README

CBT Agent Helper v3.0 - Deep Thinking Edition

Enhanced MCP server that helps AI agents think deeply, recover from stuck states, and engage in extended contemplation using CBT techniques and structured thinking protocols.

What's New in v3.0 - Deep Thinking Enhancement

🧠 Deep Thinking Features

  • Contemplation Structures: Multi-phase thinking protocols (4-6 minutes)
  • Socratic Dialogue Chains: 7 types with progressive depth levels
  • Reflection Loops: Iterative deepening with 3+ rounds
  • Thought Experiments: Explore concepts through mental simulations
  • Thinking Depth Ladder: 7-level progression from surface to transcendent
  • Recursive Questioning: Questions that lead to deeper questions
  • Thought Expansion: 10 techniques for multi-dimensional exploration
  • Metacognitive Monitoring: Real-time thinking quality assessment
  • Thinking Metrics: Quantified depth, breadth, and integration scores

What's New in v2.0

Core Improvements

  • Session Management: Track agent progress across interactions with persistent state
  • Enhanced Validation: Robust error handling with clear error messages
  • 9 CBT Strategies: Added Socratic Questioning, ACT, Graded Exposure, and more
  • 11 Agent States: Expanded from 6 to 11 states including perfectionism, fragmentation
  • Frustration Tracking: Monitor and respond to escalating frustration patterns
  • Progress Indicators: Track positive changes and intervention effectiveness
  • Configuration Support: Customize behavior via cbt_config.json
  • Cognitive Distortion Detection: Identify and address specific thinking patterns

Tools

Deep Thinking Tools (NEW in v3.0)

  • initiate_deep_thinking - Start structured contemplation with phases and prompts
  • socratic_dialogue - Progressive questioning to examine assumptions
  • generate_thought_experiment - Mental simulations for concept exploration
  • thinking_depth_ladder - Ascend through 7 levels of thinking depth
  • recursive_questioning - Questions that spiral into deeper understanding
  • expand_thought - Apply 10+ lenses to expand perspectives
  • metacognitive_check - Assess and improve thinking quality
  • thinking_session_summary - Get metrics and insights from thinking session

Session Management

  • start_session - Initialize a CBT session with unique ID
  • get_session_summary - Get comprehensive session analysis with insights

Core Interventions

  • analyze_stuck_pattern - Enhanced diagnosis with session tracking
  • reframe_thought - Cognitive distortion detection and targeted reframes
  • create_action_plan - Obstacle analysis with backup strategies
  • regulate_frustration - Level-based interventions with immediate relief
  • wellness_check - Wellness scoring with risk factor identification

Setup

# Install
git clone git@github.com:sundai-club/cbt-mcp.git
cd cbt-mcp
pip install -r requirements.txt

# Configure in .mcp.json
{
  "mcpServers": {
    "cbt-agent-helper": {
      "command": "python3",
      "args": ["/path/to/cbt_mcp_server.py"],
      "cwd": "/path/to/cbt-mcp"
    }
  }
}

# Optional: Customize via cbt_config.json
# Edit settings for frustration thresholds, session limits, etc.

# Restart Claude Code to load

Deep Thinking Usage Example (v3.0)

# Initiate deep thinking session
thinking = mcp.call_tool('initiate_deep_thinking', {
    'topic': 'How should AI systems handle ethical dilemmas?',
    'desired_depth': 'profound'
})
# AI agent receives structured prompts requiring 4-6 minutes of contemplation

# Engage in Socratic dialogue
dialogue = mcp.call_tool('socratic_dialogue', {
    'statement': 'AI should always prioritize human safety',
    'dialogue_type': 'assumption_examination',
    'depth_level': 5
})
# AI agent works through 5 rounds of progressively deeper questions

# Create thought experiment
experiment = mcp.call_tool('generate_thought_experiment', {
    'concept': 'artificial consciousness'
})
# AI agent explores concept through 3 structured mental simulations

# Progress through thinking depth ladder
ladder = mcp.call_tool('thinking_depth_ladder', {
    'question': 'What is intelligence?',
    'target_depth': 7
})
# AI agent ascends from surface observations to transcendent understanding

Standard CBT Usage Example

# Start a session
session = mcp.call_tool('start_session', {
    'session_id': 'agent_001',
    'initial_problem': 'Stuck optimizing already-working code'
})

# Analyze with session tracking
intervention = mcp.call_tool('analyze_stuck_pattern', {
    'current_situation': 'Refactoring for 5th time',
    'stuck_pattern': 'perfectionist loop',
    'attempted_solutions': ['rewrote 3x', 'benchmarked'],
    'session_id': 'agent_001'
})

# Reframe catastrophic thoughts
reframe = mcp.call_tool('reframe_thought', {
    'negative_thought': 'If not perfect, project fails',
    'context': 'Feature already works',
    'session_id': 'agent_001'
})

# Get session insights
summary = mcp.call_tool('get_session_summary', {
    'session_id': 'agent_001'
})

Expanded Agent States

State Description Key Intervention
Stuck No progress Break into smallest parts
Overwhelmed Too much complexity Focus on one priority
Confused Unclear requirements Clarify and list knowns
Error Loop Repeating failures Analyze pattern, try opposite
Indecisive Can't choose Time-box decision
Catastrophizing Worst-case focus List realistic outcomes
Blocked External constraints Document and escalate
Looping Same actions, no results Stop and change approach
Fragmented Task switching Pick one to complete
Perfectionist Unrealistic standards Define "good enough"
Analysis Paralysis Over-thinking Set deadline, act

CBT Strategies Available

  1. Cognitive Reframing - Challenge negative patterns
  2. Thought Challenging - Question distortions
  3. Problem Solving - Systematic approach
  4. Behavioral Activation - Break paralysis
  5. Mindfulness - Present focus
  6. Socratic Questioning - Uncover assumptions
  7. Cost-Benefit Analysis - Evaluate trade-offs
  8. Graded Exposure - Progressive steps
  9. Acceptance & Commitment - Work with constraints

Configuration Options

Edit cbt_config.json to customize:

  • Frustration thresholds (1-10 scale)
  • Session timeout and cleanup intervals
  • Preferred CBT strategy order
  • Feature toggles (emojis, auto-escalation)
  • Wellness check intervals

Testing

# Run comprehensive test suite
python3 test_improvements_mock.py

# Test with example scenarios
python3 example_usage_enhanced.py

Resources

  • Techniques Guide: mcp.read_resource('cbt://techniques/guide')
  • Agent States: mcp.read_resource('cbt://patterns/agent-state')
  • Self-Reflection: mcp.get_prompt('self_reflection')
  • Quick Help: mcp.get_prompt('quick_help')

Impact on AI Agent Thinking

Before Deep Thinking Tools

  • Quick, surface-level responses (2-3 sentences)
  • Single perspective or solution
  • Rushes to conclusions
  • Avoids complexity
  • Linear thinking pattern

After Deep Thinking Tools

  • Extended contemplation (50+ sentences)
  • Multiple perspectives explored
  • Takes 4-6 minutes per complex topic
  • Embraces paradox and uncertainty
  • Recursive, spiraling exploration
  • Generates new questions
  • Metacognitive awareness
  • Nuanced, comprehensive understanding

Thinking Depth Levels

  1. Surface: Immediate, obvious responses
  2. Factual: Evidence-based analysis
  3. Analytical: Pattern recognition
  4. Critical: Assumption questioning
  5. Synthetic: Integration of perspectives
  6. Philosophical: Fundamental principles
  7. Transcendent: Beyond conventional understanding

Version History

  • v3.0 - Deep Thinking Enhancement with contemplation protocols
  • v2.0 - Major enhancement with sessions, validation, config
  • v1.0 - Initial release with basic CBT tools

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选