modelcontextprotocol / modelcontextprotocol/ext-apps

threejs-server example cannot work within current spec due to `unsafe-eval`

Open
#199 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

The three.js app uses this code:

https://github.com/modelcontextprotocol/ext-apps/blob/e514e6c745554f2aa18250116d0ada4c6bf0ffb2/examples/threejs-server/src/threejs-app.tsx#L122-L137

This requires the unsafe-eval CSP policy. However, the server does not define a CSP policy and from my understanding of the spec it should not be provided by default

https://github.com/modelcontextprotocol/ext-apps/blob/e514e6c745554f2aa18250116d0ada4c6bf0ffb2/specification/draft/apps.mdx?plain=1#L202-L211

Additionally, there is no way to make it work as the spec currently does not provide servers a way to request unsafe-eval:

https://github.com/modelcontextprotocol/ext-apps/blob/e514e6c745554f2aa18250116d0ada4c6bf0ffb2/specification/draft/apps.mdx?plain=1#L1411-L1426

To Reproduce
Steps to reproduce the behavior:

  1. Build a complient client with CSP policies
  2. Try to run the threejs example

You get an error:

Image

Expected behavior

I think the spec should be revised to support trusted types or let the UI request unsafe-eval

Logs
N/A

Additional context
N/A

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

Start by reproducing the threejs-server example with a CSP-enforcing client, then read the referenced code in examples/threejs-server/src/threejs-app.tsx and the CSP sections of specification/draft/apps.mdx. Determine whether the specification or example must change; done means the spec and example provide an agreed, runnable path without the current unsafe-eval failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
three.js, typescript
Domain
documentation, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.