Repository navigation
feat(skills): guide agents through file uploads over MCP - #25
Draft
xavierandueza wants to merge 1 commit into
Draft
xavierandueza wants to merge 1 commit into
xavierandueza wants to merge 1 commit into
Conversation
MCP has no file upload, so a file reaches ReadMe as a string inside execute-request. Add an 'Uploading files' section to managing-readme-docs: prefer the url param for hosted files, send local text files as a multipart param with fileName and contentType, copy contents exactly with code where possible, and use rdme or curl for binary files.
[Medium impact] This appears safe to merge in the deployment order stated by the author. Reviews (1) · Last reviewed commit: "feat(skills): guide agents through file ..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an Uploading files section to the
managing-readme-docsskill, plus "file uploads" in its description so agents load it for this case. The Codex and Cursor copies are re-synced.claude/skills/is left alone on purpose.Why
MCP has no file upload. Even the 2026-07-28 spec only takes JSON tool arguments, and its elicitation forms have no file field. So a file reaches ReadMe as a string inside
execute-request, and the MCP server builds the multipart request from it. Agents can't find the following out at runtime, so the skill now covers it:urlparam and ReadMe fetches the file. This is the best route for API definitions: nothing large goes through the tool call, and the content stays exact.value,fileNameandcontentType. WithoutfileNamethe part goes out as plain text and APIv2 rejects it ("We received a MIME type oftext/plain"). Agents should copy the contents with code where they can, because a model rewriting a file can change it. In testing, Claude minified the JSON.rdme openapi uploadorcurl. fetch-har sendsvalueas text, so base64 or a data URL would be stored as literal text.uriuntilupload.statusisdone, then compare the storedschemawith the file.Depends on readmeio/ai#1602
The
fileNameandcontentTypefields only reach APIv2 once readmeio/ai#1602 ships. Before that, the MCP server drops them, so the local-file route fails. Merge this after that PR is deployed. Theurlroute works today.Testing
Run locally: the AI service with readmeio/ai#1602 on
:9563, and ReadMemainon:3000.fileName: Claude Code and Codex agents, connected to the local MCP server, uploaded petstore OAS files withfileNameandcontentType. Neither prompt mentionedfileName. Both definitions reacheddone, and their stored paths matched the source files. Evidence is in readmeio/ai#1602.text/plainerror.urlroute: a multiparturlparam pointing at a public petstore definition returned 202, then reacheddone. It was stored aspetstore.jsonwith sourceurland all 14 paths. This was sent straight to APIv2, because the local MCP project had stopped serving tools. The MCP server already passes plain text params through unchanged.node scripts/sync-skills.mjs --check,node scripts/validate-skills.mjsandclaude plugin validate --strictall pass.