PinchTab SMCP Plugin
SMCP plugin for PinchTab: browser control for AI agents via the PinchTab HTTP API. Conforms to the SMCP plugin contract (discovery via --describe, tool naming plugin__command, execution via python cli.py <command> --arg val ..., JSON to stdout).
Requirements
- Python 3.9+
- A running PinchTab server (orchestrator on port 9867 or direct instance on 9868+)
- No extra Python dependencies (stdlib only)
SMCP contract (this plugin)
- Discovery: SMCP runs
python cli.py --describe. This plugin returns JSON withplugin(name,version,description) andcommands(each withname,description,parameterswithname,type,description,required,default). - Tool names: SMCP registers tools as
pinchtab__<command>(double underscore), e.g.pinchtab__navigate,pinchtab__instance-start,pinchtab__snapshot. - Execution: SMCP runs
python cli.py <command> --arg1 val1 --arg2 val2 .... Parameter names are kebab-case (e.g.--base-url,--instance-id,--tab-id). The plugin prints a single JSON object to stdout; SMCP uses it as the tool result. Timeout is 300 seconds (SMCP default). - Layout: This folder must contain
cli.pyand it must be executable (chmod +x cli.py). SMCP discovers it whenMCP_PLUGINS_DIRpoints at the parent directory that contains thispinchtabfolder (see ../README.md).
Commands
| Command | Description |
|---|---|
health |
Health check |
instances |
List instances (orchestrator) |
instance-start |
Start an instance (optional profile-id, mode, port) |
instance-stop |
Stop an instance (requires instance-id) |
tabs |
List tabs |
navigate |
Navigate to URL |
snapshot |
Get accessibility tree (filter, format, selector, max-tokens, diff) |
action |
Single action: click, type, press, focus, fill, hover, select, scroll |
actions |
Batch actions (JSON array) |
text |
Extract page text |
screenshot |
Take screenshot |
pdf |
Export tab to PDF (requires tab-id) |
evaluate |
Run JavaScript |
cookies-get |
Get cookies |
stealth-status |
Stealth/fingerprint status |
Usage
- Base URL:
--base-url http://localhost:9867(default). Use orchestrator URL or a direct instance URL. - Orchestrator + instance: When talking to the orchestrator, pass
--instance-id inst_xxxxfor instance-scoped calls (navigate, snapshot, action, etc.). - Token: If PinchTab uses
PINCHTAB_TOKEN, pass--token YOUR_TOKENin the tool args.
Example (SMCP tool call)
- Agent calls tool
pinchtab__navigatewith arguments (e.g. from MCP client):{ "base_url": "http://localhost:9867", "instance_id": "inst_0a89a5bb", "url": "https://pinchtab.com" } - SMCP invokes:
python cli.py navigate --base-url http://localhost:9867 --instance-id inst_0a89a5bb --url https://pinchtab.com - Plugin prints to stdout:
SMCP returns that JSON as the tool result.{ "status": "success", "data": { ... } }
Installation (summary)
- Set
MCP_PLUGINS_DIRto the path of the parentplugins/directory (the one that contains thispinchtabfolder), or copy thispinchtabfolder into your existing SMCP plugins directory. - Run
chmod +x cli.py. - Restart SMCP. No
pip installis required for runtime.
Tests
Optional (for development). From this directory:
python3 -m venv .venv
.venv/bin/pip install pytest
.venv/bin/pytest tests/ -v