Skip to main content

Encrypted bilingual (English/Persian) personal journal with AI assistant and MCP server

Project description

📓 The Notebook

English · فارسی

A feature-rich, encrypted, bilingual (English / Persian-Farsi) personal journal and diary application for the desktop — now with an AI assistant and MCP server for AI agent integration.

Your thoughts, your words, your keys.


🆕 What's New in v1.4.0

🤖 AI Assistant

Bring your own API key and ask questions about your journal:

  • Ask Your Journal — query your past entries in natural language
  • Auto-generated summaries — weekly or monthly digests
  • Sentiment analysis — track your emotional patterns over time
  • Auto-tagging suggestions — AI-suggested tags for new entries
  • Supports Claude (Anthropic), OpenAI (GPT), Google Gemini, and Ollama (local, private, no API key needed)
  • API keys are encrypted at rest with the same AES-GCM key as your entries

🔌 MCP Server (Model Context Protocol)

The first encrypted journal with MCP support. Any MCP-compatible AI client (Claude Desktop, OpenClaw, Hermes, Cursor, etc.) can:

  • List folders, entries, and tags
  • Read and search entries
  • Create new entries and append to existing ones
  • Get journal statistics
# Start the MCP server (from the command line)
the-notebook-mcp --password YOUR_PASS

# Or via environment variable
NOTEBOOK_PASS=YOUR_PASS the-notebook-mcp

🔒 Encrypted Attachments

File attachments are now encrypted with AES-256-GCM — the same crypto that protects your entries. Your photos, audio notes, and documents are safe at rest. (Toggleable in Settings.)

📓 Multiple Notebooks

Create separate journals for Work, Personal, Dreams — each with its own password and folder tree. Switch between them from the Data menu.

🏗️ Architecture Improvements

  • PyPI packagepip install the-notebook
  • XDG-compliant paths on Linux (~/.local/share/TheNotebook/)
  • Config migration system — automatic upgrades between versions
  • Threaded operations — no more UI freezes during re-encryption
  • Proper loggingapp.log with rotation for debugging
  • Package structure — proper Python package, not flat scripts

✨ Features

Security

  • 🔐 AES-256-GCM encryption for every entry, with an additional HMAC-SHA256 integrity tag (defence-in-depth).
  • 🔑 PBKDF2 key derivation (480 000 iterations) with a per-installation random salt.
  • 🔒 Auto-lock after a configurable period of inactivity; keys are zeroed from memory on lock.
  • 🛡️ Exponential backoff on failed unlock attempts (non-blocking).
  • 🔗 Optional OS keyring integration.
  • 🔄 Safe password change — setting, changing, or removing the password re-encrypts every entry and every history snapshot in place.
  • 🔒 Encrypted attachments — files attached to entries are encrypted with the same AES-GCM key as the entries themselves.

AI Assistant (NEW in v1.4.0)

  • 🤖 Ask Your Journal — natural-language Q&A about your past entries.
  • 📅 Auto-generated summaries — weekly or monthly digests.
  • 💭 Sentiment analysis — track your emotional patterns.
  • 🏷️ Auto-tagging suggestions — AI-suggested tags for new entries.
  • 🔑 Bring your own API key — supports Claude, OpenAI, Gemini, Ollama.
  • 🔒 API keys encrypted at rest with your journal password.
  • 🤖 No vendor lock-in — switch providers anytime.

MCP Server (NEW in v1.4.0)

  • 🔌 Expose your journal to any MCP-compatible AI client.
  • 📖 Read tools: list folders, entries, tags; search; read; statistics.
  • ✏️ Write tools: create entries, append to entries.
  • 🔒 Requires the journal to be unlocked (password-gated).
  • 🖥️ Runs as a standalone process via the-notebook-mcp.

Writing

  • 📝 Rich-text editor with bold / italic / underline / strikethrough, bullet and numbered lists.
  • 🖼️ Drag-and-drop images directly into entries.
  • 🎙️ Audio notes — record voice memos inline (optional).
  • 📎 File attachments (now encrypted!) of any type.
  • 🌐 Three editor views: WYSIWYG, HTML source, Markdown preview.
  • 🔄 Auto-save every 30 seconds.
  • 🔤 Optional spell check.

Organization

  • 📁 Folders and dated entries.
  • 🏷️ Tags, ⭐ favorites, 😊 mood tracking.
  • 🗑️ Soft-delete trash with restore.
  • 📜 Version history with one-click restore.
  • 📓 Multiple notebooks — separate journals with separate passwords.

Calendars & search

  • 🗓️ Dual calendars: Gregorian and a custom Jalali (Persian) calendar.
  • 🎉 Holiday / event labels for both Iranian and US calendars.
  • 🔍 Full-text search via an inverted index.
  • ⌨️ Command palette (Ctrl+Shift+P).
  • 🔎 Quick search bar (Ctrl+F).

Insights & sync

  • 📊 Statistics: activity graph, tag cloud, per-folder breakdown, mood chart.
  • 💭 Daily writing prompts (20 each in English and Persian).
  • 📆 "On This Day" memories.
  • 🔄 Folder sync via Markdown.
  • 💾 Backup & restore to/from zip.
  • 📤 Batch export to HTML or Markdown.

🚀 Installation

Option 1: Download a pre-built binary (easiest)

Go to the Releases page and download the appropriate file for your platform.

Option 2: Install from PyPI

pip install the-notebook
the-notebook   # launch the app

# With AI support:
pip install the-notebook[ai]

# With everything (AI, MCP, audio, keyring, spellcheck):
pip install the-notebook[all]

# To run the MCP server:
pip install the-notebook[mcp]
the-notebook-mcp --password YOUR_PASS

Option 3: Build from source

git clone https://github.com/Bloody-Crow/The-Notebook.git
cd The-Notebook
pip install -e .
the-notebook

🤖 AI Assistant Setup

  1. Open the app → Settings → AI Assistant Settings...
  2. Choose your provider (Claude / OpenAI / Gemini / Ollama).
  3. Paste your API key (it's encrypted with your journal password).
  4. Optionally override the model name or set a custom base URL (for Ollama).
  5. Use Data → Ask Your Journal... to ask questions about your entries.
  6. Use Data → Generate Summary... for weekly/monthly digests.

Supported providers

Provider API Key Needed Model Example
Claude (Anthropic) Yes claude-sonnet-4-20250514
OpenAI (GPT) Yes gpt-4o
Google Gemini Yes gemini-1.5-pro
Ollama (local) No llama3.2

🔌 MCP Server Setup

The MCP server lets AI agents (Claude Desktop, OpenClaw, Hermes, Cursor, etc.) read and write your journal entries.

Starting the server

# If your journal has no password:
the-notebook-mcp

# If your journal is encrypted:
the-notebook-mcp --password YOUR_PASS

# Or via environment variable:
NOTEBOOK_PASS=YOUR_PASS the-notebook-mcp

Connecting from Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "the-notebook": {
      "command": "the-notebook-mcp",
      "args": ["--password", "YOUR_PASS"]
    }
  }
}

Available tools

Tool Description
list_folders List all journal folders
list_entries List entries in a folder (optionally by date)
read_entry Read the full content of an entry
search_entries Full-text search across all entries
create_entry Create a new journal entry
append_to_entry Append text to an existing entry
list_tags List all tags
get_statistics Get journal statistics

📦 For Developers

Run the test suite

pip install -e ".[dev]"
pytest tests/ -v

Package structure

the_notebook/
├── __init__.py        # Package metadata
├── __main__.py        # python -m the_notebook entry point
├── main.py            # Application entry point
├── config.py          # Paths, config, migration, logging
├── crypto.py          # AES-GCM + HMAC encryption (text + binary)
├── models.py          # File I/O, search index, re-encryption
├── i18n.py            # Translations + Persian calendar events
├── widgets.py         # RichTextEditor + PersianCalendarWidget
├── dialogs.py         # All QDialog subclasses
├── main_window.py     # JournalApp main window
├── notebooks.py       # Multi-notebook manager
├── ai.py              # AI assistant (Claude/OpenAI/Gemini/Ollama)
├── mcp_server.py      # MCP server for AI agent integration
└── workers.py         # Threading utilities

🔒 Security

See SECURITY.md for the full threat model.

Short version:

  • Entry text is encrypted with AES-256-GCM + HMAC-SHA256.
  • Attachments are encrypted with the same key (new in v1.4.0).
  • Filenames, folder names, tags, moods, favorites, and the search index are NOT encrypted.
  • AI API keys are encrypted with your journal password.

📜 License

MIT — see LICENSE.

Copyright © 2025 Bloody-Crow.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

the_notebook-1.4.1.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

the_notebook-1.4.1-py3-none-any.whl (73.5 kB view details)

Uploaded Python 3

File details

Details for the file the_notebook-1.4.1.tar.gz.

File metadata

  • Download URL: the_notebook-1.4.1.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for the_notebook-1.4.1.tar.gz
Algorithm Hash digest
SHA256 bae8ecdfed1976594bacf291a763cff01b5392101e733ab5115cf4994423fe7d
MD5 23a145dbfea49907a5c0fc4b2b66f8e1
BLAKE2b-256 be13d2624e67fdf124b8d304f7efbb2b293155afbd15ff7629b1ce33ef9f71a0

See more details on using hashes here.

File details

Details for the file the_notebook-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: the_notebook-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 73.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for the_notebook-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb4ac3a2220cfb83f92ae0ee78dfff1f9092e3b9b95462005a7aa423dbc85434
MD5 0d4fb42f4b1350fa0fb40440d8517d68
BLAKE2b-256 b2c4a8bdec4fc95c3ccd819506ffb5d24d8c535b4d0573c82a6aacbe68dc5bdc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page