API key authentication
All public API requests require an API key sent in theX-API-Key header:
mc_ and shown only once at creation — store them securely.
MCP server authentication
The hosted MCP server athttps://mcp.memcontext.in/mcp accepts the API key via HTTP headers. Both MEMCONTEXT-API-KEY and X-API-Key are supported:
Rate limits
MemContext rate-limits requests per endpoint using a sliding window:| Endpoint | Limit | Window |
|---|---|---|
Save memory (POST /api/memories) | 30 requests | 1 minute |
Search memories (GET /api/memories/search) | 60 requests | 1 minute |
Submit feedback (POST /api/memories/:id/feedback) | 30 requests | 1 minute |
Global (all /api/* endpoints) | 100 requests | 1 minute |
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Remaining requests in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
429 Too Many Requests.
Error responses
All errors follow a consistent JSON format:| Field | Description |
|---|---|
error | What went wrong |
code | Machine-readable error code (e.g. HTTP_401, HTTP_404, INTERNAL_ERROR) |
requestId | Unique request ID, also returned in the X-Request-Id response header |
errorId | Unique error reference for support (only on server errors, format ERR_XXXXXXXX) |
| Code | Status | Meaning |
|---|---|---|
HTTP_401 | 401 | Missing or invalid API key |
HTTP_403 | 403 | Memory limit exceeded for current plan |
HTTP_404 | 404 | Memory not found |
HTTP_429 | 429 | Rate limit exceeded |
INTERNAL_ERROR | 500 | Unexpected server error |
Request limits
| Constraint | Value |
|---|---|
| Max request body size | 50 KB |
| Max memory content length | 10,000 characters |
| Max search query length | 1,000 characters |
| Max feedback context length | 1,000 characters |
Best practices
- Create a separate API key per integration or environment
- Keep API keys server-side — never expose them in client-side code
- Rotate keys immediately if you suspect exposure
- Use the
projectparameter to scope memories when working across multiple projects
