Labsco
shuntaka9576 logo

cal2prompt

15

from shuntaka9576

A command-line tool to fetch Google Calendar schedules and convert them into custom prompts or text snippets using a template engine.

🔥🔥✓ VerifiedFreeQuick setup

⚠️ This project is still experimental. Features may change without notice. Use with caution! ⚠️

cal2prompt

cal2prompt is a command-line tool that fetches your schedule (e.g., from Google Calendar) and converts it into a custom prompt or text snippet via a template engine. It can output directly to your stdout, or run as an experimental MCP (Model Context Protocol) server.

cal2prompt uses the Google Calendar API version 3.

CLI Example img

Model Context Protocol(MCP) Example(experimental) img

Features

  • 🚀 Google Calendar Integration
    Utilizes the Google Calendar API v3 to fetch your schedule.

  • 📄 Flexible LLM Prompt Customization with a Template Engine
    Customize the generated prompts using the Jinja2 template engine.

  • ⚡️ Blazing fast
    High-speed Processing Powered by the Rust Ecosystem.

  • 🔧 Experimental MCP Mode
    Run cal2prompt as a Model Context Protocol server.

Date: {{ day.date }}


All-Day Events:

{% if day.all_day_events|length == 0 %} (No all-day events) {% else %} {% for ev in day.all_day_events %}

  • {{ ev.summary }}
    • (All Day)
    • Location: {{ ev.location or "N/A" }}
    • Description: {{ ev.description or "No description." }}
    • Attendees: {% if ev.attendees|length > 0 %} {% for a in ev.attendees %}
      • {{ a }} {% endfor %} {% else %}
      • (No attendees) {% endif %} {% endfor %} {% endif %}

Timed Events:

{% if day.timed_events|length == 0 %} (No timed events) {% else %} {% for ev in day.timed_events %}

  • {{ ev.summary }}
    • Start: {{ ev.start }}
    • End: {{ ev.end }}
    • Location: {{ ev.location or "N/A" }}
    • Description: {{ ev.description or "No description." }}
    • Attendees: {% if ev.attendees|length > 0 %} {% for a in ev.attendees %}
      • {{ a }} {% endfor %} {% else %}
      • (No attendees) {% endif %} {% endfor %} {% endif %} {% endfor %} ]], }, }
Copy & paste — that's it

#### 3. CLI Authentication

cal2prompt executes the OAuth 2.0 flow to obtain authentication credentials. For detailed step-by-step flow instructions, please refer to [docs/setup-cli-auth](https://github.com/shuntaka9576/cal2prompt/blob/HEAD/docs/setup-cli-auth.md)

```bash
cal2prompt

Integrating Claude Desktop with MCP

Please add the following configuration to ~/Library/Application\ Support/Claude/claude_desktop_config.json:

  • For mcpServers.cal2prompt.command: You must specify the full path obtained by running which cal2prompt.
  • For mcpServers.cal2prompt.env.HOME: Since Claude Desktop may not inherit the HOME environment variable, so it needs to be set explicitly.
Copy & paste — that's it
{
  "mcpServers": {
    "cal2prompt": {
      "command": "/Users/username/.cargo/bin/cal2prompt",
      "args": ["mcp"],
      "env": {
        "HOME": "/Users/username"
      }
    }
  }
}

Environment

Variable NameDescriptionDefault Value
CAL2_PROMPT_CONFIG_FILE_PATHPath to a custom Lua configuration file if you do not want to use the default.~/.config/cal2prompt/config.lua