PromptLayer MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with PromptLayer MCP or direct API to version prompts, run evaluations, inspect request logs, and analyze LLM performance through natural language.

PromptLayer logoPromptLayer
Api Key

PromptLayer is a prompt management and observability platform for LLM apps. Use it to version prompts, run evaluations, trace requests, and analyze model behavior.

16 Tools

Try PromptLayer now

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

TOOL ROUTER PLAYGROUND
PromptLayer
Try asking
TOOLS

Supported Tools

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

Get Prompt Template

Retrieve a prompt template version, release label, messages, model metadata, snippets, and optionally provider-ready kwargs without executing it.

Get Registered Tool

Retrieve a PromptLayer registered tool definition by ID or name at a selected version or release label without test execution.

Get Request Log

Retrieve one PromptLayer request log with its recorded input, output, timing, usage, metadata, tags, and scores.

Get Skill Collection

Retrieve a PromptLayer skill collection and its files as JSON at a selected version or release label.

Get Table

Retrieve one PromptLayer Table's metadata and per-sheet row counts by UUID.

Get Workflow

Retrieve a PromptLayer workflow definition by ID or name at a specific version or release label without running it.

List Folder Entities

Browse or search PromptLayer folders and registry entities in the API-key workspace, optionally recursively and with metadata.

List Prompt Templates

Search and page through PromptLayer prompt templates and snippets without executing a model.

List Registered Tools

List and filter tools defined in PromptLayer's tool registry without executing them.

List Skill Collections

List and filter PromptLayer skill collections available in the API-key workspace.

List Table Columns

List one page of user and optionally system columns for a PromptLayer Table sheet.

List Table Rows

Read one page of rows and cells from a PromptLayer Table sheet, with optional schema and execution aggregates.

List Tables

Search and page through PromptLayer Tables by folder, name, or referenced prompt.

List Table Sheets

List one page of sheets in a PromptLayer Table, optionally filtering by referenced prompt.

List Workflows

Search and page through PromptLayer workflows without running them.

Search Request Logs

Search PromptLayer request logs by text or structured filters and return one rate-limited page sorted by operational fields.

SETUP GUIDE

Connect PromptLayer 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: ["promptlayer"],
  mcp: true,
});
Create a session scoped to PromptLayer 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: "List failed PromptLayer requests from the last 24 hours and summarize the main error patterns",
  stopWhen: stepCountIs(10),
});

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

Connect PromptLayer 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: ["promptlayer"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to PromptLayer
3

Run PromptLayer tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "List failed PromptLayer requests from the last 24 hours and summarize the main error patterns" }],
});

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 PromptLayer tool calls through the session, and print the final answer

Why Use Composio?

AI Native PromptLayer Integration

  • Supports both PromptLayer MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable prompt, log, and evaluation workflows
  • Rich coverage for reading, writing, and querying your PromptLayer data without bespoke integration code

Managed Auth

  • PromptLayer uses API key auth, and Composio keeps those keys out of your agent code
  • Create auth configs with auth_configs.create() and link user accounts with connected_accounts.link()
  • Use per user and per environment credentials instead of hard-coded PromptLayer keys

Agent Optimized Design

  • Tools are tuned for LLMs, so agents can safely inspect PromptLayer runs, evaluations, and prompt versions
  • Comprehensive execution logs help you see what ran, when, and on whose behalf
  • Use mcp.create() or Tool Router sessions to connect PromptLayer to Claude, ChatGPT, Cursor, and other agents

Enterprise Grade Security

  • Fine-grained RBAC helps you control which agents and users can access PromptLayer
  • Scoped, least privilege access keeps PromptLayer prompt and observability data protected
  • Full audit trails make agent activity easier to review, debug, and govern
FAQ

Frequently asked questions

Yes, PromptLayer requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Yes. Composio is SOC 2 Type II compliant and is built to keep your PromptLayer connection and credentials secure. OAuth tokens and API keys are encrypted, and sensitive customer data is protected at rest and in transit.

Composio also undergoes independent security testing and continuously monitors its systems for security threats. You can review the latest reports and policies in the Composio Trust Center.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Create the key in your PromptLayer account settings, then paste it once on Composio's connection page. Composio stores it encrypted and uses it only for the PromptLayer actions your agent runs. Nobody else in your workspace can read it, and you can revoke it inside PromptLayer at any time.

When you connect a PromptLayer account through Composio, every action runs under that account, so anything the agent creates, sends, or changes shows up in PromptLayer as done by you. Keep an approval step in your prompt for actions with side effects, such as sending or deleting, and have the agent draft first.

Whatever the credentials you connect allow inside PromptLayer. If PromptLayer lets you scope a key to specific permissions, create a scoped one so the agent can only do what you intend. You can revoke the key inside PromptLayer at any time.

Yes. Composio supports multiple connected accounts for the same app, and that works in Claude, ChatGPT, or any other assistant you connect through Composio. Give each PromptLayer connection a name such as work or personal, and the assistant uses the one you mention in the request. Each account keeps its own credentials and nothing is merged.

The connection stops working the moment PromptLayer rejects the old key. Create a new key in PromptLayer and reconnect the account from the Composio dashboard or by asking your agent to reconnect PromptLayer. Nothing else changes.

Composio's free Hobby plan includes 100,000 tool calls per month with no credit card, which covers most personal PromptLayer use. Paid plans add higher limits and team features. Your PromptLayer plan and its API limits still apply as usual.

Built-in connectors usually give one AI access to a limited set of apps. Many people use Composio because it lets their AI connect to more apps than it normally supports, or connect to multiple accounts for the same app (e.g. connect Claude to multiple PromptLayer accounts).

With Composio, you connect PromptLayer once and then use it across different AI assistants without setting it up separately in each one. Connect your apps to Composio once, then connect Composio to whichever AI you use, whether that's Claude, ChatGPT, Hermes, or your own custom assistant.

Start with PromptLayer.It takes 30 seconds.

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

Start building