Unkey MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Unkey MCP or direct API to create API keys, verify access, manage rate limits, and review usage analytics through natural language.

Unkey logoUnkey
Api Key

Unkey is an API infrastructure platform for key management, authorization, rate limiting, and usage analytics. It helps teams secure APIs and control access without building these systems from scratch.

43 Tools

Try Unkey now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Unkey
Try asking
TOOLS

Supported Tools

Every Unkey action and event your agent gets out of the box.

Add Key Roles

Add existing roles to a customer API key without removing its current roles or direct permissions.

Consume Multiple Rate Limits

Irreversibly consume quota for up to 100 independent Unkey rate limits.

Consume Rate Limit

Irreversibly consume quota for one identifier in an existing Unkey rate-limit namespace.

Create API

Create an API namespace for organizing and issuing customer API keys.

Create API Key

Create a customer API key in an API namespace and return its one-time plaintext key value.

Create Existing-Key Portal Session

Create an end-user portal session with key read, key reroll, and analytics access for existing keys, then return its single-use redirect URL.

Create Identity

Create an identity that groups customer API keys under one external entity with shared metadata and rate limits.

Create or Add Key Permissions

Create any missing workspace permissions for the supplied slugs, reuse existing workspace permissions, and attach all supplied slugs directly to a customer API key without removing existing direct or role-based access.

Create Permission

Create an RBAC permission with a unique slug for assignment to roles or customer API keys.

Create Portal

Create a keyspace-backed customer portal for free API Management.

Create Portal Domain

Attach a custom domain to an Unkey portal, start asynchronous DNS verification, and return the records that must be published.

Create Rate Limit Namespace

Create a named rate-limit namespace and return the rlns_ namespace ID used by quota inspection and consumption tools.

Create Role

Create an RBAC role without attaching or creating permissions.

Create Role and Permissions

Create an RBAC role, create any missing workspace permissions for the supplied slugs, reuse existing workspace permissions, and attach all of them to the new role.

Get API

Retrieve an API namespace by its API ID.

Get API Key

Retrieve metadata, status, permissions, roles, and usage settings for a customer API key by key ID.

Get API Request Metrics

Count requests served by the Unkey API for the connected workspace per time bucket, split into successful, client-error, and server-error totals.

Get Identity

Retrieve an identity by its Unkey identity ID or external ID.

Get Permission

Retrieve one RBAC permission by its permission ID or slug.

Get Portal

Retrieve one customer portal by portal ID, slug, keyspace ID, or app ID; provide exactly one selector.

Get Portal Domain

Retrieve one portal custom domain, including its verification status and required DNS records.

Get Rate Limit Override

Retrieve one rate-limit override by namespace and its exact identifier pattern.

Get Role

Retrieve one RBAC role and its assigned permissions by role ID or name.

Get Workspace Flags

Get feature flags for the connected workspace, keyed by flag slug, including each flag's current value and opt-in or opt-out availability.

Get Workspace Limits

Return every workspace plan limit and its current usage where available.

Get Workspace Usage

Return billable API operations, Compute usage, and active gateway keys for the current UTC month or one requested recent calendar month.

Identify API Key

Identify a customer API key from its complete plaintext value and return the key's metadata, status, permissions, roles, usage settings, and identity.

Inspect Multiple Rate Limits

Inspect up to 100 independent Unkey rate limits with cost zero.

Inspect Rate Limit

Inspect quota for one identifier in an existing Unkey rate-limit namespace with cost zero.

List API Keys

List one page of customer API keys in an API namespace, optionally filtered by external identity.

List API Requests

List one page of recent Unkey API requests for the connected workspace, newest first.

List Identities

List one page of identities in the connected Unkey workspace, optionally filtering by identity ID or external ID.

List Permissions

List one page of RBAC permissions in the connected Unkey workspace, optionally filtering by permission text.

List Portal Domains

List all custom domains attached to one Unkey portal, including each domain's verification status and required DNS records.

List Portal Sessions

List one page of end users with revocable sessions on a portal, including pending and active sessions.

List Rate Limit Namespaces

List one page of readable rate-limit namespaces in the connected Unkey workspace, newest first, with optional text search.

List Rate Limit Overrides

List one page of custom rate-limit overrides configured in a namespace, including each identifier pattern, request limit, and window duration.

List Roles

List one page of RBAC roles and their assigned permissions in the connected Unkey workspace, optionally filtering by role ID, name, or description.

Query Rate Limit Analytics

Run a read-only SQL query against Unkey rate-limit analytics for the connected workspace.

Query Verification Analytics

Run a read-only SQL query against Unkey key-verification analytics for the connected workspace.

Verify and Consume API Key

Verify a customer API key while explicitly consuming a positive number of credits and any requested rate-limit quota.

Verify, Migrate, and Consume API Key

Verify a customer API key using a provider-configured on-demand migration that may create or migrate a missing legacy key.

Verify Portal Domain

Restart asynchronous DNS verification for a pending or failed portal domain after correcting its records.

SETUP GUIDE

Connect Unkey MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["unkey"],
  mcp: true,
});
Create a session scoped to Unkey and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Create a new Unkey API key for the payments service with a 30-day expiration",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a Unkey request
SETUP GUIDE

Connect Unkey API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["unkey"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to Unkey
3

Run Unkey tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Create a new Unkey API key for the payments service with a 30-day expiration" }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the Unkey tool calls through the session, and print the final answer

Why Use Composio?

AI Native Unkey Integration

  • Supports both Unkey MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Unkey data

Managed Auth

  • Built-in API key handling for secure Unkey requests
  • Central place to manage, scope, and revoke Unkey access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Unkey
  • Scoped, least privilege access to Unkey resources
  • Full audit trail of agent actions to support review and compliance
FRAMEWORKS

Use Unkey with any AI Agent Framework

Choose a Framework you want to connect Unkey with

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Start with Unkey.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Unkey tool your agent needs.Free to start.

Start building