Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(MCP): allow HEAD method in CORS and improve request handling

nirholas6860ce99ad5a
diff --git a/api/mcp.js b/api/mcp.js
index b74cadd12..e3ffb5b72 100644
--- a/api/mcp.js
+++ b/api/mcp.js
@@ -8,9 +8,9 @@ import { send401, sendJsonRpcError, authenticateRequest, handleSse, handleTermin
import { sendX402Error } from './_mcp/payments.js';
export default wrap(async (req, res) => {
- if (cors(req, res, { methods: 'GET,POST,DELETE,OPTIONS' })) return;
+ if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS' })) return;
- if (req.method === 'GET') return handleSse(req, res);
+ if (req.method === 'GET' || req.method === 'HEAD') return handleSse(req, res);
if (req.method === 'DELETE') return handleTerminate(req, res);
if (req.method !== 'POST') return send401(res, 'method not supported');
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index 569bdc50b..fb34afe59 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -2277,65 +2277,6 @@
<TalkingHead bind:this={talkingHead} on:ready={onTalkingHeadReady} avatarUrl={$talkingHeadAvatarUrl || undefined} />
</div>
{/if}
-
- <div class="flex items-center gap-1.5">
- <!-- TTS toggle -->
- <button
- class="flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md ring-1 transition hover:bg-gray-50
- {$ttsEnabled ? 'ring-indigo-400' : 'ring-gray-200'}"
- title={$ttsEnabled ? 'TTS on — click to mute' : 'TTS off — click to enable voice'}
- on:click={() => ttsEnabled.update(v => !v)}
- >
- <Icon icon={feSpeaker} class="h-3.5 w-3.5 {$ttsEnabled ? 'text-indigo-500' : 'text-slate-400'}" />
- </button>
-
- <!-- TalkingHead toggle (when no agent-3d) -->
- {#if !effectiveAgentId}
- <button
- class="flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md ring-1 transition hover:bg-gray-50
- {$talkingHeadEnabled ? 'ring-indigo-400' : 'ring-gray-200'}"
- title={$talkingHeadEnabled ? 'Hide avatar' : 'Show 3D avatar'}
- on:click={() => {
- talkingHeadEnabled.update(v => !v);
- talkingHeadReady = false;
- pendingSpeak = null;
- }}
- >
- <Icon icon={feCpu} class="h-3.5 w-3.5 {$talkingHeadEnabled ? 'text-indigo-500' : 'text-slate-400'}" />
- </button>
- {/if}
-
- <!-- Agent picker -->
- <button
- class="flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md ring-1 ring-gray-200 transition hover:bg-gray-50"
- title="Choose agent avatar"
- on:click={() => (agentPickerOpen = !agentPickerOpen)}
- >
- <Icon icon={feUsers} class="h-3.5 w-3.5 text-slate-600" />
- </button>
-
- <!-- Agent settings (only when an agent is active) -->
- {#if $activeAgent}
- <button
- class="flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md ring-1 ring-gray-200 transition hover:bg-gray-50"
- title="Agent settings"
- on:click={() => (showAgentSettings = true)}
- >
- <Icon icon={feSettings} class="h-3.5 w-3.5 text-slate-600" />
- </button>
- {/if}
-
- <!-- Show/hide toggle (when agent-3d is set) -->
- {#if effectiveAgentId}
- <button
- class="flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md ring-1 ring-gray-200 transition hover:bg-gray-50"
- title={agentVisible ? 'Hide agent' : 'Show agent'}
- on:click={() => (agentVisible = !agentVisible)}
- >
- <Icon icon={agentVisible ? feX : feCpu} class="h-3.5 w-3.5 text-slate-600" />
- </button>
- {/if}
- </div>
</div>
{/if}
</ul>
diff --git a/src/viewer.js b/src/viewer.js
index 441d5645a..3614cecdd 100644
--- a/src/viewer.js
+++ b/src/viewer.js
@@ -1219,6 +1219,8 @@ export class Viewer {
this._animPanelEl = null;
}
+ if (this.options.kiosk) return;
+
const defs = this.animationManager.getAnimationDefs();
if (defs.length === 0) return;