What this means in practice
Important endpoint families include:- capture
- recall
- search-messages
- recent-messages
- wake
- checkpoint
- trace
- stats
crystal_recallcrystal_search_messagescrystal_recentcrystal_debug_recall
How it actually works
Key repo surfaces:convex/crystal/mcp.tspackages/mcp-server/README.mdmcp-server/README.md
Endpoint Reference
Session Initialization
POST /api/mcp/wake
Fetch the last session summary and recent messages to initialize a new session.
Request:
Memory Recall
POST /api/mcp/recall
Vector search over memories by semantic query.
Request:
channel— channel/scope context, including peer-scoped or shared-main valuesagentId— agent identifier used when resolving knowledge-base visibility for mixed private/shared deploymentsincludeGraphContext— defaults totrue; set tofalsewhen temporarily prioritizing lower latency over linked entity/relation context
Peer-first fallback (new in 0.7.15). If
channel is omitted on a peer-facing call, recall fails-closed on any knowledge base with a concrete peer scope. Previously the guard silently upgraded unscoped callers to management-level visibility. Always pass the peer channel (e.g. peer-coach:511172388) from a peer session.- the live MCP recall path computes one query embedding and reuses it across semantic memory recall and message-search evidence
- identical repeated HTTP recall requests can reuse the short-lived query embedding cache
- KB results are merged after normal memory recall, with agent/scope-aware visibility rules
- compact graph context is included by default and omitted only when the caller explicitly sends
includeGraphContext: false
Message Search
POST /api/mcp/search-messages
Semantic + keyword search over raw message transcripts, optionally bounded to a
time window and paged. Use it for questions like “what did X say last month
about Y”: pass the topic as query, the peer as channel, and the window via
fromMs/toMs (or ISO startDate/endDate).
Request:
query(required) — search text.channel/sessionKey— exact scope. On a multi-client (peer) account, always pass the peer channel — search is channel-isolated and never crosses clients.limit— 1–100 (default 10).offset— skip N ranked results for pagination.- Time window —
fromMs/toMs(epoch ms) orstartDate/endDate(ISO date/datetime);sinceMs,before,afterare accepted aliases. A plausible seconds-precision value is auto-upscaled to ms.
offset: nextOffset while pagination.hasMore is true. A short page
means you have reached the end — do not assert a window is empty from one page.
POST /api/mcp/recent-messages
Fetch the most recent messages in time order without vector-search cost. Accepts
the same channel scope and time window (fromMs/toMs or startDate/endDate)
as search-messages; order may be "chronological" (default) or "newest".
Request:
Memory Management
POST /api/mcp/capture
Store a new memory (typically called after AI response completes).
Request:
POST /api/mcp/checkpoint
Mark a session milestone.
Request:
POST /api/mcp/trace
Retrieve the original conversation context for a memory.
Request:
System
GET /api/mcp/stats
Memory store health and usage.
Response:
Usage Pattern: Full Turn
Typical agentic flow:- Session start:
POST /api/mcp/wake→ prime context - Before work:
POST /api/mcp/recallwith relevant query → semantic context - After response:
POST /api/mcp/capturewith extracted memory - Optional:
POST /api/mcp/checkpointif turning point reached
- Add
debugRecallOutput=truequery param to recall endpoints to get verbose output including all search results, filtering, and prompt injections - Use
POST /api/mcp/traceto understand memory provenance
Common mistakes
- assuming the endpoint list is the whole behavior without reading the surrounding logic in
mcp.ts - mixing HTTP endpoints and MCP tool names without explaining the relationship
- ignoring auth/rate-limit behavior when describing the API surface
Source of truth
Primary files behind this page:convex/crystal/mcp.tspackages/mcp-server/README.mdmcp-server/README.md