mcp-notes
by: truaxki
A Model Context Protocol (MCP) server implementation providing persistent note management created with Python SDK.
πOverview
Purpose: To provide a server implementation for managing notes with persistent storage using the Model Context Protocol (MCP).
Overview: The MCP Notes Server allows users to efficiently create, manage, and access notes through a structured framework that ensures data persistence and easy manipulation. It utilizes a JSON storage format and offers comprehensive features for note operations.
Key Features:
-
CRUD Operations: Enables users to create, read, update, and delete notes easily, ensuring full lifecycle management of note data.
-
Persistent Storage: Notes are stored in a JSON format, allowing for reliable data retention and straightforward data access.
-
Timestamp Tracking: Records the creation and modification times of notes, providing a clear history of changes.
-
Note Summarization: Offers prompt capabilities to generate summaries of notes, enhancing readability and clarity.
-
Resource-Based Access: Utilizes the note:// URI scheme for streamlined access to notes, facilitating integration with other applications and services.
MCP Notes Server
A Model Context Protocol (MCP) server implementation for managing notes with persistent storage.
Features
- Create, read, update, and delete notes
- Persistent storage using JSON
- Timestamp tracking for creation and modifications
- Note summarization via prompts
- Resource-based access using note:// URI scheme
Installation
Installing via Smithery
To install notes for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install notes --client claude
Manual Installation
-
Ensure you have Python 3.10 or later installed
-
Create a virtual environment:
python -m venv .venv # On Unix/MacOS: source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install requirements:
pip install MCP
Project Structure
notes/
βββ __init__.py # Package initialization
βββ server.py # Main server implementation
βββ storage.py # Note persistence layer
βββ resources.py # Resource handling (note:// URIs)
βββ prompts.py # LLM prompt generation
βββ tools/ # Server tools
βββ __init__.py # Tools package initialization
βββ list_tools.py # Tool listing functionality
βββ handle_tools.py # Tool handling implementation
Available Tools
add-note
: Create a new notelist-all-notes
: Display all stored notesupdate-note
: Modify an existing notedelete-note
: Remove a note
Usage
-
Start the server:
mcp install src/notes mcp start Notes
-
Example operations:
# Create a note await client.call_tool("add-note", { "name": "example", "content": "This is a test note" }) # List all notes await client.call_tool("list-all-notes") # Update a note await client.call_tool("update-note", { "name": "example", "content": "Updated content" }) # Delete a note await client.call_tool("delete-note", { "name": "example" })
Storage
Notes are stored in notes_storage.json
with the following structure:
{
"note_name": {
"content": "Note content",
"created_at": "2025-01-12T11:28:16.721704",
"modified_at": "2025-01-12T11:28:16.721704"
}
}
Resource Access
Notes can be accessed as resources using the note://
URI scheme:
- List resources: Returns all available notes as resources
- Read resource: Access a specific note using
note://internal/note_name
Prompt Generation
The server includes prompt generation for note summarization:
- Supports both brief and detailed summaries
- Formats notes for language model input
- Available via the "summarize-notes" prompt
Development
To modify or extend the server:
- Clone the repository
- Install development dependencies
- Make changes in the appropriate module
- Test thoroughly before deploying
Testing
Tests should cover:
- Basic CRUD operations
- Multiple note handling
- Error cases
- Resource access
- Prompt generation
License
[Add your license here]