msi

package
v2.0.0-alpha.0....-7e08d68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package msi provides the "MCP Sandbox Interface" (tentative) that should be reusable for other projects too.

MCP Sandbox Interface defines MCP (Model Context Protocol) tools that can be used for reading, writing, and executing local files with an appropriate sandboxing technology. The sandboxing technology can be more secure and/or efficient than the default tools provided by an AI agent.

MCP Sandbox Interface was inspired by Gemini CLI's built-in tools. https://github.com/google-gemini/gemini-cli/tree/v0.1.12/docs/tools

Notable differences from Gemini CLI's built-in tools:

Eventually, this package may be split to a separate repository.

Index

Constants

This section is empty.

Variables

View Source
var Glob = &mcp.Tool{
	Name:        "glob",
	Description: `Finds files matching specific glob patterns (e.g., src/**/*.ts, *.md)`,
}
View Source
var ListDirectory = &mcp.Tool{
	Name:        "list_directory",
	Description: `Lists the names of files and subdirectories directly within a specified directory path.`,
}
View Source
var ReadFile = &mcp.Tool{
	Name:        "read_file",
	Description: `Reads and returns the content of a specified file.`,
}
View Source
var RunShellCommand = &mcp.Tool{
	Name:        "run_shell_command",
	Description: `Executes a given shell command.`,
}
View Source
var SearchFileContent = &mcp.Tool{
	Name:        "search_file_content",
	Description: `Searches for a regular expression pattern within the content of files in a specified directory. Internally calls 'git grep -n --no-index'.`,
}
View Source
var WriteFile = &mcp.Tool{
	Name:        "write_file",
	Description: `Writes content to a specified file. If the file exists, it will be overwritten. If the file doesn't exist, it (and any necessary parent directories) will be created.`,
}

Functions

This section is empty.

Types

type GlobParams

type GlobParams struct {
	Pattern string  `json:"pattern" jsonschema:"The glob pattern to match against (e.g., '*.py', 'src/**/*.js')."`
	Path    *string `` /* 135-byte string literal not displayed */

}

type ListDirectoryParams

type ListDirectoryParams struct {
	Path string `json:"path" jsonschema:"The absolute path to the directory to list."`
}

type ListDirectoryResult

type ListDirectoryResult struct {
	Entries []ListDirectoryResultEntry `json:"entries" jsonschema:"The directory content entries."`
}

type ListDirectoryResultEntry

type ListDirectoryResultEntry struct {
	Name    string       `json:"name" jsonschema:"base name of the file"`
	Size    *int64       `json:"size,omitempty" jsonschema:"length in bytes for regular files; system-dependent for others"`
	Mode    *fs.FileMode `json:"mode,omitempty" jsonschema:"file mode bits"`
	ModTime *time.Time   `json:"time,omitempty" jsonschema:"modification time"`
	IsDir   *bool        `json:"is_dir,omitempty" jsonschema:"true for a directory"`
}

ListDirectoryResultEntry is similar to io/fs.FileInfo.

type ReadFileParams

type ReadFileParams struct {
	Path string `json:"path" jsonschema:"The absolute path to the file to read."`
}

type RunShellCommandParams

type RunShellCommandParams struct {
	Command     []string `` /* 160-byte string literal not displayed */
	Description string   `` /* 132-byte string literal not displayed */
	Directory   string   `` /* 177-byte string literal not displayed */
}

type RunShellCommandResult

type RunShellCommandResult struct {
	Stdout   string `json:"stdout" jsonschema:"Output from the standard output stream."`
	Stderr   string `json:"stderr" jsonschema:"Output from the standard error stream."`
	Error    string `json:"error,omitempty" jsonschema:"Any error message reported by the subprocess."`
	ExitCode *int   `json:"exit_code,omitempty" jsonschema:"Exit code of the command."`
}

type SearchFileContentParams

type SearchFileContentParams struct {
	Pattern string  `json:"pattern" jsonschema:"The regular expression (regex) to search for (e.g., 'function\\s+myFunction')."`
	Path    *string `` /* 130-byte string literal not displayed */
	Include *string `` /* 185-byte string literal not displayed */
}

type WriteFileParams

type WriteFileParams struct {
	Path    string `json:"path" jsonschema:"The absolute path to the file to write to."`
	Content string `json:"content" jsonschema:"The content to write into the file."`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL