
personal dialy
一个基于 Node.js 的命令行日记应用,支持 AI 分析和 SQLite 数据库。
Repository Info
About This Server
一个基于 Node.js 的命令行日记应用,支持 AI 分析和 SQLite 数据库。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Personal Diary CLI
A Node.js command-line diary application with Claude Desktop integration via MCP (Model Context Protocol). Create, manage, and search your personal diary entries with AI-powered assistance.
Features
- 📝 Create diary entries with title, content, mood ratings (1-5), and tags
- 🔍 Search entries by content, tags, or date range
- 📊 Mood tracking with visual star ratings
- 🏷️ Tag system for categorizing entries
- 🤖 Claude Desktop integration via MCP for AI-powered diary analysis
- 💾 SQLite database with type-safe Kysely queries
- 🎨 Colorful CLI with chalk formatting
Installation
# Clone the repository
git clone <repository-url>
cd personal-diary
# Install dependencies
pnpm install
# Build the application
pnpm run build
Usage
CLI Commands
Create a new diary entry:
node dist/index.js add -c "Had a great day at work today!" -t "Work Day" -m 4 --tags "work,productivity"
List recent entries:
node dist/index.js list
node dist/index.js list -l 5 # Limit to 5 entries
Search entries:
node dist/index.js search -q "work"
node dist/index.js search --tags "productivity,health"
node dist/index.js search --from 2025-01-01 --to 2025-01-31
View a specific entry:
node dist/index.js show <entry-id>
Show help:
node dist/index.js --help
Claude Desktop Integration
1. Register with Claude Desktop:
pnpm run register-mcp
# or
node dist/index.js --register-mcp
2. Restart Claude Desktop
3. Use natural language commands in Claude Desktop:
- "Add a diary entry about my morning run with a mood of 5"
- "Search for entries about work meetings from last week"
- "Show me all entries with high mood ratings"
- "What patterns do you see in my recent diary entries?"
4. Manual MCP server mode (for testing):
pnpm run mcp
# or
node dist/index.js --mcp-server
Development
# Development mode (TypeScript)
pnpm run dev
# Build TypeScript
pnpm run build
# Run built JavaScript
pnpm start
# Test MCP server
echo '{"jsonrpc": "2.0", "method": "tools/list", "params": {}, "id": 1}' | pnpm run mcp
Project Structure
├── src/
│ ├── cli/
│ │ ├── commands.ts # CLI command definitions
│ │ └── mcp-config.ts # Claude Desktop registration
│ ├── database/
│ │ ├── database.ts # Kysely database setup
│ │ └── schema.ts # TypeScript types & schema
│ ├── mcp/
│ │ └── server.ts # MCP server implementation
│ ├── services/
│ │ └── diary-service.ts # Business logic
│ └── index.ts # Main entry point
├── dist/ # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md
Database
- Database Engine: SQLite
- ORM: Kysely for type-safe queries
- Location:
- CLI mode:
~/.personal-diary/diary.db - MCP mode:
$TMPDIR/personal_diary_mcp/diary.db
- CLI mode:
Schema:
diary_entries: id, title, content, created_at, updated_at, mood, tagsdiary_images: id, entry_id, filename, original_name, caption, file_size, mime_type, created_at
MCP Tools
When integrated with Claude Desktop, the following tools are available:
- add_diary_entry - Create new diary entries
- get_entries - Retrieve recent entries
- search_entries - Search entries by content, tags, or date
Technology Stack
- Runtime: Node.js 18+
- Language: TypeScript
- Database: SQLite with Kysely
- CLI Framework: Commander.js
- MCP SDK: @modelcontextprotocol/sdk
- Utilities: dayjs, chalk, uuid
License
MIT
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Troubleshooting
MCP Registration Issues:
- Ensure Claude Desktop is closed before running
--register-mcp - Check the config file at
~/Library/Application Support/Claude/claude_desktop_config.json - Manually add the MCP server configuration if automatic registration fails
Database Issues:
- Delete
~/.personal-diary/diary.dbto reset the database - Ensure sufficient disk space for SQLite database
Build Issues:
- Run
pnpm run buildto check for TypeScript errors - Ensure Node.js version 18 or higher
Quick Start
Clone the repository
git clone https://github.com/coji/personal-dialyInstall dependencies
cd personal-dialy
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.