modelcontextprotocol / modelcontextprotocol/ext-apps
threejs-server example cannot work within current spec due to `unsafe-eval`
Nobody has claimed this yet.
- 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:
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
Additionally, there is no way to make it work as the spec currently does not provide servers a way to request unsafe-eval:
To Reproduce
Steps to reproduce the behavior:
- Build a complient client with CSP policies
- Try to run the threejs example
You get an error:
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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