Technical Reference
PETP — Pipeline · Execution · Task · Processor
A Python-based configurable task runner, execution engine, and MCP Tool Server. PET = Pipeline-Execution-Task, the hierarchical model. The trailing P = Processor, handling each task one-to-one.
Desktop GUI
Full visual runtime with wxPython UI. Interactive RPA, local development, manual execution trigger.
python PETP.py
Background / Headless
No GUI. Auto-detect headless Chrome. Ideal for scheduled tasks, CLI pipelines, and server automation.
python PETP_backgroud.py
Docker
Multi-arch image (arm64 build → amd64 run). Headless, no browser automation. Supports CI/CD and NAS deployment.
docker run -p 8866:8866 petp
MCP Tool Server
Exposes executions as typed MCP tools. Supports both stdio and Streamable-HTTP transports.
GET /mcp · port 8866
| Category | Capabilities |
|---|---|
| Browser Automation Selenium |
Navigate, go back, fullscreen, close Chrome. Find element(s) then click / key-in / collect. Batch find with skip. iFrame, cookies, screenshot. Convert Selenium IDE recordings to PETP tasks. |
| SSH / SFTP Paramiko |
Create SSH / SFTP sessions. Run remote commands. Upload / download files. |
| File & Folder | Open, write, delete, read text. Find files / latest file. Watch & auto-move. ZIP / UNZIP. File-chooser dialog. |
| Data & Spreadsheet | Read CSV / Excel. Write to Excel. CSV to XLSX. Collect, filter, group-by, mapping, masking, conversion. Merge collections. |
| Database CRUD | MySQL, PostgreSQL, SAP HANA, SQLite — unified DB_ACCESS
processor.
|
| AI / LLM | DeepSeek, Google Gemini, Ollama (local), Zhipu Z.AI — each with Setup + Q&A + MCP-tool calling processors. |
| MCP | Expose PETP as standard MCP Tool Server (Streamable-HTTP). MCP client processors for all LLM providers. |
| HTTP / Network | Configurable HTTP requests. Extract response keys. Built-in HTTP service (port 8866). OAuth2 / PKCE. |
| String Utilities | Encode / decode (Base64, URL…). Hash (MD5, SHA256…). |
| Mouse & GUI PyAutoGUI |
Click, scroll, query position at absolute or relative coordinates. |
| Send email via SMTP with attachments. | |
| Data Visualization | Charts and plots via Matplotlib. |
| Execution Control | Init / check params. Nested execution. Conditional stop. Wait / sleep. Reload log config. Read JSON. Run shell commands. Run JavaScript. |
| Method | Endpoint | Description |
|---|---|---|
| GET | / | PETP HTTP service home |
| GET | /mcp | MCP Tool Server — Streamable-HTTP transport |
| GET | /health | Health check (Docker / container) |
| GET | /petp/tools | List all exposed MCP tools |
| POST | /petp/exec | Trigger execution or pipeline (async) |
| GET | /petp/result | Poll async result by ?request_id=<id> |
| POST | /mcp | MCP Tool Server — direct POST endpoint |
MCP Inspector setup
Connect any MCP Inspector or MCP-compatible client directly to PETP's HTTP server.
- Transport Type: Streamable HTTP
- URL: http://localhost:8866/mcp
- No authentication required for local dev
- Claude Code, Cursor, VS Code Copilot — add as MCP server in settings
# Claude Code — add PETP as MCP server # .claude/settings.json or mcpServers config "mcpServers": { "petp": { "type": "http", "url": "http://localhost:8866/mcp" } } # Or trigger via HTTP POST (no MCP client needed) POST http://localhost:8866/petp/exec { "wait_for_result": "true", "action": "execution", "params": { "execution": "YOUR_EXECUTION_NAME", "fromHTTPService": "true" } }
Modular requirements/
structure — install only what you need. Uses uv (10-100× faster than pip) or standard pip.
Install options
- Full (GUI desktop):
requirements.txt - Background service:
requirements-nogui.txt - Docker / headless:
requirements-docker.txt - Custom: combine any group files with
-r
# Recommended: uv (fast) pip install -U uv uv pip install -r requirements.txt # Custom combination uv pip install \ -r requirements/core.txt \ -r requirements/mcp.txt \ -r requirements/http-service.txt # Pin versions for reproducible builds uv pip compile requirements.txt \ -o requirements.lock
| Directory / File | Description |
|---|---|
| PETP.py | GUI desktop entry point |
| PETP_backgroud.py | Headless / background entry point |
| config/petpconfig.yaml | Main runtime configuration |
| core/executions/ | YAML execution definitions |
| core/processors/ | Processor implementations — one .py per task type |
| core/pipelines/ | YAML pipeline definitions |
| core/runtime/ | Background / no-GUI runtime logic |
| core/definition/ | YAML reader, Selenium IDE converter |
| httpservice/ | HTTP server, MCP handler, request routing |
| mvp/ | GUI layer (Model-View-Presenter with wxPython) |
| utils/ | Utilities — Selenium, Excel, Date, OS, Logger, Paramiko |
| webapp/ | Flask web application (this site) |
| webdriver/ | Platform ChromeDriver binaries |