Agent chat widget and headless client
Every MCP server can also be reached as a conversational agent: no MCP client or AI tool required on the other end. Turn on Agent in your MCP server settings to get an agent endpoint, ready to plug into an embeddable Bump.sh chat widget or your own interface.
The agent uses the workflows of your MCP server as its tools, with the same secrets and access rules. You define your tools once: AI tools reach them through the MCP server, your users through the agent. Each deployment of your workflow document updates both. Agent calls show up in your MCP server logs, with Agent as their source.
The agent is available as an add-on to the Pro plan. Without it, the Agent toggle shows an upgrade button.

The agent endpoint follows the format https://run.bump.sh/ORGANIZATION_SLUG/MCP_SERVER_SLUG/agent, or your https://your-custom-domain.com/agent if you set one up.
From there, you have two ways to build on it, both from the open-source agent-client SDK:
| What it does | Use it when | |
|---|---|---|
| Chat widget | A ready-to-use, embeddable chat UI (Web Component). | You want to add a working chat widget to your app in a few lines of code. |
| Headless client | A dependency-free client that streams the conversation, with no interface. | You’re building your own UI: a Slack bot, a CLI, a custom chat panel, … |
Choose an AI model #
Once Agent is turned on, you can pick the LLM that powers it in your MCP server settings. A basic model is provided for free so you can test the agent right away (limits apply). For production, switch to a more capable model with your own provider and API key.
| Provider | Model | API key |
|---|---|---|
| Bump.sh (default) | Claude Haiku | Not needed |
| Any major AI provider (Anthropic, OpenAI, Mistral, Google, …) | Any model from that provider that supports tool calling | Your own key for that provider |
Once sent, the API key is stored on the data plane and can’t be retrieved. Switching to another model or turning Agent off deletes the API key from the data plane.

Chat widget #
A ready-to-use chat widget for your product, so your own users can run your workflows straight from your app in natural language: no external LLM tool or MCP client needed on their end. It’s a Web Component that can easily be added to your page in HTML or JavaScript.
It’s live on this page: hit the button below and ask it anything about the weather.

Try it in the playground #
Before writing any code, test and customize the chat widget against your real endpoint in the playground.
You can find a playground link pre-filled with the agent endpoint in your MCP server settings.
Every option you tweak (mode, theme, title, greeting, …) is reflected live in the preview. The code panel gives you the JS or HTML snippet to copy into your app to get your customized chat widget live.

Install and embed #
@bump-sh/agent-widget provides a chat panel and an access button in a few lines of code. It has no dependencies and stays isolated from your page’s styles (Shadow DOM).
npm install @bump-sh/agent-widget
import { Widget } from "@bump-sh/agent-widget"
new Widget({ endpoint: "https://run.bump.sh/ORGANIZATION_SLUG/MCP_SERVER_SLUG/agent" })
Or declaratively, straight from a CDN, with no build step:
<agent-widget endpoint="https://run.bump.sh/ORGANIZATION_SLUG/MCP_SERVER_SLUG/agent"></agent-widget>
<script type="module" src="https://unpkg.com/@bump-sh/agent-widget"></script>
Display modes #
| Mode | Behavior |
|---|---|
modal (default) |
Access button that opens a centered chat window. |
sidebar |
Access button that opens a chat panel docked to the side. |
inline |
Always-open chat, mounted directly into an element on your page (target). |
Here, mode switches to the always-open layout inline, and target gives the CSS selector of the element to add it into.
new Widget({ endpoint, mode: "inline", target: "#chat" })
Customization #
Most of the widget’s UI is customizable through options passed to new Widget({ ... }). Here’s a list of the most commonly used:
| Option | Description |
|---|---|
title, greeting, suggestions |
Header text, optional opening message, clickable example prompts. |
theme |
Common CSS tokens (accent, bg, text, font, radius, …). |
See the widget README for the complete list of options.
Headless client #
If you’d rather build your own UI, use @bump-sh/agent-conversation directly: it’s the same streaming client the widget is built on, with no interface attached.
npm install @bump-sh/agent-conversation
import { Conversation } from "@bump-sh/agent-conversation"
const conversation = new Conversation({ endpoint: "https://…/agent" })
// await the full reply…
const reply = await conversation.send("What's the weather in Paris?")
// …or stream every event
for await (const event of conversation.send("And in Lyon?")) {
if (event.type === "text") append(event.delta)
}
Events, error handling, cancellation, and the wire protocol are covered in the conversation README.
AG-UI protocol #
The agent endpoint speaks AG-UI, an open protocol between agents and user interfaces. Each message sent is one AG-UI run: the client posts the conversation, and the endpoint streams back events (text, tool calls, tool results) as server-sent events. The agent runs your MCP server tools itself and reports them as they go.
Any AG-UI client, like CopilotKit, can connect to the agent endpoint instead of the Bump.sh packages.
Frontend tools #
Frontend tools let the agent act on the page where it lives: open a record, fill a form, apply a filter, read what the user selected. A frontend tool is a JavaScript function of your page. The agent can call it, next to the tools of your MCP server.
const widget = new Widget({
endpoint,
frontendTools: [
{
name: "get_selection",
description: "Get the trips the user selected in the table",
execute: () => table.selectedRows(),
},
],
})
For a part of the page that comes and goes, add the tool while it is on screen, and remove it after:
widget.addFrontendTool({
name: "open_booking",
description: "Open a booking on the page",
parameters: {
type: "object",
properties: { bookingId: { type: "string" } },
required: ["bookingId"],
},
execute: ({ bookingId }) => showBooking(bookingId),
confirm: "Open booking {args.bookingId}",
})
widget.removeFrontendTool("open_booking")
| Property | Description |
|---|---|
name (required) |
Letters, digits, _ or -, 64 characters at most. It must differ from the names of your MCP server tools, or the agent refuses the run. |
description (required) |
What the tool does and when to use it. The agent decides from this text. |
execute (required) |
The function to run. The agent reads its return value: a string as is, undefined as “Done.”, anything else as JSON. If it throws, the error goes to the agent, which tells the user. |
parameters |
A JSON schema of the arguments execute receives. Arguments are validated against it. |
confirm |
A button label. The tool then waits for the user to click it before it runs. Use {args.bookingId} to show an argument, or pass a function (args) => string. |
Without confirm, the tool runs as soon as the agent calls it, and the agent goes on with its result in the same reply. With confirm, the agent offers a button instead of acting on its own. The tool runs when the user clicks it, and the agent reads its result with the next message.
A reply chains at most 10 runs on frontend tools: a model calling them in a loop can’t run forever.
Frontend tools work the same way with the headless client: new Conversation({ endpoint, frontendTools }), then conversation.addFrontendTool() and conversation.removeFrontendTool().
Adapt the agent to its page #
A widget on a documentation page doesn’t need the same tools as one in a checkout flow. Two options adapt the agent to where it lives:
allowedTools: the names of the MCP server tools the agent can use. Left out, every tool is available. An unknown name makes the request fail. Frontend tools don’t go in this list.agentContext: key-value pairs describing the page, like its name or the user’s locale (4 KB at most). The agent reads them as information, never as instructions.
new Widget({
endpoint,
allowedTools: ["search_trips", "get_trip"],
agentContext: { page: "Trip search", locale: "en-GB" },
})
The same options work on the headless client.
Authentication and per-user data #
Your workflow might need something specific to the current user: a personal API key, a workspace ID, … You can pass it in from the client. Each can be a static value or a function called again on every request, handy for a token that expires:
token: sent asAuthorization: Bearer <token>, available in your workflow as$current_user.token. You should use a short-lived, user-scoped token.config: sent asConfig-<Key>headers, available as$config.<key>runtime expression in your workflow definition. Aheadersoption covers any other custom header.
new Widget({
endpoint,
token: async () => (await fetch("/agent-token")).text(),
config: { locale: "fr" },
})
The same options work on the headless client: new Conversation({ endpoint, token, config }).
See Secrets and config for how these values are used inside a workflow.
Limits #
- The agent endpoint accepts up to 30 runs a minute from one IP address. A frontend tool that runs right away costs a second run in the same reply.
- A request is 1 MB at most, conversation history included.