feat(mcp): hosted-asset upload + reference for the remote HTTP connector (tracking)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 12/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
This is a tracking issue for design work: it proposes a hosted-asset upload tool for the remote /mcp connector and explicitly says not to implement until decomposed and approved. Read the remote MCP tool definitions for primer_create_document and primer_add_version, plus the CSP/sanitizer config referenced in #68. Done means the open design questions (storage, CSP allowlist, access model, size caps) are answered and split into sub-issues.
Written by the indexing model from the issue text.
Description
Problem
On the remote HTTP connector (type: "http" → /mcp, used by Claude Web and Desktop) the upload tools are inline-only:
primer_create_document.inputSchema = { title, description?, content: z.string(), format }
primer_add_version.inputSchema = { documentId, content: z.string(), format, versionNote? }
The remote server runs on Primer's box and has no filesystem access, so the contentPath disk round-trip added in #76 cannot apply there. In the remote-connector topology the model is the only data path to the server — every byte that arrives as content was emitted by the model as tool-call output tokens. A document with a few hundred KB of inline SVG (or data: images) therefore pays that cost as output tokens on every version, and the whole payload re-transits on each primer_add_version.
This is the root cause behind "Claude Web still uploads hundreds of KB for documents with SVGs" — #76 solved it for the local stdio server (Claude Code / Codex) but the remote connector was never addressed and can't be addressed the same way.
Proposed direction (needs design + approval before implementation)
A hosted-asset upload + reference mechanism, extending the precedent set by #68 (Polygon brand fonts / hex-art served from /brand, referenced by URL from sandboxed artifacts):
- A remote MCP tool (e.g.
primer_upload_asset) that stores an asset once and returns a Primer-hosted URL (e.g./assets/<id>) the artifact HTML references instead of inlining bytes. - Artifacts reference assets by same-origin URL; the sandbox/CSP already permits same-origin
img/fontloads (proven by #68).
What this does and does not buy us:
- ✅ De-duplicates assets reused across versions; keeps the document small so re-versioning is cheap.
- ✅ Consistent with the existing sandbox/CSP model.
- ❌ Does not eliminate the first transmission — the model still emits the asset bytes once when calling the upload tool. There is no side channel around the model in the pure Claude Web case.
Open design questions (why this is triage, not agent-ready)
- Storage: reuse the existing version-content storage (
v1/<versionId>.htmlkey scheme) or a new asset namespace? Lifecycle / GC for orphaned assets? - CSP / sanitizer: exact allowlist changes to permit
/assets/<id>references from the sandboxed iframe. This touches CSP/sanitizer and per repo policy requires explicit approval before any change. - Access model: assets inherit the document's share-by-URL model, or separate?
- Ownership / size caps / content-type allowlist for uploaded assets.
Next step
Decompose into session-sized sub-issues once the design questions above are answered. Do not implement until decomposed and approved.
Related: skill-guidance sub-task (steer Claude Web away from large inline SVG in the meantime) — see the linked issue. Root-caused in the investigation of #76 / #77.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 13h 38m
- Merged PRs (30d)
- 24
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing 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.
More from 0xPolygon/primer
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Feature: @-mention people and agents in documents and comments; a mention notifies and subscribesOpen
Difficulty 5/5 Over a week Newbie friendliness 18/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
0xPolygon/primer#185 · 1 comment ·
Maintainers usually reply within 1 day
All issues in 0xPolygon/primer
Similar issues
-
P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug L3 level 1 needs-review wocs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
SatyamPandey-07/WorkSphere#10739 · 1 comment ·
Maintainers usually reply within 1 day
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
assistant-ui/assistant-ui#10946 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openclaw/openclaw#206303 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day