Blog · July 22, 2026 · 7 min read
Ship a support agent from Claude Code in 5 minutes
Claude Code connects to SyntheticBrew over MCP and provisions the whole thing itself: the agent, a knowledge base from your docs, and the embeddable widget.
Most "add an AI support agent to your site" products assume you want to spend an afternoon in a web dashboard: create an account, click through a wizard, upload files, copy a snippet. If you already live in a coding agent, there's a shorter path: let the agent do it.
SyntheticBrew ships a native MCP server. That means Claude Code can connect to it over OAuth, and then provision the whole thing itself — the agent, the knowledge base that grounds it in your docs, and the embeddable widget for your website. Your job is to paste one line and approve one browser prompt.
This is a walkthrough of exactly that flow, run against production. Everything below is what actually happens — including the rough edges, which we'll get to at the end.
What you get
By the end of this tutorial you'll have:
- A support agent hosted on SyntheticBrew Cloud, with instructions tailored to your product.
- A knowledge base built from your docs (markdown or plain text), so the agent answers from your content instead of hallucinating, and says "I don't know" when the answer isn't there.
- An embeddable
<script>widget you paste into your website's HTML, backed by a chat-scoped key. - A reproducible setup: the whole deployment came from one prompt, so you can re-run it, tweak it, or tear it down from the same chat session.
SyntheticBrew itself is a source-available agent engine (BSL 1.1) — you can self-host it, but this tutorial uses the hosted cloud because that's the five-minute path.
Prerequisites
- Claude Code installed and working in a terminal — or any coding agent that speaks MCP: the same instruction file carries setup for Cursor, VS Code Copilot, Windsurf, Zed, Codex CLI and Gemini CLI. This walkthrough uses Claude Code.
- A syntheticbrew.ai account (free) — the OAuth step sends you to a browser sign-in, and there's a Sign Up link right there if you don't have one yet.
- Your docs in markdown or text — a FAQ, a README, a pricing page. One good file is enough to see grounding work.
No API keys to copy, no SDK to install, no config files to hand-edit.
Step 0 — The one-liner
Open Claude Code in any directory and paste:
Fetch https://syntheticbrew.ai/agent-setup/prompt.md and follow the instructions. That URL serves a plain-markdown instruction file — you can open it in a browser first if you want to read what your agent is about to do (you should; it's short). It tells the coding agent to connect to SyntheticBrew's MCP server, then walks it through building the support agent step by step. The instructions explicitly tell the agent to only interrupt you when a step requires it — so from here on, you're mostly watching.
Step 1 — Connect (OAuth, one browser click)
The first thing Claude Code does is register the MCP server:
claude mcp add --transport http syntheticbrew https://app.syntheticbrew.ai/api/v1/mcp/rpc Then it asks you to run /mcp inside Claude Code and pick syntheticbrew. A browser window opens, you sign in to your SyntheticBrew account, and approve access. That's the entire auth ceremony — no key generation, no token pasting.
Under the hood this is a standard OAuth 2.1 flow: Claude Code dynamically registers itself as a client, runs a PKCE authorization, and receives a token scoped to provision manage — plus a refresh token, so the connection survives beyond the first session. More on why this matters in the "under the hood" section.
Once connected, Claude Code sees the SyntheticBrew toolset — 39 MCP tools covering agents, knowledge bases, documents, models, and the embed snippet. The setup prompt only needs seven of them.
Step 2 — Watch it build
The instruction file asks you exactly two questions: what is your product about, and what should the agent be called (default: support). Answer those, then the agent works through the build:
1. Provision the agent. A call to provision_agent creates the agent with baseline instructions: answer customer questions about your product, stay grounded, and prefer "I don't know" over inventing an answer. In the production run this was a single call returning the new agent's ID.
2. Refine the instructions. Using the product context you gave it, Claude Code calls admin_update_agent to write a system prompt that actually knows what your product is — not a generic support template.
3. Ground it in your docs. This is the part that makes the agent useful rather than decorative:
admin_create_knowledge_basecreates a knowledge base — the embedding model is picked automatically; you don't choose one.admin_add_documentuploads your markdown/text docs. Point Claude Code at local files, or at pages you want it to fetch. Indexing is asynchronous.admin_link_knowledge_baseattaches the KB to your agent — the knowledge capability switches on automatically with the link; there's no separate toggle to remember.- The agent polls
admin_list_documentsuntil your documents reportready. In the production run, a small markdown doc was indexed by the first poll — about five seconds.
4. Hand over the widget. get_embed_snippet returns a ready-to-paste <script> tag with a chat-scoped key — a key that can talk to the chat endpoint and nothing else, which is what you want in public HTML.
5. Suggest a test question. The prompt tells the agent to propose a question whose answer lives in your uploaded docs, so the first thing you see is a grounded answer.
In the production e2e run, the test document contained an upload-limit spec, the test question asked about it, and the streamed answer came back with the correct figure straight from the doc — grounding verified end to end, on the first try. To be precise about the "five minutes": the engine-side steps are fast (OAuth takes seconds, knowledge-base indexing was ready in about five seconds in our run). Most of the wall clock is your coding agent reading instructions and calling tools, so expect five to ten minutes end to end depending on the agent and your docs.
Step 3 — Put it on your site
Here's the part that makes this feel complete: if you ran the prompt inside your website's repo, Claude Code doesn't just hand you the snippet — it offers to add it to your site layout itself, shows you the exact change, and applies it once you agree. You review a one-line diff, deploy, and the chat widget is live. (Not in your website's project? Paste the snippet before </body> yourself — it works the same.)
Everything the agent built is also visible in the SyntheticBrew dashboard: the agent, its knowledge base, document indexing status, and conversations once real traffic arrives. The dashboard's activation checklist flips automatically as each piece comes alive — you don't need to touch it during setup, but it's where you'll live afterwards: reading conversations, updating docs, adjusting instructions.
And because the whole deployment came from one prompt, it's reproducible. Re-run the prompt and you get the same setup; ask Claude Code to update the system prompt or swap a document and it uses the same tools it used to build it.
What's under the hood
Two standards do the heavy lifting here, and the details matter: they're the reason this doesn't feel like a vendor lock-in trick.
MCP (Model Context Protocol). SyntheticBrew's MCP server is a plain streamable-HTTP endpoint (/api/v1/mcp/rpc) listed in the official MCP registry. Claude Code is just an MCP client — the same instruction file carries connection sections for Cursor, VS Code Copilot, Codex CLI, Windsurf, Zed, and Gemini CLI. Nothing in the flow is Claude-Code-specific; the tools are the product's real admin surface, not a demo shim.
OAuth 2.1 with dynamic client registration. Your coding agent never sees a long-lived API key. It registers itself as an OAuth client, runs PKCE, and gets a token scoped to provisioning and management. You approve access once in the browser, in your own session; you can revoke it from your account. This is the difference between "paste your admin key into a config file" and an auth flow you'd accept from any serious SaaS.
The result: your editor becomes the admin console, with real auth, against a documented protocol.
Honest limitations
A tutorial that hides the rough edges wastes your time, so here's what to expect:
- Raw retrieval output leaks into the stream. Before the final answer, the response stream currently includes the raw "Knowledge search results" the agent retrieved — visible in the widget too. The final answer is fine; the preamble is noise. It's a known issue.
- No knowledge-base deletion over MCP. The toolset can delete documents and agents, but not knowledge bases — so your coding agent can't fully roll back its own work. Deleting a knowledge base currently means the dashboard or the REST API.
- Tool schemas are strict. Field names are exact (
system_prompt, notinstructions; session IDs must be UUIDs). Coding agents read the tool schemas so this mostly self-corrects, but if a call fails, expect the agent to retry once with fixed arguments rather than sail through flawlessly. - Grounding is the honest sell — nothing else is. This flow gives you a doc-grounded Q&A widget. SyntheticBrew has more machinery (multi-agent delegation, memory), but this tutorial deliberately doesn't lean on it — the grounded support agent is the part that's solid enough to put in front of your users today.
- Small docs index in seconds; large ones take longer. The five-second indexing above was one markdown file. Budget more for a real documentation set, and let the polling step do its job.
Try it
One line, one browser approval, one paste into your HTML:
Fetch https://syntheticbrew.ai/agent-setup/prompt.md and follow the instructions. The engine is source-available if you'd rather read the code first — or self-host the whole thing and run the same flow against your own deployment.
Keep reading
See the runtime behind the argument.
SyntheticBrew is open source — inspect the code, self-host it free, or book a call and have us deliver the implementation.