create_file and update_file rely on base64 encoded content #72
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/OpenSpec
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
RFC - Request For Comments
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human-required
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
agentic-forges/forgejo-mcp#72
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I noticed that
create_fileandupdate_filerely on base64 encoded content. This causes errors as it isn't clearly communicated and also that would mean that the AI would have to use an external mechanism to encode the content first. Letting the model do the base64 encoding internally hasn't worked great for me in the past with more complex files.What's your workflow here?
Here's an error message when the content in
content:is not base64 encoded.hey @c6sepl6p thanks for the report. I'm not using it. Could you give an example of what would be best for your use case?
https://codeberg.org/api/swagger#/repository/repoCreateFile
I looked into this a bit and it seems like the forgejo API requires content to be a base64 encoded string.
It seems like content is just passed through atm and the API throws the error.. The mcp server should encode the values of content to base64 before passing it to the API.
Thanks for the report and the investigation @c6sepl6p — you were spot on.
The fix has been implemented in commit
593eeb8:create_fileandupdate_filenow automatically base64-encode thecontentparameter before passing it to the Forgejo APIcontenthas been updated to clarify it accepts plain textAI models (and users) can now pass plain text content directly — no manual base64 encoding needed.
This fix is now on
main. @c6sepl6p could you test with the current release and confirm it resolves the issue for you? If you run into any further problems, feel free to reopen.Thank you, works perfectly!