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.

Pipeline 1:n Execution Execution 1:n Task Task 1:1 Processor
Running Modes
🖥️

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
Processor Library
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.
Email 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.
HTTP Service & MCP Endpoints
Built-in HTTP server — port 8866
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"
  }
}
Dependency Groups

Modular requirements/ structure — install only what you need. Uses uv (10-100× faster than pip) or standard pip.

core.txt
pyyaml, croniter, cryptocode
web-automation.txt
selenium, urllib3, Pillow
http-client.txt
requests, httpx, httpx-sse
ssh-sftp.txt
paramiko
excel-data.txt
openpyxl, pandas
database.txt
psycopg, mysql-connector, hdbcli
ai-deepseek.txt
openai (DeepSeek compat.)
ai-gemini.txt
google-genai
ai-ollama.txt
ollama (local LLM)
ai-zhipu.txt
zai (Zhipu Z.AI)
mcp.txt
mcp protocol
http-service.txt
fastapi, uvicorn
javascript.txt
pythonmonkey
gui-wxpython.txt
wxpython 4.3.x
gui-automation.txt
pyautogui, pyperclip
chart.txt
matplotlib

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
Project Structure
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

Python 3.14 · MIT License

Cross-platform — macOS (Apple Silicon & Intel) and Windows. ChromeDriver in webdriver/darwin/ or webdriver/win32/. Port 8866 configurable in petpconfig.yaml.

View on GitHub Back to Home