Skip to main content

API key authentication

All public API requests require an API key sent in the X-API-Key header:
Create API keys from the MemContext dashboard under Settings > API Keys. Each key is bound to one workspace selected at creation, and API-key requests cannot override that workspace. Keys are prefixed with mc_ and shown only once at creation - store them securely.

MCP server authentication

The hosted MCP server at https://mcp.memcontext.in/mcp accepts the API key via HTTP headers. Both MEMCONTEXT-API-KEY and X-API-Key are supported:
See MCP Setup for configs specific to Claude Code, Cursor, OpenCode, and Codex CLI.

Claude.ai / Claude Desktop connector authentication

For Claude.ai and Claude Desktop custom connectors, MemContext uses OAuth instead of manual API-key entry.
  1. Open Settings → Connectors in Claude.
  2. Add a custom connector with https://mcp.memcontext.in/mcp.
  3. Click Connect.
  4. Sign in to MemContext and approve the requested scopes.
This path is intended for everyday Claude usage. API-key headers and config files are only needed for coding-agent setups such as Claude Code, Cursor, OpenCode, and Codex CLI.

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 scope as the hard isolation boundary when one API key serves multiple app users or tenants
  • Use project only as a secondary grouping/filter inside that scope