This document provides a comprehensive reference for all MCP tools exposed by DockaShell. These tools enable AI agents to interact with isolated Docker containers for secure shell execution and project management.
DockaShell exposes tools organized into four main categories:
- Project Management - Project lifecycle and status operations
- Shell Execution - Shell command execution and code running
- File Operations - File creation, modification, and patching
- Trace & Logging - Activity tracking and audit trails
Lists all configured projects with their status.
Arguments: None
Returns: Array of project objects with status information
Example:
// Get overview of all projects
list_projects();Starts a Docker container for the specified project.
Arguments:
project_name(string) - Name of the project to start
Returns: Success status and container information
Example:
start_project({ project_name: 'web-app' });Stops the project container.
Arguments:
project_name(string) - Name of the project to stop
Returns: Success status
Example:
stop_project({ project_name: 'web-app' });Returns detailed status information about the project container.
Arguments:
project_name(string) - Name of the project to check
Returns: Detailed status including container state, ports, mounts, and resource usage
Example:
project_status({ project_name: 'web-app' });Executes a shell command in the project container.
Arguments:
project_name(string) - Target project namecommand(string) - Shell command to execute
Returns: Command output, exit code, and execution metadata
Security Features:
- Commands run as non-root user (vscode, UID 1000)
- Automatic timeout protection
- Full audit trail with timestamps
- Container isolation from host system
Example:
// Run development server
bash({
project_name: 'web-app',
command: 'npm start',
});
// Check environment
bash({
project_name: 'web-app',
command: 'node --version && npm --version',
});Creates or overwrites a file inside the container.
Arguments:
project_name(string) - Target project namepath(string) - File path inside the containercontent(string) - File content to writeoverwrite(boolean, optional) - Whether to replace existing files (default: false)
Features:
- Automatic creation of intermediate directories
- Safe overwrite protection (requires explicit flag)
- Full path validation
Examples:
// Create new configuration file
write_file({
project_name: 'web-app',
path: '/workspace/config.json',
content: '{"port": 3000, "debug": true}',
});
// Overwrite existing file
write_file({
project_name: 'web-app',
path: '/workspace/package.json',
content: packageJsonContent,
overwrite: true,
});Applies patches using the OpenAI format inside the project container.
Arguments:
project_name(string) - Target project namepatch(string) - Patch content in OpenAI format
Advantages:
- Context-based matching (more reliable than line-number diffs)
- Handles file modifications, additions, and deletions
- Robust against formatting changes
- Perfect for iterative edits
Patch Format:
--- a/path/to/file.js
+++ b/path/to/file.js
@@ ... @@
context line
-old line
+new line
context line
Example:
apply_patch({
project_name: 'web-app',
patch: `--- a/src/app.js
+++ b/src/app.js
@@ -10,7 +10,7 @@
app.get('/', (req, res) => {
- res.send('Hello World!');
+ res.send('Hello DockaShell!');
});`,
});Writes an arbitrary note to the project trace log for documentation and debugging.
Arguments:
project_name(string) - Target project nametype(string) - Trace type: "user", "agent", or "summary"text(string) - Trace content
Use Cases:
- Document reasoning and planning steps
- Record user inputs and decisions
- Mark project milestones
- Debug agent behavior
Examples:
// Document planning phase
write_trace({
project_name: 'web-app',
type: 'agent',
text: 'Planning React component structure for user dashboard',
});
// Record user decision
write_trace({
project_name: 'web-app',
type: 'user',
text: 'User requested dark mode toggle implementation',
});
// Mark completion
write_trace({
project_name: 'web-app',
type: 'summary',
text: 'Successfully implemented authentication system with JWT tokens',
});Returns formatted trace entries with advanced filtering and field selection capabilities.
Arguments:
project_name(string) - Target project nametype(string, optional) - Filter by trace typesearch(string, optional) - Search term across trace contentskip(number, optional) - Number of entries to skip (pagination)limit(number, optional) - Maximum entries to returnfields(string[], optional) - Specific fields to includeoutput_max_len(number, optional) - Maximum length for output preview (default: 1000)
Field Options:
timestamp,type,content- Always included for contextexit_code,duration- Command execution metadata (commands only)output- Command output preview (truncated tooutput_max_len)
Type Filtering:
"command"- Shell command executions only"note"- All note types (user, agent, summary)"user","agent","summary"- Specific note types
Usage Examples:
// Recent activity overview
read_traces('web-app', { limit: 10 });
// Debug failed commands with full output
read_traces('web-app', {
type: 'command',
fields: ['timestamp', 'type', 'content', 'exit_code', 'output'],
output_max_len: 5000,
});
// Search for error-related entries
read_traces('web-app', { search: 'error' });
// Get agent reasoning steps only
read_traces('web-app', {
type: 'agent',
limit: 20,
});
// Paginated access to command history
read_traces('web-app', {
type: 'command',
skip: 50,
limit: 25,
});- Use
apply_patchfor incremental edits (more reliable) - Use
write_filefor new files or complete rewrites - Set
overwrite: trueexplicitly when replacing existing files
- Keep commands focused and specific
- Use timeouts appropriately for long-running processes
- Monitor command exit codes for error detection
- Use
write_traceliberally to document reasoning - Include context in trace messages for future reference
- Use different trace types to organize information
- Query traces with
read_tracesfor debugging and context
- Limit
read_tracesresults withlimitparameter - Use field selection to reduce data transfer
- Use
skipfor pagination when processing large trace sets - Set appropriate
output_max_lenbased on needs