Overview
While our SDKs are the recommended way to integrate Jean Memory for most applications, we also provide a powerful, low-level API endpoint for advanced use cases. The Model Context Protocol (MCP) API is designed for developers who need direct control over the context engineering process or are building autonomous agents that can leverage Jean Memory’s tool-calling capabilities. This is the same endpoint that our enterprise partners, like Claude, use to integrate Jean Memory as a tool for their models.When to use the MCP API:
- You are building an autonomous AI agent.
- You need to integrate Jean Memory as a callable tool for an existing LLM.
- You require streaming responses using Server-Sent Events (SSE).
- You need more control than the SDKs provide.
Endpoint URL
The primary endpoint for all MCP interactions is a single HTTP POST request:client_name
: A unique identifier for your application (e.g.,my-agent
,claude
).user_id
: The unique identifier for the end-user.
Authentication
The MCP API uses the same secure authentication as our SDKs. All requests must include a valid JWT in theAuthorization
header.
Request Body
The request body is a JSON object that specifies the tool you want to call and its parameters.Key Parameters:
method
: Should always betools/call
.tool_name
: The name of the tool you want to execute. Usejean_memory
for all interactions.tool_params
: An object containing the parameters for the specified tool.
The jean_memory
Tool
This is the primary tool for all MCP interactions. It provides intelligent context engineering with configurable depth levels.
Tool Parameters:
user_message
(string, required): The user’s complete message or query.is_new_conversation
(boolean, required): Set totrue
only for the very first message in a new conversation.depth
(integer, optional, default:2
): The desired context depth level.0
: No context retrieval. Use for generic knowledge questions that don’t require personal context.1
: Fast search for quick personal facts or simple lookups (sub-second response time).2
: Balanced synthesis for conversational responses using AI-powered memory synthesis (3-5 seconds).3
: Comprehensive analysis with deep document search and extensive memory correlation (20-30 seconds).
Server-Sent Events (SSE) for Streaming
For clients that support streaming (like many conversational AI applications), the MCP API can stream responses using SSE. This allows you to receive the response as it’s generated, improving the user experience. To enable streaming, include theAccept: text/event-stream
header in your request.
Example JavaScript Client:
Heartbeats: The API will send colon-prefixed comments (
:heartbeat
) periodically to keep the connection alive, especially through proxies like Cloudflare. Your client should be prepared to ignore these messages.Example Response (Non-Streaming)
A standard, non-streamingPOST
request will receive a JSON response like this: