Skip to content

feat(skills): guide agents through file uploads over MCP - #25

Draft
xavierandueza wants to merge 1 commit into
mainfrom
feature/mcp-file-uploads
Draft

xavierandueza wants to merge 1 commit into
mainfrom
feature/mcp-file-uploads

Conversation

@xavierandueza

Copy link
Copy Markdown
Contributor

What

Adds an Uploading files section to the managing-readme-docs skill, 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:

  • Hosted file: send the multipart url param 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.
  • Local text file: send a param with value, fileName and contentType. Without fileName the part goes out as plain text and APIv2 rejects it ("We received a MIME type of text/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.
  • Binary file, or one the agent can't copy exactly: use rdme openapi upload or curl. fetch-har sends value as text, so base64 or a data URL would be stored as literal text.
  • After uploading: poll the returned uri until upload.status is done, then compare the stored schema with the file.

Depends on readmeio/ai#1602

The fileName and contentType fields 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. The url route works today.

Testing

Run locally: the AI service with readmeio/ai#1602 on :9563, and ReadMe main on :3000.

  • Local file with fileName: Claude Code and Codex agents, connected to the local MCP server, uploaded petstore OAS files with fileName and contentType. Neither prompt mentioned fileName. Both definitions reached done, and their stored paths matched the source files. Evidence is in readmeio/ai#1602.
  • Local file without the fix: the same call against the MCP server without the fix got the 422 text/plain error.
  • url route: a multipart url param pointing at a public petstore definition returned 202, then reached done. It was stored as petstore.json with source url and 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.
  • Checks: node scripts/sync-skills.mjs --check, node scripts/validate-skills.mjs and claude plugin validate --strict all pass.

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.
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant