coji
MCP Servercojipublic

personal dialy

一个基于 Node.js 的命令行日记应用,支持 AI 分析和 SQLite 数据库。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
-
License

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

Schema:

  • diary_entries: id, title, content, created_at, updated_at, mood, tags
  • diary_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:

  1. add_diary_entry - Create new diary entries
  2. get_entries - Retrieve recent entries
  3. 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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.db to reset the database
  • Ensure sufficient disk space for SQLite database

Build Issues:

  • Run pnpm run build to check for TypeScript errors
  • Ensure Node.js version 18 or higher

Quick Start

1

Clone the repository

git clone https://github.com/coji/personal-dialy
2

Install dependencies

cd personal-dialy
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownercoji
Repopersonal-dialy
LanguageTypeScript
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation