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.

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 at https://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 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