modelcontextprotocol / modelcontextprotocol/ext-apps

[Proposal] Features for speeding up slow Python/ Pyodide based apps

Open
#513 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2.9k
Forks
387
Avg merge
3h 21m
Merged PRs (30d)
6

Description

MCP Apps: Pyodide/WASM apps take >2 minutes to load in Claude.ai webview

Summary

MCP Apps that use Pyodide (Python in WebAssembly) take over 2 minutes to load in Claude.ai's MCP App webview. The same app loads in ~5 seconds in VS Code Copilot Chat.

Claude believes the root cause is that Claude.ai's webview does not set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers, so window.crossOriginIsolated is false and Pyodide cannot use SharedArrayBuffer.

Reproduction

  1. Start an MCP server that returns an MCP App using Pyodide:
    pip install "panel-live[mcp] @ git+https://github.com/panel-extensions/panel-live.git"
    panel-live mcp --transport streamable-http --port 5002
    
  2. Expose via ngrok: ngrok http 5002
  3. In Claude.ai: Settings > Connectors > Add custom connector > paste ngrok URL + /mcp
  4. Ask: "Create an interactive sine wave with a frequency slider"
  5. Observe: the MCP App webview shows "Loading Python runtime..." for >2 minutes

The same flow in VS Code Copilot Chat (which Claude claims provides COOP/COEP headers) loads in ~5 seconds.

Expected behavior

MCP App webviews should set these HTTP headers on the iframe/webview:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

This enables window.crossOriginIsolated = true, which allows SharedArrayBuffer, which Pyodide uses for efficient memory sharing between the main thread and workers.

Why this matters

Pyodide (Python in WebAssembly) is the runtime behind panel-live MCP tool that render interactive data apps in chat.

Without cross-origin isolation, Pyodide falls back to a slow single-threaded path. The 2+ minute load time makes the experience impractical for users.

Environment

  • Claude.ai web (Pro plan)
  • MCP server: panel-live with FastMCP 3.0.2, streamable-http transport
  • Tunnel: ngrok
  • Browser: Chrome (latest)

Gif

This gif is speeded up 10 times. You can see that panel-live can load. But it takes +2 mins.

Image

Workaround

According to Claude VS Code Copilot Chat provides COOP/COEP headers

Panel Live loads in ~5 seconds.

Image

Claude.ai

Reported in 215473300183121.

Latest Updates

Please refer to https://panel-extensions.github.io/panel-live/tutorials/getting-started-mcp/ for the latest updates for installing and using the panel-live MCP server.

Please report issues at https://github.com/panel-extensions/panel-live.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the MCP App webview handling and how iframe response headers are provided; the report identifies missing COOP/COEP headers as the suspected cause. Reproduce with the panel-live Pyodide example using the listed pip and ngrok setup, then verify that crossOriginIsolated is enabled and loading time improves toward the reported VS Code result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript, wasm
Domain
frontend, performance, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.