Tentacle is a mobile automation gateway that exposes Appium and AWS Device Farm workflows through standard MCP over stdio and Streamable HTTP, HTTP JSON-RPC compatibility, WebSocket event streaming, and internal gRPC services.
It is designed for AI-assisted mobile testing, scripted automation, and browser-based monitoring. The repository ships with embedded validation tools, PostgreSQL migrations, and production-oriented configuration examples so the same codebase can be used for local development, CI, and hosted deployments.
- MCP
2026-07-28stateless server with2025-11-25and2025-06-18initialization-based compatibility - Standard MCP transports through
stdioand Streamable HTTPPOST /mcp - HTTP JSON-RPC endpoint for service-to-service integrations
- Deterministic JSON Schema 2020-12 catalog with 26 built-in tools and an
adbShellkill switch - Session lifecycle, element actions, gestures, screenshots, health checks, and semantic snapshots
- Browser event streaming through short-lived WebSocket subscription tokens
- AWS Device Farm support for both scheduled test runs and live remote-access Appium sessions
- PostgreSQL, Redis, and S3-backed persistence for traces, events, and artifacts
Local development uses the Go version declared in go.mod and requires PostgreSQL, Redis, and an existing S3 or S3-compatible bucket. Gateway startup checks those three dependencies before listening. Appium 2 is required when a mobile session is created, but not for protocol discovery or health inspection.
cp config.example.yaml config.yaml
mkdir -p bin
go build -o ./bin/gateway ./cmd/gatewayUpdate config.yaml with reachable PostgreSQL, Redis, and S3 settings before starting the binary. The S3 identity needs HeadBucket access at startup and object access for screenshot artifacts.
Add Tentacle as an MCP server in your Claude Desktop configuration:
{
"mcpServers": {
"tentacle": {
"command": "/absolute/path/to/repository/bin/gateway",
"args": ["--stdio", "--config", "/absolute/path/to/config.yaml"]
}
}
}Common configuration file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\\Claude\\claude_desktop_config.json
Start the gateway:
./bin/gateway --config config.yamlDiscover the server through the stateless MCP 2026-07-28 endpoint:
curl -X POST http://localhost:8080/mcp \
-H "Accept: application/json, text/event-stream" \
-H "Content-Type: application/json" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: server/discover" \
-d '{
"jsonrpc": "2.0",
"method": "server/discover",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {},
"io.modelcontextprotocol/clientInfo": {"name": "local-test", "version": "1.0.0"}
}
},
"id": 1
}'Every modern request repeats the namespaced protocol metadata. HTTP requests also mirror the method in Mcp-Method; tools/call and resources/read mirror their target in Mcp-Name.
The non-standard /jsonrpc endpoint remains available for existing integrations. List the available tools with:
curl -X POST http://localhost:8080/jsonrpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":2}'The local configuration disables authentication. When PAT, OIDC, or HMAC authentication is enabled, supply the corresponding credentials to protected HTTP endpoints.
Apply the shipped PostgreSQL migrations before starting gateway or orchestrator:
export DATABASE_URL='postgres://postgres:postgres@127.0.0.1:5432/mcp_mobile_worker?sslmode=disable'
psql "$DATABASE_URL" -f internal/storage/postgres/migrations/001_init.sql
psql "$DATABASE_URL" -f internal/storage/postgres/migrations/002_audit_logs.sql
psql "$DATABASE_URL" -f internal/storage/postgres/migrations/003_reserved_slot.sql
psql "$DATABASE_URL" -f internal/storage/postgres/migrations/004_pat_tokens.sql
psql "$DATABASE_URL" -f internal/storage/postgres/migrations/005_hmac_keys.sql
psql "$DATABASE_URL" -f internal/storage/postgres/migrations/006_trace_execution_state.sql
psql "$DATABASE_URL" -f internal/storage/postgres/migrations/007_trace_session_ownership.sqlVerify the migration set:
go run ./cmd/migration_replay_checkRun the main integration suite:
go test ./internal/integration -count=1 -vRun the distributed end-to-end flow separately with:
go test ./internal/integration -run TestDistributedStartExecuteTraceEndFlow -count=1 -vThe gateway --stdio entry point exposes the full MCP tool catalog and is the simplest way to connect the project to AI tools and desktop clients. It accepts modern per-request metadata and both supported legacy initialize revisions.
The standard endpoint is POST /mcp. Modern 2026-07-28 requests are stateless and validate MCP-Protocol-Version, Mcp-Method, and method-specific Mcp-Name headers. Legacy 2025-11-25 and 2025-06-18 initialize flows remain supported.
The /jsonrpc endpoint preserves the operational surface for older service integrations, but it is not the standard MCP Streamable HTTP transport.
Browser clients can mint a short-lived subscription token through:
POST /api/ws/traces/{traceId}/subscription-token
and then subscribe to:
GET /ws/plan-events
using the issued token.
/healthz/metrics
monolithis the supported gateway execution mode. Both HTTP andstdioembed the orchestrator in the gateway process.distributedremains experimental. The standalone orchestrator and worker implement capacity admission, leases, callbacks, recovery, and stale-result protection, but the gateway does not yet forward ingress traffic to an external orchestrator.- Plan events are durable in PostgreSQL and published best-effort through Redis PubSub to the at-most-once WebSocket stream. Historical events are read through
getTrace. /metricscurrently shares the gateway listener;telemetry.metrics_portdoes not create a separate listener. Gateway and orchestrator initialize OTEL tracing, while worker currently uses structured logging.
The repository contains 26 session, execution, element, gesture, screenshot, health, Device Farm, and debugging tools. The local example exposes all 26; the production example disables adbShell and therefore exposes 25.
Core interactive tools include:
startSessionendSessionexecutePlancancelPlangetTracefindElementclickElementsendKeysToElementclearElementgetElementTextgetElementAttributeisElementDisplayedtapswipelongPresspressBackhideKeyboardtakeScreenshotgetSemanticSnapshothealthCheck
Device Farm tools include:
createDeviceFarmUploadgetDeviceFarmUploadgetDeviceFarmRuntimeContextscheduleDeviceFarmRungetDeviceFarmRun
Optional device-shell debugging can be exposed through adbShell. Operators can remove that tool completely with:
gateway:
disable_adb_shell_tool: trueThe built-in plan executor supports the following step types:
clickclearElementwaitsendKeystapswipelongPresspressBackhideKeyboardscreenshot
Use run_api mode when you want the service to upload assets, schedule Device Farm runs, and query run status.
Use remote_access mode when startSession should create a live Device Farm remote-access Appium session. The following w3cCapsJson extension keys are supported:
devicefarm:deviceArnrequireddevicefarm:appArnoptionaldevicefarm:projectArnoptionaldevicefarm:sessionNameoptional
Start from one of the shipped configuration templates:
- config.example.yaml for local development
- config.production.example.yaml for staging and production-style deployments
The production file is still a template. Replace all placeholder hosts, certificates, tokens, and database settings, and configure transport encryption and access controls for PostgreSQL, Redis, and S3 before deployment.
- Third-Party Integration Guide
- Usage Examples
- PostgreSQL Migrations
- Changelog
- Release Notes v1.0.0
- Security Policy
- MCP 2026-07-28 Alignment
- MIT License
This project is released under the MIT License. See LICENSE for the full text.