Server and asset origins
SetMCP_URL to your server’s public origin (OAuth resource URL, API calls, CSP connectDomains):
MCP_ASSETS_URL when view JS/CSS and public/ files are served from a different prefix (CDN, Supabase Storage):
MCP_ASSETS_URL is unset, assets use the same origin as MCP_URL (or the request origin behind a proxy).
At mcp-use build, MCP_ASSETS_URL rewrites manifest paths to full https:// URLs for static upload workflows.
CSP merge order
On eachresources/read, the framework merges CSP in this order (high → low priority):
- Author
view.cspon the bound tool CSP_*_DOMAINSenv vars (per category) or theCSP_URLSshortcut- MCP auto-append:
MCP_URL→connectDomains; assets origin →resourceDomains
CSP_URLS and per-category env vars rank above MCP auto-append. Duplicate origins keep the higher-priority entry’s position.
Add domains for one view
Declare CSP on the tool’sview: config:
connectDomains, resourceDomains, frameDomains, baseUriDomains.
Global CSP env vars
UseCSP_URLS when every view needs the same extra domains (shortcut for all four categories):
Static deployments (Supabase / CDN)
When assets live on static storage and the MCP server runs elsewhere:Verify CSP
The mcp-use Inspector provides a CSP Mode Toggle for testing:- Permissive: Relaxed CSP for debugging
- Widget-Declared: Enforces the view’s declared CSP (production-like)
Next Steps
- MCP Apps: View overview and routing
- Supabase Deployment: Static deployment with CSP