webpuppet_mcp/
lib.rs

1//! # webpuppet-mcp
2//!
3//! MCP (Model Context Protocol) server for webpuppet browser automation.
4//!
5//! This crate provides a standards-compliant MCP server that exposes webpuppet
6//! functionality as tools for AI assistants like GitHub Copilot, Claude Desktop,
7//! and other MCP-compatible clients.
8//!
9//! ## Features
10//!
11//! - **MCP-compliant**: Implements JSON-RPC 2.0 over stdio (standard MCP transport)
12//! - **Tool exposure**: Exposes AI prompting, screenshot, and research capabilities
13//! - **Security guardrails**: Inherits webpuppet's permission system
14//! - **Response screening**: Filters prompt injections and malicious content
15//! - **Browser detection**: Automatic detection of Chromium-based browsers
16//! - **Human intervention**: Pause/resume workflow for manual steps (captcha, 2FA)
17//!
18//! ## Available Tools
19//!
20//! - `webpuppet_prompt`: Send prompts to AI providers (Claude, Grok, Gemini, ChatGPT, Perplexity, NotebookLM, Kaggle)
21//! - `webpuppet_screenshot`: Take screenshots of web pages
22//! - `webpuppet_navigate`: Navigate browser to a specific URL
23//! - `webpuppet_browser_status`: Get current browser session status and page info
24//! - `webpuppet_list_providers`: List available AI providers
25//! - `webpuppet_provider_capabilities`: Get capabilities for a specific provider
26//! - `webpuppet_detect_browsers`: Detect installed browsers (Brave, Chrome, Chromium, Edge, Opera, Vivaldi, Firefox, Safari)
27//! - `webpuppet_check_permission`: Check if an operation is allowed by permission policy
28//! - `webpuppet_intervention_status`: Check if human intervention is needed
29//! - `webpuppet_intervention_complete`: Signal completion of manual intervention
30//! - `webpuppet_pause`: Pause automation for manual interaction
31//! - `webpuppet_resume`: Resume automation after pause
32//!
33//! ## Usage with VS Code
34//!
35//! Add to your `.vscode/mcp.json`:
36//!
37//! ```json
38//! {
39//!   "servers": {
40//!     "webpuppet": {
41//!       "command": "webpuppet-mcp",
42//!       "args": ["--stdio"],
43//!       "env": {}
44//!     }
45//!   }
46//! }
47//! ```
48//!
49//! ## Security Model
50//!
51//! All operations are subject to the webpuppet permission system:
52//! - Destructive operations (delete account, etc.) are blocked
53//! - Only allowed domains can be accessed
54//! - Responses are screened for prompt injections
55//! - All operations are audit logged
56
57#![warn(missing_docs)]
58#![warn(clippy::all)]
59
60pub mod error;
61pub mod protocol;
62pub mod server;
63pub mod tools;
64
65pub use error::{Error, Result};
66pub use protocol::{JsonRpcRequest, JsonRpcResponse, McpMessage};
67pub use server::McpServer;
68pub use tools::{Tool, ToolRegistry};