Important Note
Client-side MCP servers require custom development and cannot be used directly in:- Dust Web Application
- Official Dust browser extensions
What It Enables
This client-side integration pattern allows you to:- Expose local tools and functionality to Dust conversations at runtime through your client applications
- Keep sensitive operations and data within your control by executing tools in your client’s environment
- Dynamically register and provide tools based on the user’s context or permissions
- Integrate internal services and systems with Dust while maintaining full control over the execution environment
Key Concepts
- Client-side Execution: Unlike custom MCP servers that run as standalone services, client-side MCP tools execute directly in your client application’s environment when it interacts with Dust through the Conversations API.
- Dynamic Registration: Tools are registered at runtime when your application creates or updates a conversation, allowing you to dynamically control which tools are available based on the user’s context.
- Conversation-scoped: The tools you register are available specifically for the conversations created by your client application, ensuring proper isolation and control.
Implementation Requirements
- Development skills in TypeScript/JavaScript (recommended) or other languages supporting the MCP protocol
- Access to Dust’s public API with OAuth authentication
Authentication & Security
- Only works with OAuth personal access tokens
- API Keys are not supported
Implementation
Our SDK provides aDustMcpServerTransport that handles all the communication complexity with Dust. This lets you focus solely on implementing your tools’ business logic. For other languages see below.
Real-World Example: Integrating Dust in Your Application’s Interface
Let’s say you’re building a ticketing system web application and want to expose its functionality to Dust agents directly from your application’s interface. This example shows how to create a client-side MCP server that exposes the same actions available in your UI to Dust:Using the Server in Conversations/Messages
When starting a conversation or posting a message with Dust, include the server ID you received from getServerId():- Search your ticket system
- Update ticket statuses
- Reassign tickets
- Add comments
- When a user opens your ticketing system UI, your application creates a new client-side MCP server instance
- The server exposes a subset of your UI’s capabilities as tools (searching and updating tickets)
- Each client (browser tab/window) maintains its own server instance
- When the user navigates away or closes the tab, the server instance is terminated
Technical Architecture
Client-side MCP servers follow a distributed architecture where:- Per-Client Instances: Each client (browser tab, application window) runs its own independent server instance
- Session Binding: Server instances are bound to your application’s user session and execution context
- Instance Lifecycle: Servers exist only while your client application is running and are automatically terminated when the client closes
- Independent Communication: Each instance maintains its own connection with Dust through:
- Server-Sent Events (SSE) for receiving requests
- HTTP POST endpoints for registration, heartbeat, and sending results
Implementing Your Own Transport
If you’re not using our TypeScript/JavaScript SDK, you’ll need to implement the following protocol:1. Server Registration
Each server is registered by providing a name. The server will be registered for the currently authenticated user. The registration is valid for 5 minutes unless the server continuously sends heartbeats (see endpoint documentation):http
serverId that you’ll need for all subsequent calls.
2.Heartbeat Mechanism
To keep the server active so Dust knows that it can be used by your agent, the transport must implement heartbeat behavior. There must be no more than 5 minutes between two heartbeats. This is required so Dust knows that the server is still active and can still be used:http
serverId retrieved from the registration must be used in the body of this API call.
3. Listening for Requests
Connect to the SSE endpoint to receive tool execution requests:http
transport.onmessage() with the event payload.
4. Sending Results
To post back results, thesend function of the transport must POST results to:
http