Integrations
Connect your MCP server
By default the widget answers questions from your crawled site content. Connect an MCP server and it can also act on your product — checking a signed-in user's account, looking up their records, making changes they approve — using their own permissions, enforced by your API.
What this gives you
Your MCP server already describes what your product can do. Replyflow discovers those tools once, you choose which ones the widget may use, and from then on the assistant calls them mid-conversation and answers with real data. A worked example: DomainPilot connected theirs, and their users can now ask “what domains do I have?” or “point app.example.com at this IP” directly in the chat widget.
You do not write any glue code. There is no SDK to install and no callback endpoint to host — Replyflow speaks MCP to your server directly.
What your MCP server needs
Three things:
- Streamable HTTP transport, reachable over HTTPS at a stable URL (for example
https://mcp.yourapp.com/mcp). A stdio-only server — the kind you run locally with Claude Desktop — cannot be reached by Replyflow's servers. initializeandtools/listanswerable without a bearer token, so Replyflow can discover your tool schemas when you register the integration. Only the tool list is exposed — no user data.tools/callthat requires a bearer token and constructs its API client from that token per request. Never fall back to a server-wide credential: that is what keeps one user's call from reading another user's data.
Private, loopback and link-local addresses are rejected, as are non-HTTPS URLs (http://localhost is allowed in development only).
Choosing an auth mode
| Mode | The widget acts as | Use when |
|---|---|---|
Per-user token | the signed-in end user | the widget runs inside your logged-in app and should only ever touch that user's data. Most integrations want this. |
Static bearer | one shared service account | the tools read non-user-specific data (stock levels, shipping rates, a public catalog). |
None | an anonymous caller | your MCP server needs no credentials at all. |
Per-user tools are only offered to the model when a verified token is present. Anonymous visitors on a public page get ordinary question answering, never account access.
Passing per-user identity
For per-user mode, your page tells the widget who is signed in by calling Replyflow.identify(token) with a credential your backend minted. Add the stub snippet before the widget script so calls made during page load are not lost:
<script>window.Replyflow=window.Replyflow||{q:[],identify:function(t){this.q.push(['identify',t])}}</script>
<script async src="https://api.replyflow.chat/widget.js" data-site="YOUR_SITE_ID"></script>Then, once your app knows who the user is:
// after your session loads (re-run this on every page load / app mount)
const res = await fetch('/api/widget-token', { credentials: 'include' });
const { token } = await res.json();
window.Replyflow.identify(token);
// when the user signs out
window.Replyflow.clearIdentity();Only embed the widget on pages behind your login when you intend it to act as that user. On marketing pages, leave identity out entirely.
Minting session tokens
The token is minted by your backend and is opaque to Replyflow — it is forwarded to your MCP server as an Authorization: Bearer header and nothing else. Keep it short-lived, scope it to exactly what the tools need, and mint it from the logged-in session (never from a public endpoint).
# Rails — the pattern DomainPilot uses
# POST /api/v1/widget_tokens (session-authenticated, rate limited)
def create
token, plain = ApiToken.generate(current_user, expires_at: 30.minutes.from_now)
render json: { token: plain, expires_at: token.expires_at }, status: :created
end30 minutes is a good default. There is no refresh protocol: your app simply mints a fresh token and calls identify() again on the next page load.
Connecting it in Replyflow
In the dashboard, open Settings → Integrations and add your server:
- Give it a short name (lowercase letters, numbers, underscores). It prefixes your tools for the model, so
ordersbecomesorders__create_refund. - Paste the MCP server URL and pick an auth mode.
- Save. Replyflow calls
tools/listand shows everything it found. - Enable only the tools the assistant should use — everything arrives switched off.
Use Refresh after you ship new tools; your enable and approval settings are preserved by tool name. If your server is unreachable the integration is kept with the error shown, so nothing is lost to a transient outage. A site can hold up to three integrations.
Guiding the AI
Tool descriptions say what each tool does, one at a time. They cannot say how the tools work together, what your policy is, or what a customer's wording usually means. That goes in Instructions for the AI on the integration — free text the assistant sees whenever this integration's tools are available.
When someone says their site is down, check get_dns_records and
get_ssl_status before anything else — it is almost always one of those.
Always quote the renewal price and expiry date before calling renew_domain.
Never advise transferring a domain to another registrar.
Billing disputes: do not attempt a refund, hand off to a human.
search_domains is for NEW registrations only — never use it to look up a
domain the customer already owns.Guidance shapes behavior; it never widens permissions. It cannot enable a tool you switched off, and it cannot skip an Ask visitor first card — those stay enforced by Replyflow, whatever the text says.
Writes and visitor approval
Any tool can be flagged Ask visitor first. When the assistant calls one, nothing executes: the widget shows a card naming the tool and every argument, and waits.
- Approve runs the call with exactly the arguments shown — they are stored server-side when the card appears, so what the user saw is what executes.
- Cancel, a new message, or ten minutes of silence all decline it, and the assistant carries on.
Turn this on for anything that changes state, spends money, or sends a message. It is the control that makes it safe to expose write tools to a chat interface at all.
Security model
- Your API is the authority. Replyflow never interprets your permissions. A tool call can only do what the token allows, and your server decides that on every request.
- Tokens are pass-through only. They are held in memory for the length of one request, attached to the outbound MCP call, and never written to the database, the conversation transcript, logs, or anything the model can read.
- Prompt injection is assumed. Page content and visitor messages are untrusted input to the model. Confirmation-flagged tools are the boundary: injected text can at most produce a card the user must approve.
- Tools are bounded. Each call has a hard timeout and a turn can chain only a few before it must answer, so a failing server degrades a reply rather than hanging the chat.
Troubleshooting
Discovery failed when I saved
Check that the URL ends at your MCP endpoint (often /mcp), that it is HTTPS and publicly resolvable, and that tools/list answers without a bearer token. The exact error is shown on the integration.
The assistant answers from my site instead of calling a tool
Confirm the tool is enabled, and for per-user mode that the page actually called identify() — per-user tools are hidden from the model without a token. Tool descriptions matter too: say when to use it (“call this when the user asks about their current orders”), not just what it does.
Tool calls come back unauthorized
The token likely expired before the message was sent. Re-mint on page load, and check your server reads the bearer from the request rather than from its environment.
A tool never runs
It is probably flagged Ask visitor first and waiting on the card — expected for write tools.