MCP: servers, clients & widget
AbstractAI speaks the Model Context Protocol in both directions.
Use an MCP server as a tool
Section titled “Use an MCP server as a tool”Any remote (Streamable HTTP) MCP server can be an assistant tool — see Tools → Remote MCP servers.
Every assistant is an MCP server
Section titled “Every assistant is an MCP server”A deployed assistant answers MCP at POST <endpoint>/mcp (Streamable HTTP, JSON replies). It exposes one tool, ask,
which runs the whole assistant — its instructions, model and tools — and returns the answer.
- If the assistant has an
ASSISTANT_API_KEYsecret, clients must sendAuthorization: Bearer <key>. - Tools that need approval never run over MCP; the call returns an error saying so.
Get the client config:
agent-platform mcp support-bot # checks /mcp, lists its tools, prints the configagent-platform mcp support-bot --key # include the keyThe deployment page has a Connect card with the same snippet.
{ "mcpServers": { "support-bot": { "url": "https://<endpoint>/mcp", "headers": { "Authorization": "Bearer <ASSISTANT_API_KEY>" } } }}assistant: tools: - type: mcp name: billing url: https://<billing-assistant>/mcp headers: { authorization: "Bearer ${BILLING_KEY}" }secrets: [BILLING_KEY]Host any stdio MCP server (kind: mcp-server)
Section titled “Host any stdio MCP server (kind: mcp-server)”Turn a local, stdio MCP server into a remote, authenticated one running in your cloud:
kind: mcp-servername: github-mcpcloud: aws # or gcp / azureregion: us-east-1mcpServer: command: npx -y @modelcontextprotocol/server-githubsecrets: [GITHUB_PERSONAL_ACCESS_TOKEN, MCP_API_KEY]agent-platform deployagent-platform mcp github-mcpThe server runs inside a small bridge and becomes reachable at POST <endpoint>/mcp.
- Shared session: the bridge starts the server once and shares it between clients, rewriting request ids so concurrent clients never collide.
- Restarts: if the server crashes it is restarted;
/healthanswers 503 until it’s ready. - Secrets reach the process as environment variables (how stdio servers read tokens). Give a hosted server only the secrets it needs.
- Auth: set
MCP_API_KEYto require it as a Bearer token. The bridge never passes its own key to the server. - Your own HTTP MCP server: deploy it with
kind: mcp-serverplussource.path; it’s built like any agent. - Today only Node (
npx) servers are supported forcommand.
Chat widget
Section titled “Chat widget”Put an assistant on your website with one script tag.
assistant: widget: origins: [https://www.example.com] # pages allowed to embed it title: Ask us greeting: Hi! How can I help? rateLimitPerMinute: 10 # per visitor IP<script src="https://<endpoint>/widget.js" async></script>- Browsers can’t hold the API key, so
/chatfrom the listed origins works withoutASSISTANT_API_KEY; everything else still needs it. - CORS is allowed only for the listed origins, and requests are rate-limited per IP.
- Visitors can never approve tools — a turn that needs approval tells them so.
- For https pages the endpoint must be https (put a custom domain in front if needed).