MCP tools
Lima implements the “MCP Sandbox Interface” (tentative name): https://pkg.go.dev/github.com/lima-vm/lima/v2/pkg/mcp/msi
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, such as Lima.
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 Google Gemini CLI’s built-in tools.
glob
Description
Finds files matching specific glob patterns (e.g., src/**/*.ts, *.md)
Input Schema
{
"type": "object",
"required": [
"pattern"
],
"properties": {
"path": {
"type": [
"null",
"string"
],
"description": "The absolute path to the directory to search within. If omitted, searches the tool's root directory."
},
"pattern": {
"type": "string",
"description": "The glob pattern to match against (e.g., '*.py', 'src/**/*.js')."
}
},
"additionalProperties": false
}
list_directory
Description
Lists the names of files and subdirectories directly within a specified directory path.
Input Schema
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"description": "The absolute path to the directory to list."
}
},
"additionalProperties": false
}
read_file
Description
Reads and returns the content of a specified file.
Input Schema
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"description": "The absolute path to the file to read."
}
},
"additionalProperties": false
}
run_shell_command
Description
Executes a given shell command.
Input Schema
{
"type": "object",
"required": [
"command",
"directory"
],
"properties": {
"command": {
"type": "array",
"description": "The exact shell command to execute. Defined as a string slice, unlike Gemini's run_shell_command that defines it as a single string.",
"items": {
"type": "string"
}
},
"description": {
"type": "string",
"description": "A brief description of the command's purpose, which will be potentially shown to the user."
},
"directory": {
"type": "string",
"description": "The absolute directory in which to execute the command. Unlike Gemini's run_shell_command, this must not be a relative path, and must not be empty."
}
},
"additionalProperties": false
}
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’.
Input Schema
{
"type": "object",
"required": [
"pattern"
],
"properties": {
"include": {
"type": [
"null",
"string"
],
"description": "A glob pattern to filter which files are searched (e.g., '*.js', 'src/**/*.{ts,tsx}'). If omitted, searches most files (respecting common ignores)."
},
"path": {
"type": [
"null",
"string"
],
"description": "The absolute path to the directory to search within. Defaults to the current working directory."
},
"pattern": {
"type": "string",
"description": "The regular expression (regex) to search for (e.g., 'function\\s+myFunction')."
}
},
"additionalProperties": false
}
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.
Input Schema
{
"type": "object",
"required": [
"path",
"content"
],
"properties": {
"content": {
"type": "string",
"description": "The content to write into the file."
},
"path": {
"type": "string",
"description": "The absolute path to the file to write to."
}
},
"additionalProperties": false
}