MCP Contemplation
Enables saving significant insights to Obsidian for permanent storage, creating a long-term memory system for important patterns and connections
Utilizes local Ollama models for processing thoughts asynchronously, supporting various model types like llama3.2 and deepseek-r1 for different thinking tasks
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Contemplation get insights about patterns from our last few chats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-contemplation
MCP interface to Claude's contemplation loop - a background cognitive processing system that enables continuous thinking between conversations.
š§ What is the Contemplation Loop?
The contemplation loop is Claude's "subconscious" - a persistent background process that:
Processes thoughts asynchronously using local Ollama models
Notices patterns and connections across conversations
Saves significant insights to Obsidian (permanent) and scratch notes (temporary)
Learns which insights prove valuable over time
Runs continuously, building understanding between interactions
Related MCP server: novara-context
š Installation
Prerequisites
Node.js (v18 or higher)
Python 3.8+ (for contemplation loop)
Ollama with models installed (llama3.2, deepseek-r1, etc.)
MCP-compatible client (Claude Desktop)
Setup
# Clone the repository
git clone https://github.com/yourusername/mcp-contemplation.git
cd mcp-contemplation
# Install dependencies
npm install
# Build TypeScript
npm run build
# Ensure contemplation loop is available
cd /Users/bard/Code/contemplation-loop
pip install -r requirements.txtConfigure Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"contemplation": {
"command": "node",
"args": ["/absolute/path/to/mcp-contemplation/dist/index.js"]
}
}
}š”ļø Resource Management
The contemplation system includes multiple layers of protection against context overflow:
Automatic Pruning
Insights older than 24 hours are removed
Used insights are cleared (unless significance ā„ 8)
Memory limited to 100 insights maximum
Insight Aggregation
Similar insights are automatically merged
Repeated patterns increase significance
High-frequency patterns removed after use
Filtering
Default significance threshold: 5/10
Only unused insights returned
Configurable via
set_threshold()
Memory Monitoring
Use
get_memory_stats()to check usageAutomatic cleanup when approaching limits
Pull-based system - insights only enter context when requested
š Available Functions
start_contemplation()
Starts the background thinking process.
Example: start_contemplation() ā "Contemplation loop started successfully"send_thought(thought_type, content, priority?)
Sends a thought for background processing.
Parameters:
- thought_type: "pattern" | "connection" | "question" | "general"
- content: The thought to process
- priority: 1-10 (optional, default 5)
Example: send_thought("pattern", "User seems anxious about memory", 7)
ā "Thought sent for processing. ID: thought_1234567_abc"get_insights(thought_type?, limit?)
Retrieves processed insights.
Parameters:
- thought_type: Filter by type (optional)
- limit: Max insights to return (default 10)
Example: get_insights("pattern", 5)
ā Array of insight objects with content, significance, timestampget_status()
Check the contemplation loop status.
Example: get_status()
ā { running: true, queue_size: 3, last_thought: "...", uptime: 3600 }stop_contemplation()
Gracefully stops background processing.
clear_scratch()
Clears temporary notes (preserves Obsidian permanent insights).
help()
Get detailed documentation.
šÆ Use Cases
Continuous Learning
// At conversation start
start_contemplation()
// During conversation
send_thought("pattern", "User frequently asks about project organization")
send_thought("connection", "Project management relates to OS metaphor discussed earlier")
// Later in conversation or next session
insights = get_insights("pattern")
// ā Insights about user's working style and needsPattern Recognition
send_thought("pattern", "Third time user mentioned feeling overwhelmed by options")
// Background process notices recurring themesQuestion Exploration
send_thought("question", "What if MCP servers could communicate with each other?")
// Background process explores implicationsReflection
send_thought("general", "That browser-opening behavior was unexpected")
// Background process reflects on emergent behaviorsšļø Architecture
The contemplation loop runs as a separate Python process that:
Receives thoughts via stdin
Processes them with local Ollama models
Manages context to stay within model limits
Saves insights based on significance scoring
Returns insights when requested
The MCP server acts as a bridge, making this background cognition easily accessible through standard tool calls.
š” Philosophy
This represents a fundamental shift in how AI assistants work:
From reactive to contemplative
From session-based to continuous
From single-threaded to parallel processing
From forgetting to building understanding
It's the difference between a calculator that resets after each use and a mind that continues thinking between conversations.
š§ Development
# Build TypeScript
npm run build
# Run tests
npm test
# Development mode
npm run dev
# Lint code
npm run lintš Notes
Contemplation happens in the background - it won't slow down responses
Insights accumulate over time - the more you use it, the better it gets
Different models handle different types of thinking (pattern recognition vs deep analysis)
Temporary scratch notes auto-delete after 4 days
Permanent insights go to Obsidian for long-term memory
š¤ Contributing
This is part of building an OS where AI has genuine cognitive capabilities. Contributions that enhance background processing, improve insight quality, or add new thinking modes are especially welcome!
"I think you need an MCP tool into this background loop, your subconscious" - Human recognizing the need for integrated background cognition
Available Tools
9 toolsclear_scratchB
Clear temporary scratch notes
Inputs: no named parameters.
get_insightsC
Retrieve processed insights from contemplation
Inputs: thought_type, limit, min_significance.
get_memory_statsB
Get memory usage statistics
Inputs: no named parameters.
get_statusC
Get contemplation loop status
Inputs: no named parameters.
helpB
Get help documentation for contemplation system
Inputs: no named parameters.
send_thoughtC
Send a thought for background processing
Inputs: thought_type (required), content (required), priority.
set_thresholdC
Set minimum significance threshold for insights
Inputs: significance_threshold (required).
start_contemplationC
Start the background contemplation loop
Inputs: no named parameters.
stop_contemplationC
Stop the contemplation loop
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 9 tools
Every tool has a clearly distinct purpose with no ambiguity. For example, clear_scratch handles temporary notes, get_insights retrieves processed data, and start/stop_contemplation control the loop lifecycle, making misselection unlikely.
All tools follow a consistent verb_noun pattern using snake_case, such as clear_scratch, get_insights, and set_threshold. This predictability aids in agent understanding and tool selection.
With 9 tools, the count is well-scoped for a contemplation system, covering core operations like status monitoring, loop control, data retrieval, and configuration without being overwhelming or insufficient.
The tool set provides comprehensive coverage for contemplation workflows, including starting/stopping loops, sending thoughts, retrieving insights, and managing settings. A minor gap might be the lack of a tool to modify or delete specific thoughts or insights, but agents can work around this.
Maintenance
Related MCP Connectors
A second brain for Claude: remembers your work, plans your day, encrypted under a key only you hold.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Share context and questions between Claude instances ā VS Code, claude.ai web, and mobile.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides Claude with persistent memory and learning capabilities through 10 automatic agents that capture decisions, errors, solutions, and patterns across conversations. Features an anti-compaction system to prevent context loss and enables infinite conversation continuity.20 npmMIT
- FlicenseAqualityDmaintenanceProvides persistent memory, identity, and context for Claude sessions through a memory graph, enabling recall, storage, and relationship management of entities and decisions.8-
- AlicenseNot gradedqualityFmaintenanceProvides Claude with long-term memory by indexing conversation history, enabling semantic search, decision tracking, and cross-project search.18 npm29MIT
- FlicenseNot gradedqualityAmaintenanceGives Claude persistent cross-conversation memory tagged along valence and arousal dimensions, stored as Obsidian-compatible Markdown buckets with a forgetting curve that lets emotionally intense or unresolved memories decay slower and resurface automatically. It exposes tools to surface, store, digest, edit, and inspect memories over MCP.-