Developer Tools · IT & Security

Unkey MCP

Unkey MCP lets agents manage API keys, identities, permissions and roles, rate limits, deployments, domains, portals and workspace settings, and query analytics and logs through Unkey's hosted MCP server.

Tools

This is a reference catalogue. Tools cannot be configured or run from this page.

  • Unkey v2 apis create api

    Create an API namespace for organizing keys by environment, service, or product. Use this to separate production from development keys, isolate different services, or manage multiple products. Each API gets a unique identifier and dedicated infrastructure for secure key operations. **Important**: API names must be unique within your workspace and cannot be changed after creation. **Required Permissions** Your root key must have one of the following permissions: - `api.*.create_api` (to create APIs in any workspace)

  • Unkey v2 apps create app

    Create an app within a project. The app is created with default `production` and `preview` environments. Set exactly one source. Use `git` to create a GitHub-sourced app and connect its repository. Use `oci` to create an app from a prebuilt OCI image. The slug you provide is the stable, caller-defined handle used to reference this app. It must be unique within the project. **Important**: The slug cannot collide with an existing app in the same project. A duplicate slug returns a 409 conflict. **Required Permissions** Your root key must have one of the following permissions: - `project.*.create_app` (to create apps in any project) - `project.<project_id>.create_app` (to create apps in a specific project)

  • Unkey v2 deployments create deployment v3

    Create a deployment for an app in a project. Omit the source to use the app's configured default. A Git app builds its default branch. An OCI app deploys its default image. Optionally provide one source override: - `oci`: deploy a prebuilt OCI image without a build. Mutable tags are resolved to immutable digests before rollout. - `git`: build and deploy from the app's connected GitHub repository, a branch, a specific commit, or a fork commit. Requires the app to have a repository connected. - `deployment`: re-run an existing deployment by its id. Git deployments rebuild from the recorded commit; OCI deployments reuse the recorded resolved image. Returns immediately with a `deploymentId`. The build and rollout run asynchronously. Poll `deployments.getDeployment` to watch status until it is ready. **Authentication**: requires a root key with `unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>/environments/<environment_id>/deployments/*#write`. Wildcards can replace resource IDs to grant access across a wider scope.

  • Unkey v2 domains create domain

    Attach a custom domain to an environment and start verifying it. The domain is created in the `pending` state and does not serve traffic until verification succeeds. Verification runs in the background and polls DNS, so it is eventually consistent. The response returns `dnsRecords`: every record needed to finish setup, already resolved for whether this domain is an apex or a subdomain. Create every entry exactly as given. One record establishes routing and one proves ownership, and both are needed: whether ownership can be inferred from the routing record depends on how your provider publishes it, and a name another workspace has already verified can only be claimed through the ownership record. Neither is knowable before the records exist. When your DNS provider supports Domain Connect, the response also carries a `domainConnect` object; opening its `url` applies the same records at the provider in one step. The object is absent when the shortcut is unavailable. Domains are unique per workspace, so the same name cannot be attached to two environments. Attaching a domain that already exists in your workspace returns a 409 conflict. How many domains you may attach is set by your plan. Attaching one beyond that allowance returns a 403; upgrade the plan or remove a domain you no longer need. **Important**: verification stops after 24 hours without the required DNS records, and the domain moves to `failed`. **Required Permissions** Your root key must have one of the following permissions: - `environment.*.create_domain` (to attach domains to any environment) - `environment.<environment_id>.create_domain` (to attach domains to a specific environment)

  • Unkey v2 github install app

    Start installing the Unkey GitHub App for your workspace. Returns a GitHub App install URL: open it in a browser to install the app and grant repository access. After installation GitHub returns to Unkey, which binds the installation to your workspace and lands you in the workspace settings. Installation is workspace-wide and takes no parameters. Once installed, link repositories to individual apps with the `git` field on `apps.createApp` and `apps.updateApp`. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:github/apps/*#write` Replace `<workspace_id>` with the authenticated workspace ID.

  • Unkey v2 identities create identity

    Create an identity to group multiple API keys under a single entity. Identities enable shared rate limits and metadata across all associated keys. Perfect for users with multiple devices, organizations with multiple API keys, or when you need unified rate limiting across different services. **Important** Requires `unkey:v1:<workspaceId>:projects/<projectId>/identities/*#write` for the workspace's default project.

  • Unkey v2 keys create key

    Create a new API key for user authentication and authorization. Use this endpoint when users sign up, upgrade subscription tiers, or need additional keys. Keys are cryptographically secure and unique to the specified API namespace. **Important**: Store the returned key securely. Unless you create a recoverable key, the plaintext cannot be retrieved later. Recoverable keys require key encryption and permission to decrypt them. **Common use cases:** - Generate keys for new user registrations - Create additional keys for different applications - Issue keys with specific permissions or limits **Required Permissions** Your credential needs `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#write` for the target keyspace. Use the keyspace's project ID, not the API's project ID if they differ. A grant with wildcard project or keyspace segments can cover multiple keyspaces in the authorized workspace. Recoverable keys use the same write permission. They also require the keyspace to support key encryption. Without write permission, this endpoint returns 404 to hide whether the API exists. If your credential can read the keyspace, it returns 403 and names the missing write permission instead.

  • Unkey v2 keys migrate keys

    Returns HTTP 200 even on partial success; hashes that could not be migrated are listed under `data.failed`. **Required Permissions** Your root key must have `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#write` for the target keyspace in its project and workspace.

  • Unkey v2 permissions create permission

    Create a new permission to define specific actions or capabilities in your RBAC system. Permissions can be assigned directly to API keys or included in roles. Use hierarchical naming patterns like `documents.read`, `admin.users.delete`, or `billing.invoices.create` for clear organization. **Important:** Permission slugs must be unique within the workspace. Names do not need to be unique. Once created, permissions are immediately available for assignment. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/*#write` Use your workspace ID and its default project ID. A wildcard project grant also authorizes this operation.

  • Unkey v2 permissions create role

    Create a new role to group related permissions for easier management. Roles enable consistent permission assignment across multiple API keys. Permission slugs supplied in `permissions` are attached during creation. Missing permissions are created automatically. **Important:** Role names must be unique within the workspace. Once created, roles are immediately available for assignment. **Required Permissions** Your root key must always have: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/roles/*#write` When any requested permission slug does not exist, it must also have: - `unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/*#write` Both grants must cover the authenticated workspace and its default project. Attaching existing permissions requires only role write access.

  • Unkey v2 portal create domain

    Attach a custom domain to a portal and start verifying it. The domain is created in the `pending` state and does not serve the portal until verification succeeds. The response returns `dnsRecords`: create every entry exactly as given. Verification runs in the background; poll `portal.getDomain` for the result. A name already attached to one of your portals or environments returns a 409. Requires `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/domains/*#write`. Use `portals/*/domains/*#write` to attach domains to any portal in the project. Without the permission this returns **404**, not 403, unless the key can read the portal or its domains.

  • Unkey v2 portal create portal

    Create a portal for one app or keyspace in your workspace. Unreleased and subject to change without notice. Send exactly one of `keyspaceId` or `appId`. That resource must belong to your workspace, and it can back only one portal, so a second portal for the same resource is a **409**. `displayName` is what your end users see. It is yours to set and change independently of the resource the portal serves. **Required Permissions** Your root key must have `unkey:v1:<workspace_id>:projects/<project_id>/portals/*#write` for the project that owns the app or keyspace. A grant scoped to a specific portal ID does not authorize creation, because the ID does not exist yet. You must also have read permission on the resource the portal serves: - `unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>#read` for an app. - `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>#read` for a keyspace. Broader grants that cover these resources and actions also authorize the request. A missing permission returns **403**. An app or keyspace outside your workspace returns **404**, the same as a resource that does not exist.

  • Unkey v2 portal create session

    Create a portal session for an end user and get the URL to redirect them to. The URL carries a single-use exchange code valid for 15 minutes, which the portal redeems exactly once for a 24-hour access token via `portal.exchangeCode`. **Required Permissions** Authorization runs in two stages, and both must pass. First, your root key must have `unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/sessions/*#write`. Write permission on the portal itself does not grant permission to mint sessions. Second, a session can never carry a capability your root key does not itself hold. Each requested scope additionally requires the equivalent permission on every keyspace the portal resolves to: - `keys:read` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#read` and `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>#read`. - `keys:reroll` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#write`, including when the keyspace stores encrypted keys. - `keys:create` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#write`, the same permission creating a key with `keys.createKey` requires. - `analytics:read` requires `unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/logs#read`. Broader URN grants that cover these resources and actions are also accepted. A grant on one concrete key cannot satisfy the `keys/*` requirement. Requesting a scope you do not hold returns 403 for the whole request rather than minting a reduced session, so a missing grant is visible instead of surfacing later as a broken portal. Missing the portal permission itself returns **404** when your root key cannot read the portal or its sessions, so a caller who cannot see a portal is not told whether it exists. A root key that can read the portal but lacks the permission gets **403**. Your root key must also be associated with a workspace that has an enabled portal.

  • Unkey v2 projects create project

    Create a project to group deployments and applications under a workspace-scoped slug. The slug you provide is the stable, caller-defined handle used to reference this project in subsequent operations (get, update, delete). It must be unique within your workspace. **Important**: The slug cannot collide with an existing project in your workspace. A duplicate slug returns a 409 conflict. **Required Permissions** Your root key must have the following permission: - `project.*.create_project` (to create projects in your workspace)

  • Unkey v2 ratelimit create namespace

    Create a rate limit namespace before you rate limit against it. `ratelimit.limit` also creates a namespace the first time you use its name, when your root key can create namespaces. Use this endpoint when you want the namespace to exist up front, for example to set overrides before the first request. **Important**: Names are unique within your workspace, deleted namespaces included. A name that is in use or was deleted returns 409. **Required Permissions** Your root key must have the following permission: - `unkey:v1:<workspace_id>:projects/*/ratelimits/namespaces/*#write`