plugin-mcp: auto-generated create tool for upload-enabled collections has no way to attach file content
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nodejs, typescript
Research direction
Start by tracing createRequestFromPayloadRequest through mcp-handler, then inspect convertCollectionSchemaToZod and mcp/tools/resource/create.js for how upload collection schemas and create arguments are handled. Done means an upload-enabled collection's generated create tool can receive file content and complete creation, including with the storage configurations described in the issue.
Written by the indexing model from the issue text.
Description
Summary
For any collection with upload: true, plugin-mcp's auto-generated create<Collection> tool can never succeed — it has no parameter for file content, so every call fails with MissingFile: No files were uploaded.
Reproduction
- Enable the plugin on an upload collection (e.g. Payload's own
Mediaexample) withcreatecapability on. - Call the generated tool, e.g.
createMedia, with the collection's writable fields (alt, etc.). - Call fails:
Error creating resource in collection "media": MissingFile: ...
Root cause (traced in the installed @payloadcms/[email protected] / [email protected]):
- The MCP endpoint hands the raw request to a generic JSON-RPC handler (
createRequestFromPayloadRequest→mcp-handler) — no multipart parsing anywhere in that path. - The tool's input schema is generated purely from the collection's field schema (
convertCollectionSchemaToZod), with no special-casing for upload collections — no file parameter is ever generated. - The generated handler (
mcp/tools/resource/create.js) forwards only the JSON fields topayload.create({ data, ... }), never settingfile. - Payload's own
generateFileData()checkpoint then finds neitherreq.filenor an explicitfileargument and throws.
This is independent of storage backend — local disk or S3, the create operation requires an attached file before it decides where to store it. Confirmed same failure against S3-backed storage.
Suggested fix direction, and offer to contribute: for collections with upload: true, the generated tool could accept a base64-encoded file argument and pass it through as file: { data: Buffer.from(base64, 'base64'), mimetype, name, size } on the Local API create() call (supported since #708). I've verified this works end-to-end (base64 round-trip + real S3 upload) as a standalone patch — happy to open a PR if that direction is welcome, or if there's a reason upload collections were intentionally left out, that'd be useful to know too.
Versions: @payloadcms/[email protected], [email protected], Postgres adapter, @payloadcms/storage-s3.
- Dominant language
- TypeScript
- Stars
- 45.5k
- Forks
- 4.3k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 302
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the 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 payloadcms/payload
-
WhereBuilder throws "Cannot read properties of undefined (reading 'value')" when the list URL filters on a field that is not filterablePossibly taken A pull request linked to this issue is open or already merged. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19002 · 1 comment ·
Maintainers usually reply within 1 day
-
Regression: `findByID` with `disableErrors: true` throws `NotFound` for null/empty ids since 3.91.0Possibly taken @Krrishkumar125 claimed this 6 days ago. Openarea: core Bug invalid-reproduction status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
payloadcms/payload#18935 · 2 comments ·
Maintainers usually reply within 1 day
-
bug: Local API call with req resets req.fallbackLocale to defaultLocalePossibly taken A pull request linked to this issue is open or already merged. Openarea: core Bug created-by: Contributor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#18768 ·
Maintainers usually reply within 1 day
-
[plugin-multi-tenant] Infinite redirect loop with custom tenantFieldName and isGlobal collectionsPossibly taken A pull request linked to this issue is open or already merged. OpenBug plugin: multi-tenant status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
payloadcms/payload#18690 ·
Maintainers usually reply within 1 day
-
Global update drops overrideAccess, so Local API updateGlobal fails filterOptions validation (3.90 regression)Possibly taken @PINYOPATTANAWASANPORN claimed this 14 days ago. Openarea: core Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#18674 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in payloadcms/payload
Similar issues
-
Plugin: sheet music can't be scrolled by hand before playbackPossibly taken @snakajima claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
receptron/jinglescript#51 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 9 days
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/openclaw#186424 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
chore(worker): five module header comments describe the code from before later issues changed itOpenarea:dev U2-later
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bentleypark/aiwatch#1824 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Pal-AI-Lab/Coopanion#469 ·
Maintainers usually reply within 1 day