Copy one line of code, paste it into your site, and your visitors get a ChatGPT-like chat experience powered by your own MCP server.
Grab the script tag below and paste it into your website's HTML, just before the closing </body> tag.
Replace the data-api-url with the URL of your AI agent / MCP server endpoint. The widget will POST messages there and stream back responses.
A chat bubble appears on your site. Visitors click it and get a full ChatGPT-style conversation with your AI agent.
Copy this snippet and add it to your website. The widget will appear automatically.
<script
src="https://YOUR-DOMAIN.com/widget.js"
data-api-url="https://YOUR-API-ENDPOINT.com/chat"
data-title="Chat with us"
data-subtitle="Ask me anything"
data-color="#2563eb"
data-position="right"
data-placeholder="Type a message…">
</script>
| Attribute | Description | Default |
|---|---|---|
data-api-url |
Your AI endpoint URL. The widget POSTs { messages: [...] } here. |
Demo mode |
data-title |
Header title shown in the chat panel | Chat with us |
data-subtitle |
Header subtitle | Ask me anything |
data-color |
Primary accent color (hex) | #2563eb |
data-position |
Bubble position: right or left |
right |
data-placeholder |
Input placeholder text | Type a message… |
Your endpoint should accept POST requests with this body and return a streaming response (SSE or plain text):
{
"messages": [
{ "role": "user", "content": "Hello!" },
{ "role": "assistant", "content": "Hi there!" },
{ "role": "user", "content": "What can you do?" }
]
}