AutoSpectra MCP server provides advanced computer use capabilities with a flexible, hybrid approach that supports both API-only and container-based implementations. While initially designed for Claude, our implementation works with any AI agent supporting the MCP protocol.
The computer use integration offers two provider types:
Both providers are accessed through the same interface, allowing you to choose the approach that best fits your needs.
ANTHROPIC_API_KEY
environment variable or provide it directlyANTHROPIC_API_KEY
environment variable or provide it directlyInitializes a computer use provider with the specified configuration.
initialize_computer({
type: 'api' | 'container', // Provider type
apiKey?: string, // Optional Anthropic API key
containerImage?: string, // Optional container image to use (for container provider)
width?: number, // Optional screen width (for container provider)
height?: number // Optional screen height (for container provider)
})
Uses the initialized computer use provider to perform a task.
use_computer({
prompt: string, // Description of the computer task to perform
model?: string // Optional Claude model to use (default: claude-3-7-sonnet-20240307)
})
Uses the initialized computer use provider with fallback to AutoSpectra automation tools if needed.
smart_computer_use({
prompt: string, // Description of the computer task to perform
useAutomation?: boolean, // Whether to fall back to automation tools if computer use fails (default: true)
model?: string // Optional Claude model to use (default: claude-3-7-sonnet-20240307)
})
Cleans up any resources used by the computer use provider.
cleanup_computer()
// Initialize the API provider
await initialize_computer({ type: 'api' });
// Use computer capabilities
await use_computer({
prompt: "Create a new text document with today's date and save it as today.txt"
});
// Clean up when done
await cleanup_computer();
// Initialize the container provider
await initialize_computer({
type: 'container',
width: 1280,
height: 800
});
// Use computer capabilities
await use_computer({
prompt: "Open Firefox, navigate to wikipedia.org, and search for 'artificial intelligence'"
});
// Clean up when done
await cleanup_computer();
// Initialize any provider
await initialize_computer({ type: 'api' });
// Use smart computer capabilities with automation fallback
await smart_computer_use({
prompt: "Navigate to google.com and search for 'Claude computer use'",
useAutomation: true
});
// Clean up when done
await cleanup_computer();
The computer use capabilities integrate with AutoSpectra’s existing automation tools, providing a seamless experience that can fall back to more traditional automation when needed.
When using smart_computer_use
, if the computer use provider fails to complete the task, it will automatically attempt to:
This ensures robustness and flexibility even when computer use capabilities are limited.
The implementation automatically detects and adapts to different environments:
This allows the computer use capabilities to work across different contexts with minimal configuration.