MCP HubMCP Hub
dceluis

tasker-mcp

by: dceluis

An MCP server for Android's Tasker automation app.

10created 10/03/2025
Visit
Android
Automation

📌Overview

Purpose: The Tasker MCP framework facilitates integration between Tasker and MCP-enabled applications, allowing users to create custom automation tasks with ease.

Overview: Tasker MCP provides a streamlined approach to set up, run, and manage Tasker integration using a command-line interface (CLI) server that communicates with Tasker via secure API keys. This solution is geared toward users who want to extend Tasker's capabilities by connecting with other applications and services with minimal configuration effort.

Key Features:

  • Tasker Profile Integration: Easily import and configure the MCP profile into Tasker, enabling automated task generation through an intuitive step-by-step process.

  • Command-Line Server: A versatile CLI server can be customized with various command-line flags to specify tool definitions, host addresses, and transport modes (SSE or stdio), facilitating adaptable server setups based on user requirements.

  • Dynamic Task Management: Users can enhance task functionalities by creating custom tasks with defined metadata and proper handling of arguments, ensuring efficient execution and integration with external applications.


Tasker MCP

This document guides you through setting up and running the Tasker MCP integration, including installing dependencies, preparing servers, and updating tasks.


Usage Guide

Step 1: Import the Tasker Profile

  • Import dist/mcp_server.prj.xml into your Tasker app.
  • Run the MCP generate_api_key task to generate an API key for secure access.

Step 2: Select and Run Your Server

CLI Server:

  • From the dist/ folder, select the correct CLI server binary for your device's architecture, e.g., tasker-mcp-server-cli-aarch64.
  • Copy both the binary and toolDescriptions.json to your device (phone or PC).
  • Rename the binary to mcp-server after copying.

Example using scp:

scp dist/tasker-mcp-server-cli-aarch64 user@phone_ip:/data/data/com.termux/files/home/mcp-server

Example using adb push:

adb push dist/tasker-mcp-server-cli-aarch64 /data/data/com.termux/files/home/mcp-server
  • Run the server in SSE mode:
./mcp-server --tools /path/to/toolDescriptions.json --tasker-api-key=tk_... --mode sse
  • Or call it through stdio transport:
payload='{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "tasker_flash_text", "arguments": { "text": "Hi" }  } }'
echo $payload | ./mcp-server --tools /path/to/toolDescriptions.json --tasker-api-key=tk_...

Command-Line Flags

  • --tools: Path to JSON file with Tasker tool definitions.
  • --host: Host address to listen on for SSE (default: 0.0.0.0).
  • --port: Port to listen on for SSE (default: 8000).
  • --mode: Transport mode: sse or stdio (default: stdio).
  • --tasker-host: Tasker server host (default: 0.0.0.0).
  • --tasker-port: Tasker server port (default: 1821).
  • --tasker-api-key: The Tasker API key.

Step 3: Connect Your MCP-enabled App

Connect your MCP-enabled app by pointing it to the running server.

Example Configuration for Claude Desktop with stdio transport

{
  "mcpServers": {
    "tasker": {
      "command": "/home/luis/tasker-mcp/dist/tasker-mcp-server-cli-x86_64",
      "args": [
        "--tools",
        "/home/luis/tasker-mcp/dist/toolDescriptions.json",
        "--tasker-host",
        "192.168.1.123",
        "--tasker-api-key",
        "tk_...",
        "--mode",
        "stdio"
      ]
    }
  }
}

Building the CLI Server Yourself

Unix/Linux:

  • Install Go:
sudo apt-get install golang-go
  • Build the CLI server (cross-compiling for ARM64):
cd cli
GOOS=linux GOARCH=arm64 go build -o dist/tasker-mcp-server-cli-aarch64 main.go

Updating the MCP Profile with Additional Tasks

Because Tasker only supports two positional arguments, use the following steps to mark tasks as MCP-enabled:

Step 1: Set Task Comment

Add a comment in the task settings. This comment becomes the tool description.

Step 2: Configure Tool Arguments Using Task Variables

Use Task Variables to define arguments:

  • A Task Variable becomes an MCP argument if:

    1. Configure on Import: unchecked
    2. Immutable: true
    3. Value: empty
  • Additional metadata:

    • Type: Derived from the Task Variable’s type (number, string, onoff, etc).
    • Description: Set via the variable’s Prompt field.
    • Required: If the "Same as Value" field is checked.

Note: Temporarily enable "Configure on Import" to set the Prompt description, then disable it again.

Step 3: Copy the Special Action

Copy the action MCP#parse_args to the top of your MCP task to enable argument parsing. Do not modify this action.

Step 4: Export and Generate Updated Tool Descriptions

  • Export your mcp-server project and save it on your PC.
  • Ensure Node.js is installed, then run:
cd utils
npm install
node xml-to-tools.js /path/to/your/exported/mcp_server.prj.xml > toolDescriptions.json

Use this toolDescriptions.json with your server.


Happy automation!