Skip to content

Add file delete to Python and TypeScript SDKs - #22

Merged
rowantrollope merged 1 commit into
redis:mainfrom
zechengz:sdk-file-delete
Jun 23, 2026
Merged

rowantrollope merged 1 commit into
redis:mainfrom
zechengz:sdk-file-delete

Conversation

@zechengz

Copy link
Copy Markdown
Contributor

Summary

The hosted file_delete MCP tool already exists, but neither mounted-FS SDK exposed it. This adds delete(path) to the mounted filesystem in both SDKs at parity.

  • PythonMountedFS.delete (sync) and AsyncMountedFS.delete (async)
  • TypeScriptMountedFS.delete, plus a FileDeleteResponse type

Each mirrors write_file: resolve the workspace-relative path, call file_delete, and remove the local mirror entry when the mount has been materialized locally.

Behavior

  • Returns the tool result { operation: "delete", kind }, where kind is "file", "dir" (empty), or "symlink".
  • The workspace root and non-empty directories are rejected backend-side and surface as a raised error.
  • No backend changes — works against the deployed control plane today.

Tests

  • New unit tests for sync, async, and TypeScript delete (against mocked MCP clients; return shape matches the Go handlers).
  • Python: 41 passing. TypeScript: 6 passing, type-check clean.

Docs

Updated the Python and TypeScript reference docs (quick reference, signatures, and the "not yet exposed" limits list).

The hosted file_delete MCP tool already exists, but neither mounted-FS
SDK exposed it. Add delete(path) to MountedFS (sync + async in Python,
and the TypeScript MountedFS), mirroring write_file: resolve the
workspace-relative path, call file_delete, and remove the local mirror
entry when the mount is materialized.

Returns the tool result {operation: "delete", kind}. Non-empty
directories and the workspace root are rejected backend-side.

Includes unit tests for both SDKs and updates the Python/TypeScript
reference docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zechengz
zechengz marked this pull request as ready for review June 21, 2026 08:35
@rowantrollope
rowantrollope merged commit d43f3e0 into redis:main Jun 23, 2026
12 checks passed
@rowantrollope

Copy link
Copy Markdown
Collaborator

Thanks Zecheng!

@zechengz
zechengz deleted the sdk-file-delete branch June 23, 2026 00:42
@zechengz

Copy link
Copy Markdown
Contributor Author

Thanks Zecheng!

Glad to help! May pleasure :)

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.

2 participants