Chat Integration
SynapseX Chat integrates with the MCP Router through a server-side Next.js proxy. The browser calls the Chat backend, and the backend forwards the request toapi-gateway with the correct credentials.
Chat Proxy Route
| Action | Gateway target | Purpose |
|---|---|---|
route | /v1/mcp/route | Select domain, MCP server and tool |
plan | /v1/mcp/plan | Create an explainable plan and approval gate |
ask | /v1/mcp/ask | Plan or execute when safe/approved |
execute | /v1/mcp/execute | Execute a structured request |
Auth Resolution
The proxy resolves credentials in this order:- Incoming
Authorizationheader. - Incoming
X-API-Keyheader. - Server-side
SYNAPSEX_API_KEYenvironment variable. - NextAuth session access token, when available.
Chat Service Methods
The client service methods live in:Recommended Chat UX
- Call
planIntelligentMcpfor domain-specific prompts. - Render the selected MCP, tool, risk, cost model and steps.
- If
requiresApprovalis true, require explicit user confirmation. - Call
askIntelligentMcpwithapprove: trueand structuredtoolInput. - Store outputs as artifacts through
workspace-servicewhen results should persist.
Environment Variables
| Variable | Purpose |
|---|---|
SYNAPSEX_API_GATEWAY_URL | Server-side gateway URL, defaults to NEXT_PUBLIC_API_GATEWAY_URL or http://localhost:8080 |
NEXT_PUBLIC_API_GATEWAY_URL | Browser-compatible gateway URL for existing direct client integrations |
SYNAPSEX_API_KEY | Optional server-side API key used by the Chat proxy |
QCOS Flow
Safety
- QCOS jobs require approval by default.
- VM operations require approval by default.
- Internal platform actions return a guided plan unless a direct executable tool is configured.
- The proxy avoids exposing API keys to the browser when
SYNAPSEX_API_KEYis configured server-side.