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:
Claude.ai / Claude Desktop connector authentication
For Claude.ai and Claude Desktop custom connectors, MemContext uses OAuth instead of manual API-key entry.- Open Settings → Connectors in Claude.
- Add a custom connector with
https://mcp.memcontext.in/mcp. - Click Connect.
- Sign in to MemContext and approve the requested scopes.
OAuth for other MCP clients
The same OAuth flow works for any client that supports remote MCP authorization (MCP spec 2026-07-28 and earlier), including ChatGPT, Claude Code, Codex CLI, Cursor, VS Code, and OpenCode. Point the client athttps://mcp.memcontext.in/mcp without an API key header; it discovers MemContext’s authorization server automatically, using Client ID Metadata Documents where supported and dynamic client registration otherwise.
- On the consent screen, choose the workspace the connection should use. Each connection stays bound to that workspace.
- Connections stay signed in: clients receive refresh tokens and renew access in the background, so you will not be asked to re-authorize every hour.
- API keys keep working exactly as before and take precedence when a request includes both.
Rate limits
MemContext rate-limits requests per endpoint using fixed 1-minute windows. Authenticated memory endpoint limits scale with the workspace plan:
API traffic may also be protected by a global abuse backstop of 3,000 requests per minute.
Rate-limited responses include headers to help you manage request timing:
When the limit is exceeded, the API returns
429 Too Many Requests.
Error responses
All errors follow a consistent JSON format:
Common error codes:
Request limits
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
scopeas the hard isolation boundary when one API key serves multiple app users or tenants - Use
projectonly as a secondary grouping/filter inside that scope
