mcp-smart-notes
Prototype Model Context Protocol (MCP) note-taking system with intelligent auto-tagging powered by local LLMs. Full MCP specification compliance, JSON-RPC 2.0 transport, and robust error handling with graceful fallbacks.
MCP Smart Note-Taking System
A sophisticated Model Context Protocol (MCP) compliant note-taking system with intelligent automatic tagging capabilities powered by local Large Language Models via Ollama.
Features
- š·ļø Intelligent Auto-Tagging: Uses LLM analysis to automatically categorize notes
- š Full MCP Compliance: Implements complete MCP specification for seamless AI integration
- š Advanced Search: Full-text search across titles, content, and tags
- šļø Robust Data Management: JSON-based persistence with atomic operations
- š”ļø Error Resilience: Multiple fallback mechanisms ensure reliability
- šÆ Tag Categories: Predefined taxonomy: Greeting, Coding, Education, Finance
- š¤ Local AI: Privacy-focused with local Ollama integration
šļø Architecture
graph TD
A[Smart Tagging Bridge] --> B[Ollama LLM]
A --> C[Note Storage]
A --> D[MCP Protocol]
D --> E[MCP Server]
D --> F[MCP Client]
G[CLI] --> A
H[Auto-Tagging Engine] --> B
H --> I[Keyword Fallback]
š Quick Start
Prerequisites
- Python 3.8+
- Ollama installed and running
- Compatible LLM model (recommended:
qwen2.5:7b)
Installation
-
Clone the repository
git clone https://github.com/yourusername/mcp-smart-notes.git cd mcp-smart-notes -
Install dependencies
pip install -r requirements.txt -
Start Ollama (in another terminal)
ollama serve -
Pull a compatible model
ollama pull qwen2.5:7b
Usage
šÆ Smart Auto-Tagging System (Recommended)
python smart_tagging_bridge.py
š” Example Usage
You: Create a note about my Python web development project
š§ Using tool: create_note
š·ļø Auto-assigned tags: ['Coding']
ā
Created note 'Python Web Development Project' with ID: 20250629_223459_661 with tags: ['Coding']
š Project Structure
MCP-Testing/
āāā š smart_tagging_bridge.py # Main system with intelligent auto-tagging
āāā š note_server.py # Full MCP server implementation
āāā š ollama_mcp_client.py # MCP client for Ollama integration
āāā š simple_note_server.py # Minimal MCP server for testing
āāā š simple_bridge.py # Direct integration layer
āāā š test_auto_tagging.py # Comprehensive test suite
āāā š requirements.txt # Python dependencies
āāā š README.md # This file
āāā š .gitignore # Git ignore patterns
āāā š Documentation/ # MCP protocol documentation
š ļø Available Tools
| Tool | Description | Usage |
|---|---|---|
create_note | Create notes with auto-tagging | Title, content, optional manual tags |
search_notes | Full-text search | Query string matches title/content/tags |
search_by_tag | Tag-specific search | Find all notes with specific tag |
list_notes | List all notes | Shows titles, IDs, and auto-tag indicators |
update_note | Modify existing notes | Update title, content, or tags |
delete_note | Remove notes | Permanent deletion by note ID |
š·ļø Auto-Tagging Categories
- š¤ Greeting: Welcomes, introductions, social interactions
- š» Coding: Programming, development, technical content
- š Education: Learning, courses, tutorials, studies
- š° Finance: Budget, money, investments, financial planning
š§ Technical Details
MCP Protocol Compliance
- ā JSON-RPC 2.0 over stdio transport
- ā Tool registration with parameter schemas
- ā Resource discovery and URI handling
- ā Error handling and status codes
- ā Session management and lifecycle
Error Handling
- Ollama Offline: Graceful degradation with helpful messages
- LLM Failures: Automatic keyword-based fallback tagging
- File Corruption: Silent skip of corrupted JSON files
- Network Issues: Retry mechanisms with exponential backoff
š¤ Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
š Documentation
For detailed MCP protocol information, see:
- Model Context Protocol Specification
- Documentation for Agent/ - Complete MCP documentation
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
- Model Context Protocol team for the excellent specification
- Ollama for local LLM capabilities
- Anthropic for Claude's assistance in development
š Known Issues
- Large note collections may experience slower search performance
ā Star this repository if you find it useful! ā