tasker-mcp
Summary: tasker-mcp is an MCP server that gives an AI agent full read, edit, and run access to Tasker on Android, talking to the phone over HTTP via a Tasker HTTP Request profile (optionally tunnelled with adb).
Read anything: list and inspect projects, profiles, tasks, scenes, and global variables, plus raw XML for backups, tasks, profiles, projects, and scenes (
get_backup_xml,get_task_xml,list_tasks,get_task,get_project, etc.).Edit the configuration: create, edit, delete, rename, and move tasks, profiles, and projects, and import task XML or whole configurations (
import_xml).Run things: run a task with parameters and variables, run an ad-hoc action list via a reusable scratch task, or stop a running task.
Manipulate variables and state: read/write global variables, list globals, enable/disable profiles, and send Tasker Command System text.
Look up Tasker knowledge: get/search action specs and categories, and search, list, or fetch Tasker userguide docs (with a refreshable local cache).
Debug: pull Tasker logcat lines (token redacted);
get_run_logexplains Tasker's Run Log can't be exported.Safety features: automatic snapshots before mutations with
restore_snapshot, verify-readback after imports, action-table validation, write-prefix allowlisting (TASKER_WRITE_ALLOW), andpersist_configto save changes to disk.Per-task tools: any task whose comment contains
#mcpis exposed as atasker_<name>tool with its Task Variables as arguments;refresh_toolsre-reads the config.Note on the supplied schema: the schema given here lists only the
pingtool (a no-argument health check of the MCP server itself), so as written it exposes nothing beyond liveness checking.
Provides tools for interacting with Tasker on Android, enabling AI agents to inspect, create, edit, run, and manage tasks, profiles, projects, scenes, global variables, and Tasker action references through Tasker's HTTP Request event and XML import/export.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tasker-mcprun my Morning Routine task and show me the output"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tasker-mcp
An MCP server that gives AI agents full read, edit, and run access to Tasker on Android. An agent can list and inspect every task, profile, project, and scene, create and edit them, run tasks and ad-hoc action lists, read and write global variables, and look up Tasker's action reference, all without you clicking through the Tasker editor. It works through Tasker's own HTTP Request event and its XML export/import, so the only thing on the phone is one small Tasker project: there is no Android app to install beyond Tasker itself.
Requirements
Tasker 6.2 or newer on the phone (the HTTP Request event is required). Tested on 6.6.20 and 6.7.6-beta.
Node 26 or newer on the machine that runs your MCP client.
adb is optional. It is the safest way to reach the phone (see Quickstart).
Related MCP server: mcp-android
Quickstart
1. Install the phone project
Copy
tasker/TaskerMCP.prj.xmlfrom this repo to the phone (for example intoTasker/projects/in shared storage).In Tasker, long-press the project tab bar at the bottom, choose Import Project, and pick the file.
Run the
TaskerMCP.Setuptask once (open it and press play). It generates a token and flashes it. You can read it again later in the VARS tab as%TaskerMCP_Token.Make sure Tasker is enabled and the
TaskerMCP HTTPprofile is on.
2. Connect
adb (recommended). Attach the phone by USB or wireless debugging. When
TASKER_URLis unset and exactly one device is attached, tasker-mcp runsadb forwardfor port 1821 itself and talks tolocalhost, so the port never has to be reachable from the network. With several devices, setTASKER_ADB_SERIAL.Direct. The phone project refuses non-localhost callers by default. To use
TASKER_URL=http://<phone-ip>:1821on a network you trust, first set the global%TaskerMCP_AllowRemoteto1in Tasker's VARS tab. Read SECURITY.md: with remote access on, the token is the only protection.
Give the server the token with TASKER_TOKEN or, better, TASKER_TOKEN_FILE
(a file containing just the token).
3. Install the server
The package is not published to npm yet (the publish workflow currently runs
npm publish --dry-run). Until it is, build from source:
git clone https://github.com/pmaxhogan/tasker-mcp.git
cd tasker-mcp
npm ci
npm run build
claude mcp add tasker --scope user \
-e TASKER_TOKEN_FILE=/abs/path/to/tasker-token.txt \
-- node /abs/path/to/tasker-mcp/dist/index.jsOnce published, this becomes:
claude mcp add tasker --scope user \
-e TASKER_TOKEN_FILE=/abs/path/to/tasker-token.txt \
-- npx -y @pmaxhogan/tasker-mcpAny other MCP client that speaks stdio takes the same command in its JSON config:
{
"mcpServers": {
"tasker": {
"command": "node",
"args": ["/abs/path/to/tasker-mcp/dist/index.js"],
"env": {
"TASKER_TOKEN_FILE": "/abs/path/to/tasker-token.txt",
"TASKER_WRITE_ALLOW": "TaskerMCP.Test,TaskerMCP."
}
}
}
}Verify with the ping tool.
Configuration
Every option is an environment variable or a command line flag; flags win.
Env var | Flag | Default | Meaning |
|
| unset | Phone URL, e.g. |
|
| unset | Bearer token. |
|
| unset | File holding the token. Order: |
|
| unset | adb device serial when more than one is attached. |
|
|
| adb executable. |
|
|
| State directory (snapshots, docs cache). |
|
|
| Per-request timeout in milliseconds. |
|
| unset (everything) | Comma separated name prefixes. Mutating tools only touch objects whose name starts with one. |
|
| unset | Comma separated project name prefixes. Those projects, and every task, profile and scene in them, are writable too. |
|
|
| Allow whole-configuration imports (see below). |
|
|
| Run |
Also --help and --version.
Safe mode for a real phone
Start a real phone like this until you trust your agent:
TASKER_WRITE_ALLOW=TaskerMCP.Test,TaskerMCP.Writes are then confined to objects named TaskerMCP.Test... or TaskerMCP....
(tasks, profiles, projects, scenes, globals), and whole-configuration imports
are off. Reads, runs, and snapshots are unaffected. Set
TASKER_ALLOW_CONFIG_IMPORT=true to allow deletes, renames, and profile edits
inside the allowed prefixes. Also pull a Tasker Data Backup before the first
write.
To open up whole projects instead of (or as well as) name prefixes:
TASKER_WRITE_ALLOW_PROJECTS=MCP.Every project whose name starts with MCP. is then writable, along with the
tasks, profiles and scenes in it, whatever they are called. An existing object
is judged by the project it is in now, so one cannot be pulled in from another
project. Editing a task in place needs nothing more. Creating one in such a
project, moving, renaming and deleting are whole-configuration imports (a new
task always lands in Base first), so they also need
TASKER_ALLOW_CONFIG_IMPORT=true.
persist_config and TASKER_AUTO_PERSIST work in safe mode: they save
Tasker's own running configuration, which holds nothing the allow lists did
not let through. They drive the phone over adb, so with TASKER_URL set also
give TASKER_ADB_SERIAL.
Tools
Tools that change your Tasker configuration or phone state are marked yes.
Raw XML
Tool | What it does | Mutates |
| The full Data Backup XML. | no |
| One task as TaskerData XML. | no |
| One profile as XML. | no |
| One project as XML. | no |
| One scene as XML. | no |
| Import a Task XML (replaced in place by name) or a full config. | yes |
Structured read and edit
Tool | What it does | Mutates |
| Projects and their contents. | no |
| Profiles with their contexts and tasks. | no |
| Tasks, optionally by project. | no |
| Scenes. | no |
| A task as JSON: actions with named, decoded args. | no |
| A profile as JSON. | no |
| A project as JSON. | no |
| Create a task from a JSON action list. | yes |
| Change the actions of a task. | yes |
| Delete a task (whole-configuration import). | yes |
| Create a profile (whole-configuration import). | yes |
| Edit a profile (whole-configuration import). | yes |
| Delete a profile (whole-configuration import). | yes |
| Move a task or profile into a project (whole-configuration import). | yes |
| Rename a task, profile, or project (whole-configuration import). | yes |
Run
Tool | What it does | Mutates |
| Run a task with | yes |
| Run an ad-hoc action list. Uses one reusable task, | yes |
| Stop a running task. | yes |
Variables, profiles, commands
Tool | What it does | Mutates |
| Read a global variable. | no |
| Set a global variable. | yes |
| All global variables. | no |
| Turn a profile on or off. | yes |
| Send a Tasker Command System text. | yes |
Action specs and docs
Tool | What it does | Mutates |
| An action by code or name: args with ids, names, and types. | no |
| Search the action table. | no |
| Action categories. | no |
| Search the Tasker userguide. | no |
| List userguide pages. | no |
| One userguide page, or one section of a long manual. | no |
| Re-download the docs index; drops cached pages if changed. | no |
Logs
Tool | What it does | Mutates |
| Tasker lines from logcat (needs adb and Tasker's "Debug To System Log"); redacts the token. | no |
| Explains that Tasker has no action that exports the Run Log, and points at | no |
Snapshots
Tool | What it does | Mutates |
| Saved snapshots, newest first. | no |
| Save a snapshot of the current configuration. | no |
| Restore a snapshot (whole-configuration import). | yes |
Saving to disk
Tool | What it does | Mutates |
| Save Tasker's running configuration to disk so changes survive a Tasker restart or reboot. Drives Tasker's editor over adb (Data > Restore of the live backup, then the Apply checkmark to save); needs an unlocked screen and takes about 25 seconds. | yes |
Every mutating tool's result carries persisted (and a persistHint when it
is false). See Limitations for why.
Per-task tools and connection
Any task whose comment (its description in Tasker) contains #mcp becomes a tool
named tasker_<name>, with the rest of the comment as its description and the
task's Task Variables as arguments (the convention from dceluis/tasker-mcp).
Calling it runs the task, so it mutates whatever the task does.
refresh_tools re-reads the configuration and tells the client when the set
changed. ping checks the connection.
To make a task a tool:
Put
#mcpand a one-line description in the task's comment.Add Task Variables for the arguments (Immutable on, Configure on Import off); the Prompt becomes the argument description, and "(required)" in the Prompt makes it required. Type Number becomes a number argument, On/Off a boolean.
Make the first action a JavaScriptlet labelled
MCP#parse_args, with the condition%par1 Is Setand this code:const args = JSON.parse(local("par1")); for (const name in args) { setLocal(name, args[name]); } exit();Tasker does not let Perform Task overwrite Immutable Task Variables, so the arguments arrive as JSON in
%par1and this action copies them into the task's variables (the dceluis/tasker-mcp convention; tasks built for that project work unchanged).
Safety net
Snapshot before every mutation. Each write first fetches a full backup and saves it under
~/.tasker-mcp/snapshots, keeping the newest 20. Undo withrestore_snapshot.Verify-readback. After an import the server re-fetches the configuration and checks that the change landed, and reports a mismatch instead of assuming success.
Validation. Edits are checked against the action table (arg ids and types) before anything is sent.
Unknown action codes are allowed as raw XML, so a new Tasker action is not blocked by an out-of-date table.
Write policy. See safe mode above.
How it works
The phone runs a Tasker project with one HTTP Request profile and a JavaScript dispatcher. This server talks to it over HTTP and does all XML parsing, editing, and validation on the desktop. The design and the reasoning behind each decision are in docs/architecture.md. The route table and the Tasker behaviour verified on a device are in tasker/README.md. How the library was checked against Tasker's own editor, in both directions, is in docs/conformance.md.
Limitations
Changes are not saved to disk until persisted. Tasker keeps two copies of its configuration: the running one, which every tasker-mcp change edits, and the editor's copy, which is the only one Tasker ever writes to disk. So a change made through tasker-mcp works at once but is lost when Tasker restarts (force-stop, update, reboot). Worse, if you open Tasker's editor and save anything before persisting, the editor's stale copy overwrites the changes. After a batch of changes, call
persist_config(or start the server withTASKER_AUTO_PERSIST=true, which does it after every change). It needs adb (withTASKER_URLset, alsoTASKER_ADB_SERIAL) and an unlocked screen; on a phone without adb, do it by hand: Tasker > menu > Data > Restore > User Local Backup > tasker-mcp-live > OK, then tap the checkmark in the toolbar (or press Back). (Global variables and a profile's on/off state are saved by Tasker itself, but that save does not include other unsaved changes, soset_profile_enabledstill reportspersisted: false.)Imported new tasks always land in the default
Baseproject. Usemove_to_projectafterwards.Tasker's Import Data only takes tasks or a whole configuration. Profile, project, rename, and delete edits therefore replace the whole configuration, which restarts Tasker's monitor for about 3 seconds. The server waits for the phone to answer again.
The Run Log cannot be exported by any Tasker action. Use
get_logcat.Scenes are read-only.
Trial builds of Tasker work as the full app while the trial lasts; behaviour after it expires is Tasker's, not this project's.
Docs search
The Tasker userguide is scraped weekly by a GitHub Action into the orphan
docs-data branch of this repo and downloaded to ~/.tasker-mcp/docs on first
use of a docs tool. The text is (c) joaoapps and is never committed to main
or shipped in the npm package.
Manuals that the site loads section by section with JavaScript, such as the
Scenes V2 (Screen Builder) Manual, are stored one section per page:
get_doc {"slug": "scenes_v2"} returns an index of the sections, and each
section has its own slug (scenes_v2__05_general) that search_docs returns
and get_doc reads.
The cache is not refreshed on its own. Call refresh_docs to pick up a newer
scrape; pages already downloaded are dropped when the published guide changed
and are downloaded again when next read.
Development
npm ci
git config core.hooksPath .githooks # gitleaks pre-push hook
npm run build
npm test # unit and XML fixture tests (what CI runs)
npm run test:coverage # with v8 coverage
npm run coverage:ratchet # fail if coverage dropped more than 0.5 points
npm run test:device # live tests against an emulator or phone, never in CI
npm run lint # eslint plus the ASCII dash check
npm run format
npm run typecheckscripts/device/ holds the emulator drivers (import-project.mjs,
add-actions.mjs, ui.mjs); they default ANDROID_SERIAL to the emulator. See
CONTRIBUTING.md.
setup-emulator.mjs <Tasker.apk> rebuilds an emulator target in one go; start the
emulator with -no-snapshot, or a restart rolls back to an old snapshot and
loses the Tasker install.
Releasing
publish.yml runs on every push to main and publishes a patch release. The
version is computed from the registry (latest published patch + 1, never below
the major.minor.0 floor in package.json) and is not committed back. The job
installs with --ignore-scripts and no dependency cache, and npm attaches
provenance.
Auth is npm trusted publishing (OIDC) only; no token is stored. npm is retiring
direct publishes from 2FA-bypass tokens: they will only be able to stage a
release that a human then approves with 2FA
(changelog).
Trusted publishing can still publish directly, provided the trusted publisher
is allowed to run npm publish. The job always runs npm publish, so a
stage-only publisher fails the job instead of queueing a release for approval.
Until the repository variable NPM_TRUSTED_PUBLISHING is true, the job runs
npm publish --dry-run and skips the tag. One-time setup:
The package must exist before a trusted publisher can be attached. Publish the first version by hand:
npm login,npm ci,npm run build,npm publish --access public(npm asks for 2FA once).Attach the trusted publisher, allowing direct publishes (2FA once):
npm trust github @pmaxhogan/tasker-mcp --repo pmaxhogan/tasker-mcp --file publish.yml --allow-publishThe same thing on npmjs.com: package Settings > Trusted publishing > GitHub Actions, owner
pmaxhogan, repositorytasker-mcp, workflowpublish.yml, and tick the option that allowsnpm publish. New configurations are stage-only unless you do.Arm the job:
gh variable set NPM_TRUSTED_PUBLISHING --body true.Run the workflow straight away (Actions > Publish > Run workflow). A new trusted publisher expires unless it completes a publish within 2 days.
Optional hardening once that works: package Settings > Publishing access > "Require two-factor authentication and disallow tokens". Trusted publishing keeps working.
Credits
Tasker by joaoapps. Action names, labels, and help text are extracted from the Tasker app for interoperability.
MapTasker (MIT): the action table.
Tasker-XML-Info (MIT): action codes.
dceluis/tasker-mcp (MIT): the per-task
#mcptool convention.
Licenses and notices for the bundled data are in data/NOTICE.
License
MIT, see LICENSE.
Available Tools
1 toolpingPingA
Check that the tasker-mcp server itself is alive. Example: ping {}
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it discloses only that the check targets the server itself. It says nothing about the response shape, latency, or side effects, though for a stateless liveness probe there is little behavior to disclose.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, with the purpose front-loaded ahead of the invocation example. Nothing is wasted, though the 'ping {}' example is largely redundant given the already-empty schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers purpose and invocation, but with no output schema it does not tell the agent what a successful response looks like (e.g., a pong or status payload), leaving a small but real gap for a health-check tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, which is the baseline-4 case; the empty schema already conveys this fully, and the example 'ping {}' reinforces that no arguments are needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb ('Check') and an explicit resource/scope ('the tasker-mcp server itself is alive'), so the agent knows this is a liveness probe rather than a task operation. No siblings exist, so there is nothing to differentiate against, which keeps it just short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by the nature of a ping (use it to verify the server is reachable), but the description never states when to reach for it versus another tool, nor any condition under which it should not be used. Adequate but with a clear gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
ping
TDQS
Scored across 1 tool
There is only one tool, so there is no risk of confusing it with another tool. Its purpose as a liveness check is clear from the description.
A single tool named 'ping' is readable and conventional, but there is no multi-tool pattern to establish consistency across. It is neither inconsistent nor a strong example of a predictable verb_noun convention.
The server is named tasker-mcp, implying task-management functionality, but exposes only a single trivial health-check tool. This is an extreme mismatch between the apparent domain and the tool surface.
No task-related operations such as create, list, update, or delete are present. The surface cannot support any actual task management workflow, making it severely incomplete.
Maintenance
Related MCP Connectors
- mcp-serverOAuthcom.make
Give your AI agents the tools to build, manage, and run automation workflows.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Task management for people and AI agents, with scoped OAuth access to issues, projects, and docs.
Task management for people and AI agents, with scoped OAuth access to issues, projects, and docs.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to control Android phones via MCP and HTTP. Supports screen capture, taps, swipes, text input, and app management.6AGPL 3.0
- FlicenseBqualityAmaintenanceEnables an AI agent to control an Android phone over a private Tailscale network via accessibility UI automation, screenshots, gestures, notifications, clipboard, intents, SAF file access, and optional Termux/Shizuku shells without root or ADB.65-
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to remotely control a real Android phone over MCP with no ADB, root, or emulator, by connecting a broker server to a sideloaded APK. Exposes tools to list devices, capture screenshots, read the UI tree, open links and deep links, and perform taps, swipes, typing, and global navigation actions.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to see and control Android devices through ADB and scrcpy, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, audio/video streaming, and clipboard access.154 npmMIT