# Authentication (https://docs.docfork.com/core/authentication) Choose between API keys or OAuth to authenticate your Docfork MCP connection. Both methods work with [Cabinets](/core/cabinets) for project-scoped documentation. API Keys [#api-keys] API keys give you explicit control over authentication. Create separate keys per AI agent for easier debugging and revocation. API Keys dashboard Create a key [#create-a-key] 1. Open [app.docfork.com/api-keys](https://app.docfork.com/api-keys) 2. Go to **API Keys** 3. Click **Create Key** 4. Name the key by client or project (for example `cursor-main` or `opencode-agent`) Keys are shown once and have the pattern `docf_***`. Use a key in MCP config [#use-a-key-in-mcp-config] Add your API key to the `DOCFORK_API_KEY` header: ```diff { "mcpServers": { "docfork": { "url": "https://mcp.docfork.com/mcp", + "headers": { + "DOCFORK_API_KEY": "YOUR_API_KEY" + } } } } ``` Team sharing [#team-sharing] Share API keys with your team through your workspace. Everyone using the same key gets access to the same [Cabinets](/core/cabinets) and libraries. Rotate or revoke [#rotate-or-revoke] * Delete unused keys from **API Keys** * Create replacement keys before removing active keys * Keep one key per client when possible for easier debugging and revocation Key limits [#key-limits] Free tier currently supports up to **3 API keys** per workspace. OAuth 2.0 [#oauth-20] OAuth eliminates key management by handling authentication through your browser. Sign in once, and your client handles token refresh automatically. Use OAuth for quick setup or when you need workspace SSO and shared settings. OAuth works with remote HTTP connections only. For local MCP connections using stdio transport (like `npx docfork`), use [API keys](#api-keys) instead. Note that remote connections also support API keys — OAuth is optional and mainly for convenience.