Overview
Chronologue integrates the Model Context Protocol (MCP) to enable structured memory access, event scheduling, and tool invocation via standardized agent interfaces. This implementation supports:- Serving memory traces over a FastAPI or stdio MCP server
- Scheduling calendar events through Google Calendar API
- Converting
.json
memory traces to.ics
format - Running OpenAI or Claude-based ReAct loops to populate and update the calendar
MCP Server Setup
The server exposes tools and resources via eitherstdio_server
or FastMCP
(FastAPI-based):
- Tool:
sync_to_google_calendar
Sync.json
memory traces to a Google Calendar - Tool:
generate_embedding
Generate OpenAI embeddings for trace content - Tool:
convert_trace_to_ics
Convert memory trace to.ics
string for calendar export
server.py
(stdio server)server_google_calendar.py
(FastAPI)
MCP Client: Chat + Tool Invocation
The client connects to the MCP server, lists available tools, and forwards user queries through a Claude (or OpenAI) chat loop. Key features:- Uses Claude 3.5 Sonnet API with tools attached
- Handles tool calls like
sync_to_google_calendar
, embedding generation - Supports a full interactive REPL
client.py
Calendar Tooling and Integration
Chronologue exposes structured tools to bridge memory traces and calendar APIs:Key Tools
-
convert_trace_to_ics(trace: dict) -> str
Converts a single memory trace into a VEVENT-compliant.ics
string -
sync_traces_to_google(traces: list[dict]) -> str
Sends memory traces to Google Calendar using OAuth-authenticated API -
load_memory_file(file_path: str) -> list[dict]
Loads structured memory from a.json
file
server_google_calendar.py
calendar/credentials.json
calendar/token.json
['https://www.googleapis.com/auth/calendar']
MCP Resources
Memory traces can be exposed as structured resources via MCP:-
calendar://pending_goals
Allgoal
-type memory traces withcompletion_status: pending
-
calendar://week_summary/{iso_week}
All traces from the specified ISO week (2025-W18
) -
calendar://trace_by_id/{trace_id}
Lookup a specific memory trace by ID
Agent Loop (Planner + Executor)
Chronologue supports integration with OpenAI or Claude models to generate schedules:- Query the MCP server for memory or context blocks
- Pass them into a prompt:
“Given the user’s upcoming goals and availability, what events should be scheduled this week?” - Receive a response in the form of
MCPContextBlock(type="calendar_event")
- Sync to calendar using tools
process_query()
and chat_loop()
methods of the MCPClient
.
Optional: Custom UI for Calendar + Agent Logs
For deeper integration or review:- Top panel: MCP-derived upcoming events
- Side panel: agent chat logs and memory trace history
- Bottom panel: annotate traces, schedule goals, or trigger planner
Streamlit
orFlet
for simple UI prototypingTempo Tokens
, feedback inputs, and calendar visualizations
Example Usage
Run the FastAPI-based MCP server and query events for the week: python server_google_calendar.pycurl http://localhost:8000/context?type=calendar_event&last_n=5 Trigger syncing memory to calendar:
Then: Type “Sync last session to calendar”
Summary
Chronologue’s MCP backend provides a powerful interface for:- Agent reflection, planning, and memory access
- Tool invocation via structured protocols
- Real-world event scheduling grounded in memory
- Integrating
.ics
,.json
, and calendar APIs in a unified loop
System Design: Chronologue + MCP
Chronologue integrates structured memory traces, natural language input, and calendar-based coordination through a unified interface. It relies on the Model Context Protocol (MCP) to connect user input with event memory, agent reasoning, and calendar output. Event Schema All memory traces are converted into structured events, enabling both human review and agent planning. The core event types include:-
goal
– a future-oriented intent (“Finish literature review”) -
observation
– a passive or descriptive record (“Met with advisor”) -
reflection
– a qualitative note or summary (“Need to prioritize data cleanup”) -
scheduled_event
– a time-bound commitment (“Lab sync at 2PM Thursday”)
- Memory Trace Ingestion Conversational input is parsed into structured trace entries (goal, reflection, etc.)
-
Timeline Generation
MCP organizes these traces into a coherent timeline—annotated with metadata and available for
.ics
export. -
Conversational Routing
Chat commands like"schedule a writing block tomorrow"
are interpreted into:- Actionable event traces
-
.ics
entries - Planning context for future agent tasks
-
.ics
files – Standards-compliant events compatible with Apple Calendar, Google Calendar, Outlook - Google Calendar API – OAuth-authenticated event sync for read/write access
- Structured Event I/O – Sync back updated events into memory system for trace consistency
.ics
export:
.ics
events, and be pushed back into the MCP memory system as scheduled traces.