Sponsored by Deepsite.site

Tasker MCP

Created By
dceluis9 months ago
An MCP server for Android's Tasker automation app.
Content

Tasker MCP

This document will guide you through setting up and running the Tasker MCP integration, including instructions for 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.
  • After importing, 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, such as tasker-mcp-server-cli-aarch64.
  • Copy both the binary and the toolDescriptions.json file 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

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 with:
./mcp-server --tools /path/to/toolDescriptions.json --tasker-api-key=tk_... --mode sse
  • Or call it through the 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

The tasker-mcp-server-cli application accepts the following flags:

  • --tools: Path to JSON file with Tasker tool definitions.
  • --host: Host address to listen on for SSE server (default: 0.0.0.0).
  • --port: Port to listen on for SSE server (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 application 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 using your package manager:
sudo apt-get install golang-go
  • Build the CLI server (cross-compiling example 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

Due to limitations in Tasker's argument handling, follow these steps carefully to mark tasks as MCP-enabled:

Step 1: Set Task Comment

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

Step 2: Configure Tool Arguments Using Task Variables

Tasker supports only two positional arguments (par1, par2). To work around this, we'll use Task Variables:

  • A TaskVariable becomes an MCP argument if:
    1. Configure on Import: unchecked
    2. Immutable: true
    3. Value: empty

After setting the above values you can also set some additional metadata:

  • Metadata mapping:
    • Type: Derived from 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 if hidden, then disable it again. The prompt will survive.\

These steps will make sure valid tool descriptions can be generated when we export our custom project later.
Task Variables cannot be pass-through from other tasks, though, so we need to do one last thing in order to get all the variables from the MCP request properly set.

Step 3: Copy the special action

Copy the action MCP#parse_args to the top of your MCP task to enable argument parsing. You can get this from any of the default tasks. But do not modify this action!

Step 4: Exporting and Generating Updated Tool Descriptions

Now your custom tasks are ready:

  • 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 file with your server.


Happy automation!

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
DeepChatYour AI Partner on Desktop
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
Amap Maps高德地图官方 MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.