Architecture
CEMS supports two MCP transport modes:- stdio transport - Direct command-line integration via
cems-mcp - Streamable HTTP transport - Express.js wrapper for HTTP-based MCP clients
stdio Transport
The stdio transport is implemented in Python and reads credentials from~/.cems/credentials or environment variables.
Configuration
Create~/.cems/credentials:
Entry Point
Thecems-mcp command starts the stdio server:
User Profile as Instructions
The stdio server fetches the user’s memory profile on startup and injects it as server instructions:HTTP Transport
The HTTP transport is implemented in TypeScript using Express.js and the MCP SDK.Stateless Mode
The wrapper operates in stateless mode with JSON responses:Authentication
Auth headers are extracted from each request:Proxying to Python API
All tool calls are proxied to the Python REST API:Available Tools
Both transports expose the same set of memory tools:memory_search- Search memories with unified retrieval pipelinememory_add- Store new memoriesmemory_get- Retrieve full memory by IDmemory_forget- Delete or archive memoriesmemory_update- Update existing memoriesmemory_maintenance- Run maintenance jobs
Resources
Both transports expose memory resources:memory://status- Current memory system statusmemory://personal/summary- Personal memory summarymemory://shared/summary- Shared team memory summary
Health Checks
The HTTP transport provides health endpoints:Method Restrictions
The HTTP transport enforces stateless mode:POST /mcp- Handle MCP requestsGET /mcp- Returns 405 (stateless mode, no SSE)DELETE /mcp- Returns 405 (no session management)