Skip to content

MCP: servers, clients & widget

AbstractAI speaks the Model Context Protocol in both directions.

Any remote (Streamable HTTP) MCP server can be an assistant tool — see Tools → Remote MCP servers.

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_KEY secret, clients must send Authorization: Bearer <key>.
  • Tools that need approval never run over MCP; the call returns an error saying so.

Get the client config:

Terminal window
agent-platform mcp support-bot # checks /mcp, lists its tools, prints the config
agent-platform mcp support-bot --key # include the key

The deployment page has a Connect card with the same snippet.

{
"mcpServers": {
"support-bot": {
"url": "https://<endpoint>/mcp",
"headers": { "Authorization": "Bearer <ASSISTANT_API_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-server
name: github-mcp
cloud: aws # or gcp / azure
region: us-east-1
mcpServer:
command: npx -y @modelcontextprotocol/server-github
secrets: [GITHUB_PERSONAL_ACCESS_TOKEN, MCP_API_KEY]
Terminal window
agent-platform deploy
agent-platform mcp github-mcp

The 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; /health answers 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_KEY to 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-server plus source.path; it’s built like any agent.
  • Today only Node (npx) servers are supported for command.

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 /chat from the listed origins works without ASSISTANT_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).