/sharepoint/. Unlike the single-drive OneDrive VFS, it exposes the
full enterprise topology: many sites, each with many document libraries. Site
and drive names are resolved to Microsoft Graph ids automatically, so you mount
once and browse everything you have access to. All operations involve network
I/O to Microsoft Graph. Files are served as raw bytes (no Office filetype
conversion). Uses aiohttp for async Graph access.
For credential setup (tokens, app vs delegated auth, permissions), see the
SharePoint Setup guide.
Config
SharePointVFS(config) takes a SharePointConfig object with a Microsoft
Graph bearer token. No drive id is required: the VFS discovers sites and
drives for you. Both READ and WRITE modes are supported.
Config Reference
Fields marked secret are redacted in snapshots.
access_token accepts either a static string or a Callable[[], str] provider.
With a callable, the VFS refreshes the token on 401, so long-running
mounts survive token expiry.
graph_base_url selects the Graph deployment, and means the same here as for
OneDrive: see The service root.
VFS.md
The VFS.md an agent reads with SharePoint mounted at/<path>.
- Rendered
- Raw
/{site}/{library}/{path}. The first two
levels are virtual (sites and drives), and everything below is a real Graph
driveItem.
- Level 0 (
/sharepoint/): lists all accessible sites - Level 1 (
/sharepoint/{site}/): lists document libraries (drives) in that site - Level 2+ (
/sharepoint/{site}/{library}/...): lists files and folders
/sharepoint/Engineering/Documents/spec.md resolves the
site Engineering to a site id, the library Documents to a drive id, then
reads the driveItem at /root:/spec.md.
When site and drive are configured, those two namespace levels disappear.
Adding key_prefix="team/reports" makes that folder the mount root, so virtual
/sharepoint/q1.csv resolves to the driveItem at
/root:/team/reports/q1.csv.
Versioning and Snapshots
SharePoint keeps per-file version history. The VFS exposes it the same way the OneDrive and S3 backends do:- Fingerprint is the driveItem
cTag, so normal reads andstatreflect the current content without extra Graph calls. - Snapshots pin each file the agent read to its driveItem version id.
Replaying a snapshot reads
/versions/{id}/content, giving the exact bytes captured at snapshot time. A file the agent wrote carries no version and is not checked on replay.
Cache
The SharePoint VFS caches site, drive, and directory listings viaIndexCacheStore to reduce repeated Graph calls during traversal.
Example
examples/python/vfs/sharepoint/sharepoint.py (command
matrix) and examples/python/vfs/sharepoint/sharepoint_vfs.py (an in-process
ws.shell() run that writes a Markdown report).
Shell Commands
The SharePoint VFS supports the full set of shell commands since it operates on real file content (text, binary, JSON, CSV, etc.). Large files benefit from range reads to avoid downloading entire items.Read Commands
File Operations
Path Utilities
Use Cases
- AI agents accessing org documents: Mount enterprise SharePoint for agents to read and process files across many sites
- Multi-site discovery: Browse every accessible site and library from a single mount, no drive ids to manage
- Versioned document workflows: Snapshot and replay exact file states over time
- FUSE mounting: Expose SharePoint through a virtual FUSE mount for external tools
Integration
What SharePoint answers through its own API, so fewer files are read. Integration explains each command.grep -rw and
rg -w read only the files Microsoft Graph search names, within one document
library (a directory above one is read in full); every file is read when the
search fails or finds nothing. walk_limit: -1 in the mount’s "@all" command limit reads every file instead, since Graph searches the text
it extracted, not the bytes grep reads, and indexes a write some time after
it lands, so a file that holds the word can be left out: an office file, PDF
or archive, the end of a large file, or a word Graph splits differently
(foo.bar).
SharePoint vs OneDrive
Both backends talk to Microsoft Graph driveItems and behave identically below the drive level. Choose by topology:- Use OneDrive for a single drive (personal
OneDrive, OneDrive for Business, or one targeted SharePoint library via
drive_id/site_id). - Use SharePoint for enterprise scenarios with many sites and libraries that you want to discover and traverse without knowing drive ids up front.