Ansight.Tools.FileSystem 0.1.0-pre8

This is a prerelease version of Ansight.Tools.FileSystem.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Ansight.Tools.FileSystem --version 0.1.0-pre8
                    
NuGet\Install-Package Ansight.Tools.FileSystem -Version 0.1.0-pre8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ansight.Tools.FileSystem" Version="0.1.0-pre8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ansight.Tools.FileSystem" Version="0.1.0-pre8" />
                    
Directory.Packages.props
<PackageReference Include="Ansight.Tools.FileSystem" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ansight.Tools.FileSystem --version 0.1.0-pre8
                    
#r "nuget: Ansight.Tools.FileSystem, 0.1.0-pre8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ansight.Tools.FileSystem@0.1.0-pre8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ansight.Tools.FileSystem&version=0.1.0-pre8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Ansight.Tools.FileSystem&version=0.1.0-pre8&prerelease
                    
Install as a Cake Tool

Ansight.Tools.FileSystem

Grouped sandboxed file access tool registrations for the Ansight .NET SDK.

Registered tools:

  • files.list_directory
  • files.read_file
  • files.get_file_checksum
  • files.download_file
  • files.begin_binary_download
  • files.push_file
  • files.copy_file
  • files.move_file
  • files.delete_file

Usage

using Ansight;
using Ansight.Tools.FileSystem;

var options = Options.CreateBuilder()
    .WithFileSystemTools()
    .WithReadOnlyToolAccess()
    .Build();

File checksums

files.get_file_checksum computes one or more hexadecimal checksums for a sandboxed file without returning file contents.

Checksum request arguments:

  • root: optional sandbox root alias
  • path: file path relative to the root
  • algorithms: optional comma-separated list of md5, sha1, sha256, sha384, sha512, crc32, or all; defaults to sha256

Checksum response highlights:

  • fileName, fileExtension, mimeType
  • sizeBytes, lastModifiedUtc, version
  • checksums: array of { algorithm, checksum, encoding }

MCP-facing file transfer

files.begin_binary_download is the bridge-oriented path when an MCP caller wants the SDK to stream raw bytes over the pairing WebSocket and materialize the file in a caller-chosen local temp directory. The app SDK does not choose or know that temp path; it only returns metadata and then emits binary frames keyed by a transferId.

Binary download request arguments:

  • root: optional sandbox root alias
  • path: file path relative to the root
  • chunkBytes: maximum bytes to include in each binary websocket frame
  • downloadId: optional caller-supplied correlation id for mapping the transfer to a local temp file

Binary download response highlights:

  • downloadId, transferId
  • fileName, fileExtension, mimeType
  • sizeBytes, lastModifiedUtc, version
  • deliveryMode = websocket_binary
  • wireProtocol = ansight.file-transfer.v1

The consuming MCP bridge is expected to:

  • choose the temp directory and local file path
  • call files.begin_binary_download
  • map transferId to that local temp file
  • write incoming ASFT binary frames into the chosen file until the complete frame arrives

files.download_file remains available as a JSON fallback when the caller cannot consume binary websocket frames. It stays inside the configured sandbox roots, returns best-effort file metadata for tool selection, and pages large files through ordinary tool.result payloads.

JSON fallback request arguments:

  • root: optional sandbox root alias
  • path: file path relative to the root
  • offsetBytes: starting byte offset for the chunk
  • maxBytes: maximum bytes to return for the chunk
  • encoding: auto, utf8, or base64
  • expectedVersion: optional version token from a prior chunk

JSON fallback response highlights:

  • fileName, fileExtension, mimeType
  • sizeBytes, lastModifiedUtc, version
  • offsetBytes, bytesRead, hasMore, nextOffsetBytes
  • contentType, encoding, and either text or base64
  • nextRequest, which contains the next tool.call payload to continue the download safely

File writes and file management

files.push_file writes caller-provided content into a folder under an approved sandbox root. MCP bridges should pass arbitrary files as contentBase64; text is available for UTF-8 text payloads.

Push request arguments:

  • root: optional sandbox root alias
  • directoryPath: destination folder path relative to the root
  • fileName: destination file name, not a path
  • contentBase64 or text: provide exactly one
  • overwrite: replace an existing file
  • createDirectory: create the destination folder when missing

files.copy_file and files.move_file accept:

  • root: optional source sandbox root alias
  • sourcePath: source file path relative to the source root
  • destinationRoot: optional destination sandbox root alias
  • destinationPath: destination file path relative to the destination root
  • overwrite: replace an existing destination file
  • createDirectory: create the destination folder when missing

files.delete_file accepts root and path and is delete-scoped. Use WithAllToolAccess() or a custom ToolGuard if you want delete operations to execute. files.push_file, files.copy_file, and files.move_file are write-scoped and require WithReadWriteToolAccess(), WithAllToolAccess(), or a custom write-enabled guard.

Configure additional tagged roots:

using Ansight;
using Ansight.Tools.FileSystem;

var options = Options.CreateBuilder()
    .WithFileSystemTools(fileSystem =>
    {
        fileSystem.AddRoot("logs", "/absolute/path/to/logs");
    })
    .WithReadOnlyToolAccess()
    .Build();
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-maccatalyst18.0 is compatible.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

  • net9.0-android35.0

  • net9.0-ios18.0

  • net9.0-maccatalyst18.0

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Ansight.Tools.FileSystem:

Package Downloads
Ansight

All-in-one Ansight SDK package for .NET apps, including core runtime, pairing, and remote tools.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.19 38 5/8/2026
0.1.0-preview.18 39 5/8/2026
0.1.0-preview.17 36 5/8/2026
0.1.0-preview.16 44 5/6/2026
0.1.0-preview.15 43 5/5/2026
0.1.0-preview.14 52 5/5/2026
0.1.0-preview.13 45 5/5/2026
0.1.0-pre9 55 5/3/2026
0.1.0-pre8 52 5/3/2026
0.1.0-pre7 45 4/30/2026
0.1.0-pre6 43 4/30/2026
0.1.0-pre5 42 4/30/2026
0.1.0-pre4 52 4/27/2026
0.1.0-pre3 53 4/21/2026
0.1.0-pre2 72 4/4/2026
0.1.0-pre12 52 5/4/2026
0.1.0-pre11 62 5/4/2026
0.1.0-pre10 54 5/3/2026
0.1.0-pre1 64 3/31/2026