Skip to main content

The on-premise API supports API keys for server-to-server and MCP access. Pass the key in the Authorization header:

The server also accepts the key in the x-api-key, context7-api-key, or context7_api_key header.

A key belongs to the user who created it and has that user’s role (admin or member). Keys have no scopes and do not expire. To stop a key from working, revoke it.

A request with an invalid or revoked key gets 401. It is not treated as an anonymous request.

Creating an API Key#

Open Personal settings

Open the account menu in the admin dashboard, choose Personal settings, and click Create API key in the API keys card.

API keys card in Personal settings

Name the key

Give the key a descriptive name so you know which client or service is using it (e.g. CI pipeline, Cursor).

Create API key dialog

Copy the key

Copy the full key value before closing the dialog. It is only shown once.

Copy your key now dialog showing the key value

Warning
API keys are shown only once at creation. Store yours securely before closing the dialog.

Revoking a Key#

Go to Personal settings > API keys and click the delete icon next to the key. Revocation is immediate and cannot be undone. Update any integrations using the key before revoking.

Roles#

RoleAccess
adminFull access to all endpoints including settings, user management, and delete operations
memberCan parse, refresh, search, and use MCP. Cannot delete libraries, cancel parses, import libraries, or access admin endpoints

A personal API key acts with the role of its owner:

OperationMember keyAdmin key
Parse and refresh librariesYes, if they can read an existing libraryYes
Refresh Notion and Google Drive librariesNoYes
Delete libraries, cancel parses, download the support bundleNoYes
Import libraries (/api/import-libraries)NoYes
/mcp and /api/v2 search and contextYesYes

Settings, user management, and other admin routes need an admin signed in to the dashboard. They do not accept API keys.

Default credentials on a fresh install are admin / admin. Change them immediately from Personal settings > Password > Change password.

Non-admin permissions#

Certain operations can be opened to anonymous callers (no session and no API key). Configure them in the Non-admin permissions card under Workspace Settings › Authorization:

PermissionDefault
Parse repositoriesOff
Refresh repositoriesOff
Delete repositoriesOff
Download support bundleOff

These switches do not limit signed-in users. Members and their API keys can always parse and refresh, except Notion and Google Drive libraries, which only admins refresh. To re-parse or replace an existing library, a member needs read access to it.

The delete switch also covers cancelling a parse. When it is on, members can delete and cancel too. The support bundle switch works the same way for downloads.

Note

Earlier versions allowed anonymous parse and refresh by default.

MCP authentication is configured separately in Workspace Settings › Authentication. When enabled, these endpoints require a dashboard session or a personal API key:

  • /mcp
  • /api/v2/*, including /api/v2/libs/search and /api/v2/context
  • GET /api/projects and GET /api/projects/{name}
  • GET /api/projects/{name}/logs and GET /api/projects/{name}/search
  • GET /api/queue
  • GET /api/parse-status

When it is off, these endpoints answer anonymous callers. Library access rules still hide restricted libraries from them.

The bundled MCP server calls the v2 endpoints over loopback with a secret token. A reverse proxy on the same host therefore cannot skip MCP authentication.