Python SDK for Undisk MCP — undo-first versioned file storage for AI agents
Project description
undisk-mcp
Python SDK for Undisk MCP — undo-first versioned file storage for AI agents.
Install
pip install undisk-mcp
Quick Start
import asyncio
from undisk_mcp import UndiskClient
async def main():
async with UndiskClient(api_key="your-api-key") as client:
await client.initialize()
# Write a file
await client.write_file("hello.txt", "Hello from Python!")
# Read it back
result = await client.read_file("hello.txt")
print(result.text)
# List all files
files = await client.list_files()
print(files.text)
asyncio.run(main())
Features
- Typed client with convenience methods for common MCP tools
- Session management (automatic
Mcp-Session-Idtracking) - Retry with exponential backoff (configurable)
- Async-first design using
httpx - Context manager support (
async with)
API Reference
UndiskClient
client = UndiskClient(
api_key="your-key",
endpoint="https://mcp.undisk.app", # default
max_retries=3, # default
timeout=60.0, # default
)
Methods
| Method | Description |
|---|---|
initialize() |
Initialize MCP session |
call_tool(name, args) |
Call any MCP tool by name |
read_file(path) |
Read a file |
write_file(path, content) |
Write a file |
create_file(path, content) |
Create a new file (fails if exists) |
list_files(path) |
List files |
delete_file(path) |
Delete a file |
move_file(from_path, to_path) |
Move or rename a file |
search_files(pattern) |
Search file contents |
list_versions(path) |
Get version history |
restore_version(path, version_id) |
Restore a version |
get_diff(path, from_version, to_version) |
Compare two versions |
append_log(path, content) |
Append to a log file |
close() |
Close the client |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
undisk_mcp-0.42.0.tar.gz
(13.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file undisk_mcp-0.42.0.tar.gz.
File metadata
- Download URL: undisk_mcp-0.42.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7f2466a760e4cf7d6e8d62b34fa988e7b04538b5215466ab834dda71f4afb2e
|
|
| MD5 |
b3ed4df3c8d40b77ca74e87d03fe876f
|
|
| BLAKE2b-256 |
2c4cd39e156fa452712623fd35d37f04523e99907794213cb8eff85ca3bf60cb
|
File details
Details for the file undisk_mcp-0.42.0-py3-none-any.whl.
File metadata
- Download URL: undisk_mcp-0.42.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
891580a78a27c827a2a7f5750b990870b4939682717b6c53d7aecff095b57a3f
|
|
| MD5 |
fda896ca1a6a1e75e4fbf69d99b7a4bf
|
|
| BLAKE2b-256 |
2c58ae43128ec2b4827b9bf2411e6d6f9ebf8b2b3fc83a860e1656ee44328ff6
|