AI21 Studio MCP server for AI agents

Live

BEARER TOKEN

LANGUAGE MODELS

AI

AI21 Studio gives your agent language model access in your AI21 Studio account: generate chat responses with Jamba models, start and follow Maestro runs, and manage files in your library.

  • Per-user credentials: each call uses the actual user's access token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
AI21 Studio
agent · Acme Q3
Run
Summarize this contract clause in 2 sentences.
S
ai21_chat_completion_create
1450ms
Language model agent
Returned a 2-sentence summary from an AI21 Jamba model, along with the token usage.
Sources: AI21 Studio chat, 1 completion
ai21
1 completion
18:29
Message Claude...

Tools your language model agent reaches for on AI21 Studio, scoped per user.

CALL ANY TOOL
8 tools for language models in AI21 Studio: generate chat responses with Jamba, start and read Maestro runs, and list, update, download, and delete library files.
ai21_chat_completion_create
Create chat completion
Generate a chat response with an AI21 Jamba model from a list of messages, optionally grounded in documents you pass or with function tools the model may call. Returns choices with the assistant message (content and any tool_calls), finish_reason and token usage. Use ai21_maestro_run_create for multi-step tasks with requirements, web or file search.
Parameters
Name
Type
Required
Description
messages
array
Required
Conversation so far, each message an object with role (system, user, assistant or tool) and content. An optional first system message sets the tone. Example: [{"role": "user", "content": "Summarize our refund policy in two sentences."}].
model
string
Required
Jamba model: jamba-large or jamba-mini (latest version of each). Example: jamba-mini. One of: `jamba-large`, `jamba-mini`.
documents
array
Optional
Documents to ground the answer in, each with content and optional metadata (a list of key/value objects). Example: [{"content": "Refunds are accepted within 30 days of purchase.", "metadata": [{"key": "title", "value": "Refund policy"}]}]
max_tokens
integer
Optional
Maximum tokens to generate, up to 4096. Example: 512.
n
integer
Optional
Number of responses to generate, 1 to 16 (temperature must be above 0 when more than 1). Example: 1.
response_format
object
Optional
Set to {"type": "json_object"} to make the model reply with valid JSON. Example: {"type": "json_object"}
stop
array
Optional
Strings that end the response when generated. Example: ["###"]
temperature
number
Optional
Sampling temperature from 0.0 to 2.0; higher is more varied. Defaults to 0.4. Example: 0.4.
tools
array
Optional
Functions the model may call, each {"type": "function", "function": {name, description, parameters}}. Example: [{"type": "function", "function": {"name": "get_order", "description": "Get an order by ID", "parameters": {"type": "object", "properties": {"order_id": {"ty...
top_p
number
Optional
Nucleus sampling from 0 to 1. Defaults to 1.0. Example: 0.9.
ai21_library_file_delete
Delete library file
ai21_library_file_download_link_get
Get library file download link
ai21_library_file_get
Get library file
ai21_library_file_update
Update library file
ai21_library_files_list
List library files
ai21_maestro_run_create
Create maestro run
ai21_maestro_run_get
Get maestro run
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// AI21 Studio tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["ai21"], toolNames: [
    "ai21_chat_completion_create",
    "ai21_maestro_run_create",
    "ai21_maestro_run_get"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Start a Maestro run to research this topic, then read the result when it completes" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["ai21"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Start a Maestro run to research this topic, then read the result when it completes" }],
  tools,
});

// Execute the tool call with the user's vaulted AI21 Studio access token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["ai21"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Start a Maestro run to research this topic, then read the result when it completes" }],
  tools,
});

// Tool call runs with the user's vaulted AI21 Studio access token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["ai21"] }, pageSize: 100,
});

const agent = new Agent({
  name: "language_model_agent",
  model: "gemini-2.5-pro",
  instruction: "AI21 Studio tools scoped to this user",
  tools,
});

await agent.run("Start a Maestro run to research this topic, then read the result when it completes");
Try these prompts
Copy any prompt into your agent. Each maps directly to a AI21 Studio tool. Click to copy, paste into your agent, done.
Chat
Copy the prompt
Copied
Summarize this clause in 2 sentences using a Jamba model.
Copy the prompt
Copied
Answer this question using only the documents I pass in.
Copy the prompt
Copied
Draft a reply to this customer email.
Maestro runs
Copy the prompt
Copied
Start a Maestro run to research this topic and check the output against my requirements.
Copy the prompt
Copied
Check the status of my Maestro run.
Copy the prompt
Copied
Get the result of the completed run.
Library files
Copy the prompt
Copied
List the files in my library with the label contracts.
Copy the prompt
Copied
Get a download link for this library file.
Copy the prompt
Copied
Update the labels on this library file.
SEE HOW AUTH WORKS
Each user connects their own AI21 Studio access token once, and Scalekit sends it with every call. Tokens stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
AI21 Studio
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
AI21 Studio
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
AI21 Studio
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
AI21 Studio
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other AI connectors.
Support and Ops Teams
Meeting prep
Pulls agenda, participant context, and open action items before every meeting.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Test other agents
See the same per-user auth pattern across other AI connectors.
OPS
Meeting prep agent
Assemble the agenda, HubSpot attendee history, and open action items from Gmail before every meeting on the calendar.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared token for AI21 Studio looks fine in a demo. In production every model call looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
AI21 Studio today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access AI21 Studio as the user or through a shared token?
As the user. Each user connects their own AI21 Studio access token once, and Scalekit sends it with every call. Audit logs attribute every completion and Maestro run to that user, not a shared service account.
Where is the AI21 Studio access token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new access token. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in AI21 Studio?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the chat and read tools without ai21_library_file_delete, which deletes a file from the library. Scalekit also enforces scope checks before every API call.
What happens when a user revokes AI21 Studio access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
What is a Maestro run?
ai21_maestro_run_create starts an agent that plans and executes a task from an instruction, checks the output against your requirements, and can use web search, file search over your library, HTTP tools, or MCP servers. Poll ai21_maestro_run_get until the status is completed.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""ai21"": {
""url"": ""https://mcp.scalekit.com/ai21"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.ai21]
url = ""https://mcp.scalekit.com/ai21""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""ai21"": {
""url"": ""https://mcp.scalekit.com/ai21"",
""type"": ""http""
}
}
}