Is your feature request related to a problem? Please describe.
The GitHub MCP server lacks a dedicated method to delete files from a repository. Currently, users can create and modify files through create_or_update_file and push_files tools, but there's no way to completely remove a file. The only workaround is to use create_or_update_file with empty content, which doesn't actually delete the file but merely empties it, leaving an unnecessary blank file in the repository.
Describe the solution you'd like
I'd like to request the addition of a delete_file tool to the GitHub MCP server that would:
- Accept parameters:
owner, repo, path, message, branch, and sha (similar to existing file operations)
- Implement the GitHub API's delete file endpoint (DELETE /repos/{owner}/{repo}/contents/{path})
- Add the tool to the server's capabilities list in index.ts
This would provide complete CRUD operations for file management in GitHub repositories through Claude.
Describe alternatives you've considered
The current alternative is to use create_or_update_file with empty content, but this is suboptimal as it:
- Doesn't actually remove the file from the repository
- Creates confusion with empty files remaining in the codebase
- Doesn't match the user's expectation when they request file deletion
Additional context
The implementation would be relatively straightforward, following the pattern of existing file operations like createOrUpdateFile but using the DELETE method instead. The GitHub API requires the file's SHA for deletion, which would need to be either provided by the user or fetched automatically before deletion (similar to how the update operation works when SHA isn't provided).
Is your feature request related to a problem? Please describe.
The GitHub MCP server lacks a dedicated method to delete files from a repository. Currently, users can create and modify files through
create_or_update_fileandpush_filestools, but there's no way to completely remove a file. The only workaround is to usecreate_or_update_filewith empty content, which doesn't actually delete the file but merely empties it, leaving an unnecessary blank file in the repository.Describe the solution you'd like
I'd like to request the addition of a
delete_filetool to the GitHub MCP server that would:owner,repo,path,message,branch, andsha(similar to existing file operations)This would provide complete CRUD operations for file management in GitHub repositories through Claude.
Describe alternatives you've considered
The current alternative is to use
create_or_update_filewith empty content, but this is suboptimal as it:Additional context
The implementation would be relatively straightforward, following the pattern of existing file operations like
createOrUpdateFilebut using the DELETE method instead. The GitHub API requires the file's SHA for deletion, which would need to be either provided by the user or fetched automatically before deletion (similar to how the update operation works when SHA isn't provided).